Comments in BasicEventSimulationEngine.java indicate that if we're the

sustainer stage, we don't check for tumbling until after apogee, which
is consistent with the email discussion eg
https://sourceforge.net/p/openrocket/mailman/message/32016278/

Not switching to tumbling until after apogee results in unstable
booster stages going into wild oscillations, and firing an exception
terminating the branch of the simulation.  This brings the code into
conformity with the comment.
This commit is contained in:
JoePfeiffer 2018-10-18 18:40:41 -06:00
parent c4793cb8b2
commit 8700450f20

View File

@ -217,11 +217,11 @@ public class BasicEventSimulationEngine implements SimulationEngine {
if (wantToTumble) { if (wantToTumble) {
final boolean tooMuchThrust = t > THRUST_TUMBLE_CONDITION; final boolean tooMuchThrust = t > THRUST_TUMBLE_CONDITION;
//final boolean isSustainer = status.getConfiguration().isStageActive(0); final boolean isSustainer = currentStatus.getConfiguration().isStageActive(0);
final boolean isApogee = currentStatus.isApogeeReached(); final boolean isApogee = currentStatus.isApogeeReached();
if (tooMuchThrust) { if (tooMuchThrust) {
currentStatus.getWarnings().add(Warning.TUMBLE_UNDER_THRUST); currentStatus.getWarnings().add(Warning.TUMBLE_UNDER_THRUST);
} else if (isApogee) { } else if (isApogee || !isSustainer) {
addEvent(new FlightEvent(FlightEvent.Type.TUMBLE, currentStatus.getSimulationTime())); addEvent(new FlightEvent(FlightEvent.Type.TUMBLE, currentStatus.getSimulationTime()));
currentStatus.setTumbling(true); currentStatus.setTumbling(true);
} }