AstroManeuvers
The AstroManeuvers module provides utilities and functions for orbital maneuver calculations in astrodynamics applications. The module includes impulsive maneuver models and functions for applying maneuvers to spacecraft objects.
Quick Start
Apply an impulsive orbital maneuver:
using AstroModels, AstroManeuvers
m = ImpulsiveManeuver(axes=Inertial(),
Isp=300.0,
element1=0.01,
element2=0.0,
element3=0.0)
sc = Spacecraft()
maneuver!(sc, m)Table of Contents
AstroManeuvers.MANEUVER_AXESAstroManeuvers.ImpulsiveManeuverAstroManeuvers.ImpulsiveManeuverAstroManeuvers._validate_maneuver_inputsAstroManeuvers.compute_mass_usedAstroManeuvers.consume_fuel!AstroManeuvers.get_deltav_elementsAstroManeuvers.get_deltav_inertialAstroManeuvers.maneuver!AstroManeuvers.push_history_segment!AstroManeuvers.rot_mat_axes_to_inertialAstroManeuvers.rot_mat_axes_to_inertialAstroManeuvers.rot_mat_vnb_to_inertialBase.promoteBase.show
API Reference
AstroManeuvers.ImpulsiveManeuver — Type
ImpulsiveManeuver{A<:AbstractAxes, T<:Real}Represents an impulsive delta-v command defined in a local maneuver frame.
Fields
- axes::A local maneuver frame (e.g., VNB() or Inertial())
- g0::T standard gravity in m/s^2 (internally converted to km/s^2 where needed)
- Isp::T specific impulse in seconds
- element1::T delta-v component along axis 1 of
axes(km/s) - element2::T delta-v component along axis 2 of
axes(km/s) - element3::T delta-v component along axis 3 of
axes(km/s)
Notes:
- Use keyword constructor for convenience to avoid setting all values.
- Delta-v components are interpreted in the provided
axesframe and expressed in km/s. - Numeric types are generic over Real to support AD and high-precision arithmetic.
Examples
using AstroManeuvers, AstroFrames
m = ImpulsiveManeuver(axes=VNB(),
g0=9.81, Isp=300.0,
element1=0.010,
element2=0.005,
element3=-0.002)
# output
ImpulsiveManeuver(
axes = VNB()
g0 = 9.81
Isp = 300.0
element1 = 0.01
element2 = 0.005
element3 = -0.002)AstroManeuvers.ImpulsiveManeuver — Method
ImpulsiveManeuver(; axes=VNB(), g0=9.81, Isp=220.0, element1=0.0, element2=0.0, element3=0.0)Construct an impulsive maneuver from keyword arguments with defaults.
AstroManeuvers._validate_maneuver_inputs — Method
function _validate_maneuver_inputs(axes::AbstractAxes, g0::Real, Isp::Real)Validates inputs for constructing an ImpulsiveManeuver.
AstroManeuvers.compute_mass_used — Method
compute_mass_used(m::ImpulsiveManeuver, initial_mass::Real, Isp::Real) -> RealComputes mass consumed from impulsive maneuver using the rocket equation.
AstroManeuvers.consume_fuel! — Method
consume_fuel!(m::ImpulsiveManeuver, sc)Subtract mass used by maneuver from the spacecraft mass.
AstroManeuvers.get_deltav_elements — Method
get_deltav_elements(m::ImpulsiveManeuver) -> (dv1, dv2, dv3)Return the delta-v components in the maneuver axes (as defined by m.axes).
Arguments
- m::ImpulsiveManeuver maneuver definition
Returns
- (dv1, dv2, dv3)::Tuple components in the maneuver frame axes
AstroManeuvers.get_deltav_inertial — Method
get_deltav_inertial(m::ImpulsiveManeuver, sc) -> (dvi, dvj, dvk)Returns maneuver components in the inertial frame.
AstroManeuvers.maneuver! — Method
maneuver!(sc::Spacecraft, m::ImpulsiveManeuver) -> SpacecraftApply an impulsive delta-v maneuver to a spacecraft, updating velocity, mass, and history.
Arguments
- sc::Spacecraft Spacecraft being maneuvered
- m::ImpulsiveManeuver Maneuver definition (axes, Δv components, g0, Isp)
Notes:
- Model updates spacecraft velocity, mass, and history.
- In places updates to spacecraft are performed.
Returns
- sc::Spacecraft The same spacecraft instance with updated state, mass, and history
Examples
using AstroManeuvers, AstroFrames, AstroModels
m = ImpulsiveManeuver(axes=Inertial(),
Isp=300.0,
element1=0.01,
element2=0.0,
element3=0.0)
sc = Spacecraft()
maneuver!(sc, m)
# output
Spacecraft: unnamed
AstroEpochs.Time
value = 2015-09-21T12:23:12.000
scale = UTC()
format = ISOT()
OrbitState:
statetype: AstroStates.Cartesian
CartesianState:
x = 7000.00000000
y = 0.00000000
z = 0.00000000
vx = 0.01000000
vy = 7.50000000
vz = 0.00000000
CoordinateSystem:
origin: Earth
axes: ICRFAxes
Total Mass = 996.6078730003628 kgAstroManeuvers.push_history_segment! — Method
push_history_segment!(sc::Spacecraft, m::ImpulsiveManeuver)Append a new segment with maneuver to spacecraft history.
AstroManeuvers.rot_mat_axes_to_inertial — Method
rot_mat_axes_to_inertial(::Inertial, posvel) -> 3x3Return the DCM from the maneuver frame to inertial.
AstroManeuvers.rot_mat_axes_to_inertial — Method
rot_mat_axes_to_inertial(::VNB, posvel) -> 3x3Return the DCM from the maneuver frame to inertial.
AstroManeuvers.rot_mat_vnb_to_inertial — Method
rot_mat_vnb_to_inertial(posvel::AbstractVector) -> 3x3Build the VNB→Inertial DCM from position/velocity (km, km/s).
Notes:
- V is along v,
- N is orbital normal r×v,
- B completes right-handed triad.
Base.promote — Method
promote(m::ImpulsiveManeuver, ::Type{T}) where T<:Real -> ImpulsiveManeuver{A,T}Promote all Real fields of an ImpulsiveManeuver to type T for automatic differentiation.
Arguments
- m::ImpulsiveManeuver: The maneuver to promote
- ::Type{T}: Target numeric type (e.g., ForwardDiff.Dual, BigFloat)
Returns
- ImpulsiveManeuver{A,T}: New maneuver with all Real fields promoted to type T
Examples
using ForwardDiff
m = ImpulsiveManeuver(axes=VNB(), g0=9.81, Isp=300.0, element1=0.01, element2=0.02, element3=0.03)
m_dual = promote(m, ForwardDiff.Dual{Float64})AstroManeuvers.MANEUVER_AXES — Constant
MANEUVER_AXESAllowed maneuver axes types for ImpulsiveManeuver.