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 
116  int expansion_order
117  );
118 
120  template<class POSITION_TYPE>
121  double operator()(
129  const POSITION_TYPE &position,
130 
133  double time,
134 
136  int expansion_order
137  );
138 
140  inline double get_expansion_precision() const
141  {return __expansion_coef.get_expansion_precision();}
142 
143 
144  }; //End TidalPotentialExpansion class.
145 
146  template<class POSITION_TYPE>
148  const POSITION_TYPE &position,
149  double time,
150  int expansion_order
151  )
152  {
153  double radial_distance = position.norm(),
154  polar_angle = (
155  radial_distance == 0
156  ? 0
157  : std::acos(position[2]/radial_distance)
158  ),
159  azimuthal_angle = std::atan2(position[1], position[0]);
160 
161  if(azimuthal_angle < 0)
162  azimuthal_angle += 2.0 * M_PI;
163 
165  radial_distance,
166  azimuthal_angle,
167  polar_angle,
168  time,
169  expansion_order
170  );
171  }
172 } //End Evolve namespace.
173 #endif
double get_expansion_precision() const
Return the expansion precision target for the expansion terms.
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.
double operator()(const POSITION_TYPE &position, double time, int expansion_order)
Return the tidal potential at a specific position and time in SI.
Orientations of zones of bodies in a binary system.
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 get_expansion_precision() const
Return the expansion precision target for the expansion terms.
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 evaluate_spherical_coords(double radial_distance, double azimuthal_angle, double polar_angle, double time, int expansion_order)
double __primary_mass
The mass of the tidally perturbed object in solar masses.
Declare an interface for working with eccentric orbits.