Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Oblique20LinearQuantity.cpp
Go to the documentation of this file.
1 
9 
10 double Oblique20LinearQuantity::indefinite_integral(double star_angmom) const
11 {
12  double s2 = std::pow(star_angmom, 2),
13  t2 = std::pow(__total_angmom, 2),
14  t3 = t2 * __total_angmom,
15  atanh_good_arg = star_angmom / (1.0 + __total_angmom),
16  atanh_bad_arg = star_angmom / (1.0 - __total_angmom);
17  return (
18  (
19  2.0 * star_angmom * __total_angmom
20  *
21  (1.0 - s2 * t2 + t2 * t2 - (s2 + 2.0 * t2))
22  /
23  (1.0 + std::pow(s2 - t2, 2) - 2.0 * (s2 + t2))
24  )
25  +
26  (t3 - 1.0) * (std::log(std::abs(atanh_bad_arg + 1.0))
27  -
28  std::log(std::abs(atanh_bad_arg - 1.0))) / 2.0
29  +
30  (1.0 + t3) * std::atanh(atanh_good_arg)
31  ) / (2.0 * t3);
32 }
33 
34 Oblique20LinearQuantity::Oblique20LinearQuantity(double total_angmom,
35  double orbital_angmom,
36  double initial_star_angmom) :
37  __total_angmom(total_angmom / orbital_angmom),
38  __initial_star_angmom(initial_star_angmom / orbital_angmom),
39  __angmom_scale(orbital_angmom),
41 {
42  assert(total_angmom > 0);
43  assert(orbital_angmom > 0);
44  assert(initial_star_angmom > 0);
45  assert(total_angmom <= orbital_angmom + initial_star_angmom);
46  assert(orbital_angmom <= total_angmom + initial_star_angmom);
47  assert(initial_star_angmom <= orbital_angmom + total_angmom);
48  assert(std::pow(total_angmom, 2) - std::pow(orbital_angmom, 2)
49  >
50  std::pow(initial_star_angmom, 2));
51  assert(!std::isnan(__initial_star_angmom));
52  assert(!std::isnan(__initial_indefinite_integral));
53 }
54 
55 double Oblique20LinearQuantity::operator()(double star_angmom) const
56 {
57  return (indefinite_integral(star_angmom / __angmom_scale)
58  -
60 }
61 
63  double
64 ) const
65 {
66  throw Core::Error::Runtime("Differentiating m=2, m' = 0 linearly evolving "
67  "function of the stellar angular momentum is not"
68  " supported.");
69 }
double operator()(double star_angmom) const
The value of the function at the given abscissa.
Any runtime error.
Definition: Error.h:61
double indefinite_integral(double star_angmom) const
Return the real part of the indefinite integral of the inverse of the rate of change of the stellar a...
double __total_angmom
The Magnitude of the total angular momentum in the system in units of the orbital angular momentum (c...
A class representing arbitrary order derivatives of a function.
Definition: Functions.h:66
double __angmom_scale
The initial orbital angular momentum (everything is scaled by this quantity).
double __initial_star_angmom
The Magnitude of the initial stellar spin angular momentum in.
const Core::FunctionDerivatives * deriv(double star_angmom) const
Returns a pointer to the derivative of the function.
double __initial_indefinite_integral
The value of indefinite integral(__initial_star_angmom)
Declares a function of the stellar angular momentum that evolves linearly with time when only the m =...