Vulcan
Aerospace Engineering Utilities Built on Janus
Loading...
Searching...
No Matches
vulcan::exponential_atmosphere Namespace Reference

Classes

struct  AtmosphericState
 Complete atmospheric state at a given altitude. More...

Functions

template<typename Scalar>
Scalar density (const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
 Exponential atmosphere - Density.
template<typename Scalar>
Scalar pressure (const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
 Exponential atmosphere - Pressure.
template<typename Scalar>
Scalar temperature (const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
 Exponential atmosphere - Temperature.
template<typename Scalar>
Scalar speed_of_sound (const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
 Exponential atmosphere - Speed of Sound.
template<typename Scalar>
AtmosphericState< Scalar > state (const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
 Exponential atmosphere - Complete atmospheric state.
double compute_scale_height (double temperature=T_0, double gravity=G_0)
 Compute scale height from reference conditions.
template<typename Scalar>
Scalar altitude_from_density (const Scalar &rho, double scale_height=DEFAULT_SCALE_HEIGHT)
 Compute altitude from density.
template<typename Scalar>
Scalar altitude_from_pressure (const Scalar &P, double scale_height=DEFAULT_SCALE_HEIGHT)
 Compute altitude from pressure.

Variables

constexpr double RHO_0 = 1.225
 Sea-level reference density [kg/m³].
constexpr double P_0 = 101325.0
 Sea-level reference pressure [Pa].
constexpr double T_0 = 288.15
 Sea-level reference temperature [K].
constexpr double DEFAULT_SCALE_HEIGHT = 8500.0
constexpr double G_0 = 9.80665
 Sea-level gravitational acceleration [m/s²].
constexpr double R_AIR = 287.058
 Specific gas constant for air [J/(kg·K)].
constexpr double GAMMA = 1.4
 Ratio of specific heats for air (γ = Cp/Cv).

Function Documentation

◆ altitude_from_density()

template<typename Scalar>
Scalar vulcan::exponential_atmosphere::altitude_from_density ( const Scalar & rho,
double scale_height = DEFAULT_SCALE_HEIGHT )

Compute altitude from density.

Inverse of the density function: h = -H * ln(ρ / ρ₀)

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
rhoDensity [kg/m³]
scale_heightAtmospheric scale height [m] (default: 8500 m)
Returns
Altitude [m]

◆ altitude_from_pressure()

template<typename Scalar>
Scalar vulcan::exponential_atmosphere::altitude_from_pressure ( const Scalar & P,
double scale_height = DEFAULT_SCALE_HEIGHT )

Compute altitude from pressure.

Inverse of the pressure function: h = -H * ln(P / P₀)

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
PPressure [Pa]
scale_heightAtmospheric scale height [m] (default: 8500 m)
Returns
Altitude [m]

◆ compute_scale_height()

double vulcan::exponential_atmosphere::compute_scale_height ( double temperature = T_0,
double gravity = G_0 )
inline

Compute scale height from reference conditions.

The scale height H = R*T / g relates temperature, gravity, and the rate of pressure decay.

Parameters
temperatureReference temperature [K]
gravityGravitational acceleration [m/s²]
Returns
Scale height [m]

◆ density()

template<typename Scalar>
Scalar vulcan::exponential_atmosphere::density ( const Scalar & altitude,
double scale_height = DEFAULT_SCALE_HEIGHT )

Exponential atmosphere - Density.

Computes air density using the simple exponential model: ρ = ρ₀ * exp(-h / H)

This model is suitable for quick estimates and trajectory optimization where a simple, smooth, differentiable model is preferred.

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
altitudeGeometric altitude above sea level [m]
scale_heightAtmospheric scale height [m] (default: 8500 m)
Returns
Density [kg/m³]
Note
For altitudes below 0, density will be greater than ρ₀. For very high altitudes, density approaches 0.

◆ pressure()

template<typename Scalar>
Scalar vulcan::exponential_atmosphere::pressure ( const Scalar & altitude,
double scale_height = DEFAULT_SCALE_HEIGHT )

Exponential atmosphere - Pressure.

Computes pressure using the simple exponential model: P = P₀ * exp(-h / H)

Uses the same scale height as density for consistency with an isothermal atmosphere assumption.

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
altitudeGeometric altitude above sea level [m]
scale_heightAtmospheric scale height [m] (default: 8500 m)
Returns
Pressure [Pa]

◆ speed_of_sound()

template<typename Scalar>
Scalar vulcan::exponential_atmosphere::speed_of_sound ( const Scalar & altitude,
double scale_height = DEFAULT_SCALE_HEIGHT )

Exponential atmosphere - Speed of Sound.

Computes speed of sound from temperature: a = sqrt(γ * R * T)

Since temperature is constant in this model, speed of sound is also constant.

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
altitudeGeometric altitude above sea level [m] (unused)
scale_heightAtmospheric scale height [m] (unused)
Returns
Speed of sound [m/s] - constant at ~340.3 m/s

◆ state()

template<typename Scalar>
AtmosphericState< Scalar > vulcan::exponential_atmosphere::state ( const Scalar & altitude,
double scale_height = DEFAULT_SCALE_HEIGHT )

Exponential atmosphere - Complete atmospheric state.

Returns all atmospheric properties in a single evaluation. Efficient for trajectory optimization where multiple properties are needed.

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
altitudeGeometric altitude above sea level [m]
scale_heightAtmospheric scale height [m] (default: 8500 m)
Returns
AtmosphericState containing T, P, ρ, a

◆ temperature()

template<typename Scalar>
Scalar vulcan::exponential_atmosphere::temperature ( const Scalar & altitude,
double scale_height = DEFAULT_SCALE_HEIGHT )

Exponential atmosphere - Temperature.

Returns the reference temperature (isothermal assumption). The exponential atmosphere model assumes constant temperature, which is why both density and pressure decay with the same scale height.

Template Parameters
Scalardouble or casadi::MX for symbolic computation
Parameters
altitudeGeometric altitude above sea level [m] (unused)
scale_heightAtmospheric scale height [m] (unused)
Returns
Temperature [K] - always returns T_0 = 288.15 K

Variable Documentation

◆ DEFAULT_SCALE_HEIGHT

double vulcan::exponential_atmosphere::DEFAULT_SCALE_HEIGHT = 8500.0
inlineconstexpr

Default atmospheric scale height [m] Approximately 8.5 km based on RT/g at sea level

◆ G_0

double vulcan::exponential_atmosphere::G_0 = 9.80665
inlineconstexpr

Sea-level gravitational acceleration [m/s²].

◆ GAMMA

double vulcan::exponential_atmosphere::GAMMA = 1.4
inlineconstexpr

Ratio of specific heats for air (γ = Cp/Cv).

◆ P_0

double vulcan::exponential_atmosphere::P_0 = 101325.0
inlineconstexpr

Sea-level reference pressure [Pa].

◆ R_AIR

double vulcan::exponential_atmosphere::R_AIR = 287.058
inlineconstexpr

Specific gas constant for air [J/(kg·K)].

◆ RHO_0

double vulcan::exponential_atmosphere::RHO_0 = 1.225
inlineconstexpr

Sea-level reference density [kg/m³].

◆ T_0

double vulcan::exponential_atmosphere::T_0 = 288.15
inlineconstexpr

Sea-level reference temperature [K].