mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-06-16 15:17:23 +00:00
using wrong comparison operator
This commit is contained in:
parent
8432f17117
commit
7a31ed04a9
@ -59,14 +59,14 @@ void burnStartTimeCalc(struct sVars &Vars, double g) {
|
||||
for (double i = 0.148; i < 3.450; i = i + dt) {
|
||||
m = Vars.m0 - i * Vars.mdot;
|
||||
|
||||
if ((i > 0.147) & (i < 0.420))
|
||||
if ((i > 0.147) && (i < 0.420))
|
||||
thrust = 65.165 * i - 2.3921;
|
||||
|
||||
else if ((i > 0.419) & (i < 3.383))
|
||||
else if ((i > 0.419) && (i < 3.383))
|
||||
thrust = 0.8932 * pow(i, 6) - 11.609 * pow(i, 5) + 60.739 * pow(i, 4) -
|
||||
162.99 * pow(i, 3) + 235.6 * pow(i, 2) - 174.43 * i + 67.17;
|
||||
|
||||
else if ((i > 3.382) & (i < 3.46))
|
||||
else if ((i > 3.382) && (i < 3.46))
|
||||
thrust = -195.78 * i + 675.11;
|
||||
|
||||
v = (((thrust / m) + g) * dt) + v;
|
||||
@ -103,16 +103,16 @@ void thrustSelection(struct sVars &Vars, int t) {
|
||||
else
|
||||
Vars.burnElapsed = 2000; // arbitrary number to ensure we don't burn
|
||||
|
||||
if ((Vars.burnElapsed > 0.147) & (Vars.burnElapsed < 0.420))
|
||||
if ((Vars.burnElapsed > 0.147) && (Vars.burnElapsed < 0.420))
|
||||
Vars.thrust = 65.165 * Vars.burnElapsed - 2.3921;
|
||||
|
||||
else if ((Vars.burnElapsed > 0.419) & (Vars.burnElapsed < 3.383))
|
||||
else if ((Vars.burnElapsed > 0.419) && (Vars.burnElapsed < 3.383))
|
||||
Vars.thrust =
|
||||
0.8932 * pow(Vars.burnElapsed, 6) - 11.609 * pow(Vars.burnElapsed, 5) +
|
||||
60.739 * pow(Vars.burnElapsed, 4) - 162.99 * pow(Vars.burnElapsed, 3) +
|
||||
235.6 * pow(Vars.burnElapsed, 2) - 174.43 * Vars.burnElapsed + 67.17;
|
||||
|
||||
else if ((Vars.burnElapsed > 3.382) & (Vars.burnElapsed < 3.46))
|
||||
else if ((Vars.burnElapsed > 3.382) && (Vars.burnElapsed < 3.46))
|
||||
Vars.thrust = -195.78 * Vars.burnElapsed + 675.11;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user