Fixed-Step Solver — Dynamics, Stability, and Control

This page develops a fixed-step simulation workflow for GNC-style dynamics. It shows how discrete updates, timestep size, sampling delay, and aliasing can create false behaviour even when the equations of motion are correct.

In fixed-step simulation, the model can be correct — but the timestep can break the physics.

The timestep becomes part of the system

Fixed-step solvers are used when the simulation must update at a known rate. This is common in flight software, digital control, real-time simulation, hardware-in-the-loop testing, and embedded control systems.

The danger is that a fixed-step method does not automatically reduce the timestep when the dynamics become fast, sensitive, or oscillatory. The engineer chooses \(\Delta t\), and that choice affects the behaviour of the simulated system.

Core warning: A fixed timestep turns continuous physics into a sampled system. If the sampling is too slow, the simulation can create false damping, false oscillation, false instability, or false frequency content.

One problem, six fixed-step lessons

A · Missing \(\omega\)
A discrete update fails when angle is not advanced using angular velocity.
B · Euler vs reality
Forward Euler is compared against the analytical rotational response.
C · Discrete PD control
A digital controller updates torque only at sampled time instants.
D · Stability vs timestep
The same gains are tested across \(\Delta t\) to find the stability boundary.
E · Numerical instability
Large timestep creates energy growth even when the model and controller are unchanged.
F · Chaser control
The same sampled-data issue appears in a simple relative-motion GNC example.

Missing \(\omega\): discrete update error

In rotational motion, angle must be advanced using angular velocity. The fixed-step update is:

\[\theta_{k+1}=\theta_k+\omega_k\Delta t\]

A common discrete mistake is to keep the angle unchanged, or to update it without the correct angular velocity term. The simulation may still run, but the physics is broken.

Correct final θ
Wrong final θ
Final mismatch
Main lessonState update

Euler integration vs reality

For constant torque, the rotational dynamics are:

\[I\dot{\omega}=\tau,\qquad \dot{\theta}=\omega\]

Forward Euler uses straight-line updates. With a small timestep it can look close to the analytical result. With a large timestep, it visibly drifts.

\[\omega_{k+1}=\omega_k+\frac{\tau}{I}\Delta t,\qquad \theta_{k+1}=\theta_k+\omega_k\Delta t\]
Final Euler θ
Final analytical θ
Final error
Interpretation

PD controller in discrete time

A digital controller does not react continuously. It samples the state, computes a torque, then holds that torque until the next update.

\[\tau_k=-K_p\theta_k-K_d\omega_k\]
\[\omega_{k+1}=\omega_k+\frac{\tau_k}{I}\Delta t,\qquad \theta_{k+1}=\theta_k+\omega_k\Delta t\]
Classification
Peak |θ|
Final |θ|
Torque styleSampled

Stability boundary: same gains, different timestep

This is the key fixed-step lesson. Keep \(K_p\) and \(K_d\) fixed, then sweep \(\Delta t\). The controller did not change, the model did not change, but the sampled simulation can move from stable to oscillatory to unstable.

Insight: Stability is not only a function of gains. It is also a function of timestep.
Stable Oscillatory Unstable
Δt sampleBehaviourPeak |θ|

Numerical instability caused by timestep

The equations do not change. The controller does not change. Only the timestep changes. If the coarse-step result grows energy while the fine-step result decays, the instability is numerical rather than physical.

Engineering message: In fixed-step simulation, timestep is not housekeeping. It is a design decision.

Phase lag due to timestep

A sampled controller waits until the next update before reacting. The torque therefore appears as a stair-step signal. As \(\Delta t\) increases, the control action becomes more delayed. Delay behaves like additional phase lag in a control system.

0.0050.1200.35
Sampling rate
Approx delay
Torque signalStair-step
Control effectPhase lag

Aliasing: seeing the wrong dynamics

If a fast oscillation is sampled too slowly, the sampled points can appear to represent a different, slower frequency. This is aliasing. In engineering simulation, aliasing can make the system appear to have dynamics that are not actually present.

\[x(t)=\sin(2\pi f t),\qquad f_s=\frac{1}{\Delta t}\]
\[\text{Aliasing risk when}\qquad f_s<2f\]
Sampling frequency
Nyquist limit
Aliasing status
Perceived frequency
Industry-level insight: If the timestep is too large, the system can “see” the wrong dynamics.

Chaser control: discrete GNC example

A chaser approaches a target using a sampled PD-like controller. The relative-motion model is intentionally simple so the timestep effect is easy to see.

\[\ddot{x}=\frac{u}{m},\qquad u_k=-K_p(x_k-x_{target})-K_dv_k\]
\[v_{k+1}=v_k+\frac{u_k}{m}\Delta t,\qquad x_{k+1}=x_k+v_k\Delta t\]
Mission insight: A chaser can fail not because the guidance law is conceptually wrong, but because the update rate is too slow for the closed-loop dynamics.

Fixed-step code blocks

These snippets mirror the page logic. Keep them short so the reader can connect each code block to one specific engineering idea.

# Fixed-step rotational PD controller
import numpy as np
import matplotlib.pyplot as plt

Kp = 20.0
Kd = 4.0
I = 1.0
dt = 0.05
t_final = 8.0

theta = 1.0
omega = 0.0

T = np.arange(0, t_final + dt, dt)
TH = []
OM = []
TAU = []

for t in T:
    tau = -Kp*theta - Kd*omega
    TH.append(theta)
    OM.append(omega)
    TAU.append(tau)

    omega = omega + (tau/I)*dt
    theta = theta + omega*dt

plt.plot(T, TH, label='theta')
plt.step(T, TAU, where='post', label='sampled torque')
plt.grid(True)
plt.legend()
plt.show()
Teaching note: These examples intentionally use fixed-step updates. The purpose is not to make the most accurate solver; the purpose is to show how timestep changes the simulated behaviour.

Fixed-step simulation is powerful, but timestep is a design choice

1 · The model can be correct

The equations may represent the real physics, but the discrete update can still distort the response.

2 · The controller is sampled

A digital controller only reacts at update instants, so the torque naturally includes delay and phase lag.

3 · Sampling can lie

If the timestep is too large, aliasing can make fast dynamics appear as a different slower motion.

Final insight: For GNC, choosing \(\Delta t\) is not housekeeping. It is part of the engineering design.