Library
Documentation for AstroForceModels.jl
.
AstroForceModels.AbstractSatelliteDragModel
— TypeAbstract satellite drag model to help compute drag forces.
AstroForceModels.AbstractSatelliteSRPModel
— TypeAbstract satellite drag model to help compute drag forces.
AstroForceModels.CannonballFixedDrag
— TypeCannonball Fixed Drag Model struct Contains information to compute the ballistic coefficient of a cannonball drag model with a fixed ballistic coefficient.
Fields
radius::Number
: The radius of the spacecraft.mass::Number
: The mass of the spacecraft.drag_coeff::Number
: The drag coefficient of the spacecraft.ballistic_coeff::Number
: The fixed ballistic coefficient to use.
AstroForceModels.CannonballFixedDrag
— MethodCannonballFixedDrag(radius::Number, mass::Number, drag_coeff::Number)
Constructor for a fixed cannonball ballistic coefficient drag model.
The ballistic coefficient is computed with the following equation:
BC = CD * area/mass
where area is the 2D projection of a sphere
area = π * r^2
Arguments
radius::Number
: The radius of the spacecraft.mass::Number
: The mass of the spacecraft.drag_coeff::Number
: The drag coefficient of the spacecraft.
Returns
drag_model::CannonballFixedDrag
: A fixed ballistic coefficient drag model.
AstroForceModels.CannonballFixedDrag
— MethodCannonballFixedDrag(ballistic_coeff::Number)
Constructor for a fixed ballistic coefficient drag model.
Arguments
ballistic_coeff::Number
: The fixed ballistic coefficient to use.
Returns
drag_model::CannonballFixedDrag
: A fixed ballistic coefficient drag model.
AstroForceModels.CannonballFixedSRP
— TypeCannonball Fixed SRP Model struct Contains information to compute the reflectivity coefficient of a cannonball drag model with a fixed reflectivity coefficient.
Fields
radius::Number
: The radius of the spacecraft.mass::Number
: The mass of the spacecraft.reflectivity_coeff::Number
: The reflectivity coefficient of the spacecraft.reflectivity_ballistic_coeff::Number
: The fixed ballistic coefficient to use.
AstroForceModels.CannonballFixedSRP
— MethodCannonballFixedSRP(radius::Number, mass::Number, drag_coeff::Number)
Constructor for a fixed cannonball ballistic coefficient SRP model.
The ballistic coefficient is computed with the following equation:
RC = CD * area/mass
where area is the 2D projection of a sphere
area = π * r^2
Arguments
radius::Number
: The radius of the spacecraft.mass::Number
: The mass of the spacecraft.reflectivity_coeff::Number
: The reflectivity coefficient of the spacecraft.
Returns
- srp_model::CannonballFixedSRP`: A fixed ballistic coefficient SRP model.
AstroForceModels.CannonballFixedSRP
— MethodCannonballFixedSRP(ballistic_coeff::Number)
Constructor for a fixed ballistic coefficient SRP model.
Arguments
ballistic_coeff::Number
: The fixed ballistic coefficient to use.
Returns
srp_model::CannonballFixedDrag
: A fixed ballistic coefficient SRP model.
AstroForceModels.CelestialBody
— TypeCreates a CelestialBody Object from a name Available: {Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto,
Fields: -CelestialBody{T<:Number}
: PlanetBody Object with Fields: - name::String
: Name of Object - central_body::String
: Name of Central Body Being Orbited - jpl_code::Int
: NAIF ID Code - μ::T
: Graviational Parameter [km/s] - Req::T
: Equatorial Radius [km]
AstroForceModels.DragAstroModel
— TypeDrag Astro Model struct Contains information to compute the acceleration of a drag force on a spacecraft.
Fields
satellite_drag_model::AbstractSatelliteDragModel
: The satellite drag model for computing the ballistic coefficient.atmosphere_model::Symbol
: The atmospheric model for computing the density.eop_data::EopIau1980
: Earth orientation parameters to help compute the density with the atmospheric model.
AstroForceModels.GravityHarmonicsAstroModel
— TypeGravitational Harmonics Astro Model struct Contains information to compute the acceleration of a Gravitational Harmonics Model acting on a spacecraft.
Fields
gravity_model::AbstractGravityModel
: The gravitational potential model and coefficient data.eop_data::Union{EopIau1980,EopIau2000A}
: The data compute the Earth's orientation.order::Int
: The maximum order to compute the graviational potential to, a value of -1 compute the maximum order of the supplied model. (Default=-1)degree::Int
: The maximum degree to compute the graviational potential to, a value of -1 compute the maximum degree of the supplied model. (Default=-1)
AstroForceModels.KeplerianGravityAstroModel
— TypeGravitational Keplerian Astro Model struct Contains information to compute the acceleration of a Gravitational Harmonics Model acting on a spacecraft.
Fields
μ::Number
: The gravitational potential constant of the central body.
AstroForceModels.RelativityModel
— TypeRelativity Astro Model struct Contains information to compute the acceleration of relativity acting on a spacecraft.
Fields
central_body::ThirdBodyModel
: The data to compute the central body's graviational parameter.sun_body::ThirdBodyModel
: The data to compute the Sun's position, velocity, and graviational parameter.eop_data::Union{EopIau1980,EopIau2000A}
: Earth Orientation Parameter data.c::Number
: The speed of light [km/s].γ::Number
: Post-Newtonian Parameterization parameter. γ=1 in General Relativity.β::Number
: Post-Newtonian Parameterization parameter. β=1 in General Relativity.schwartzchild_effect::Bool
: Include the Schwartzchild relativity effect.lense_thirring_effect::Bool
: Include the Lense Thirring relativity effect.de_Sitter_effect::Bool
: Include the De Sitter relativity effect.
AstroForceModels.SRPAstroModel
— TypeSRP Astro Model struct Contains information to compute the acceleration of a SRP a spacecraft.
Fields
satellite_srp_model::AbstractSatelliteDragModel
: The satellite srp model for computing the ballistic coefficient.sun_data::ThirdBodyModel
: The data to compute the Sun's position.
AstroForceModels.StateDragModel
— TypeState Drag Model struct Empty struct used for when the simulation state includes the ballistic coefficient.
AstroForceModels.StateSRPModel
— TypeState SRP Model struct Empty struct used for when the simulation state includes the reflectivity ballistic coefficient.
AstroForceModels.ThirdBodyModel
— TypeThird Body Model Astro Model struct Contains information to compute the acceleration of a third body force acting on a spacecraft.
Fields
body::CelestialBody
: Celestial body acting on the craft.ephem_type::AbstractEphemerisType
: Ephemeris type used to compute body's position. Options are currently Vallado().
AstroForceModels.ThirdBodyModel
— MethodConvenience to compute the ephemeris position of a CelestialBody in a ThirdBodyModel Wraps get_position().
Arguments
time::Number
: Current time of the simulation in seconds.
Returns
body_position: SVector{3}
: The 3-dimensional third body position in the J2000 frame.
AstroForceModels.acceleration
— Methodacceleration(u::AbstractArray, p::ComponentVector, t::Number, drag_model::DragAstroModel)
Computes the drag acceleration acting on a spacecraft given a drag model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.drag_model::DragAstroModel
: Drag model struct containing the relevant information to compute the acceleration.
Returns
acceleration: SVector{3}
: The 3-dimensional drag acceleration acting on the spacecraft.
AstroForceModels.acceleration
— Methodacceleration(u::AbstractArray, p::ComponentVector, t::Number, grav_model::GravityHarmonicsAstroModel)
Computes the gravitational acceleration acting on a spacecraft given a gravity model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.gravity_model::GravityHarmonicsAstroModel
: Gravity model struct containing the relevant information to compute the acceleration.
Returns
acceleration: SVector{3}
: The 3-dimensional gravity acceleration acting on the spacecraft.
AstroForceModels.acceleration
— Methodacceleration(u::AbstractArray, p::ComponentVector, t::Number, grav_model::KeplerianGravityAstroModel)
Computes the gravitational acceleration acting on a spacecraft given a gravity model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.gravity_model::KeplerianGravityAstroModel
: Gravity model struct containing the relevant information to compute the acceleration.
Returns
acceleration: SVector{3}
: The 3-dimensional gravity acceleration acting on the spacecraft.
AstroForceModels.acceleration
— Methodacceleration(u::AbstractArray, p::ComponentVector, t::Number, srp_model::SRPAstroModel)
Computes the srp acceleration acting on a spacecraft given a srp model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.srp_model::SRPAstroModel
: SRP model struct containing the relevant information to compute the acceleration.
Returns
acceleration: SVector{3}
: The 3-dimensional srp acceleration acting on the spacecraft.
AstroForceModels.acceleration
— Methodacceleration(u::AbstractArray, p::ComponentVector, t::Number, third_body_model::ThirdBodyModel)
Computes the drag acceleration acting on a spacecraft given a drag model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.third_body_model::ThirdBodyModel
: Third body model struct containing the relevant information to compute the acceleration.
Returns
acceleration: SVector{3}
: The 3-dimensional srp acceleration acting on the spacecraft.
AstroForceModels.acceleration
— Methodacceleration(u::AbstractArray, p::ComponentVector, t::Number, relativity_model::RelativityModel)
Computes the srp acceleration acting on a spacecraft given a srp model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.relativity_model::RelativityModel
: Relativity model struct containing the relevant information to compute the acceleration.
Returns
acceleration: SVector{3}
: The 3-dimensional relativity acceleration acting on the spacecraft.
AstroForceModels.ballistic_coefficient
— Methodballistic_coefficient( u::AbstractArray, p::ComponentVector, t::Number, model::CannonballFixedDrag)
Returns the ballistic coefficient for a drag model given the model and current state of the simulation.
Arguments
- `u::AbstractArray`: The current state of the simulation.
- `p::ComponentVector`: The parameters of the simulation.
- `t::Number`: The current time of the simulation.
- `model::CannonballFixedDrag`: Drag model for the spacecraft.
Returns
-`ballistic_coeff::Number`: The current ballistic coefficient of the spacecraft.
AstroForceModels.ballistic_coefficient
— Methodballistic_coefficient( u::AbstractArray, p::ComponentVector, t::Number, model::StateDragModel)
Returns the ballistic coefficient for a drag model given the model and current state of the simulation.
Arguments
- `u::AbstractArray`: The current state of the simulation.
- `p::ComponentVector`: The parameters of the simulation.
- `t::Number`: The current time of the simulation.
- `model::StateDragModel`: The drag model for the spacecraft.
Returns
-`ballistic_coeff::Number`: The current ballistic coefficient of the spacecraft.
AstroForceModels.build_dynamics_model
— Methodbuild_dynamics_model(u::AbstractArray, p::ComponentVector, t::Number, models::AbstractArray{AbstractAstroForceModel})
Convenience funcction to compute the overall acceleration acting on the spacecraft.
Arguments
u::AbstractArray
: Current State of the simulation.p::ComponentVector
: Current parameters of the simulation.t::Number
: Current time of the simulation.models::AbstractArray{AbstractAstroForceModel}
: Array of acceleration models acting on the spacecraft
Returns
acceleration: SVector{3}
: The 3-dimensional drag acceleration acting on the spacecraft.
AstroForceModels.compute_density
— Functioncompute_density(JD::Number, u::AbstractArray, eop_data::EopIau1980, AtmosphereType::AtmosphericModelType)
Computes the atmospheric density at a point given the date, position, eop_data, and atmosphere type
Arguments
JD::Number
: The current time of the simulation in Julian days.u::AbstractArray
: The current state of the simulation.eop_data::EopIau1980
: The earth orientation parameters.AtmosphereType::AtmosphericModelType
: The type of atmospheric model used to compute the density. Available options are Jacchia-Bowman 2008 (JB2008), Jacchia-Roberts 1971 (JR1971), NRL MSIS 2000 (MSIS2000), Exponential (ExpAtmo), and None (None)
Returns
rho::Number
: The density of the atmosphere at the provided time and point [kg/m^3].
AstroForceModels.de_Sitter_acceleration
— Methodde_Sitter_acceleration(
u::AbstractArray,
r_sun::AbstractArray,
v_sun::AbstractArray,
μ_Sun::Number;
c::Number=SPEED_OF_LIGHT,
γ::Number=1.0,
)
Computes the relativity acceleration acting on a spacecraft given a relativity model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.r_sun::AbstractArray
: The position of the sun in the Earth inertial frame.v_sun::AbstractArray
: The velocity of the sun in the Earth inertial frame.μ_Sun::Number
: Gravitation Parameter of the Sun. [km^3/s^2]c::Number
: Speed of Light [km/s]γ::Number
: Post-Newtonian Parameterization parameter. γ=1 in General Relativity.
Returns
de_Sitter_acceleration: SVector{3}
: The 3-dimensional de Sitter acceleration acting on the spacecraft.
AstroForceModels.drag_accel
— Methoddrag_accel(u::AbstractArray, rho::Number, BC::Number, ω_vec::AbstractArray, t::Number, [DragModel]) -> SVector{3}{Number}
Compute the Acceleration Atmospheric Drag
The atmosphere is treated as a solid revolving with the Earth and the apparent velocity of the satellite is computed using the transport theorem
𝐯_app = 𝐯 - 𝛚 x 𝐫
The acceleration from drag is then computed with a cannonball model as
𝐚 = 1/2 * ρ * BC * |𝐯_app|₂^2 * v̂
Currently only fixed cannonball state based ballistic coefficients are supported, custom models can be created for higher fidelity.
Arguments
u::AbstractArray
: The current state of the spacecraft in the central body's inertial frame.rho::Number
: Atmospheric density at (t, u) [kg/m^3].BC::Number
: The ballistic coefficient of the satellite – (area/mass) * drag coefficient [kg/m^2].ω_vec::AbstractArray
: The angular velocity vector of Earth. Typically approximated as [0.0; 0.0; ω_Earth]t::Number
: Current time of the simulation.
Returns
SVector{3}{Number}
: Inertial acceleration from drag
AstroForceModels.get_position
— MethodComputes the position of the celestial body using Vallado's ephemeris
Arguments
ephem_type::Symbol
: Ephemeris type used to compute body's position.body::CelestialBody
: Celestial body acting on the craft.time::Number
: Current time of the simulation in seconds.
Returns
body_position: SVector{3}
: The 3-dimensional third body position in the J2000 frame.
AstroForceModels.get_velocity
— MethodComputes the velocity of the celestial body using Vallado's ephemeris
Arguments
ephem_type::Symbol
: Ephemeris type used to compute body's position.body::CelestialBody
: Celestial body acting on the craft.time::Number
: Current time of the simulation in seconds.
Returns
body_position: SVector{3}
: The 3-dimensional third body position in the J2000 frame.
AstroForceModels.lense_thirring_acceleration
— Methodlense_thirring_acceleration(
u::AbstractArray,
μ_body::Number,
J::AbstractArray;
c::Number=SPEED_OF_LIGHT,
γ::Number=1.0,
)
Computes the lense thirring relativity acceleration acting on a spacecraft given a relativity model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.μ_body::Number
: Gravitation Parameter of the central body.J::AbstractArray
: Angular momentum vector per unit mass of the central body. [km^3/s^2]c::Number
: Speed of Light [km/s]γ::Number
: Post-Newtonian Parameterization parameter. γ=1 in General Relativity.
Returns
lense_thirring_acceleration: SVector{3}
: The 3-dimensional lense thirring acceleration acting on the spacecraft.
AstroForceModels.reflectivity_ballistic_coefficient
— Methodreflectivityballisticcoefficient( u::AbstractArray, p::ComponentVector, t::Number, model::CannonballFixedSRP)
Returns the ballistic coefficient for a SRP model given the model and current state of the simulation.
Arguments
- `u::AbstractArray`: The current state of the simulation.
- `p::ComponentVector`: The parameters of the simulation.
- `t::Number`: The current time of the simulation.
- `model::CannonballFixedSRP`: SRP model for the spacecraft.
Returns
-`ballistic_coeff::Number`: The current ballistic coefficient of the spacecraft.
AstroForceModels.reflectivity_ballistic_coefficient
— Methodballistic_coefficient( u::AbstractArray, p::ComponentVector, t::Number, model::StateSRPModel)
Returns the ballistic coefficient for a SRP model given the model and current state of the simulation.
Arguments
- `u::AbstractArray`: The current state of the simulation.
- `p::ComponentVector`: The parameters of the simulation.
- `t::Number`: The current time of the simulation.
- `model::StateSRPModel`: The SRP model for the spacecraft.
Returns
-`ballistic_coeff::Number`: The current ballistic coefficient of the spacecraft.
AstroForceModels.relativity_accel
— Methodrelativity_accel(
u::AbstractArray,
r_sun::AbstractArray,
v_sun::AbstractArray,
μ_body::Number,
μ_Sun::Number,
J::AbstractArray;
c::Number=SPEED_OF_LIGHT / 1E3,
γ::Number=1.0,
β::Number=1.0,
schwartzchild_effect::Bool=true,
lense_thirring_effect::Bool=true,
de_Sitter_effect::Bool=true,
)
Computes the relativity acceleration acting on a spacecraft given a relativity model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.r_sun::AbstractArray
: The position of the sun in the Earth inertial frame.v_sun::AbstractArray
: The velocity of the sun in the Earth inertial frame.μ_body::Number
: Gravitation Parameter of the central body.μ_Sun::Number
: Gravitation Parameter of the Sun. [km^3/s^2]J::AbstractArray
: Angular momentum vector per unit mass of the central body. [km^3/s^2]c::Number
: Speed of Light [km/s]γ::Number
: Post-Newtonian Parameterization parameter. γ=1 in General Relativity.β::Number
: Post-Newtonian Parameterization parameter. β=1 in General Relativity.schwartzchild_effect::Bool
: Include the Schwartzchild relativity effect.lense_thirring_effect::Bool
: Include the Lense Thirring relativity effect.de_Sitter_effect::Bool
: Include the De Sitter relativity effect.
Returns
acceleration: SVector{3}
: The 3-dimensional relativity acceleration acting on the spacecraft.
AstroForceModels.schwartzchild_acceleration
— Methodschwartzchild_acceleration(
u::AbstractArray, μ_body::Number; c::Number=SPEED_OF_LIGHT, γ::Number=1.0, β::Number=1.0
)
Computes the relativity acceleration acting on a spacecraft given a relativity model and current state and parameters of an object.
Arguments
u::AbstractArray
: Current State of the simulation.μ_body::Number
: Gravitation Parameter of the central body.c::Number
: Speed of Light [km/s]γ::Number
: Post-Newtonian Parameterization parameter. γ=1 in General Relativity.β::Number
: Post-Newtonian Parameterization parameter. β=1 in General Relativity.
Returns
schwartzchild_acceleration: SVector{3}
: The 3-dimensional schwartzchild acceleration acting on the spacecraft.
AstroForceModels.shadow_model
— Methodshadow_model(sat_pos::AbstractArray, sun_pos::AbstractArray, R_Sun::Number, R_Occulting::Number, t::Number, ShadowModel::ShadowModelType)
Computes the Lighting Factor of the Sun occur from the Umbra and Prenumbra of Earth's Shadow
Arguments
sat_pos::AbstractArray
: The current satellite position.sun_pos::AbstractArray
: The current Sun position.R_Sun::Number
: The radius of the Sun.R_Occulting::Number
: The radius of the Occulting Body.ShadowModel::ShadowModelType
: The Earth shadow model to use. Current Options – Cylindrical, Conical, Conical_Simplified, None
Returns
SVector{3}{Number}
: Inertial acceleration from the 3rd body
AstroForceModels.srp_accel
— Methodsrp_accel(u::AbstractArray, sun_pos::AbstractArray, R_Sun::Number, R_Occulting::Number, Ψ::Number, RC::Number, t::Number; ShadowModel::ShadowModelType)
Compute the Acceleration from Solar Radiaiton Pressure
Radiation from the Sun reflects off the satellite's surface and transfers momentum perturbing the satellite's trajectory. This force can be computed using the a Cannonball model with the following equation
𝐚 = F * RC * Ψ * (AU/(R_sc_Sun))^2 * R̂_sc_Sun
Currently only Cannonball SRP is supported, to use a higher fidelity drag either use a state varying function or compute the ballistic coefficient further upstream
Arguments
u::AbstractArray
: The current state of the spacecraft in the central body's inertial frame.sun_pos::AbstractArray
: The current position of the Sun.R_Sun::Number
: The radius of the Sun.R_Occulting::Number
: The radius of the Earth.Ψ::Number
: Solar Constant at 1 Astronomical Unit.RC::Number
: The solar ballistic coefficient of the satellite – (Area/mass) * Reflectivity Coefficient [kg/m^2].t::Number
: The current time of the Simulation
Optional Arguments
ShadowModel::ShadowModelType
: SRP Earth Shadow Model to use. Current Options – :Conical, :Conical_Simplified, :Cylinderical
Returns
SVector{3}{Number}
: Inertial acceleration from the 3rd body
AstroForceModels.third_body_accel
— Methodthird_body_accel(u::AbstractArray, μ_body::Number, body_pos::AbstractArray, h::Number) -> SVector{3}{Number}
Compute the Acceleration from a 3rd Body Represented as a Point Mass
Since the central body is also being acted upon by the third body, the acceleration of body 𝐁 acting on spacecraft 𝐀 in the orbiting body's 𝐂 is part of the force not acting on the central body
a = ∇UB(rA) - ∇UB(rC)
Arguments
u::AbstractArray
: The current state of the spacecraft in the central body's inertial frame.μ_body
: Gravitation Parameter of the 3rd body.body_pos::AbstractArray
: The current position of the 3rd body in the central body's inertial frame.
Returns
SVector{3}{Number}
: Inertial acceleration from the 3rd body