1
0
mirror of https://gitlab.com/lander-team/lander-cpp.git synced 2025-06-16 23:26:43 +00:00

initial commit

This commit is contained in:
bpmcgeeney 2021-09-11 17:18:39 -07:00
parent 44d0db8bfd
commit d50f766169
3 changed files with 33 additions and 39 deletions

View File

@ -1,6 +0,0 @@
{
"files.associations": {
"array": "cpp",
"iostream": "cpp"
}
}

View File

@ -39,32 +39,32 @@ struct sVars
double simTime; double simTime;
int stepSize; int stepSize;
std::array<std::array<double, 2>, 26> thrustCurve = { { {0.148, 7.638}, std::array<std::array<double, 2>, 26> thrustCurve = {{{0.148, 7.638},
{0.228, 12.253}, {0.228, 12.253},
{0.294, 16.391}, {0.294, 16.391},
{0.353, 20.210}, {0.353, 20.210},
{0.382, 22.756}, {0.382, 22.756},
{0.419, 25.260}, {0.419, 25.260},
{0.477, 23.074}, {0.477, 23.074},
{0.520, 20.845}, {0.520, 20.845},
{0.593, 19.093}, {0.593, 19.093},
{0.688, 17.500}, {0.688, 17.500},
{0.855, 16.225}, {0.855, 16.225},
{1.037, 15.427}, {1.037, 15.427},
{1.205, 14.948}, {1.205, 14.948},
{1.423, 14.627}, {1.423, 14.627},
{1.452, 15.741}, {1.452, 15.741},
{1.503, 14.785}, {1.503, 14.785},
{1.736, 14.623}, {1.736, 14.623},
{1.955, 14.303}, {1.955, 14.303},
{2.210, 14.141}, {2.210, 14.141},
{2.494, 13.819}, {2.494, 13.819},
{2.763, 13.338}, {2.763, 13.338},
{3.120, 13.334}, {3.120, 13.334},
{3.382, 13.013}, {3.382, 13.013},
{3.404, 9.352}, {3.404, 9.352},
{3.418, 4.895}, {3.418, 4.895},
{3.450, 0.000}} }; {3.450, 0.000}}};
}; };
#endif #endif

View File

@ -1,10 +1,10 @@
#include "sVars.h" #include "sVars.h"
void burnStartTimeCalc(struct sVars&, double g); void burnStartTimeCalc(struct sVars &, double g);
void thrustSelection(struct sVars&, int t); void thrustSelection(struct sVars &, int t);
void lqrCalc(struct sVars&); void lqrCalc(struct sVars &);
void TVC(struct sVars&, double g); void TVC(struct sVars &, double g);
void vehicleDynamics(struct sVars&, int t); void vehicleDynamics(struct sVars &, int t);
void write2CSV(struct sVars&, std::fstream& outfile, int t); void write2CSV(struct sVars &, std::fstream &outfile, int t);
double derivative(double x2, double x1, double dt); double derivative(double x2, double x1, double dt);
double integral(double x2, double x1, double dt); double integral(double x2, double x1, double dt);