Usage

julia> using SatelliteToolboxPropagators
julia> using Dates

All the propagators can be accessed using the available API, which allows to initialize and propagate the orbit.

All the API function are available inside the module Propagators that is exported by this package.

Initialization

We can initialize an orbit propagator using the function:

Propagators.init(::Val{:propagator}, args...; kwargs...)

It initializes a propagator of type :propagator using the arguments args... and keywords kwargs... supported by it. Currently, the following algorithms are available:

Propagator NameSymbol
J2 analytical orbit propagator:J2
J2 osculating analytical orbit propagator:J2osc
J4 analytical orbit propagator:J4
J4 osculating analytical orbit propagator:J4osc
SGP4/SDP4 orbit propagator:SGP4
Two body analytical orbit propagator:TwoBody

See the documentation of each algorithm to verify the supported arguments and keywords.

For example, a J2 analytical orbit propagator can be initialized with a set of mean elements as follows:

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{Float64, Float64}:
           Epoch :    2.45995e6 (2023-01-01T00:00:00)
 Semi-major axis : 7190.98     km
    Eccentricity :    0.001111
     Inclination :   98.405    °
            RAAN :  100.0      °
 Arg. of Perigee :   90.0      °
    True Anomaly :   19.0      °
julia> orbp = Propagators.init(Val(:J2), orb)OrbitPropagatorJ2{Float64, Float64}: Propagator name : J2 Orbit Propagator Propagator epoch : 2023-01-01T00:00:00 Last propagation : 2023-01-01T00:00:00

We also have the function:

init!(orbp::OrbitPropagator, args...; kwargs...)

that initializes the propagator orbp in-place using the arguments args... and keywords kwargs.... This function allows to reduce the memory allocation when performing multiple initialization. However, notice that this function is optional in the propagator API. Hence, some algorithms might not support it.

Propagate the Orbit

After the initialization, we can propagate the orbit using some functions as follows.

propagate!(orbp::OrbitPropagator, Δt::Number[, sink = Tuple])
propagate!(orbp::OrbitPropagator, p::Union{Dates.Period, Dates.CompoundPeriod}[, sink = Tuple])

This function propagates the orbit using orbp by t [s] or by the period defined by p from the initial orbit epoch .

The return type depends on the parameter sink. If sink is Tuple (default), the function returns two vectors: the position [m] and velocity [m / s]. Both are represented in the same inertial reference frame used to describe the input data during the propagator initialization. On the other hand, if sink is OrbitStateVector, it returns an object of type OrbitStateVector [SI] with the same information.

For example, using the initialized propagator, we can propagate the orbit by 6000s as follows:

julia> Propagators.propagate!(orbp, 6000)([1.315275218969375e6, -1.5933886600051075e6, 6.879702066837699e6], [993.0153598407071, -7152.788087325106, -1844.2917373854057])
julia> Propagators.propagate!(orbp, Dates.Hour(1))([-1.6260551476934198e6, 5.483598832165034e6, -4.366525056327519e6], [51.60406452249429, 4638.618516085275, 5816.867529315314])
julia> Propagators.propagate!(orbp, Dates.Minute(60))([-1.6260551476934198e6, 5.483598832165034e6, -4.366525056327519e6], [51.60406452249429, 4638.618516085275, 5816.867529315314])

To obtain an OrbitStateVector as the output, we can use:

julia> Propagators.propagate!(orbp, 6000, OrbitStateVector)OrbitStateVector{Float64, Float64}:
  epoch : 2.45995e6 (2023-01-01T01:40:00)
      r : [1315.28, -1593.39, 6879.7]     km
      v : [0.993015, -7.15279, -1.84429]  km/s
julia> Propagators.propagate!(orbp, Dates.Hour(1), OrbitStateVector)OrbitStateVector{Float64, Float64}: epoch : 2.45995e6 (2023-01-01T01:00:00) r : [-1626.06, 5483.6, -4366.53] km v : [0.0516041, 4.63862, 5.81687] km/s
julia> Propagators.propagate!(orbp, Dates.Minute(60), OrbitStateVector)OrbitStateVector{Float64, Float64}: epoch : 2.45995e6 (2023-01-01T01:00:00) r : [-1626.06, 5483.6, -4366.53] km v : [0.0516041, 4.63862, 5.81687] km/s

The API also supports propagating the orbit for multiple instants if we pass a vector of instants as follows:

propagate!(orbp::OrbitPropagator, vt::AbstractVector[, sink = Tuple]; kwargs...)
propagate!(orbp::OrbitPropagator, vp::AbstractVector{Union{Dates.Period, Dates.CompundPeriod}}[, sink = Tuple]; kwargs...)

Those functions propagate the orbit using orbp for every instant defined in vt [s] or for every period defined in vp from the initial orbit epoch.

The return type depends on the parameter sink. If it is Tuple (default), the output is a tuple with the arrays containing the position and velocity vectors. If it is OrbitStateVector, the output is an array of OrbitStateVector [SI] objects.

In this case, the user can pass the keyword argument ntasks to specify the number of parallel tasks to propagate the orbit. If it is set to a number equal or lower than 1, the function will propagate the orbit sequentially. If ntasks is omitted, it defaults to the number of available threads.

For example, using the initialized propagator, we can propagate the orbit every 5 min in an hour as follows:

julia> Propagators.propagate!(orbp, 0:300:3600)(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.5757673490163519e6, -4.0932850809379886e6, 5.690361350663258e6], [1.6170706180101584e6, -5.663947783670352e6, 4.116847402157316e6], [1.5038315291342728e6, -6.692806067371421e6, 2.1494832095972965e6], [1.2469425515166773e6, -7.082029514601705e6, -23350.63741554037], [870996.8747641824, -6.795101605094242e6, -2.193990186785612e6], [411894.7979609058, -5.860068995424881e6, -4.1553900694554574e6], [-86606.98043120792, -4.366624650829354e6, -5.720813803646317e6], [-577063.2552010136, -2.4573918344990914e6, -6.741462341434128e6], [-1.0128294472749413e6, -314296.9856601295, -7.120432818767674e6], [-1.3524571308390647e6, 1.8586644739184943e6, -6.821766963238004e6], [-1.5635968100201162e6, 3.8546745213840096e6, -5.873800555828346e6], [-1.6260551476934198e6, 5.483598832165034e6, -4.366525056327519e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [394.71913497215485, -5991.571951565604, -4413.003019372595], [-123.11809062084382, -4408.150756264968, -6004.587754887654], [-628.9638599777445, -2404.586082912033, -7020.703132146314], [-1074.4843248969355, -173.30052780472136, -7365.167677171215], [-1417.274933276462, 2072.22519625963, -7006.41657752532], [-1624.862718952868, 4117.998443625576, -5980.020094662476], [-1677.7079770303278, 5769.794678619826, -4384.797506467221], [-1570.9560430652232, 6871.293425623303, -2373.079268127465], [-1314.8150181303552, 7318.490914004595, -136.1577752225213], [-933.5563157783738, 7069.202597811712, 2113.6839877810385], [-463.24422416200287, 6146.905104103476, 4162.95913003822], [51.60406452249429, 4638.618516085275, 5816.867529315314]])
julia> Propagators.propagate!(orbp, Dates.Minute(0):Dates.Minute(5):Dates.Minute(60))(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.5757673490163519e6, -4.0932850809379886e6, 5.690361350663258e6], [1.6170706180101584e6, -5.663947783670352e6, 4.116847402157316e6], [1.5038315291342728e6, -6.692806067371421e6, 2.1494832095972965e6], [1.2469425515166773e6, -7.082029514601705e6, -23350.63741554037], [870996.8747641824, -6.795101605094242e6, -2.193990186785612e6], [411894.7979609058, -5.860068995424881e6, -4.1553900694554574e6], [-86606.98043120792, -4.366624650829354e6, -5.720813803646317e6], [-577063.2552010136, -2.4573918344990914e6, -6.741462341434128e6], [-1.0128294472749413e6, -314296.9856601295, -7.120432818767674e6], [-1.3524571308390647e6, 1.8586644739184943e6, -6.821766963238004e6], [-1.5635968100201162e6, 3.8546745213840096e6, -5.873800555828346e6], [-1.6260551476934198e6, 5.483598832165034e6, -4.366525056327519e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [394.71913497215485, -5991.571951565604, -4413.003019372595], [-123.11809062084382, -4408.150756264968, -6004.587754887654], [-628.9638599777445, -2404.586082912033, -7020.703132146314], [-1074.4843248969355, -173.30052780472136, -7365.167677171215], [-1417.274933276462, 2072.22519625963, -7006.41657752532], [-1624.862718952868, 4117.998443625576, -5980.020094662476], [-1677.7079770303278, 5769.794678619826, -4384.797506467221], [-1570.9560430652232, 6871.293425623303, -2373.079268127465], [-1314.8150181303552, 7318.490914004595, -136.1577752225213], [-933.5563157783738, 7069.202597811712, 2113.6839877810385], [-463.24422416200287, 6146.905104103476, 4162.95913003822], [51.60406452249429, 4638.618516085275, 5816.867529315314]])

To obtain an array of OrbitStateVector as the output, we can use:

julia> Propagators.propagate!(orbp, 0:300:3600, OrbitStateVector)13-element Vector{OrbitStateVector{Float64, Float64}}:
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:05:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:10:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:15:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:20:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:25:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:30:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:35:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:40:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:45:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:50:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:55:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T01:00:00)
julia> Propagators.propagate!( orbp, Dates.Minute(0):Dates.Minute(5):Dates.Minute(60), OrbitStateVector )13-element Vector{OrbitStateVector{Float64, Float64}}: OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:05:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:10:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:15:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:20:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:25:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:30:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:35:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:40:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:45:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:50:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:55:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T01:00:00)

propagate_to_epoch!(orbp::OrbitPropagator, jd::Number[, sink = Tuple])
propagate_to_epoch!(orbp::OrbitPropagator, dt::DateTime[, sink = Tuple])

This function propagates the orbit using orbp until the Julian Day jd [UTC] or until the epoch defined by the DateTime object dt [UTC].

The return type depends on the parameter sink. If sink is Tuple (default), the function returns two vectors: the position [m] and velocity [m / s]. Both are represented in the same inertial reference frame used to describe the input data during the propagator initialization. On the other hand, if sink is OrbitStateVector, it returns an object of type OrbitStateVector [SI] with the same information.

For example, using the initialized propagator, we can propagate the orbit to 2023-01-02T00:00:00 as follows:

julia> Propagators.propagate_to_epoch!(orbp, date_to_jd(2023, 1, 2, 0, 0, 0))([1.2007441457621562e6, -7.014291058654363e6, -1.0443532029853627e6], [-1262.9147605014525, 860.1551061949126, -7285.029139518301])
julia> Propagators.propagate_to_epoch!(orbp, DateTime("2023-01-02"))([1.2007441457621562e6, -7.014291058654363e6, -1.0443532029853627e6], [-1262.9147605014525, 860.1551061949126, -7285.029139518301])

To obtain an OrbitStateVector as the output, we can use:

julia> Propagators.propagate_to_epoch!(orbp, date_to_jd(2023, 1, 2, 0, 0, 0), OrbitStateVector)OrbitStateVector{Float64, Float64}:
  epoch : 2.45995e6 (2023-01-02T00:00:00)
      r : [1200.74, -7014.29, -1044.35]   km
      v : [-1.26291, 0.860155, -7.28503]  km/s
julia> Propagators.propagate_to_epoch!(orbp, DateTime("2023-01-02"), OrbitStateVector)OrbitStateVector{Float64, Float64}: epoch : 2.45995e6 (2023-01-02T00:00:00) r : [1200.74, -7014.29, -1044.35] km v : [-1.26291, 0.860155, -7.28503] km/s

The API also supports propagating the orbit for multiple instants if we pass a vector of epochs as follows:

propagate_to_epoch!(orbp::OrbitPropagator, vjd::AbstractVector[, sink = Tuple]; kwargs...)
propagate_to_epoch!(orbp::OrbitPropagator, vdt::AbstractVector{DateTime}[, sink = Tuple]; kwargs...)

Those functions propagate the orbit using orbp for every epoch defined in the vector of Julian Days vjd [UTC] or in the vector of DateTime objects vdt [UTC].

The return type depends on the parameter sink. If it is Tuple (default), the output is two arrays containing the position [m] and velocity vectors [m / s]. Both are represented in the same inertial reference frame used to describe the input data during the propagator initialization. If it is OrbitStateVector, the output is an array of OrbitStateVector [SI] objects.

In this case, the user can pass the keyword argument ntasks to specify the number of parallel tasks to propagate the orbit. If it is set to a number equal or lower than 1, the function will propagate the orbit sequentially. If ntasks is omitted, it defaults to the number of available threads.

For example, using the initialized propagator, we can propagate the orbit to midnight of every day in January 2023 as follows:

julia> Propagators.propagate_to_epoch!(
           orbp,
           date_to_jd(2023, 1, 1, 0, 0, 0):date_to_jd(2023, 1, 31, 0, 0, 0)
       )(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.2007441457621562e6, -7.014291058654363e6, -1.0443532029853627e6], [-968181.2053904973, -504119.3059649518, -7.115719133914778e6], [-1.7923654434792988e6, 6.775456143933428e6, -1.6122631380440632e6], [245606.84020042166, 3.026873278928036e6, 6.509653104753734e6], [2.0882098255763007e6, -5.6022982484615585e6, 3.9906574936800646e6], [658821.5765369013, -5.087873281812952e6, -5.048944459424906e6], [-1.9981919622281645e6, 3.639601830883607e6, -5.87681062875044e6], [-1.591991885231654e6, 6.396276444192802e6, 2.859935344614596e6], [1.494288288466062e6, -1.2344582472609233e6, 6.918441343524275e6]  …  [-3.653318267450084e6, 5.4315579397527985e6, -2.965283920875161e6], [-1.3961504071487207e6, 3.9848702926143757e6, 5.812183567887921e6], [3.3000409498213003e6, -3.860497054610459e6, 5.094950437098254e6], [2.7788642908386234e6, -5.353409314548367e6, -3.929486236272695e6], [-2.3556667792016915e6, 1.7666876111765283e6, -6.559581636335294e6], [-3.8309850965658897e6, 5.88672468390458e6, 1.5051469037127674e6], [977648.9592076776, 440378.0792593019, 7.109264843221361e6], [4.389239826330382e6, -5.595460930981228e6, 1.1159880654293252e6], [710141.0376761291, -2.5338934806316034e6, -6.695810725340501e6], [-4.28849202723585e6, 4.503453687920061e6, -3.5974045000858423e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [-1262.9147605014525, 860.1551061949126, -7285.029139518301], [-1577.1909654958963, 7261.588068610954, -299.34505795069884], [659.5136778570821, 1873.0106161025556, 7174.838537262153], [2055.8287906631, -6526.252568535608, 2955.1359997363893], [197.47989900670686, -4277.332041603436, -6094.040873163521], [-2168.1048773561997, 4865.380078019384, -5191.21310944853], [-1175.065479736641, 6056.673334917898, 4158.8079152565515], [1860.5203824919158, -2559.546458783426, 6745.973236951681], [2079.038051461201, -6954.555726245038, -1684.475805733959]  …  [-698.1389184285181, 3180.0151640679833, 6701.080710274578], [3679.333686245506, -4896.350682358737, 4245.76779383717], [2182.879734489334, -4924.9771554083345, -5134.7088505340325], [-2993.912367597576, 2951.570135490917, -6134.799075428645], [-3479.2523555243633, 5931.38964315391, 2855.9809562122837], [1776.3190174759707, -686.7882375231483, 7206.029129816602], [4331.4370574683735, -6053.456628453627, -212.41860581728207], [-160.53258261091722, -1578.262292370501, -7266.112192660738], [-4577.530767643054, 5313.521772593598, -2488.225048959107], [-1622.381707857566, 3528.500529692135, 6360.181091322684]])
julia> Propagators.propagate_to_epoch!( orbp, DateTime("2023-01-01"):Dates.Day(1):DateTime("2023-01-31") )(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.2007441457621562e6, -7.014291058654363e6, -1.0443532029853627e6], [-968181.2053904973, -504119.3059649518, -7.115719133914778e6], [-1.7923654434792988e6, 6.775456143933428e6, -1.6122631380440632e6], [245606.84020042166, 3.026873278928036e6, 6.509653104753734e6], [2.0882098255763007e6, -5.6022982484615585e6, 3.9906574936800646e6], [658821.5765369013, -5.087873281812952e6, -5.048944459424906e6], [-1.9981919622281645e6, 3.639601830883607e6, -5.87681062875044e6], [-1.591991885231654e6, 6.396276444192802e6, 2.859935344614596e6], [1.494288288466062e6, -1.2344582472609233e6, 6.918441343524275e6] … [-3.653318267450084e6, 5.4315579397527985e6, -2.965283920875161e6], [-1.3961504071487207e6, 3.9848702926143757e6, 5.812183567887921e6], [3.3000409498213003e6, -3.860497054610459e6, 5.094950437098254e6], [2.7788642908386234e6, -5.353409314548367e6, -3.929486236272695e6], [-2.3556667792016915e6, 1.7666876111765283e6, -6.559581636335294e6], [-3.8309850965658897e6, 5.88672468390458e6, 1.5051469037127674e6], [977648.9592076776, 440378.0792593019, 7.109264843221361e6], [4.389239826330382e6, -5.595460930981228e6, 1.1159880654293252e6], [710141.0376761291, -2.5338934806316034e6, -6.695810725340501e6], [-4.28849202723585e6, 4.503453687920061e6, -3.5974045000858423e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [-1262.9147605014525, 860.1551061949126, -7285.029139518301], [-1577.1909654958963, 7261.588068610954, -299.34505795069884], [659.5136778570821, 1873.0106161025556, 7174.838537262153], [2055.8287906631, -6526.252568535608, 2955.1359997363893], [197.47989900670686, -4277.332041603436, -6094.040873163521], [-2168.1048773561997, 4865.380078019384, -5191.21310944853], [-1175.065479736641, 6056.673334917898, 4158.8079152565515], [1860.5203824919158, -2559.546458783426, 6745.973236951681], [2079.038051461201, -6954.555726245038, -1684.475805733959] … [-698.1389184285181, 3180.0151640679833, 6701.080710274578], [3679.333686245506, -4896.350682358737, 4245.76779383717], [2182.879734489334, -4924.9771554083345, -5134.7088505340325], [-2993.912367597576, 2951.570135490917, -6134.799075428645], [-3479.2523555243633, 5931.38964315391, 2855.9809562122837], [1776.3190174759707, -686.7882375231483, 7206.029129816602], [4331.4370574683735, -6053.456628453627, -212.41860581728207], [-160.53258261091722, -1578.262292370501, -7266.112192660738], [-4577.530767643054, 5313.521772593598, -2488.225048959107], [-1622.381707857566, 3528.500529692135, 6360.181091322684]])

To obtain an array of OrbitStateVector as the output, we can use:

julia> Propagators.propagate_to_epoch!(
           orbp,
           date_to_jd(2023, 1, 1, 0, 0, 0):date_to_jd(2023, 1, 31, 0, 0, 0),
           OrbitStateVector
       )31-element Vector{OrbitStateVector{Float64, Float64}}:
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-02T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-03T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-04T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-05T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-06T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-07T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-08T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-09T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-10T00:00:00)
 ⋮
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-23T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-24T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-25T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-26T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-27T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-28T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-29T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-30T00:00:00)
 OrbitStateVector{Float64, Float64}: Epoch = 2.45998e6 (2023-01-31T00:00:00)
julia> Propagators.propagate_to_epoch!( orbp, DateTime("2023-01-01"):Dates.Day(1):DateTime("2023-01-31"), OrbitStateVector )31-element Vector{OrbitStateVector{Float64, Float64}}: OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-02T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-03T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-04T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-05T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-06T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-07T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-08T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-09T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-10T00:00:00) ⋮ OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-23T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-24T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-25T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-26T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-27T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-28T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-29T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-30T00:00:00) OrbitStateVector{Float64, Float64}: Epoch = 2.45998e6 (2023-01-31T00:00:00)

step!(orbp::OrbitPropagator, Δt::Number[, sink = Tuple])

Every time we propagate the orbit, the propagation instant is recorded inside the structure. Hence, we can use the function step! to propagate the orbit by Δt [s] from the current orbit epoch.

The return type depends on the parameter sink. If sink is Tuple (default), the function returns two vectors: the position [m] and velocity [m / s]. Both are represented in the same inertial reference frame used to describe the input data during the propagator initialization. On the other hand, if sink is OrbitStateVector, it returns an object of type OrbitStateVector [SI] with the same information.

For example, using the initialized propagator, we can advance the propagation by 60 s as follows:

julia> orbpOrbitPropagatorJ2{Float64, Float64}:
   Propagator name : J2 Orbit Propagator
  Propagator epoch : 2023-01-01T00:00:00
  Last propagation : 2023-01-31T00:00:00
julia> Propagators.step!(orbp, 60)([-4.377437060506315e6, 4.706038733601647e6, -3.2095416283234553e6], [-1343.1767051932468, 3231.723702565716, 6579.52277612223])
julia> orbpOrbitPropagatorJ2{Float64, Float64}: Propagator name : J2 Orbit Propagator Propagator epoch : 2023-01-01T00:00:00 Last propagation : 2023-01-31T00:01:00

To obtain an OrbitStateVector as the output, we can use:

julia> orbpOrbitPropagatorJ2{Float64, Float64}:
   Propagator name : J2 Orbit Propagator
  Propagator epoch : 2023-01-01T00:00:00
  Last propagation : 2023-01-31T00:01:00
julia> Propagators.step!(orbp, 60, OrbitStateVector)OrbitStateVector{Float64, Float64}: epoch : 2.45998e6 (2023-01-31T00:02:00) r : [-4449.49, 4890.46, -2809.29] km v : [-1.05875, 2.92245, 6.77349] km/s
julia> orbpOrbitPropagatorJ2{Float64, Float64}: Propagator name : J2 Orbit Propagator Propagator epoch : 2023-01-01T00:00:00 Last propagation : 2023-01-31T00:02:00

Simultaneous Initialization and Propagation

We can use the following functions to simultaneously initialize and propagate the orbit:

propagate([sink = Tuple, ]::Val{:propagator}, Δt::Number, args...; kwargs...)
propagate([sink = Tuple, ]::Val{:propagator}, p::Union{Dates.Period, Dates.CompundPeriod}, args...; kwargs...)
propagate_to_epoch([sink = Tuple, ]::Val{:propagator}, jd::Number, args...; kwargs...)
propagate_to_epoch([sink = Tuple, ]::Val{:propagator}, dt::DateTime, args...; kwargs...)

The symbol :propagator, the arguments args..., and the keywords kwargs... are the same as described in the section related to the propagator initialization.

The two first functions propagates the orbit by Δt [s] or by the period defined by p from the initial epoch, whereas the two last functions propagated the orbit until the Julian Day jd [UTC] or until the epoch defined by the DateTime object dt [UTC]

The return type of both functions depends on the parameter sink. If sink is Tuple (default), the function returns two vectors: the position [m] and velocity [m / s]. Both are represented in the same inertial reference frame used to describe the input data during the propagator initialization. On the other hand, if sink is OrbitStateVector, it returns an object of type OrbitStateVector [SI] with the same information. Additionally to those informations, the function also return the initialized orbit propagator.

For example, we can propagate by 60 s a set of mean elements using a J2 analytical propagator as follows:

julia> r_i, v_i, orbp = Propagators.propagate(Val(:J2), 60, orb)([1.4335775819994728e6, -2.5460150747451796e6, 6.562531225282292e6], [784.1942680146806, -6851.527294680269, -2825.966636363812], J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 60.0 s))
julia> r_i, v_i, orbp = Propagators.propagate(Val(:J2), Dates.Second(60), orb)([1.4335775819994728e6, -2.5460150747451796e6, 6.562531225282292e6], [784.1942680146806, -6851.527294680269, -2825.966636363812], J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 60.0 s))

To obtain an OrbitStateVector as the output, we can use:

julia> sv_i, orbp = Propagators.propagate(OrbitStateVector, Val(:J2), 60, orb)(OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:01:00), J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 60.0 s))
julia> sv_i, orbp = Propagators.propagate(OrbitStateVector, Val(:J2), Dates.Second(60), orb)(OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:01:00), J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 60.0 s))

The following algorithm propagates a set of mean elements using a J4 analytical propagator until the midnight of June 19, 2023:

julia> r_i, v_i, orbp = Propagators.propagate_to_epoch(
           Val(:J4),
           date_to_jd(2023, 6, 19, 0, 0, 0),
           orb
       )([1.3637882450024236e6, 6.603786275592241e6, -2.5079746074029477e6], [616.8945283725513, -2751.003242630033, -6886.8616457917], J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 1.46016e7 s))
julia> r_i, v_i, orbp = Propagators.propagate_to_epoch(Val(:J4), DateTime("2023-06-19"), orb)([1.3637882450024236e6, 6.603786275592241e6, -2.5079746074029477e6], [616.8945283725513, -2751.003242630033, -6886.8616457917], J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 1.46016e7 s))

To obtain an OrbitStateVector as the output, we can use:

julia> sv_i, orbp = Propagators.propagate_to_epoch(
           OrbitStateVector,
           Val(:J4),
           date_to_jd(2023, 6, 19, 0, 0, 0),
           orb
       )(OrbitStateVector{Float64, Float64}: Epoch = 2.46011e6 (2023-06-19T00:00:00), J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 1.46016e7 s))
julia> sv_i, orbp = Propagators.propagate_to_epoch( OrbitStateVector, Val(:J4), DateTime("2023-06-19"), orb )(OrbitStateVector{Float64, Float64}: Epoch = 2.46011e6 (2023-06-19T00:00:00), J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 1.46016e7 s))

The API also supports propagating the orbit for multiple instants or epochs if we pass a time vector as follows:

propagate([sink = Tuple, ]::Val{:propagator}, vt::AbstractVector, args...; kwargs...)
propagate([sink = Tuple, ]::Val{:propagator}, vp::AbstractVector{Union{Dates.Period, Dates.CompundPeriod}}, args...; kwargs...)
propagate_to_epoch([sink = Tuple, ]::Val{:propagator}, vjd::AbstractVector, args...; kwargs...)
propagate_to_epoch([sink = Tuple, ]::Val{:propagator}, vdt::DateTime, args...; kwargs...)

The symbol :propagator, the arguments args..., and the keywords kwargs... are the same as described in the section related to the propagator initialization.

The two first functions propagate the orbit to each instant in the vector vt [s] or period in the array vp from the initial epoch. The two last functions propagate the orbit to each Julian Day in the vector vjd [UTC] or epoch defined by a DateTime object in the array vdt [UTC].

The return type of both functions depends on the parameter sink. If sink is Tuple (default), the output is two arrays containing the position [m] and velocity vectors [m / s]. Both are represented in the same inertial reference frame used to describe the input data during the propagator initialization. On the other hand, if sink is OrbitStateVector, it returns an array of OrbitStateVector [SI] with the same information. Additionally to those informations, the function also return the initialized orbit propagator.

For example, we can propagate a set of mean elements every 5 min in an hour using the J2 analytical propagator as follows:

julia> vr_i, vv_i, orbp = Propagators.propagate(Val(:J2), 0:300:3600, orb)(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.5757673490163519e6, -4.0932850809379886e6, 5.690361350663258e6], [1.6170706180101584e6, -5.663947783670352e6, 4.116847402157316e6], [1.5038315291342728e6, -6.692806067371421e6, 2.1494832095972965e6], [1.2469425515166773e6, -7.082029514601705e6, -23350.63741554037], [870996.8747641824, -6.795101605094242e6, -2.193990186785612e6], [411894.7979609058, -5.860068995424881e6, -4.1553900694554574e6], [-86606.98043120792, -4.366624650829354e6, -5.720813803646317e6], [-577063.2552010136, -2.4573918344990914e6, -6.741462341434128e6], [-1.0128294472749413e6, -314296.9856601295, -7.120432818767674e6], [-1.3524571308390647e6, 1.8586644739184943e6, -6.821766963238004e6], [-1.5635968100201162e6, 3.8546745213840096e6, -5.873800555828346e6], [-1.6260551476934198e6, 5.483598832165034e6, -4.366525056327519e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [394.71913497215485, -5991.571951565604, -4413.003019372595], [-123.11809062084382, -4408.150756264968, -6004.587754887654], [-628.9638599777445, -2404.586082912033, -7020.703132146314], [-1074.4843248969355, -173.30052780472136, -7365.167677171215], [-1417.274933276462, 2072.22519625963, -7006.41657752532], [-1624.862718952868, 4117.998443625576, -5980.020094662476], [-1677.7079770303278, 5769.794678619826, -4384.797506467221], [-1570.9560430652232, 6871.293425623303, -2373.079268127465], [-1314.8150181303552, 7318.490914004595, -136.1577752225213], [-933.5563157783738, 7069.202597811712, 2113.6839877810385], [-463.24422416200287, 6146.905104103476, 4162.95913003822], [51.60406452249429, 4638.618516085275, 5816.867529315314]], J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 3600.0 s))
julia> vr_i, vv_i, orbp = Propagators.propagate( Val(:J2), Dates.Minute(0):Dates.Minute(5):Dates.Minute(60), orb )(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.5757673490163519e6, -4.0932850809379886e6, 5.690361350663258e6], [1.6170706180101584e6, -5.663947783670352e6, 4.116847402157316e6], [1.5038315291342728e6, -6.692806067371421e6, 2.1494832095972965e6], [1.2469425515166773e6, -7.082029514601705e6, -23350.63741554037], [870996.8747641824, -6.795101605094242e6, -2.193990186785612e6], [411894.7979609058, -5.860068995424881e6, -4.1553900694554574e6], [-86606.98043120792, -4.366624650829354e6, -5.720813803646317e6], [-577063.2552010136, -2.4573918344990914e6, -6.741462341434128e6], [-1.0128294472749413e6, -314296.9856601295, -7.120432818767674e6], [-1.3524571308390647e6, 1.8586644739184943e6, -6.821766963238004e6], [-1.5635968100201162e6, 3.8546745213840096e6, -5.873800555828346e6], [-1.6260551476934198e6, 5.483598832165034e6, -4.366525056327519e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [394.71913497215485, -5991.571951565604, -4413.003019372595], [-123.11809062084382, -4408.150756264968, -6004.587754887654], [-628.9638599777445, -2404.586082912033, -7020.703132146314], [-1074.4843248969355, -173.30052780472136, -7365.167677171215], [-1417.274933276462, 2072.22519625963, -7006.41657752532], [-1624.862718952868, 4117.998443625576, -5980.020094662476], [-1677.7079770303278, 5769.794678619826, -4384.797506467221], [-1570.9560430652232, 6871.293425623303, -2373.079268127465], [-1314.8150181303552, 7318.490914004595, -136.1577752225213], [-933.5563157783738, 7069.202597811712, 2113.6839877810385], [-463.24422416200287, 6146.905104103476, 4162.95913003822], [51.60406452249429, 4638.618516085275, 5816.867529315314]], J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 3600.0 s))

To obtain an array of OrbitStateVector as the output, we can use:

julia> vsv_i, orbp = Propagators.propagate(OrbitStateVector, Val(:J2), 0:300:3600, orb)(OrbitStateVector{Float64, Float64}[OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:05:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:10:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:15:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:20:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:25:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:30:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:35:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:40:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:45:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:50:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:55:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T01:00:00)], J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 3600.0 s))
julia> vsv_i, orbp = Propagators.propagate( OrbitStateVector, Val(:J2), Dates.Minute(0):Dates.Minute(5):Dates.Minute(60), orb )(OrbitStateVector{Float64, Float64}[OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:05:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:10:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:15:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:20:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:25:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:30:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:35:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:40:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:45:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:50:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:55:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T01:00:00)], J2 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 3600.0 s))

The following algorithm propagates a set of mean elements to midnight of every day in January 2023 using the J4 analytical propagator:

julia> vr_i, vv_i, orbp = Propagators.propagate_to_epoch(
           Val(:J4),
           date_to_jd(2023, 1, 1, 0, 0, 0):date_to_jd(2023, 1, 31, 0, 0, 0),
           orb
       )(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.2005550419764202e6, -7.014268891198139e6, -1.0447212979922796e6], [-968358.6696247363, -503350.41260645643, -7.115749382502843e6], [-1.7919025450793009e6, 6.77583637592255e6, -1.6111756663364314e6], [246238.12729823356, 3.0255377396530826e6, 6.510249840606645e6], [2.087759090662912e6, -5.603564231172567e6, 3.989117925228607e6], [657618.8214993683, -5.086467382383941e6, -5.050518644791206e6], [-1.9981525426020848e6, 3.6419947491509328e6, -5.875339448416422e6], [-1.5903266484757434e6, 6.395469873941444e6, 2.8626605220611123e6], [1.495033827870874e6, -1.2378587428335883e6, 6.917674296614739e6]  …  [-3.6520191511849603e6, 5.436298869022398e6, -2.95817654859842e6], [-1.3904986901130409e6, 3.979974649250507e6, 5.816894610076181e6], [3.3009861504761158e6, -3.867573374157423e6, 5.0889762840449e6], [2.77293629125043e6, -5.351013126845765e6, -3.9369277833622373e6], [-2.359267806793537e6, 1.7752316851827248e6, -6.555972175766926e6], [-3.8259166755315117e6, 5.88759490562676e6, 1.5146042904319335e6], [983763.6099573688, 431646.45986805303, 7.108964308083106e6], [4.386207570503878e6, -5.599882274225754e6, 1.1057003413103572e6], [702123.2572222403, -2.526468159812414e6, -6.699453306053789e6], [-4.288529371918087e6, 4.511092546286667e6, -3.587767201149616e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [-1262.9644074254836, 860.5573366942392, -7284.9727421983625], [-1576.8270290954179, 7261.698778653835, -298.5765793666147], [659.9050671888052, 1871.8745360981832, 7175.099921821663], [2055.3091061558152, -6527.05677436923, 2953.7215960546155], [196.53208587832776, -4275.831302014843, -6095.122931432423], [-2167.79689338872, 4867.26136934486, -5189.576791550061], [-1173.5520560030263, 6055.441550162393, 4161.031319593705], [1860.8451825628918, -2562.5891415698093, 6744.730125244792], [2077.1903355135646, -6954.286603914805, -1687.8557209784194]  …  [-692.7855903491417, 3174.083854885012, 6704.452910582265], [3679.0739523986194, -4902.554463027355, 4238.822859996059], [2176.751759854781, -4921.066588067526, -5141.046880900803], [-2996.242974428832, 2959.7903165204257, -6129.700700628975], [-3473.4098542117995, 5930.540268786079, 2864.861180933239], [1781.4048332758316, -695.9285167042455, 7203.896646467099], [4327.085075342381, -6056.185133901981, -222.81918760660284], [-167.95455132233377, -1569.7159057615168, -7267.793132734174], [-4575.88258738444, 5319.858183628798, -2477.717696169206], [-1613.5074201333273, 3522.0247993318803, 6366.030659753233]], J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 2.592e6 s))
julia> vr_i, vv_i, orbp = Propagators.propagate_to_epoch( Val(:J4), DateTime("2023-01-01"):Dates.Day(1):DateTime("2023-01-31"), orb )(StaticArraysCore.SVector{3, Float64}[[1.3838190168559616e6, -2.130768629818518e6, 6.7191141876615e6], [1.2005550419764202e6, -7.014268891198139e6, -1.0447212979922796e6], [-968358.6696247363, -503350.41260645643, -7.115749382502843e6], [-1.7919025450793009e6, 6.77583637592255e6, -1.6111756663364314e6], [246238.12729823356, 3.0255377396530826e6, 6.510249840606645e6], [2.087759090662912e6, -5.603564231172567e6, 3.989117925228607e6], [657618.8214993683, -5.086467382383941e6, -5.050518644791206e6], [-1.9981525426020848e6, 3.6419947491509328e6, -5.875339448416422e6], [-1.5903266484757434e6, 6.395469873941444e6, 2.8626605220611123e6], [1.495033827870874e6, -1.2378587428335883e6, 6.917674296614739e6] … [-3.6520191511849603e6, 5.436298869022398e6, -2.95817654859842e6], [-1.3904986901130409e6, 3.979974649250507e6, 5.816894610076181e6], [3.3009861504761158e6, -3.867573374157423e6, 5.0889762840449e6], [2.77293629125043e6, -5.351013126845765e6, -3.9369277833622373e6], [-2.359267806793537e6, 1.7752316851827248e6, -6.555972175766926e6], [-3.8259166755315117e6, 5.88759490562676e6, 1.5146042904319335e6], [983763.6099573688, 431646.45986805303, 7.108964308083106e6], [4.386207570503878e6, -5.599882274225754e6, 1.1057003413103572e6], [702123.2572222403, -2.526468159812414e6, -6.699453306053789e6], [-4.288529371918087e6, 4.511092546286667e6, -3.587767201149616e6]], StaticArraysCore.SVector{3, Float64}[[874.922879060432, -7002.276750354891, -2397.8788532333633], [-1262.9644074254836, 860.5573366942392, -7284.9727421983625], [-1576.8270290954179, 7261.698778653835, -298.5765793666147], [659.9050671888052, 1871.8745360981832, 7175.099921821663], [2055.3091061558152, -6527.05677436923, 2953.7215960546155], [196.53208587832776, -4275.831302014843, -6095.122931432423], [-2167.79689338872, 4867.26136934486, -5189.576791550061], [-1173.5520560030263, 6055.441550162393, 4161.031319593705], [1860.8451825628918, -2562.5891415698093, 6744.730125244792], [2077.1903355135646, -6954.286603914805, -1687.8557209784194] … [-692.7855903491417, 3174.083854885012, 6704.452910582265], [3679.0739523986194, -4902.554463027355, 4238.822859996059], [2176.751759854781, -4921.066588067526, -5141.046880900803], [-2996.242974428832, 2959.7903165204257, -6129.700700628975], [-3473.4098542117995, 5930.540268786079, 2864.861180933239], [1781.4048332758316, -695.9285167042455, 7203.896646467099], [4327.085075342381, -6056.185133901981, -222.81918760660284], [-167.95455132233377, -1569.7159057615168, -7267.793132734174], [-4575.88258738444, 5319.858183628798, -2477.717696169206], [-1613.5074201333273, 3522.0247993318803, 6366.030659753233]], J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 2.592e6 s))

To obtain an array of OrbitStateVector as the output, we can use:

julia> vsv_i, orbp = Propagators.propagate_to_epoch(
           OrbitStateVector,
           Val(:J4),
           date_to_jd(2023, 1, 1, 0, 0, 0):date_to_jd(2023, 1, 31, 0, 0, 0),
           orb
       )(OrbitStateVector{Float64, Float64}[OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-02T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-03T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-04T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-05T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-06T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-07T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-08T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-09T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-10T00:00:00)  …  OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-22T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-23T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-24T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-25T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-26T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-27T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-28T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-29T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-30T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45998e6 (2023-01-31T00:00:00)], J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 2.592e6 s))
julia> vsv_i, orbp = Propagators.propagate_to_epoch( OrbitStateVector, Val(:J4), DateTime("2023-01-01"):Dates.Day(1):DateTime("2023-01-31"), orb )(OrbitStateVector{Float64, Float64}[OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-01T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-02T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-03T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-04T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-05T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-06T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-07T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-08T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-09T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45995e6 (2023-01-10T00:00:00) … OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-22T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-23T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-24T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-25T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-26T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-27T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-28T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-29T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45997e6 (2023-01-30T00:00:00), OrbitStateVector{Float64, Float64}: Epoch = 2.45998e6 (2023-01-31T00:00:00)], J4 Orbit Propagator (Epoch = 2023-01-01T00:00:00, Δt = 2.592e6 s))

Helpers

We have the following functions that provide some useful information related to the propagators.

epoch(orbp::OrbitPropagator{Tepoch, T}) where {Tepoch<:Number, T<:Number}

It returns the initial elements' epoch of the propagator orbp [JD].

julia> Propagators.epoch(orbp)2.4599455e6

last_instant(orbp::OrbitPropagator{Tepoch, T}) where {Tepoch<:Number, T<:Number}

It returns the last propagation instant [s] measured from the input elements' epoch.

julia> Propagators.last_instant(orbp)2.592e6

name(orbp::OrbitPropagator)

It returns the propagator name.

julia> Propagators.name(orbp)"J4 Orbit Propagator"

mean_elements(orbp::OrbitPropagator)

It returns the mean elements using the structure KeplerianElements of the latest propagation performed by orbp. Notice that this is an optional funciton in the propagators' API. If a propagator does not support it, this function returns nothing.

julia> Propagators.mean_elements(orbp)KeplerianElements{Float64, Float64}:
           Epoch :    2.45998e6 (2023-01-31T00:00:00)
 Semi-major axis : 7190.98     km
    Eccentricity :    0.001111
     Inclination :   98.405    °
            RAAN :  128.665    °
 Arg. of Perigee :    2.35609  °
    True Anomaly :  327.325    °