Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
testOrbitSolver.h
Go to the documentation of this file.
1 
9 #ifndef __TEST_ORBIT_SOLVER_H
10 #define __TEST_ORBIT_SOLVER_H
11 
12 #include "TransformedSolution.h"
13 #include "RealEvolutionQuantity.h"
14 #include "ExpectedEvolutionMode.h"
19 #include "../../Evolve/OrbitSolver.h"
20 #include "../../Star/EvolvingStar.h"
21 #include "../../Planet/Planet.h"
22 #include "../../Evolve/DiskBinarySystem.h"
23 #include "../../Core/AstronomicalConstants.h"
24 #include "../shared/PolynomialEvolution.h"
25 #include "../shared/Common.h"
26 #include "../shared/MakeStar.h"
27 #include <iostream>
28 #include <vector>
29 
30 namespace Evolve {
31 
36  class test_OrbitSolver : public Test::Suite {
37  private:
40 
43 
46 
49 
51  std::vector< const Core::OneArgumentDiffFunction* > __temp_functions;
52 
54  //component.
58  double min_frequency,
59 
62  double max_frequency,
63 
65  double decay_scale,
66 
68  double phase_lag = 1.0e-5
69  );
70 
75  const StellarEvolution::Interpolator &evolution,
76 
78  double wind_strength,
79 
81  double wind_sat_freq,
82 
84  double coupling_timescale,
85 
88  double min_frequency,
89 
92  double max_frequency,
93 
95  double decay_scale,
96 
98  double phase_lag = 1.0e-5
99  );
100 
102  void evolve(
103  double wdisk,
104  double tdisk,
105  double initial_a,
106  const double *initial_Lstar,
107  double initial_incl = 0.0,
108  double secondary_mass = 1.0,
110  double tsecondary = Core::NaN,
111  double max_age = MAX_AGE,
112  double secondary_radius = 1.0,
113  double precision = 1e-8,
114  double max_step_factor = 1e-3,
115  const std::list<double> required_ages = std::list<double>()
116  );
117 
119  std::vector< const std::list<double> *> get_evolution() const;
120 
123  void test_solution(
124  const std::vector< const std::list<double> * > &
125  tabulated_real_quantities,
126  std::vector<const Core::OneArgumentDiffFunction *>
127  expected_real_quantities,
129  expected_evol_mode,
130  const ExpectedEvolutionMode<bool> &expected_wind_mode,
131  double min_age,
132  double max_age,
133  bool debug_mode = false
134  );
135 
139  const StellarEvolution::Interpolator &stellar_evol,
140  double *initial_Lstar,
141  double windK,
142  double wind_sat_freq,
143  double core_env_coupling_time,
144  std::vector<const Core::OneArgumentDiffFunction *>
145  &expected_evolution,
146  const ExpectedEvolutionMode<bool> &expected_wind_mode,
147  double max_age = MAX_AGE,
148  bool debug_mode = false
149  );
150 
153  std::vector<const Core::OneArgumentDiffFunction *>
156  double phase_lag,
157 
159  double secondary_mass,
160 
163  bool decaying=true
164  );
165 
168  std::vector<const Core::OneArgumentDiffFunction *>
169  calculate_expected_disklocked_to_fast_to_locked(
171  double lgQ,
172 
174  double tdisk,
175 
177  double async,
178 
180  double tsync,
181 
183  double tend,
184 
186  bool include_disk_lock=true
187  );
188 
191  std::vector<const Core::OneArgumentDiffFunction *>
192  calculate_expected_polar_1_0(
194  double tdisk,
195 
197  double wstar,
198 
200  double worb
201  );
202 
205  std::vector<const Core::OneArgumentDiffFunction *>
206  calculate_expected_polar_2_0(
208  double tdisk,
209 
211  double wstar,
212 
214  double worb,
215 
217  double phase_lag,
218 
221  double &lconv_decay_rate,
222 
224  //envolve).
225  double &semimajor
226  );
227 
230  std::vector<const Core::OneArgumentDiffFunction *>
231  calculate_expected_oblique_m_0(
233  unsigned m,
234 
236  double tdisk,
237 
239  double worb,
240 
242  double initial_inc,
243 
245  double initial_wstar,
246 
248  double phase_lag,
249 
252  double &min_wstar
253  );
254 
255  protected:
257  void setup();
258 
260  void tear_down();
261  public:
264 
267  void test_disk_locked_no_stellar_evolution();
268 
271  void test_disk_locked_with_stellar_evolution();
272 
278  void test_no_planet_evolution();
279 
287  //
290  void test_unlocked_evolution();
291 
295  void test_locked_evolution();
296 
300  void test_disklocked_to_locked_to_noplanet();
301 
305  void test_disklocked_to_fast_to_noplanet();
306 
310  void test_disklocked_to_fast_to_locked();
311 
315  void test_disklocked_to_locked_to_fast();
316 
321  void test_polar_1_0_evolution();
322 
329  void test_polar_2_0_evolution();
330 
347  void test_oblique_1_0_evolution();
348 
351  void test_oblique_2_0_evolution();
352  };//End test_OrbitSolver class.
353 
354 }//End Evolve namespace.
355 
356 
357 #endif
Declare & define a class tracking flags indicating the expected state of the evolution (e...
Star::InterpolatedEvolutionStar * __star
The star used in the current test (NULL if primary is planet).
The test suite that exercises the OrbitSolver class.
Definition: setup.py:1
Declare a class that transforms an orbital solution before checking.
Single zone non-evolving planets with huge dissipation, so they always remain locked to the disk...
Definition: Planet.h:21
void test_no_planet_scenario(const StellarEvolution::Interpolator &stellar_evol, double *initial_Lstar, double windK, double wind_sat_freq, double core_env_coupling_time, std::vector< const Core::OneArgumentDiffFunction *> &expected_evolution, const ExpectedEvolutionMode< bool > &expected_wind_mode, double max_age=MAX_AGE, bool debug_mode=false)
Test a planet-less scenario computed in 3 different ways: 1) withou a planet 2) without dissipation 3...
void make_single_component_star(const StellarEvolution::Interpolator &evolution, double wind_strength, double wind_sat_freq, double coupling_timescale, double min_frequency, double max_frequency, double decay_scale, double phase_lag=1.0e-5)
Create __star with constant dissipation in a range, quickly decaying outside of that.
Evolve::DiskBinarySystem * __system
The system being evolved by the current test.
const double MAX_AGE
Most tests end at this age in Gyr.
Definition: Common.h:57
Orientations of zones of bodies in a binary system.
Planet::Planet * __primary_planet
The primary planet in the current test (NULL if primary is star).
A class that interpolates among stellar evolution tracks.
Definition: Interpolator.h:42
Declare an inumeration for the various quantities tracked by the evolution and checked.
void set_single_component_dissipation(double min_frequency, double max_frequency, double decay_scale, double phase_lag=1.0e-5)
Set the dissipation of the primary to only a single tidal.
void evolve(double wdisk, double tdisk, double initial_a, const double *initial_Lstar, double initial_incl=0.0, double secondary_mass=1.0, double tsecondary=Core::NaN, double max_age=MAX_AGE, double secondary_radius=1.0, double precision=1e-8, double max_step_factor=1e-3, const std::list< double > required_ages=std::list< double >())
Add a planet to the given star and evolve, returning the solver.
Declares a OneArgumentDiffFunction sub-class giving the evolution of the stellar convective zone angu...
std::vector< const Core::OneArgumentDiffFunction * > calculate_expected_unlocked_evolution(double phase_lag, double secondary_mass, bool decaying=true)
Calculate the predicted evolution for the test_unlocked_evolution() case.
Declares a OneArgumentDiffFunction sub-classes giving the evolution of the core and envelope obliquit...
void test_solution(const std::vector< const std::list< double > * > &tabulated_real_quantities, std::vector< const Core::OneArgumentDiffFunction *> expected_real_quantities, const ExpectedEvolutionMode< Core::EvolModeType > &expected_evol_mode, const ExpectedEvolutionMode< bool > &expected_wind_mode, double min_age, double max_age, bool debug_mode=false)
Tests the latest evolution calculated by the solver against the given tracks.
std::vector< const Core::OneArgumentDiffFunction *> __temp_functions
A list of functions allocated during a test to delete at the end.
Solves the system of ODEs describing the evolution of a single planet around a single star...
Definition: OrbitSolver.h:115
Evolve::OrbitSolver * __solver
The solver used for the current test.
Declares a function of the stellar angular momentum that evolves linearly with time when only the m =...
Declares a function of the stellar angular momentum that evolves linearly with time when only the m =...
std::vector< const std::list< double > * > get_evolution() const
Return the last calculated evolution.
Some evolution mode that changes at specified ages.
For some prescribed amount of time the surface of the pramary spins at a prescribed rate...