If the user selected a really small (0) timestep, the simulation gets
into an infinite loop. Don't use a user selected timestep smaller than MIN_TIME_STEP.
This commit is contained in:
parent
4d77c817d8
commit
372bcae9a7
@ -139,7 +139,8 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
|
|||||||
double[] dt = new double[8];
|
double[] dt = new double[8];
|
||||||
Arrays.fill(dt, Double.MAX_VALUE);
|
Arrays.fill(dt, Double.MAX_VALUE);
|
||||||
|
|
||||||
dt[0] = status.getSimulationConditions().getTimeStep();
|
// If the user selected a really small timestep, use MIN_TIME_STEP instead.
|
||||||
|
dt[0] = MathUtil.max(status.getSimulationConditions().getTimeStep(),MIN_TIME_STEP);
|
||||||
dt[1] = maxTimeStep;
|
dt[1] = maxTimeStep;
|
||||||
dt[2] = status.getSimulationConditions().getMaximumAngleStep() / store.lateralPitchRate;
|
dt[2] = status.getSimulationConditions().getMaximumAngleStep() / store.lateralPitchRate;
|
||||||
dt[3] = Math.abs(MAX_ROLL_STEP_ANGLE / store.flightConditions.getRollRate());
|
dt[3] = Math.abs(MAX_ROLL_STEP_ANGLE / store.flightConditions.getRollRate());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user