16 std::sqrt(3.0 * M_PI / 10.0) / 4.0,
17 -std::sqrt(6.0 * M_PI / 5.0) / 4.0,
18 std::sqrt(3.0 * M_PI / 10.0) / 4.0
21 -std::sqrt(3.0 * M_PI / 10.0) / 2.0,
22 -std::sqrt(6.0 * M_PI / 5.0) / 2.0,
23 std::sqrt(3.0 * M_PI / 10.0) / 2.0
26 3.0 * std::sqrt(M_PI / 5.0) / 4.0,
27 -std::sqrt(M_PI / 5.0) / 2.0,
28 3.0 * std::sqrt(M_PI / 5.0) / 4.0
31 -std::sqrt(3.0 * M_PI / 10.0) / 2.0,
32 std::sqrt(6.0 * M_PI / 5.0) / 2.0,
33 std::sqrt(3.0 * M_PI / 10.0) / 2.0
36 std::sqrt(3.0 * M_PI / 10.0) / 4.0,
37 -std::sqrt(6.0 * M_PI / 5.0) / 4.0,
38 std::sqrt(3.0 * M_PI / 10.0) / 4.0
43 double arg_of_periapsis)
71 __Ummp[4][0] =
__Umm_coef[4][0] * std::pow(cm1, 2);
82 __Ummp[2][1] =
__Umm_coef[2][1] * (2.0 - 3.0 * s2);
86 __Ummp_deriv[3][1] =
__Umm_coef[3][1] * (1.0 - 2.0 * s2);
89 __Ummp_deriv[4][1] =
__Umm_coef[4][1] * 2.0 * sc;
93 __Ummp[0][2] =
__Umm_coef[0][2] * std::pow(cm1, 2);
94 __Ummp_deriv[0][2] = -
__Umm_coef[0][2] * 2.0 * cm1 * s;
97 __Ummp_deriv[1][2] = -
__Umm_coef[1][2] * (c * cm1 - s2);
100 __Ummp_deriv[2][2] =
__Umm_coef[2][2] * 2.0 * sc;
103 __Ummp_deriv[3][2] =
__Umm_coef[3][2] * (c * cp1 - s2);
105 __Ummp[4][2] =
__Umm_coef[4][2] * std::pow(cp1, 2);
106 __Ummp_deriv[4][2] = -
__Umm_coef[4][2] * 2.0 * cp1 * s;
109 TidalPotentialTerms::TidalPotentialTerms() :
115 for(
int i = 0; i < 5; ++i) {
125 std::complex<double> &no_deriv,
126 std::complex<double> &inclination_deriv,
127 std::complex<double> &eccentricity_deriv,
128 std::complex<double> &highest_e_order_term
131 no_deriv = inclination_deriv = eccentricity_deriv = 0;
132 for(
int i = 0; i < 3; ++i) {
134 std::pair<double, double> pms =
__pms(s, mp, e,
__e_order,
false);
135 std::complex<double> periapsis_factor(
137 -std::sin(s * __arg_of_periapsis)
139 no_deriv += pms.first *
__Ummp[m+2][i] * periapsis_factor;
140 inclination_deriv += (pms.first
145 eccentricity_deriv += (
152 highest_e_order_term += (pms.second
157 assert(!std::isnan(no_deriv.real()));
158 assert(!std::isnan(inclination_deriv.real()));
159 assert(!std::isnan(eccentricity_deriv.real()));
160 assert(!std::isnan(highest_e_order_term.real()));
168 double &inclination_deriv,
169 double &eccentricity_deriv,
170 double &highest_e_order_term)
const 172 std::complex<double> complex_no_deriv,
173 complex_inclination_deriv,
174 complex_eccentricity_deriv,
175 complex_highest_e_order_term;
180 complex_inclination_deriv,
181 complex_eccentricity_deriv,
182 complex_highest_e_order_term);
183 no_deriv = complex_no_deriv.real();
184 inclination_deriv = complex_inclination_deriv.real();
185 eccentricity_deriv = complex_eccentricity_deriv.real();
186 highest_e_order_term = complex_highest_e_order_term.real();
std::valarray< std::valarray< double > > __Ummp
The quantities defined in Lai (2012).
double __Ummp_inclination
The inclination with which __Ummp was last filled.
void operator()(double e, int m, int mp, std::complex< double > &no_deriv, std::complex< double > &inclination_deriv, std::complex< double > &eccentricity_deriv, std::complex< double > &highest_e_order_term) const
Calculates (see documentation) and its derivatives w.r.t. e and .
double __arg_of_periapsis
The argument of periaspsis set by the last call to configure().
static EccentricityExpansionCoefficients __pms
The eccentricity expansion of .
Orientations of zones of bodies in a binary system.
void configure(double inclination, double arg_of_periapsis=0)
Set the inclination relative to the orbit.
Declare an interface for evaluating the expansion of the tidal potential.
static const double __Umm_coef[][3]
The constant coefficiients in of Lai (2012).
std::valarray< std::valarray< double > > __Ummp_deriv
The derivatives of the quantities w.r.t. the inclination.
unsigned __e_order
The expansion order in eccentricity to use.