JuliaSpace / SatelliteToolbox.jl

A toolbox for satellite analysis written in julia language.
MIT License
248 stars 33 forks source link

Selectable Central Body (different from Earth) #103

Open mcontim opened 4 months ago

mcontim commented 4 months ago

Hi @ronisbr!

Is it possible to change the central body in SatelliteToolboxPropagators?

For my understanding, at the moment it is possible to play with the gravitational parameters passed to Propagators.init, virtually modifing the central body.

Would you think working on a more straightforward way to personalize the central body could be interesting feature to have in SatelliteToolbox?

ronisbr commented 4 months ago

Hi @BlueTeo91 !

All the propagators depends on some constants defined using specific structure. For example, the J2 propagator uses:

struct J2PropagatorConstants{T<:Number}
    R0::T
    μm::T
    J2::T
end

const j2c_egm2008 = J2PropagatorConstants(
    6378137.0,
    √(3.986004415e14 / 6378137.0^3),
    0.0010826261738522227
)

So, in theory, you just need to use the constants related to the central body you want.

mcontim commented 4 months ago

Thanks for your answer @ronisbr! Indeed, at the moment I'm modifying the specific propagator structures in order to consider for a different central body.

I was wondering if you would consider adding something like CentralBody type to be passed to Propagators.init(), automatically changing the specific parameters (e.g., radius and gravitational constant) for the specific central body. Do you think it would be an interesting enhancement or an out of scope feature for this package? Thanks

ronisbr commented 1 month ago

Hi @BlueTeo91!

Sorry for the delay, I missed that notification. Yes, probably we can add this kind of keyword to automatically select the constants if we are using other central body!

mcontim commented 1 month ago

Cool @ronisbr! I can try to make a PR in the next few weeks, I would say is definitely not an urgent feature to be implemented :D

ronisbr commented 1 month ago

Thanks!!