Merge pull request #437 from JoePfeiffer/fixSimulationLog

Fix simulation log
This commit is contained in:
Wes Cravens 2018-08-07 18:21:31 -05:00 committed by GitHub
commit 3209e0201e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -128,7 +128,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
if (nextEvent != null) { if (nextEvent != null) {
maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001); maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001);
} }
log.trace("BasicEventSimulationEngine: Taking simulation step at t=" + currentStatus.getSimulationTime()); log.trace("Taking simulation step at t=" + currentStatus.getSimulationTime() + " altitude " + oldAlt);
currentStepper.step(currentStatus, maxStepTime); currentStepper.step(currentStatus, maxStepTime);
} }
SimulationListenerHelper.firePostStep(currentStatus); SimulationListenerHelper.firePostStep(currentStatus);
@ -319,6 +319,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
} }
// Handle event // Handle event
log.trace("Handling event " + event);
switch (event.getType()) { switch (event.getType()) {
case LAUNCH: { case LAUNCH: {
@ -486,7 +487,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
break; break;
case ALTITUDE: case ALTITUDE:
log.trace("BasicEventSimulationEngine: Handling event " + event); // nothing special needs to be done for this event
break; break;
case TUMBLE: case TUMBLE:

View File

@ -182,7 +182,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
double thrustEstimate = store.thrustForce; double thrustEstimate = store.thrustForce;
store.thrustForce = calculateAverageThrust(status, store.timestep, store.longitudinalAcceleration, store.thrustForce = calculateAverageThrust(status, store.timestep, store.longitudinalAcceleration,
store.atmosphericConditions, true); store.atmosphericConditions, true);
log.trace("Thrust at time " + store.timestep + " thrustForce = " + store.thrustForce); log.trace("Thrust = " + store.thrustForce);
double thrustDiff = Math.abs(store.thrustForce - thrustEstimate); double thrustDiff = Math.abs(store.thrustForce - thrustEstimate);
// Log if difference over 1%, recompute if over 10% // Log if difference over 1%, recompute if over 10%
if (thrustDiff > 0.01 * thrustEstimate) { if (thrustDiff > 0.01 * thrustEstimate) {