|
Vulcan
Aerospace Engineering Utilities Built on Janus
|
Classes | |
| struct | RigidBodyState |
| struct | RigidBodyDerivatives |
| Time derivatives of rigid body state. More... | |
| struct | MassProperties |
Functions | |
| template<typename Scalar> | |
| Vec3< Scalar > | position_dot (const Vec3< Scalar > &velocity) |
| template<typename Scalar> | |
| Scalar | attitude_response_accel (const Scalar &angle, const Scalar &angle_dot, const Scalar &angle_cmd, const Scalar &omega_n, const Scalar &zeta) |
| template<typename Scalar> | |
| Vec3< Scalar > | thrust_direction_btt (const Scalar &gamma, const Scalar &chi) |
| template<typename Scalar> | |
| Vec3< Scalar > | lift_direction_btt (const Scalar &gamma, const Scalar &chi, const Scalar &phi) |
| template<typename Scalar> | |
| Vec3< Scalar > | thrust_direction_stt (const Scalar &theta, const Scalar &psi) |
| template<typename Scalar> | |
| Vec3< Scalar > | side_force_direction_stt (const Scalar &theta, const Scalar &psi) |
| template<typename Scalar> | |
| Vec3< Scalar > | normal_force_direction_stt (const Scalar &theta, const Scalar &psi) |
| template<typename Scalar> | |
| Vec3< Scalar > | velocity_dot_btt (const Scalar &thrust, const Scalar &drag, const Scalar &lift, const Scalar &mass, const Scalar &gravity, const Scalar &gamma, const Scalar &chi, const Scalar &phi) |
| template<typename Scalar> | |
| Vec3< Scalar > | velocity_dot_stt (const Scalar &thrust, const Scalar &drag, const Scalar &normal_force, const Scalar &side_force, const Scalar &mass, const Scalar &gravity, const Scalar &theta, const Scalar &psi) |
| template<typename Scalar> | |
| Scalar | gamma_dot (const Scalar &lift, const Scalar &weight, const Scalar &mass, const Scalar &velocity, const Scalar &gamma, const Scalar &phi) |
| template<typename Scalar> | |
| Scalar | chi_dot_btt (const Scalar &lift, const Scalar &mass, const Scalar &velocity, const Scalar &gamma, const Scalar &phi) |
| template<typename Scalar> | |
| Scalar | load_factor_from_lift (const Scalar &lift, const Scalar &weight) |
| template<typename Scalar> | |
| Scalar | bank_for_turn_rate (const Scalar &velocity, const Scalar &chi_dot, const Scalar &gravity) |
| template<typename Scalar> | |
| Vec2< Scalar > | planar_acceleration (const Scalar &force_x, const Scalar &force_y, const Scalar &mass) |
| template<typename Scalar> | |
| Vec2< Scalar > | planar_acceleration (const Vec2< Scalar > &force, const Scalar &mass) |
| template<typename Scalar> | |
| Vec2< Scalar > | planar_acceleration_gravity (const Scalar &force_x, const Scalar &force_y, const Scalar &mass, const Scalar &gravity) |
| template<typename Scalar> | |
| Vec3< Scalar > | point_mass_acceleration (const Vec3< Scalar > &force, const Scalar &mass) |
| template<typename Scalar> | |
| Scalar | speed (const Vec3< Scalar > &velocity) |
| template<typename Scalar> | |
| Vec3< Scalar > | velocity_direction (const Vec3< Scalar > &velocity) |
| template<typename Scalar> | |
| Vec3< Scalar > | point_mass_acceleration_ecef (const Vec3< Scalar > &position, const Vec3< Scalar > &velocity, const Vec3< Scalar > &force, const Scalar &mass, const Vec3< Scalar > &omega_earth) |
| template<typename Scalar> | |
| Vec3< Scalar > | specific_force (const Vec3< Scalar > &acceleration) |
| template<typename Scalar> | |
| Vec3< Scalar > | g_load (const Vec3< Scalar > &acceleration, const Scalar &g0=Scalar(9.80665)) |
| template<typename Scalar> | |
| Scalar | g_load_magnitude (const Vec3< Scalar > &acceleration, const Scalar &g0=Scalar(9.80665)) |
| template<typename Scalar> | |
| Scalar | flight_path_angle (const Vec3< Scalar > &velocity) |
| template<typename Scalar> | |
| Scalar | heading_angle (const Vec3< Scalar > &velocity) |
| template<typename Scalar> | |
| Vec3< Scalar > | velocity_from_angles (const Scalar &speed, const Scalar &gamma, const Scalar &chi) |
| template<typename Scalar> | |
| Scalar | specific_kinetic_energy (const Vec3< Scalar > &velocity) |
| template<typename Scalar> | |
| Scalar | specific_potential_energy (const Vec3< Scalar > &position, const Scalar &mu) |
| template<typename Scalar> | |
| Scalar | specific_energy (const Vec3< Scalar > &position, const Vec3< Scalar > &velocity, const Scalar &mu) |
| template<typename Scalar> | |
| Vec3< Scalar > | rail_direction_ned (const Scalar &azimuth, const Scalar &elevation) |
| template<typename Scalar> | |
| MassProperties< Scalar > | aggregate_mass_properties (const std::vector< MassProperties< Scalar > > &components) |
| template<typename Scalar> | |
| MassProperties< Scalar > | transform_mass_properties (const MassProperties< Scalar > &props, const Mat3< Scalar > &rotation, const Vec3< Scalar > &translation) |
| MassProperties< Scalar > vulcan::mass::aggregate_mass_properties | ( | const std::vector< MassProperties< Scalar > > & | components | ) |
Aggregate a collection of mass properties
Computes combined CG and inertia tensor about combined CG. Equivalent to sum() in Python.
| components | Vector of component mass properties |
| Scalar vulcan::dynamics::attitude_response_accel | ( | const Scalar & | angle, |
| const Scalar & | angle_dot, | ||
| const Scalar & | angle_cmd, | ||
| const Scalar & | omega_n, | ||
| const Scalar & | zeta ) |
Compute attitude angle acceleration via 2nd-order transfer function
Implements: α̈ = ω²(α_cmd - α) - 2ζωα̇
This models the vehicle's attitude response to commands (e.g., from autopilot). The ω_n and ζ parameters characterize the closed-loop response.
| Scalar | Scalar type (double or casadi::MX) |
| angle | Current angle [rad] |
| angle_dot | Current angle rate [rad/s] |
| angle_cmd | Commanded angle [rad] |
| omega_n | Natural frequency of response [rad/s] |
| zeta | Damping ratio of response |
| Scalar vulcan::dynamics::bank_for_turn_rate | ( | const Scalar & | velocity, |
| const Scalar & | chi_dot, | ||
| const Scalar & | gravity ) |
Compute required bank angle for coordinated turn
For a given turn rate and velocity, the required bank angle is: tan(φ) = V·χ̇ / g
| velocity | Speed [m/s] |
| chi_dot | Desired heading rate [rad/s] |
| gravity | Gravitational acceleration [m/s²] |
| Scalar vulcan::dynamics::chi_dot_btt | ( | const Scalar & | lift, |
| const Scalar & | mass, | ||
| const Scalar & | velocity, | ||
| const Scalar & | gamma, | ||
| const Scalar & | phi ) |
Compute heading rate from lateral acceleration (bank-to-turn)
χ̇ = (L·sin(φ)) / (m·V·cos(γ))
| lift | Lift magnitude [N] |
| mass | Vehicle mass [kg] |
| velocity | Speed [m/s] |
| gamma | Flight path angle [rad] |
| phi | Bank angle [rad] |
| Scalar vulcan::dynamics::flight_path_angle | ( | const Vec3< Scalar > & | velocity | ) |
Compute flight path angle (gamma) from velocity
Flight path angle is the angle between the velocity vector and the local horizontal plane, positive upward.
$$\gamma = \arcsin(-v_z / |v|)$$ (for Z-down convention)
| velocity | Velocity vector [m/s] (Z-down) |
| Vec3< Scalar > vulcan::dynamics::g_load | ( | const Vec3< Scalar > & | acceleration, |
| const Scalar & | g0 = Scalar(9.80665) ) |
Compute g-load from acceleration
| acceleration | Acceleration vector [m/s²] |
| g0 | Standard gravity [m/s²] (default 9.80665) |
| Scalar vulcan::dynamics::g_load_magnitude | ( | const Vec3< Scalar > & | acceleration, |
| const Scalar & | g0 = Scalar(9.80665) ) |
Compute total g-load magnitude
| acceleration | Acceleration vector [m/s²] |
| g0 | Standard gravity [m/s²] |
| Scalar vulcan::dynamics::gamma_dot | ( | const Scalar & | lift, |
| const Scalar & | weight, | ||
| const Scalar & | mass, | ||
| const Scalar & | velocity, | ||
| const Scalar & | gamma, | ||
| const Scalar & | phi ) |
Compute flight path angle rate from vertical acceleration
γ̇ = (L·cos(φ) - W·cos(γ)) / (m·V)
For pseudo-5DOF, given the normal load factor, compute gamma_dot.
| lift | Lift magnitude [N] |
| weight | Weight (m*g) [N] |
| mass | Vehicle mass [kg] |
| velocity | Speed [m/s] |
| gamma | Current flight path angle [rad] |
| phi | Bank angle [rad] |
| Scalar vulcan::dynamics::heading_angle | ( | const Vec3< Scalar > & | velocity | ) |
Compute heading angle (chi) from velocity
Heading angle is the angle from North to the horizontal projection of velocity, measured clockwise (for NED convention).
$$\chi = \arctan2(v_y, v_x)$$
| velocity | Velocity vector [m/s] (in NED frame) |
| Vec3< Scalar > vulcan::dynamics::lift_direction_btt | ( | const Scalar & | gamma, |
| const Scalar & | chi, | ||
| const Scalar & | phi ) |
Compute lift direction for bank-to-turn vehicle
Lift acts perpendicular to velocity, in the plane defined by bank angle. For zero bank, lift is "up" (opposite gravity). For non-zero bank, lift tilts toward the turn.
| gamma | Flight path angle [rad] |
| chi | Heading angle [rad] |
| phi | Bank angle [rad] (positive = right wing down) |
| Scalar vulcan::dynamics::load_factor_from_lift | ( | const Scalar & | lift, |
| const Scalar & | weight ) |
Compute load factor from lift
n = L / W
| lift | Lift magnitude [N] |
| weight | Weight [N] |
| Vec3< Scalar > vulcan::dynamics::normal_force_direction_stt | ( | const Scalar & | theta, |
| const Scalar & | psi ) |
Compute normal force direction for skid-to-turn vehicle
Normal force acts perpendicular to body X in the vertical body plane. This is the lift-like force generated by angle of attack (alpha).
| theta | Pitch angle [rad] |
| psi | Yaw angle [rad] |
| Vec2< Scalar > vulcan::dynamics::planar_acceleration | ( | const Scalar & | force_x, |
| const Scalar & | force_y, | ||
| const Scalar & | mass ) |
Compute 2-DOF planar point mass acceleration
Simple Newton's second law in 2D: $$\ddot{x} = F_x/m, \quad \ddot{y} = F_y/m$$
| Scalar | Scalar type (double or casadi::MX) |
| force_x | X-direction force [N] |
| force_y | Y-direction force [N] |
| mass | Point mass [kg] |
| Vec2< Scalar > vulcan::dynamics::planar_acceleration | ( | const Vec2< Scalar > & | force, |
| const Scalar & | mass ) |
Compute 2-DOF planar acceleration from force vector
| Scalar | Scalar type (double or casadi::MX) |
| force | Force vector [Fx, Fy] [N] |
| mass | Point mass [kg] |
| Vec2< Scalar > vulcan::dynamics::planar_acceleration_gravity | ( | const Scalar & | force_x, |
| const Scalar & | force_y, | ||
| const Scalar & | mass, | ||
| const Scalar & | gravity ) |
Compute 2-DOF planar acceleration with gravity (Y-down convention)
| force_x | X-direction force [N] (not including gravity) |
| force_y | Y-direction force [N] (not including gravity) |
| mass | Point mass [kg] |
| gravity | Gravitational acceleration [m/s²] (positive down) |
| Vec3< Scalar > vulcan::dynamics::point_mass_acceleration | ( | const Vec3< Scalar > & | force, |
| const Scalar & | mass ) |
Compute 3-DOF point mass acceleration in inertial frame
Simple Newton's second law in 3D: $$\ddot{\mathbf{r}} = \mathbf{F}/m$$
| Scalar | Scalar type (double or casadi::MX) |
| force | Force vector in inertial frame [N] |
| mass | Point mass [kg] |
| Vec3< Scalar > vulcan::dynamics::point_mass_acceleration_ecef | ( | const Vec3< Scalar > & | position, |
| const Vec3< Scalar > & | velocity, | ||
| const Vec3< Scalar > & | force, | ||
| const Scalar & | mass, | ||
| const Vec3< Scalar > & | omega_earth ) |
Compute 3-DOF point mass acceleration in ECEF frame
Includes Coriolis and centrifugal terms for rotating reference frame: $$\ddot{\mathbf{r}} = \mathbf{F}/m - 2\boldsymbol{\omega}_e \times \mathbf{v} - \boldsymbol{\omega}_e \times (\boldsymbol{\omega}_e \times \mathbf{r})$$
| Scalar | Scalar type (double or casadi::MX) |
| position | Position in ECEF [m] |
| velocity | Velocity in ECEF [m/s] |
| force | Force vector in ECEF [N] |
| mass | Point mass [kg] |
| omega_earth | Earth rotation vector [rad/s] (typically {0, 0, 7.2921159e-5}) |
| Vec3< Scalar > vulcan::dynamics::position_dot | ( | const Vec3< Scalar > & | velocity | ) |
Compute position derivative (trivial kinematic relationship)
For pseudo-5DOF in NED frame: ṙ = v
| velocity | Velocity vector in NED [m/s] |
| Vec3< Scalar > vulcan::dynamics::rail_direction_ned | ( | const Scalar & | azimuth, |
| const Scalar & | elevation ) |
Compute rail direction unit vector from elevation and azimuth
| azimuth | Rail azimuth from North [rad] |
| elevation | Rail elevation from horizontal [rad] |
| Vec3< Scalar > vulcan::dynamics::side_force_direction_stt | ( | const Scalar & | theta, |
| const Scalar & | psi ) |
Compute side force direction for skid-to-turn vehicle
Side force acts perpendicular to body X-axis in the horizontal body plane. This is the force generated by sideslip (beta).
| theta | Pitch angle [rad] |
| psi | Yaw angle [rad] |
| Scalar vulcan::dynamics::specific_energy | ( | const Vec3< Scalar > & | position, |
| const Vec3< Scalar > & | velocity, | ||
| const Scalar & | mu ) |
Compute total specific mechanical energy
| position | Position vector [m] |
| velocity | Velocity vector [m/s] |
| mu | Gravitational parameter [m³/s²] |
| Vec3< Scalar > vulcan::dynamics::specific_force | ( | const Vec3< Scalar > & | acceleration | ) |
Compute specific force from acceleration (a = F/m)
| acceleration | Acceleration vector [m/s²] |
| Scalar vulcan::dynamics::specific_kinetic_energy | ( | const Vec3< Scalar > & | velocity | ) |
Compute specific kinetic energy
| velocity | Velocity vector [m/s] |
| Scalar vulcan::dynamics::specific_potential_energy | ( | const Vec3< Scalar > & | position, |
| const Scalar & | mu ) |
Compute specific potential energy (gravitation)
| position | Position vector from center of attracting body [m] |
| mu | Gravitational parameter [m³/s²] |
| Scalar vulcan::dynamics::speed | ( | const Vec3< Scalar > & | velocity | ) |
Compute velocity magnitude
| velocity | Velocity vector [m/s] |
| Vec3< Scalar > vulcan::dynamics::thrust_direction_btt | ( | const Scalar & | gamma, |
| const Scalar & | chi ) |
Compute thrust direction for bank-to-turn vehicle
Bank-to-turn: Vehicle banks (rolls) to turn. Thrust is along body X-axis. Lift acts perpendicular to velocity, rotated by bank angle.
| gamma | Flight path angle [rad] (positive = climbing) |
| chi | Heading angle [rad] (from North) |
| Vec3< Scalar > vulcan::dynamics::thrust_direction_stt | ( | const Scalar & | theta, |
| const Scalar & | psi ) |
Compute thrust direction for skid-to-turn vehicle
Skid-to-turn: Vehicle yaws to turn (like a missile with cruciform fins). Thrust is along body X-axis, defined by pitch (theta) and yaw (psi).
| theta | Pitch angle [rad] (positive = nose up) |
| psi | Yaw angle [rad] (positive = nose right) |
| MassProperties< Scalar > vulcan::mass::transform_mass_properties | ( | const MassProperties< Scalar > & | props, |
| const Mat3< Scalar > & | rotation, | ||
| const Vec3< Scalar > & | translation ) |
Transform mass properties to a new coordinate frame
| props | Original mass properties |
| rotation | Rotation matrix from old frame to new frame |
| translation | Translation from old origin to new origin (in old frame) |
| Vec3< Scalar > vulcan::dynamics::velocity_direction | ( | const Vec3< Scalar > & | velocity | ) |
Compute unit velocity direction
| velocity | Velocity vector [m/s] |
| Vec3< Scalar > vulcan::dynamics::velocity_dot_btt | ( | const Scalar & | thrust, |
| const Scalar & | drag, | ||
| const Scalar & | lift, | ||
| const Scalar & | mass, | ||
| const Scalar & | gravity, | ||
| const Scalar & | gamma, | ||
| const Scalar & | chi, | ||
| const Scalar & | phi ) |
Compute velocity derivative for bank-to-turn vehicle
| thrust | Thrust magnitude [N] |
| drag | Drag magnitude [N] |
| lift | Lift magnitude [N] |
| mass | Vehicle mass [kg] |
| gravity | Gravitational acceleration [m/s²] |
| gamma | Flight path angle [rad] |
| chi | Heading angle [rad] |
| phi | Bank angle [rad] |
| Vec3< Scalar > vulcan::dynamics::velocity_dot_stt | ( | const Scalar & | thrust, |
| const Scalar & | drag, | ||
| const Scalar & | normal_force, | ||
| const Scalar & | side_force, | ||
| const Scalar & | mass, | ||
| const Scalar & | gravity, | ||
| const Scalar & | theta, | ||
| const Scalar & | psi ) |
Compute velocity derivative for skid-to-turn vehicle
| thrust | Thrust magnitude [N] |
| drag | Drag magnitude [N] |
| normal_force | Normal force magnitude [N] (from alpha) |
| side_force | Side force magnitude [N] (from beta) |
| mass | Vehicle mass [kg] |
| gravity | Gravitational acceleration [m/s²] |
| theta | Pitch angle [rad] |
| psi | Yaw angle [rad] |
| Vec3< Scalar > vulcan::dynamics::velocity_from_angles | ( | const Scalar & | speed, |
| const Scalar & | gamma, | ||
| const Scalar & | chi ) |
Compute velocity from speed and flight path angles
| speed | Speed magnitude [m/s] |
| gamma | Flight path angle [rad] |
| chi | Heading angle from North [rad] |