Fixed-Step Solver — Events, Orbits, and Drag

This page extends fixed-step simulation beyond basic dynamics into mission logic: chaser motion, event switching, orbit propagation, drag decay, and stiff fast-slow systems.

In fixed-step simulation, timestep decides when events are seen, when modes switch, and whether orbital physics stays believable.

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.

Core warning: In mission simulation, timestep error is not just numerical error. It can become a delayed mode switch, missed safety event, false orbital energy, wrong drag decay, or unstable fast dynamics.

One page, five mission-level fixed-step failures

A · Chaser response
Small timestep gives smooth convergence. Large timestep can create overshoot, oscillation, or divergence.
B · Event switching
Threshold events are detected late because fixed-step logic only checks sampled points.
C · Orbit propagation
Euler integration injects false energy, so a circular orbit can spiral outward.
D · Drag + BC
Coarse integration can amplify orbital decay prediction error when drag is present.
E · Stiff systems
A timestep safe for slow orbital motion can be unsafe for fast actuator or sensor dynamics.
Upgrades
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.

\[\ddot{x}=\frac{u}{m},\qquad u_k=-K_p x_k-K_d v_k\]
\[v_{k+1}=v_k+\frac{u_k}{m}\Delta t,\qquad x_{k+1}=x_k+v_k\Delta t\]
Small dt result
Large dt result
Small final |x|
Large final |x|
Insight: The controller is not only defined by \(K_p\) and \(K_d\). It is also defined by how often it is allowed to act.

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.

\[|x|\leq x_{threshold}\quad \Rightarrow \quad \text{switch from approach mode to docking mode}\]
\[\Delta t_{event}=t_{detected}-t_{true}\]
True crossing time
Detected crossing time
Event delay
Mode switch
Critical GNC insight: Fixed-step solvers detect events late, which can cause incorrect mode switching.

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.

\[x_k=10.5,\qquad x_{k+1}=9.4\]

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.

Event status
Closest sample
Window
Bug type

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.

\[\ddot{\mathbf r}=-\mu\frac{\mathbf r}{r^3},\qquad v_0=\sqrt{\frac{\mu}{r_0}}\]
\[\mathbf v_{k+1}=\mathbf v_k+\mathbf a_k\Delta t,\qquad \mathbf r_{k+1}=\mathbf r_k+\mathbf v_k\Delta t\]
Initial energy
Final energy
Energy error
Final radius error

Energy conservation comparison: error vs timestep

In ideal two-body motion, specific orbital energy should remain constant:

\[\epsilon=\frac{v^2}{2}-\frac{\mu}{r}\]

This sweep turns the visual orbit drift into a numerical diagnostic. The larger the timestep, the faster energy conservation breaks down.

Insight: Energy error grows rapidly with timestep size in fixed-step integration.

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.

\[\mathbf a_{drag}=-\frac{1}{2}\rho\frac{v^2}{B}\hat{\mathbf v},\qquad B=\frac{m}{C_DA}\]
Fine final altitude
Coarse final altitude
Decay mismatch
Driverdt + drag

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.

\[\dot{x}_{slow}=-0.2x_{slow},\qquad \dot{x}_{fast}=-\lambda x_{fast}\]
\[x_{fast,k+1}=(1-\lambda\Delta t)x_{fast,k},\qquad |1-\lambda\Delta t|<1\]
Euler fast-mode limit
Safe dt status
Unsafe dt status
Main lessonFast dynamics
Insight: A timestep acceptable for slow orbital motion may be completely unsafe for fast actuator, sensor, or control-loop dynamics.

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)
Teaching note: Fixed-step methods are not wrong. But event logic, energy conservation, drag decay, and fast modes must be checked against the chosen timestep.

Fixed-step simulation is powerful only when timestep is treated as design

1 · Events are sampled

Threshold crossing can be detected late, and narrow event windows can be skipped entirely.

2 · Orbits reveal energy error

A circular orbit should conserve energy. If it spirals, the numerical method has changed the physics.

3 · Fast modes set dt limits

A timestep chosen for slow motion can be unstable for fast actuator or sensor dynamics.

Final insight: For GNC, fixed-step simulation is powerful only when the timestep is treated as part of the design.