From 18e75925d5677b2e4c102b3d6c383889804a03fc Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Wed, 15 Sep 2021 14:00:01 -0700 Subject: [PATCH] fixed burnVelocity tolerance condition --- include/sim.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/sim.h b/include/sim.h index e156e66..e8aa8d6 100644 --- a/include/sim.h +++ b/include/sim.h @@ -87,12 +87,6 @@ void burnStartTimeCalc(struct sVars &Vars) { } void thrustSelection(struct sVars &Vars, int t) { - // TODO: Determine a real tolerance - double tol = 0.001; // 0.001 seems to be a nice tolerance - - // Check to see if current velocity is close to the F15's total velocity - bool b_burnStart = (Vars.burnVelocity < (1 + tol) * Vars.vz * -1) & - (Vars.burnVelocity > (1 - tol) * Vars.vz * -1); if (Vars.burnElapsed != 2000) { // determine where in the thrust curve we're at based on elapsed burn time @@ -101,7 +95,7 @@ void thrustSelection(struct sVars &Vars, int t) { Vars.mass = Vars.massInitial - (Vars.mdot * Vars.burnElapsed); } - else if (b_burnStart) { + else if (abs(Vars.burnVelocity - Vars.vz) < .001) { // Start burn Vars.burnStart = t; Vars.burnElapsed = 0;