9 #ifndef __mx_astro_planets_hpp__
10 #define __mx_astro_planets_hpp__
12 #include "../math/constants.hpp"
56 template<
typename units>
59 typedef typename units::realT realT;
61 using namespace mx::astro::constants;
63 if( mass < 4.1*massEarth<units>())
65 return pow( mass/massEarth<units>(), math::third<realT>())*radEarth<units>();
67 else if( mass <
static_cast<realT
>(15.84)*massEarth<units>() )
69 return 0.62*pow( mass/massEarth<units>(),
static_cast<realT
>(0.67))*radEarth<units>();
71 else if( mass < 3591.1*massEarth<units>())
73 realT logM = log10(mass/massEarth<units>());
75 return (
static_cast<realT
>(14.0211)-
static_cast<realT
>(44.8414)*logM+
static_cast<realT
>(53.6554)*pow(logM,2) -
76 static_cast<realT
>(25.3289)*pow(logM,3) +
static_cast<realT
>(5.4920)*pow(logM,4)
77 - 0.4586*pow(logM,5))*radEarth<units>();
81 return static_cast<realT
>(32.03)*pow(mass/massEarth<units>(),
static_cast<realT
>(-0.125))* radEarth<units>();
109 template<
typename units>
110 typename units::realT planetMass2RadiusWThorngren(
typename units::realT mass )
112 typedef typename units::realT realT;
114 using namespace mx::astro::constants;
116 if( mass < 4.1*massEarth<units>())
118 return pow( mass/massEarth<units>(), math::third<realT>())*radEarth<units>();
120 else if( mass <
static_cast<realT
>(15.00)*massEarth<units>() )
122 return 0.6413*pow( mass/massEarth<units>(),
static_cast<realT
>(0.6477))*radEarth<units>();
124 else if( mass < 12*massJupiter<units>())
126 realT lM = log10(mass/massJupiter<units>());
128 return (
static_cast<realT
>(0.96)+
static_cast<realT
>(0.21)*lM -
static_cast<realT
>(0.20)*pow(lM,2))*radJupiter<units>();
132 return static_cast<realT
>(29.97)*pow(mass/massEarth<units>(),
static_cast<realT
>(-0.125))* radEarth<units>();
146 template<
typename units>
147 typename units::realT planetMass2RadiusThorngren(
typename units::realT mass )
149 typedef typename units::realT realT;
151 using namespace mx::astro::constants;
153 realT lM = log10(mass/massJupiter<units>());
155 return (0.96+0.21*lM - 0.2*pow(lM,2))*radJupiter<units>();
175 template<
typename units>
176 typename units::realT planetMass2RadiusFab2014(
typename units::realT mass )
178 typedef typename units::realT realT;
180 using namespace mx::astro::constants;
182 if( mass < massEarth<units>())
184 return pow( mass/massEarth<units>(), math::third<realT>())*radEarth<units>();
188 return pow( mass/massEarth<units>(),
static_cast<realT
>(1)/
static_cast<realT
>(2.06))*radEarth<units>();
units::realT planetMass2Radius(typename units::realT mass)
An ad-hoc planetary mass-to-radius relationship (old version)
Unit specifications and conversions.