Remove previous time step from simulation status
This commit is contained in:
parent
bf9fc29bcd
commit
0b6a3e54b0
@ -127,7 +127,7 @@ public abstract class AbstractEulerStepper extends AbstractSimulationStepper {
|
|||||||
// If acceleration oscillation is building up, the new timestep is the solution of
|
// If acceleration oscillation is building up, the new timestep is the solution of
|
||||||
// a + j*t = 0
|
// a + j*t = 0
|
||||||
t = Math.abs(a / jerk.z);
|
t = Math.abs(a / jerk.z);
|
||||||
log.trace("oscillation prevention changes timeStep to " + t);
|
log.trace("oscillation avoidance changes timeStep to " + t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,6 @@ public abstract class AbstractEulerStepper extends AbstractSimulationStepper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status.setSimulationTime(status.getSimulationTime() + timeStep);
|
status.setSimulationTime(status.getSimulationTime() + timeStep);
|
||||||
status.setPreviousTimeStep(timeStep);
|
|
||||||
|
|
||||||
status.setRocketPosition(newVals.pos);
|
status.setRocketPosition(newVals.pos);
|
||||||
status.setRocketVelocity(newVals.vel);
|
status.setRocketVelocity(newVals.vel);
|
||||||
|
@ -706,7 +706,6 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
double d = 0;
|
double d = 0;
|
||||||
boolean b = false;
|
boolean b = false;
|
||||||
d += currentStatus.getSimulationTime();
|
d += currentStatus.getSimulationTime();
|
||||||
d += currentStatus.getPreviousTimeStep();
|
|
||||||
b |= currentStatus.getRocketPosition().isNaN();
|
b |= currentStatus.getRocketPosition().isNaN();
|
||||||
b |= currentStatus.getRocketVelocity().isNaN();
|
b |= currentStatus.getRocketVelocity().isNaN();
|
||||||
b |= currentStatus.getRocketOrientationQuaternion().isNaN();
|
b |= currentStatus.getRocketOrientationQuaternion().isNaN();
|
||||||
@ -716,7 +715,6 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
if (Double.isNaN(d) || b) {
|
if (Double.isNaN(d) || b) {
|
||||||
log.error("Simulation resulted in NaN value:" +
|
log.error("Simulation resulted in NaN value:" +
|
||||||
" simulationTime=" + currentStatus.getSimulationTime() +
|
" simulationTime=" + currentStatus.getSimulationTime() +
|
||||||
" previousTimeStep=" + currentStatus.getPreviousTimeStep() +
|
|
||||||
" rocketPosition=" + currentStatus.getRocketPosition() +
|
" rocketPosition=" + currentStatus.getRocketPosition() +
|
||||||
" rocketVelocity=" + currentStatus.getRocketVelocity() +
|
" rocketVelocity=" + currentStatus.getRocketVelocity() +
|
||||||
" rocketOrientationQuaternion=" + currentStatus.getRocketOrientationQuaternion() +
|
" rocketOrientationQuaternion=" + currentStatus.getRocketOrientationQuaternion() +
|
||||||
|
@ -44,8 +44,6 @@ public class SimulationStatus implements Monitorable {
|
|||||||
|
|
||||||
private double time;
|
private double time;
|
||||||
|
|
||||||
private double previousTimeStep;
|
|
||||||
|
|
||||||
private Coordinate position;
|
private Coordinate position;
|
||||||
private WorldCoordinate worldPosition;
|
private WorldCoordinate worldPosition;
|
||||||
private Coordinate velocity;
|
private Coordinate velocity;
|
||||||
@ -105,7 +103,6 @@ public class SimulationStatus implements Monitorable {
|
|||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
|
||||||
this.time = 0;
|
this.time = 0;
|
||||||
this.previousTimeStep = this.simulationConditions.getTimeStep();
|
|
||||||
this.position = this.simulationConditions.getLaunchPosition();
|
this.position = this.simulationConditions.getLaunchPosition();
|
||||||
this.velocity = this.simulationConditions.getLaunchVelocity();
|
this.velocity = this.simulationConditions.getLaunchVelocity();
|
||||||
this.worldPosition = this.simulationConditions.getLaunchSite();
|
this.worldPosition = this.simulationConditions.getLaunchSite();
|
||||||
@ -178,7 +175,6 @@ public class SimulationStatus implements Monitorable {
|
|||||||
// FlightData is not cloned.
|
// FlightData is not cloned.
|
||||||
this.flightData = orig.flightData;
|
this.flightData = orig.flightData;
|
||||||
this.time = orig.time;
|
this.time = orig.time;
|
||||||
this.previousTimeStep = orig.previousTimeStep;
|
|
||||||
this.position = orig.position;
|
this.position = orig.position;
|
||||||
this.acceleration = orig.acceleration;
|
this.acceleration = orig.acceleration;
|
||||||
this.worldPosition = orig.worldPosition;
|
this.worldPosition = orig.worldPosition;
|
||||||
@ -267,17 +263,6 @@ public class SimulationStatus implements Monitorable {
|
|||||||
return flightData;
|
return flightData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getPreviousTimeStep() {
|
|
||||||
return previousTimeStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setPreviousTimeStep(double previousTimeStep) {
|
|
||||||
this.previousTimeStep = previousTimeStep;
|
|
||||||
this.modID++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setRocketPosition(Coordinate position) {
|
public void setRocketPosition(Coordinate position) {
|
||||||
this.position = position;
|
this.position = position;
|
||||||
this.modID++;
|
this.modID++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user