Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
SecondaryDeathCondition.cpp
1 #define BUILDING_LIBRARY
3 #include "BinarySystem.h"
4 
5 namespace Evolve {
6 
7  std::valarray<double> SecondaryDeathCondition::operator()(
9 #ifndef NDEBUG
10  evol_mode
11 #endif
12  ,
13  const std::valarray<double> &orbit,
14  const std::valarray<double> &derivatives,
15  std::valarray<double> &stop_deriv) const
16  {
17  assert(evol_mode == Core::BINARY);
18  assert(orbit.size() == (1
19  +
21  -
23  assert(orbit.size() == derivatives.size());
24 
25  double min_semimajor = __system.minimum_separation(),
26  semimajor = __system.semimajor(),
27  e = __system.eccentricity(),
28  dsemimajor_dt = derivatives[0],
29  de_dt = derivatives[1];
30  if(__system.number_locked_zones() == 0)
31  dsemimajor_dt *= semimajor/(6.5 * orbit[0]);
32  stop_deriv.resize(
33  1,
34  (
35  (1.0 - e) * (
36  dsemimajor_dt * min_semimajor
37  -
38  semimajor * __system.minimum_separation(true)
39  )
40  -
41  semimajor * min_semimajor * de_dt
42  )
43  /
44  std::pow(min_semimajor, 2));
45 #ifdef VERBOSE_DEBUG
46  std::cerr << "amin = " << min_semimajor
47  << ", a = " << semimajor
48  << ", da/dt = " << dsemimajor_dt
49  << ", e = " << e
50  << ", de/dt = " << de_dt
51  << ", d(death cond)/dt: " << stop_deriv[0] << std::endl;
52 #endif
53  return std::valarray<double>(
54  (semimajor * (1 - e) - min_semimajor) / min_semimajor,
55  1
56  );
57  }
58 
59  void SecondaryDeathCondition::reached(short deriv_sign,
60  unsigned index)
61  {
62  assert(index == 0);
63  assert(deriv_sign == -1);
64 
65  StoppingCondition::reached(deriv_sign, index);
67  }
68 
69  std::string SecondaryDeathCondition::describe(int ) const
70  {
71  std::ostringstream description;
72  description << "Semimajor axis crossing death boundary of "
74  return description.str();
75  }
76 
77 } //End Evolve namespace.
BinarySystem & __system
The system this condition is attached to.
virtual double minimum_separation(bool deriv=false) const
Smallest semimajor axis at which the secondary can survive for the latest system configuration.
Orientations of zones of bodies in a binary system.
void reached(short deriv_sign, unsigned index=0)
See StoppingCondition::reached().
unsigned number_locked_zones() const
How many zones on either body are currently locked.
Definition: BinarySystem.h:848
virtual void secondary_died()
Update the system to account for the death of the secondary.
virtual std::string describe(int index=-1) const
See StoppingCondition::describe().
Defines the BinarySystem class.
Declares a stopping condition class monitoring for the death of the secondary object.
EvolModeType
The various evolution modes.
Definition: Common.h:42
std::valarray< double > operator()(Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, std::valarray< double > &stop_deriv) const
The difference between the semimajor axis and the larger of the roche radius and the stellar radius d...
double semimajor() const
The current semimajor axis of the system.
Definition: BinarySystem.h:852
unsigned number_zones() const
The total number of zones in both system bodies.
Definition: BinarySystem.h:842
double eccentricity() const
The current eccentricity of the system.
Definition: BinarySystem.h:855
virtual void reached(short deriv_sign, unsigned index=0)
Called when a stopping condition has been reached by the evolution.