I'm not sure how to enter the units for rho of a planet in Orbits.jl
Which parameter do you mean by rho?
rho_planet, and rho_star are two variables in the source code.
* `R_planet`/`Rp` -- The radius of the planet [R⊙].
* `R_star`/`Rs` -- The radius of the star [R⊙].
* `rho_star`/`ρ_star` -- The spherical star density [M⊙/R⊙³].
how do I enter this with UnitfulAstro.jl?
I would expect standard Unitful units for density to work there
What unit is that? How do I enter it?
Well, any valid units for mass over volume, like
julia> using Unitful
julia> 0.9u"kg"/u"m"^3
0.9 kg m^-3
Or do something like
julia> mass = 10u"kg"
10 kg
julia> radius = 2u"cm"
2 cm
julia> mass*3/(4π*radius^3)
0.2984155182973038 kg cm^-3
M_planet=.5*1.99e30u"kg",
M_star=.8*1.99e30u"kg",
rho_star=0.9u"kg"/u"m"^3,
a=1u"AU",
t0=0u"°"
)
gives me an error that the units aren't compatable. I thought this was what I need if I don't know eccentricity, from reading the docs.
Ah, I see the mix-up. Try putting the mid-transit time in units of days u"d"
, not degrees u"°"
. We adopted this notation, i.e. [d]
in the docs, to represent day
so that it would be in line with the standard unit from Unitful.jl. I can see how this could be confused with the unit for degrees out of context, so I have opened a PR to try and clarify this https://github.com/JuliaAstro/Orbits.jl/pull/7
Last updated: Nov 22 2024 at 04:41 UTC