save simulation step data after step, not before it

This commit is contained in:
JoePfeiffer 2021-02-05 13:39:41 -07:00 committed by Billy Olsen
parent 5e0304126e
commit fefd805fcc

View File

@ -204,10 +204,6 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
}
}
// Store data
// TODO: MEDIUM: Store acceleration etc of entire RK4 step, store should be cloned or something...
storeData(status, store);
//// Second position, k2 = f(t + h/2, y + k1*h/2)
@ -270,6 +266,10 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
status.setPreviousTimeStep(store.timestep);
// Store data
// TODO: MEDIUM: Store acceleration etc of entire RK4 step, store should be cloned or something...
storeData(status, store);
// Verify that values don't run out of range
if (status.getRocketVelocity().length2() > 1e18 ||
status.getRocketPosition().length2() > 1e18 ||