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-6,
114  double max_step_factor = 1e-3
115  );
116 
118  std::vector< const std::list<double> *> get_evolution() const;
119 
122  void test_solution(
123  const std::vector< const std::list<double> * > &
124  tabulated_real_quantities,
125  std::vector<const Core::OneArgumentDiffFunction *>
126  expected_real_quantities,
128  expected_evol_mode,
129  const ExpectedEvolutionMode<bool> &expected_wind_mode,
130  double min_age,
131  double max_age,
132  bool debug_mode = false
133  );
134 
138  const StellarEvolution::Interpolator &stellar_evol,
139  double *initial_Lstar,
140  double windK,
141  double wind_sat_freq,
142  double core_env_coupling_time,
143  std::vector<const Core::OneArgumentDiffFunction *>
144  &expected_evolution,
145  const ExpectedEvolutionMode<bool> &expected_wind_mode,
146  double max_age = MAX_AGE,
147  bool debug_mode = false
148  );
149 
152  std::vector<const Core::OneArgumentDiffFunction *>
155  double phase_lag,
156 
158  double secondary_mass,
159 
162  bool decaying=true
163  );
164 
167  std::vector<const Core::OneArgumentDiffFunction *>
168  calculate_expected_disklocked_to_fast_to_locked(
170  double lgQ,
171 
173  double tdisk,
174 
176  double async,
177 
179  double tsync,
180 
182  double tend,
183 
185  bool include_disk_lock=true
186  );
187 
190  std::vector<const Core::OneArgumentDiffFunction *>
191  calculate_expected_polar_1_0(
193  double tdisk,
194 
196  double wstar,
197 
199  double worb
200  );
201 
204  std::vector<const Core::OneArgumentDiffFunction *>
205  calculate_expected_polar_2_0(
207  double tdisk,
208 
210  double wstar,
211 
213  double worb,
214 
216  double phase_lag,
217 
220  double &lconv_decay_rate,
221 
223  //envolve).
224  double &semimajor
225  );
226 
229  std::vector<const Core::OneArgumentDiffFunction *>
230  calculate_expected_oblique_m_0(
232  unsigned m,
233 
235  double tdisk,
236 
238  double worb,
239 
241  double initial_inc,
242 
244  double initial_wstar,
245 
247  double phase_lag,
248 
251  double &min_wstar
252  );
253 
254  protected:
256  void setup();
257 
259  void tear_down();
260  public:
263 
266  void test_disk_locked_no_stellar_evolution();
267 
270  void test_disk_locked_with_stellar_evolution();
271 
277  void test_no_planet_evolution();
278 
286  //
289  void test_unlocked_evolution();
290 
294  void test_locked_evolution();
295 
299  void test_disklocked_to_locked_to_noplanet();
300 
304  void test_disklocked_to_fast_to_noplanet();
305 
309  void test_disklocked_to_fast_to_locked();
310 
314  void test_disklocked_to_locked_to_fast();
315 
320  void test_polar_1_0_evolution();
321 
328  void test_polar_2_0_evolution();
329 
346  void test_oblique_1_0_evolution();
347 
350  void test_oblique_2_0_evolution();
351  };//End test_OrbitSolver class.
352 
353 }//End Evolve namespace.
354 
355 
356 #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
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-6, double max_step_factor=1e-3)
Add a planet to the given star and evolve, returning the solver.
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.
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...