| name | aerospace-engineering |
| description | Aerospace engineering fundamentals including aerodynamics, propulsion, flight dynamics, spacecraft dynamics, and structural analysis |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"engineers","category":"engineering"} |
What I do
- Analyze aerodynamic forces and moments
- Design aircraft and spacecraft propulsion systems
- Model flight dynamics and stability
- Calculate orbital mechanics and trajectories
- Perform structural analysis for aerospace structures
- Specify materials for aerospace applications
- Analyze loads and fatigue for flight vehicles
When to use me
When designing aircraft, spacecraft, propulsion systems, or analyzing aerodynamic and structural performance of aerospace vehicles.
Core Concepts
- Aerodynamics and fluid dynamics
- Propulsion systems (jet, rocket, hybrid)
- Flight dynamics and control
- Orbital mechanics and astrodynamics
- Aerospace structures and materials
- Load factors and fatigue analysis
- Aircraft performance (range, endurance, climb)
- Compressible flow and shock waves
- Stability and control derivatives
- Spacecraft attitude dynamics
Code Examples
Aerodynamic Calculations
import math
from dataclasses import dataclass
@dataclass
class Atmosphere:
altitude: float
temperature: float
pressure: float
density: float
speed_of_sound: float
def standard_atmosphere(altitude: float) -> Atmosphere:
"""Calculate standard atmosphere properties."""
if altitude < 36000:
T = 519.67 - 0.00356 * altitude
P = 2116.2 * (T / 518.67)**5.256
else:
T = 389.97
P = 2116.2 * math.exp(-(altitude - 36000) / 14700)
rho = P / (1716 * T)
a = math.sqrt(1.4 * 1716 * T)
return Atmosphere(altitude, T, P, rho, a)
def lift_coefficient(
CL: float,
rho: float,
V: float,
S: float
) -> float:
"""Calculate lift force."""
return 0.5 * rho * V**2 * S * CL
() -> :
CD0 + CL** / (math.pi * e * AR)
() -> :
V / a
() -> :
* rho * V**
alt =
atm = standard_atmosphere(alt)
V =
CL =
S =
q = dynamic_pressure(atm.density, V * )
M = mach_number(V * , atm.speed_of_sound)
()
()
()
Flight Performance
def thrust_available(
TSL: float,
altitude: float,
velocity: float
) -> float:
"""Calculate thrust at altitude using Napier's approximation."""
sigma = standard_atmosphere(altitude).density / 0.002377
return TSL * sigma * (1 - velocity**2 / 5e10)
def power_available(
HP: float,
prop_efficiency: float,
rho: float
) -> float:
"""Calculate available power."""
return HP * 550 * prop_efficiency / (rho / 0.002377)
def range_breguet(
R: float,
V: float,
L_D: float,
TSFC: float,
W_start: float,
W_end: float
) -> float:
"""Calculate fuel required using Breguet range equation."""
return V * L_D / TSFC * math.log(W_start / W_end)
def stall_speed(
W: float,
S: float,
CLmax: ,
rho:
) -> :
Vs = math.sqrt( * W / (rho * S * CLmax))
Vs *
() -> :
(T_W - W_S * * rho * CLmax / ( * W_S)) / (W_S * / (rho * CLmax))
W0 =
Wf =
range_nm =
L_D =
V =
TSFC =
fuel_required = range_nm * TSFC / (V * L_D) * (W0 - Wf)
()
Rocket Propulsion
def rocket_thrust(
md: float,
Ve: float,
Ae: float,
pe: float,
pa: float,
) -> float:
"""Calculate rocket thrust."""
return md * Ve + (pe - pa) * Ae
def specific_impulse(
thrust: float,
md: float,
g0: float = 9.81
) -> float:
"""Calculate specific impulse."""
return thrust / (md * g0)
def mass_ratio(
m_initial: float,
m_final: float
) -> float:
"""Calculate mass ratio."""
return m_initial / m_final
def delta_v_rocket(
Isp: float,
m_ratio: float,
g0: float = 9.81
) -> float:
"""Calculate delta-V using rocket equation."""
return Isp * g0 * math.log(m_ratio)
def nozzle_expansion_ratio(
pe: float,
pc: ,
gamma: =
) -> :
((gamma + ) / )**((gamma + ) / ( * (gamma - ))) * math.sqrt(pe / pc)
m_dot =
Ve =
chamber_pressure =
Isp =
m_ratio =
dV = delta_v_rocket(Isp, m_ratio)
()
Orbital Mechanics
def orbital_velocity(
mu: float,
r: float
) -> float:
"""Calculate circular orbital velocity."""
return math.sqrt(mu / r)
def orbital_period(
mu: float,
a: float
) -> float:
"""Calculate orbital period."""
return 2 * math.pi * math.sqrt(a**3 / mu)
def hohmann_transfer(
r1: float,
r2: float,
mu: float
) -> dict:
"""Calculate Hohmann transfer parameters."""
a_transfer = (r1 + r2) / 2
dv1 = math.sqrt(mu / r1) * (math.sqrt(2 * r2 / (r1 + r2)) - 1)
dv2 = math.sqrt(mu / r2) * (1 - math.sqrt(2 * r1 / (r1 + r2)))
transfer_time = math.pi * math.sqrt(a_transfer**3 / mu)
return {
"dv1": dv1,
"dv2": dv2,
"total_dv": dv1 + dv2,
"transfer_time": transfer_time
}
def escape_velocity(
mu: float,
r: float
) -> :
math.sqrt( * mu / r)
r_leo =
r_geo =
mu_earth =
transfer = hohmann_transfer(r_leo, r_geo, mu_earth)
()
()
()
Best Practices
- Use consistent unit systems throughout calculations
- Apply appropriate factors of safety for flight hardware
- Consider environmental factors (temperature, pressure) in performance
- Validate analytical results with CFD and wind tunnel data
- Follow aerospace standards (MIL, NASA, FAA, EASA)
- Account for structural loads in aerodynamic design
- Consider maintainability and inspection requirements
- Use margin on critical performance parameters
- Consider failure modes and safety margins
- Document all assumptions and methods used