J2 Osculating Analytical Orbit Propagator
This algorithm uses the J2 propagator to obtain the secular effects of the Keplerian elements caused only by the J2 term of the geopotential field. Afterward, it adds short-term perturbations. This model is useful when fitting an orbit to a set of mean elements for the J2 orbit propagator. Hence, we can use it to verify, for example, how close a satellite is from a Sun-Synchronous orbit.
Algorithm
The algorithm implemented here is based on [1].
Initialization
We can initialize the J2 osculating analytical orbit propagator with the following function:
Propagators.init(Val(:J2osc), orb₀::KeplerianElements; kwargs...) -> OrbitPropagatorJ2Osculatingwhich creates a J2 osculating propagator structure OrbitPropagatorJ2Osculating with the mean Keplerian elements orb₀.
The following keyword selects the gravitational constants for the propagation algorithm:
j2c::J2PropagatorConstants: J2 orbit propagator constants (seeJ2PropagatorConstants). (Default:J2C_EGM2008)
This package contains some pre-built propagation constants for this propagator:
| J2 Propagator Constant | Description | Type |
|---|---|---|
J2C_EGM2008 | EGM-2008 gravitational constants | Float64 |
J2C_EGM2008_F32 | EGM-2008 gravitational constants | Float32 |
J2C_EGM1996 | EGM-1996 gravitational constants | Float64 |
J2C_EGM1996_F32 | EGM-1996 gravitational constants | Float32 |
J2C_JGM02 | JGM-02 gravitational constants | Float64 |
J2C_JGM02_F32 | JGM-02 gravitational constants | Float32 |
J2C_JGM03 | JGM-03 gravitational constants | Float64 |
J2C_JGM03_F32 | JGM-03 gravitational constants | Float32 |
The type used in the propagation will be the same as used to define the constants in the structure j2c.
julia> orb = KeplerianElements( date_to_jd(2023, 1, 1, 0, 0, 0), 7190.982e3, 0.001111, 98.405 |> deg2rad, 100 |> deg2rad, 90 |> deg2rad, 19 |> deg2rad )KeplerianElements{TrueAnomaly, Float64, Float64}: Epoch : 2.45995e6 (2023-01-01T00:00:00) Semi-Major Axis : 7190.982 km Eccentricity : 0.001111 Inclination : 98.405° RA of Asc. Node : 100.0° Arg. of Periapsis : 90.0° True Anomaly : 19.0°julia> orbp = Propagators.init(Val(:J2osc), orb)OrbitPropagatorJ2Osculating{Float64, Float64} (J2 Osculating Orbit Propagator): ├─ Mean Elements │ Epoch : 2.45995e6 (2023-01-01T00:00:00) │ Semi-Major Axis : 7190.982 km │ Eccentricity : 0.001111 │ Inclination : 98.405° │ RA of Asc. Node : 100.0° │ Arg. of Periapsis : 90.0° │ Mean Anomaly : 18.95858415° ├─ Secular Rates │ Mean Motion : 14.22855327 rev/day │ RAAN Rate : 0.9565368878 °/day │ Arg. of Periapsis Rate : -2.922474801 °/day ├─ Constants │ R₀ : 6378.137 km │ μm : 0.001239447462 rad/s │ J₂ : 0.001082626174 └─ Propagation Last Instant : 0.0 s
Fitting Mean Elements
We can use the function:
Propagators.fit_mean_elements(::Val{:J2osc}, vjd::AbstractVector{Tjd}, vr_i::AbstractVector{Tv}, vv_i::AbstractVector{Tv}; kwargs...) -> KeplerianElements{MeanAnomaly, Float64, T}, SMatrix{6, 6, T}, NamedTupleto fit a set of mean Keplerian elements for the J2 osculating orbit propagator using the osculating elements represented by a set of position vectors vr_i [m] and a set of velocity vectors vv_i [m / s] represented in an inertial reference frame at instants in the array vjd [Julian Day].
It returns the fitted Keplerian elements, the final covariance matrix of the least-square algorithm, and a NamedTuple with its statistics: converged, iterations, position_rmse [m], velocity_rmse [m / s], and total_rmse.
This algorithm version will allocate a new J2 propagator with the constants j2c. If the allocation must be avoided, use the function Propagators.fit_mean_elements! instead.
The following keywords are available to configure the fitting process:
j2c::J2PropagatorConstants{T}: J2 orbit propagator constants (seeJ2PropagatorConstants), whose number typeTis used in the fitting. (Default:J2C_EGM2008)atol::Number: Tolerance for the residual absolute value. If the residual is lower thanatolat any iteration, the computation loop stops. (Default: 2e-4)rtol::Number: Tolerance for the relative difference between the residuals. If the relative difference between the residuals in two consecutive iterations is lower thanrtol, the computation loop stops. (Default: 2e-4)initial_guess::Union{Nothing, KeplerianElements}: Initial guess for the mean elements fitting process. If it isnothing, the algorithm will obtain an initial estimate from the osculating elements invr_iandvv_i. (Default:nothing)jacobian_method::AbstractJacobianMethod: Method used to compute the Jacobian matrix. It can beFiniteDiffJacobian()for finite differences orForwardDiffJacobian()for ForwardDiff.jl automatic differentiation. (Default:FiniteDiffJacobian())jacobian_perturbation::Number: Initial state perturbation to compute the finite-difference when calculating the Jacobian matrix. Only used withFiniteDiffJacobian(). (Default: 1e-3)jacobian_perturbation_tol::Number: Tolerance to accept the perturbation when calculating the Jacobian matrix. If the computed perturbation is lower thanjacobian_perturbation_tol, we increase it until its absolute value is higher thanjacobian_perturbation_tol. Only used withFiniteDiffJacobian(). (Default: 1e-7)max_iterations::Int: Maximum number of iterations allowed for the least-square fitting. (Default: 50)mean_elements_epoch::Union{Number, DateTime}: Epoch of the fitted mean elements, represented by a Julian Day [UTC] or aDateTime[UTC]. (Default:vjd[end])verbose::Bool: Iftrue, the algorithm prints debugging information tostdout. (Default:true)weight_vector::AbstractVector: Vector with the measurements weights for the least-square algorithm. We assemble the weight matrixWas a diagonal matrix with the elements inweight_vectorat its diagonal. (Default:@SVector(ones(Bool, 6)))
julia> vr_i = [ [-6792.402703741442, 2192.6458461287293, 0.18851758695295118] .* 1000, [-6357.88873265975, 2391.9476768911686, 2181.838771262736] .* 1000 ];julia> vv_i = [ [0.3445760107690598, 1.0395135806993514, 7.393686131436984] .* 1000, [2.5285015912807003, 0.27812476784300005, 7.030323100703928] .* 1000 ];julia> vjd = [ 2.46002818657856e6, 2.460028190050782e6 ];julia> orb, P, stats = Propagators.fit_mean_elements(Val(:J2osc), vjd, vr_i, vv_i)ACTION: Fitting the mean elements for the J2 osculating propagator. Iteration Position RMSE Velocity RMSE Total RMSE RMSE Variation [km] [km / s] [ ] PROGRESS: 1 6.24887 0.00466183 6248.87 --- PROGRESS: 2 0.000816963 0.00260117 2.72644 -99.9564 % PROGRESS: 3 1.69098e-05 0.00260088 2.60093 -4.60352 % PROGRESS: 4 1.69072e-05 0.00260088 2.60093 1.10532e-09 % (KeplerianElements{MeanAnomaly, Float64, Float64}: Epoch = 2.46003e6 (2023-03-24T16:33:40.388), [0.9999427807011695 -0.004901152258826149 … -0.00012021282782821985 -0.00011550583200755688; -0.00490115226000162 1.000732580079742 … 0.003266156907073989 3.8567168871770624e-5; … ; -0.00012021282783057524 0.003266156907074014 … 2.2048267812795964e-5 5.382766445309007e-8; -0.00011550583200733415 3.8567168867268407e-5 … 5.3827664438749715e-8 2.1657420758757818e-5], (converged = true, iterations = 4, position_rmse = 0.016907178972967667, velocity_rmse = 2.6008770843978817, total_rmse = 2.6009320369526865))julia> orbKeplerianElements{MeanAnomaly, Float64, Float64}: Epoch : 2.46003e6 (2023-03-24T16:33:40.388) Semi-Major Axis : 7135.801151 km Eccentricity : 0.001353825508 Inclination : 98.43042292° RA of Asc. Node : 162.1131669° Arg. of Periapsis : 64.92555131° Mean Anomaly : 313.1984092°julia> stats(converged = true, iterations = 4, position_rmse = 0.016907178972967667, velocity_rmse = 2.6008770843978817, total_rmse = 2.6009320369526865)
References
- [1] Vallado, D. A (2013). Fundamentals of Astrodynamics and Applications. 4th ed. Microcosm Press, Hawthorn, CA, USA.