This page provides a step-by-step derivation of the governing differential equations for rocket ascent.
LaTeX Reference
This section corresponds to Section 3 of nm_final_project.tex (Equations 5-14).
Overview¶
The equations of motion describe how the state vector evolves over time:
Where \(\mathbf{u}\) represents control inputs (thrust magnitude, steering angle).
Step 1: Kinematic Equations¶
1.1 Radial Velocity¶
The radial component of velocity is the rate of change of distance from Earth's center:
Derivation:
The velocity vector in polar coordinates:
The radial component is:
1.2 Angular Velocity¶
The tangential velocity component determines the angular rate:
Solving for \(\dot{\lambda}\):
Implementation:
dr = v * jnp.sin(gamma) # [Eq. 5]
dlam = v * jnp.cos(gamma) / r_safe # [Eq. 6]
Step 2: Force Analysis¶
The rocket experiences three forces:
2.1 Thrust Force \(\mathbf{T}\)¶
Where: - \(T\) = thrust magnitude [N] - \(\alpha\) = steering angle (thrust vs. velocity) [rad] - \(\hat{t}\) = unit vector along velocity - \(\hat{n}\) = unit vector perpendicular to velocity (toward center of curvature)
2.2 Drag Force \(\mathbf{D}\)¶
Drag acts opposite to velocity. The magnitude is:
See Atmosphere Model for details.
2.3 Gravitational Force \(\mathbf{W}\)¶
Components in path coordinates: - Tangential: \(-mg\sin\gamma\) (opposing ascent) - Normal: \(-mg\cos\gamma\) (toward Earth)
Step 3: Newton's Second Law¶
3.1 Path Coordinate System¶
In path coordinates (tangent \(\hat{t}\), normal \(\hat{n}\)):
Where \(\rho_c\) is the radius of curvature.
Curvature Term
The term \(\frac{v^2}{r}\cos\gamma\) accounts for the changing direction of the local horizontal as the rocket moves around the curved Earth.
3.2 Tangential Force Balance¶
Substituting \(g = \mu/r^2\):
Implementation:
# [Eq. 9] Speed equation
dv = (stage.thrust / m) * jnp.cos(alpha) - derived.drag / m - \
(mu / (r_safe * r_safe)) * jnp.sin(gamma)
3.3 Normal Force Balance¶
Rearranging:
Substituting \(g = \mu/r^2\):
Implementation:
# [Eq. 10] Flight-path angle equation with regularization
inv_v = v / (v * v + v_eps * v_eps) # Regularized 1/v
dgamma = (stage.thrust * inv_v / m) * jnp.sin(alpha) + \
(v / r_safe - (mu / (r_safe * r_safe)) * inv_v) * jnp.cos(gamma)
Step 4: Mass Flow Equation¶
4.1 Tsiolkovsky Rocket Equation¶
The thrust is produced by expelling mass at high velocity:
Where: - \(\dot{m}_e\) = propellant mass flow rate [kg/s] - \(v_e\) = exhaust velocity [m/s] - \(I_{sp}\) = specific impulse [s] - \(g_0\) = standard gravity (9.80665 m/s²)
4.2 Mass Depletion Rate¶
Since \(\dot{m} = -\dot{m}_e\) (rocket loses mass):
Implementation:
# [Eq. 11] Mass flow
dm = -stage.thrust / (stage.isp * earth.g0)
Step 5: Numerical Regularization¶
5.1 The \(1/v\) Singularity¶
Equation 10 contains \(1/v\) terms. At liftoff, \(v = 0\), causing division by zero.
Problem: $$ \frac{d\gamma}{dt} \propto \frac{1}{v} \to \infty \quad \text{as} \quad v \to 0 $$
5.2 Regularized Inverse Velocity¶
We replace \(1/v\) with a smooth approximation:
Properties:
| Regime | Behavior |
|---|---|
| \(v \gg v_\epsilon\) | \(\approx 1/v\) (exact) |
| \(v = 0\) | \(= 0\) (bounded) |
| \(v = v_\epsilon\) | \(= 1/(2v_\epsilon)\) |
Typically \(v_\epsilon = 1.0\) m/s.
5.3 Safe Radius Guard¶
Similarly for \(1/r\) terms:
This prevents singularity if numerical error pushes \(r\) below Earth's surface.
Implementation:
# Guard r to avoid singularity at r=0 [Eq. 13]
r_safe = jnp.maximum(r, earth.r_e * 0.99)
# ...
# Guard the 1/v terms near v -> 0 [Eq. 12]
inv_v = v / (v * v + v_eps * v_eps)
Complete ODE System¶
The full system of differential equations:
Implementation:
return jnp.stack([dr, dlam, dv, dgamma, dm])
Special Cases¶
Vertical Ascent (\(\gamma = \pi/2\))¶
During vertical flight: - \(\dot{r} = v\) (all velocity is radial) - \(\dot{\lambda} = 0\) (no downrange motion) - \(\dot{\gamma} = 0\) (constrained vertical)
Implementation: rhs_vertical() in dynamics.py
Gravity Turn (\(\alpha = 0\))¶
Thrust aligned with velocity: - Simplified equations (no \(\sin\alpha\) terms) - Natural trajectory curvature from gravity
Implementation: rhs_gravity_turn() in dynamics.py
Coast (\(T = 0\))¶
No thrust phase: - \(\dot{m} = 0\) (mass constant) - Only drag and gravity act
Implementation: rhs_coast() in dynamics.py
Summary Table¶
| Equation | Expression | Implementation |
|---|---|---|
| Eq. 5 | \(\dot{r} = v\sin\gamma\) | dynamics.py:69 |
| Eq. 6 | \(\dot{\lambda} = v\cos\gamma/r\) | dynamics.py:70 |
| Eq. 9 | Speed equation | dynamics.py:73 |
| Eq. 10 | Flight-path angle equation | dynamics.py:79 |
| Eq. 11 | Mass flow | dynamics.py:82 |
| Eq. 12 | Regularized \(1/v\) | dynamics.py:77 |
| Eq. 13 | Safe radius | dynamics.py:66 |
References¶
-
Battin, R.H. (1999). An Introduction to the Mathematics and Methods of Astrodynamics. AIAA Education Series. Chapter 6 - "Rocket Dynamics".
-
Sutton, G.P. & Biblarz, O. (2016). Rocket Propulsion Elements. Wiley. Chapter 4 - "Flight Performance".
-
Curtis, H.D. (2013). Orbital Mechanics for Engineering Students. Butterworth-Heinemann. Chapter 11 - "Rocket Vehicle Dynamics".
Next Steps¶
- Atmosphere Model - Density and speed of sound
- Orbital Mechanics - Two-body diagnostics
- Numerical Methods - ODE solvers