Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
TidalPotentialExpansion.h
Go to the documentation of this file.
1 
9 #ifndef __UNIT_TESTS_TIDAL_POTENTIAL_EXPANSION_H
10 #define __UNIT_TESTS_TIDAL_POTENTIAL_EXPANSION_H
11 
12 #include "EccentricOrbit.h"
13 
14 #include "../../Evolve/TidalPotentialTerms.h"
15 
16 #include <boost/math/special_functions/spherical_harmonic.hpp>
17 #include <cassert>
18 
19 namespace Evolve {
22  private:
26 
27  double
30 
33 
36 
39 
43 
48 
51  double tidal_term(
53  int mprime,
54 
56  double radial_distance,
57 
59  double azimuthal_angle,
60 
62  double polar_angle,
63 
66  double orbital_phase
67  ) const;
68  public:
71  double primary_mass=Core::NaN,
72 
74  double secondary_mass=Core::NaN,
75 
77  double semimajor=Core::NaN,
78 
80  double eccentricity=Core::NaN,
81 
83  double inclination=Core::NaN,
84 
86  double arg_of_periapsis=Core::NaN
87  ) :
88  __primary_mass(primary_mass),
89  __secondary_mass(secondary_mass),
90  __semimajor(semimajor),
91  __eccentricity(eccentricity),
92  __inclination(inclination),
93  __arg_of_periapsis(arg_of_periapsis)
94  {}
95 
101  double radial_distance,
102 
105  double azimuthal_angle,
106 
109  double polar_angle,
110 
113  double time
114  );
115 
117  template<class POSITION_TYPE>
118  double operator()(
126  const POSITION_TYPE &position,
127 
130  double time
131  );
132 
133  void set_eccentricity_order(unsigned e_order)
134  {__expansion_coef.change_e_order(e_order);}
135  }; //End TidalPotentialExpansion class.
136 
137  template<class POSITION_TYPE>
139  const POSITION_TYPE &position,
140  double time
141  )
142  {
143  double radial_distance = position.norm(),
144  polar_angle = (
145  radial_distance == 0
146  ? 0
147  : std::acos(position[2]/radial_distance)
148  ),
149  azimuthal_angle = std::atan2(position[1], position[0]);
150 
151  if(azimuthal_angle < 0)
152  azimuthal_angle += 2.0 * M_PI;
153 
155  radial_distance,
156  azimuthal_angle,
157  polar_angle,
158  time
159  );
160  }
161 } //End Evolve namespace.
162 #endif
double __semimajor
The semimajor axis of the orbit in solar radii.
double __eccentricity
The eccentricity of the orbit.
Evaluate the tidal potential using the expansion.
Orientations of zones of bodies in a binary system.
void change_e_order(unsigned new_e_order)
Change the eccentricity expansion order.
TidalPotentialTerms __expansion_coef
The coefficients of the expansion of the tidal potential. ( )
TidalPotentialExpansion(double primary_mass=Core::NaN, double secondary_mass=Core::NaN, double semimajor=Core::NaN, double eccentricity=Core::NaN, double inclination=Core::NaN, double arg_of_periapsis=Core::NaN)
double evaluate_spherical_coords(double radial_distance, double azimuthal_angle, double polar_angle, double time)
double operator()(const POSITION_TYPE &position, double time)
Return the tidal potential at a specific position and time in SI.
double __secondary_mass
The mass of the perturber object in solar masses.
double tidal_term(int mprime, double radial_distance, double azimuthal_angle, double polar_angle, double orbital_phase) const
Return a single tidal term: .
double __primary_mass
The mass of the tidally perturbed object in solar masses.
Declare an interface for working with eccentric orbits.