Flight Dynamics

6-DoF longitudinal rigid-body dynamics with second-order actuator modeling, SU2-anchored aerodynamic surrogates, and event-driven CFD verification.


The Verified Bridge

Flight dynamics connects CFD to real-world motion. An aerodynamic surrogate built from SU2 RANS data feeds a Newton-Euler 6-DoF integrator, which drives an event-driven verification hook that fires SU2 snapshots at critical flight conditions - closing the loop between fast surrogate prediction and high-fidelity CFD.

SU2 CFD RANS

Compressible RANS with SA turbulence at 5 AoA points

Angles
0° to 16°
Mesh
32K nodes

AeroSurrogate

Linear interpolation over AoA with flap delta effects

Interp
scipy interp1d
Cache
JSON serialized

6-DoF Dynamics

Newton-Euler integration at 200 Hz with second-order actuator

State
[u,w,q,θ,x,z]
Rate
200 Hz

Verification Hook

Event-driven SU2 snapshot at peak gust and cruise recovery

Triggers
2 events
Status
Active

Interactive Simulation Replay

Watch the aircraft respond to a 5 m/s “1-cos” vertical gust at 50 m/s cruise. The simulation runs at 200 Hz with second-order actuator dynamics. Nose-up pitch indicates positive AoA excursion.

0.00s
Angle of Attack
1.14°
True Airspeed
50.0 m/s
Load Factor
1.00g
Vertical Gust
0.0 m/s

Steady vs Gust Response

A 5 m/s vertical gust (duration 0.5s, onset at t=1.0s) excites the longitudinal dynamics. The aircraft experiences a transient AoA increase of 0.6° and a peak load factor of 2.48g before recovering to trim.

Steady Cruise

True Airspeed50.0 m/s
Angle of Attack1.14°
Load Factor1.00g
Flap Deflection0.0°
CL / CD0.128 / 0.081

Peak Gust Response

True Airspeed50.6 m/s
Angle of Attack1.73°
Load Factor2.48g
Flap Deflection0.0°
CL / CD0.194 / 0.083

Verification Event Log

The verification hook monitors the simulation state stream for key flight conditions. On trigger, it serializes the flight state and requests a high-fidelity SU2 RANS snapshot for comparison against the aerodynamic surrogate prediction.

[2026-07-01 20:39:12] SYSTEM INITIALIZED
[2026-07-01 20:39:12] Trim: V=50.0 m/s, AoA=1.14 deg, CL=0.128, CD=0.081
[2026-07-01 20:39:12] Surrogate: SU2 tunnel (5 AoA pts, extended -16..+16 deg)
EventTimeAoAVSurrogate CLSurrogate CDSU2 Status
Peak Gust 1.26s 1.73° 50.6 m/s 0.194 0.083 Snapshot Requested
Cruise Recovery 1.70s 0.80° 51.0 m/s 0.090 0.080 Snapshot Requested

Physics Model

The longitudinal dynamics integrate Newton-Euler rigid-body equations in body-axis coordinates. Aerodynamic forces are computed from the surrogate model and rotated from wind axes. Static stability is enforced via a negative static margin ($C_{m_\alpha} = C_L \cdot \overline{x}_{cg}$).

Newton-Euler Equations

$$ \dot{u} = -q w - g\sin\theta + \frac{F_x}{m} $$

$$ \dot{w} = q u + g\cos\theta + \frac{F_z}{m} $$

$$ \dot{q} = \frac{M}{I_{yy}} $$

$$ \dot{\theta} = q $$

Wind-to-Body Force Rotation

$$ F_x = L\sin\alpha - D\cos\alpha + T $$

$$ F_z = -L\cos\alpha - D\sin\alpha $$

$$ M = \bar{q} S c\,(C_m + C_{L}\overline{x}_{cg} + C_{m_q}\hat{q}) $$

Second-Order Actuator

$$ \ddot{\delta} = \omega_n^2(\delta_{cmd} - \delta) - 2\zeta\omega_n\dot{\delta} $$

$\zeta = 0.7$, $\omega_n = 10$ rad/s, $f_s = 200$ Hz

Gust Profile

$$ V_g(t) = \frac{A}{2}\left[1 - \cos\frac{2\pi(t-t_0)}{T}\right] $$

$A = 5$ m/s, $t_0 = 1.0$ s, $T = 0.5$ s


Full Telemetry

The dual-panel dashboard shows the flight trajectory with AoA overlay (top) and the actuator commanded vs actual deflection with load factor (bottom). The gust event at t=1.0s is visible as a transient in both panels.

Flight dynamics telemetry dashboard showing trajectory, AoA, actuator response, and load factor
Telemetry dashboard: Flight trajectory & AoA (top), Actuator response & load factor (bottom)

Module Architecture

The flight dynamics pipeline is implemented across six modules in src/ and one in physics/:

ModuleClass / FunctionPurpose
physics/aero_surrogate.pyAeroSurrogateCL/CD/CM interpolation from SU2 data
src/dynamics.pyLongitudinalDynamics6-DoF Newton-Euler integration
src/actuator.pyActuatorSecond-order control surface model
src/gust_profile.pygust_1minuscos()Smooth vertical wind gust generator
src/verification_hook.pyVerificationHookEvent-driven SU2 snapshot trigger
src/plot_telemetry.pyplot_telemetry()Dracula-themed telemetry dashboard
run_flight_dynamics.pymain()Orchestrator and entry point