Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
OrbitalExpressions.cpp
Go to the documentation of this file.
1 
6 #include "OrbitalExpressions.h"
7 
8 namespace Core {
9 
10  double factorial(unsigned n)
11  {
12  double result=1;
13  for(unsigned i=2; i<=n; ++i) result*=i;
14  return result;
15  }
16 
17  double orbital_angular_velocity(double m1,
18  double m2,
19  double semimajor,
20  bool deriv)
21  {
22  return (
23  (deriv ? -1.5 : 1.0)
24  *
25  std::sqrt(
27  /
28  std::pow(
30  (deriv ? 5 : 3)
31  )
32  )
33  *
35  );
36  }
37 
38  double orbital_energy(double m1,
39  double m2,
40  double semimajor,
41  unsigned deriv_order)
42  {
43  return (deriv_order%2 ? 1 : -1) * m1 * m2 * factorial(deriv_order)
44  /
45  (2.0 * std::pow(semimajor, static_cast<int>(deriv_order + 1)))
46  *
48  *
49  std::pow(Core::AstroConst::day, 2)
50  /
51  std::pow(Core::AstroConst::solar_radius, 3);
52  }
53 
54  double orbital_angular_momentum(double m1,
55  double m2,
56  double semimajor,
57  double eccentricity)
58  {
59  return m1 * m2
60  *
61  std::sqrt(
62  semimajor*(1.0 - std::pow(eccentricity, 2)) / (m1 + m2)
63  *
65  /
67  )
68  *
70  }
71 
72  LIB_PUBLIC double semimajor_from_period(double m1,
73  double m2,
74  double period)
75  {
76  return std::pow(
78  *
79  std::pow(Core::AstroConst::day * period, 2)
80  /
81  (4.0 * M_PI * M_PI)
82  ,
83  1.0 / 3.0
85  }
86 
87 
88 
89 }//End Core namespace.
double orbital_angular_velocity(double m1, double m2, double semimajor, bool deriv)
Returns the orbital angular velocity of the given orbit in rad/day.
double orbital_energy(double m1, double m2, double semimajor, unsigned deriv_order)
The energy of the orbit (assuming 0 gravitational potential at infinity) in .
LIB_PUBLIC double semimajor_from_period(double m1, double m2, double period)
Return the semiamjor axis in solar radii required to have the given masses orbit with the given perio...
const double solar_radius
Radius of the sun [m].
double orbital_angular_momentum(double m1, double m2, double semimajor, double eccentricity)
The angular momentum of the orbit in .
A collection of functions which calculate various quantities for two body orbits. ...
const double day
day [s]
const double solar_mass
Mass of the sun [kg].
const double G
Gravitational constant in SI.