diff --git a/core/src/net/sf/openrocket/simulation/AbstractSimulationStepper.java b/core/src/net/sf/openrocket/simulation/AbstractSimulationStepper.java index e3180ffef..20307f419 100644 --- a/core/src/net/sf/openrocket/simulation/AbstractSimulationStepper.java +++ b/core/src/net/sf/openrocket/simulation/AbstractSimulationStepper.java @@ -174,7 +174,7 @@ public abstract class AbstractSimulationStepper implements SimulationStepper { * @param stepMotors whether to step the motors forward or work on a clone object * @return the average thrust during the time step. */ - protected double calculateAvrageThrust(SimulationStatus status, double timestep, + protected double calculateAverageThrust(SimulationStatus status, double timestep, double acceleration, AtmosphericConditions atmosphericConditions, boolean stepMotors) throws SimulationException { double thrust; diff --git a/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java b/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java index e658469f7..7d137be15 100644 --- a/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java +++ b/core/src/net/sf/openrocket/simulation/RK4SimulationStepper.java @@ -111,7 +111,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper { /* * Compute the initial thrust estimate. This is used for the first time step computation. */ - store.thrustForce = calculateAvrageThrust(status, store.timestep, status.getPreviousAcceleration(), + store.thrustForce = calculateAverageThrust(status, store.timestep, status.getPreviousAcceleration(), status.getPreviousAtmosphericConditions(), false); @@ -180,7 +180,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper { * diminished by it affecting only 1/6th of the total, so it's an acceptable error. */ double thrustEstimate = store.thrustForce; - store.thrustForce = calculateAvrageThrust(status, store.timestep, store.longitudinalAcceleration, + store.thrustForce = calculateAverageThrust(status, store.timestep, store.longitudinalAcceleration, store.atmosphericConditions, true); log.trace("Thrust at time " + store.timestep + " thrustForce = " + store.thrustForce); double thrustDiff = Math.abs(store.thrustForce - thrustEstimate);