diff --git a/core/src/net/sf/openrocket/simulation/RK4SimulationStatus.java b/core/src/net/sf/openrocket/simulation/RK4SimulationStatus.java index 67465e16d..d42d951fa 100644 --- a/core/src/net/sf/openrocket/simulation/RK4SimulationStatus.java +++ b/core/src/net/sf/openrocket/simulation/RK4SimulationStatus.java @@ -8,7 +8,6 @@ public class RK4SimulationStatus extends SimulationStatus implements Cloneable { private Coordinate launchRodDirection; private double previousAcceleration = 0; - private AtmosphericConditions previousAtmosphericConditions; // Used for determining when to store aerodynamic computation warnings: private double maxZVelocity = 0; @@ -26,7 +25,6 @@ public class RK4SimulationStatus extends SimulationStatus implements Cloneable { this.previousAcceleration = ((RK4SimulationStatus) other).previousAcceleration; this.maxZVelocity = ((RK4SimulationStatus) other).maxZVelocity; this.startWarningTime = ((RK4SimulationStatus) other).startWarningTime; - this.previousAtmosphericConditions = ((RK4SimulationStatus) other).previousAtmosphericConditions; } } public void setLaunchRodDirection(Coordinate launchRodDirection) { @@ -49,18 +47,6 @@ public class RK4SimulationStatus extends SimulationStatus implements Cloneable { this.previousAcceleration = previousAcceleration; } - - public AtmosphericConditions getPreviousAtmosphericConditions() { - return previousAtmosphericConditions; - } - - - public void setPreviousAtmosphericConditions( - AtmosphericConditions previousAtmosphericConditions) { - this.previousAtmosphericConditions = previousAtmosphericConditions; - } - - public double getMaxZVelocity() { return maxZVelocity; } diff --git a/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java b/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java index 2801fbc6a..9c1b825af 100644 --- a/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java +++ b/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java @@ -102,11 +102,17 @@ public class RK4SimulationStepper extends AbstractSimulationStepper { store.timestep = MathUtil.max(MathUtil.min(store.timestep, maxTimeStep), MIN_TIME_STEP); checkNaN(store.timestep); + /* + * Get the current atmospheric conditions + */ + calculateFlightConditions(status, store); + store.atmosphericConditions = store.flightConditions.getAtmosphericConditions(); + /* * Compute the initial thrust estimate. This is used for the first time step computation. */ - store.thrustForce = calculateAverageThrust(status, store.timestep, store.timestep, - status.getPreviousAtmosphericConditions(), false); + store.thrustForce = calculateAverageThrust(status, store.timestep, store.longitudinalAcceleration, + store.atmosphericConditions, false); /* * Perform RK4 integration. Decide the time step length after the first step.