Vertical launch through a wind-shear layer
A two-dimensional educational launch vehicle ascends with a single engine and pitch-axis thrust-vector control (TVC). Horizontal wind changes the air-relative flow, creating drag and a lateral aerodynamic force. Compare open-loop ascent to outer-loop position guidance with an inner-loop pitch controller.
Coordinates and sign conventions
Inertial x points horizontally downwind; z is upward. Positive pitch tilts the vehicle thrust direction toward +x. Positive gimbal angle increases the thrust-direction angle. Wind velocity is positive along +x. The aerodynamic lateral force acts to reduce cross-flow, with a sign determined by the relative airflow.
Governing dynamics and control laws
For a positive upward speed, define the air-relative flow angle \(\gamma_a=\mathrm{atan2}(v_x-w,v_z)\), and angle of attack \(\alpha=\theta-\gamma_a\). A simplified aerodynamic side-force model uses \(F_N=-qAC_{N\alpha}\alpha\), acting perpendicular to the relative velocity, with an approximate restoring aerodynamic moment \(M_a=-qAC_{m\alpha}l_{ref}\alpha\). Axial drag is \(-qAC_D\hat{\mathbf v}_a\). These approximations are used consistently in the simulator.
Engine gimbal response is first order: \(\dot\delta=(\delta_c-\delta)/\tau_g\), with physical saturation. Gravitational acceleration decreases with altitude according to \(g(z)=g_0[R_E/(R_E+z)]^2\).
Interactive atmospheric wind and shear
Change the wind profile and observe the altitude-dependent disturbance. A Gaussian shear layer provides a smooth, differentiable profile for numerical experiments.
Open-loop versus closed-loop ascent
Run identical wind conditions with and without lateral guidance. The open-loop vehicle holds a zero pitch command; the closed-loop vehicle corrects horizontal displacement and velocity while tracking pitch through TVC. Wind loads may still cause substantial angle-of-attack excursions.
Wind-strength sensitivity sweep
Scale both background wind and shear increment from zero to twice the selected profile. For each case, compare the absolute final horizontal error of open-loop and closed-loop flight.
Gimbal authority and aerodynamic loading
Nominal versus perturbed cases
Apply deterministic parameter perturbations to the closed-loop case: +20% wind strength, −10% thrust, and +15% lateral aerodynamic slope. The comparison is illustrative and is not a statistical Monte Carlo analysis.
Numerical and physical checks
The checks below evaluate mass consistency, finite states, actuator limits, and timestep convergence. A smaller-step reference is used for a trajectory difference check; it is not an independent truth model.
Python and MATLAB starter implementations
The snippets illustrate the wind and relative-airflow model used in the browser simulation. The full coupled simulation is implemented in JavaScript in this standalone page.
Python
import numpy as np
rho0, H = 1.225, 8500.0
def atmosphere(z):
return rho0 * np.exp(-max(z, 0.0) / H)
def wind(z, w0=8.0, ws=22.0, zs=7000.0, sigma=2000.0):
return w0 + ws * np.exp(-0.5*((z-zs)/sigma)**2)
def air_relative(vx, vz, z):
va = np.array([vx - wind(z), vz])
q = 0.5 * atmosphere(z) * np.dot(va, va)
return va, q
print(air_relative(0.0, 400.0, 7000.0))MATLAB
rho0 = 1.225; H = 8500;
w0 = 8; ws = 22; zs = 7000; sigma = 2000;
z = 7000; vx = 0; vz = 400;
rho = rho0*exp(-max(z,0)/H);
w = w0 + ws*exp(-0.5*((z-zs)/sigma)^2);
va = [vx-w; vz];
q = 0.5*rho*(va.'*va);
fprintf('Dynamic pressure: %.2f Pa\n',q);