A fixed-step solver only checks the world at sample instants
Many GNC simulations are not just continuous motion. They include threshold events, mode switching, orbital propagation, drag decay, and fast actuator or sensor dynamics.
A fixed-step solver can be useful for real-time simulation and flight-software logic, but it does not continuously watch the system. It checks the state at discrete times: \(t_0,t_1,t_2,\dots\). That means a threshold crossing can be detected late, or completely missed.
One page, five mission-level fixed-step failures
Small timestep gives smooth convergence. Large timestep can create overshoot, oscillation, or divergence.
Threshold events are detected late because fixed-step logic only checks sampled points.
Euler integration injects false energy, so a circular orbit can spiral outward.
Coarse integration can amplify orbital decay prediction error when drag is present.
A timestep safe for slow orbital motion can be unsafe for fast actuator or sensor dynamics.
Event delay, missed event, and energy error vs timestep are included as explicit interactive diagnostics.
Chaser control: discrete only
A one-dimensional chaser moves toward a target using a sampled PD-like controller. The controller is simple, but the result depends strongly on update rate.
Event switching: late detection
A chaser approaches a docking threshold. In continuous reality, the threshold crossing can happen between two fixed-step samples. The simulation only detects the event at the next sampled point, so the mode switch is delayed.
Missed event: threshold window skipped in one step
A late event is eventually detected. A missed event is worse: bad logic can fail completely if no sampled point lands inside the event window.
The system passed through the threshold region, but no sampled point landed inside it. This is dangerous for contact detection, burn cutoff, docking thresholds, sensor handover, safe-mode triggers, and altitude crossings.
Orbit propagation: Euler orbit spirals out
A circular two-body orbit should remain circular if no drag or perturbation exists. If the simulated orbit spirals outward, the spacecraft did not gain energy. The numerical method created it.
Energy conservation comparison: error vs timestep
In ideal two-body motion, specific orbital energy should remain constant:
This sweep turns the visual orbit drift into a numerical diagnostic. The larger the timestep, the faster energy conservation breaks down.
Drag + ballistic coefficient: decay error amplification
With drag, timestep error can change the predicted decay trend. Drag depends on velocity squared and atmospheric density, so coarse integration can over-predict or under-predict altitude loss.
Stiff systems: fixed dt fails completely
Some systems contain slow orbital motion and fast actuator, sensor, or control-loop dynamics. One timestep may be fine for the slow state but unsafe for the fast state.
Mission-level fixed-step snippets
These snippets show the page logic in compact engineering form: event delay, circular orbit energy drift, and stiff-mode instability.
# Fixed-step event delay
import numpy as np
x0 = 100.0
closing_speed = 7.0
threshold = 10.0
dt = 2.0
true_crossing = (x0 - threshold) / closing_speed
sample_times = np.arange(0, true_crossing + 5*dt, dt)
distance = x0 - closing_speed * sample_times
detected_index = np.where(distance <= threshold)[0][0]
detected_time = sample_times[detected_index]
event_delay = detected_time - true_crossing
print(true_crossing, detected_time, event_delay)
# Euler orbit propagation and energy error
import numpy as np
mu = 398600.4418
r0 = np.array([7000.0, 0.0])
v0 = np.array([0.0, np.sqrt(mu / np.linalg.norm(r0))])
dt = 60.0
steps = 200
r = r0.copy()
v = v0.copy()
energy0 = 0.5*np.dot(v,v) - mu/np.linalg.norm(r)
for k in range(steps):
a = -mu * r / np.linalg.norm(r)**3
v = v + a*dt
r = r + v*dt
energy_final = 0.5*np.dot(v,v) - mu/np.linalg.norm(r)
print(abs(energy_final - energy0))
# Explicit Euler stability for a fast mode
lambda_fast = 50.0
stability_limit = 2.0 / lambda_fast
for dt in [0.01, 0.04, 0.08]:
multiplier = 1.0 - lambda_fast*dt
stable = abs(multiplier) < 1.0
print(dt, multiplier, stable)
Fixed-step simulation is powerful only when timestep is treated as design
Threshold crossing can be detected late, and narrow event windows can be skipped entirely.
A circular orbit should conserve energy. If it spirals, the numerical method has changed the physics.
A timestep chosen for slow motion can be unstable for fast actuator or sensor dynamics.