Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
ConservedLEObliquityEvolution.h
Go to the documentation of this file.
1 
10 #ifndef __CONSERVED_LE_OBLIQUITY_EVOLUTION_H
11 #define __CONSERVED_LE_OBLIQUITY_EVOLUTION_H
12 
13 #include "../../Core/Functions.h"
14 #include "../../Core/InterpSolutionIterator.h"
15 
17 private:
20 
23 
27 
30 
32  double value(double lconv) const
33  {
34  return std::acos((__total2_minus_orbital2 - lconv * lconv)
35  /
36  (2.0 * lconv * __orbital_angmom));
37  }
38 
39 public:
42  const Core::OneArgumentDiffFunction &lconv_evol,
43 
45  double orbital_angmom,
46 
48  double total_angmom,
49 
51  double disk_lifetime
52  ) :
53  __lconv_evol(lconv_evol),
54  __orbital_angmom(orbital_angmom),
55  __total2_minus_orbital2(std::pow(total_angmom, 2)
56  -
57  std::pow(orbital_angmom, 2)),
58  __disk_lifetime(disk_lifetime)
59  {}
60 
61  double operator()(double age) const
62  {
63  return (age < __disk_lifetime
64  ? 0.0
65  : value(__lconv_evol(age)));
66  }
67 
68  double range_high() const {return __lconv_evol.range_high();}
69  double range_low() const {return __lconv_evol.range_low();}
70 
72  {
74  "Finding all solutinos of ConservedLEConvObliquityEvolution "
75  "not supported!"
76  );
77  };
78 
85  const Core::FunctionDerivatives *deriv(double age) const
86  {
88  "Derivatives not implemented for 1-0 obliquity evolution."
89  );
90  if(age < __disk_lifetime)
91  return new Core::CubicSplineDerivatives(0.0, 0.0, 0.0);
92  const Core::FunctionDerivatives *lconv_deriv = __lconv_evol.deriv(age);
93  double obliquity = value(lconv_deriv->order(0)),
94  order1 = - 1.0 / std::sin(obliquity) * (
95  __total2_minus_orbital2
96  /
97  (2.0 * __orbital_angmom * std::pow(lconv_deriv->order(0), 2))
98  -
99  1.0 / (2.0 * __orbital_angmom)
100  ),
101  order2;
102  delete lconv_deriv;
103  return new Core::CubicSplineDerivatives(obliquity, order1, order2);
104  }
105 
106 };
107 
109 private:
112 
115 
118 
121 
125 
128 
130  double value(
132  double lconv,
133 
135  double conv_obliq
136  ) const
137  {
138  double lconv_perp = lconv * std::sin(conv_obliq),
139  lconv_par = lconv * std::cos(conv_obliq),
140  repeated = (std::pow(__orbital_angmom, 2)
141  +
142  std::pow(lconv, 2)
143  +
144  2.0 * __orbital_angmom * lconv_par);
145 
146  return __initial_obliquity - std::acos(
147  (
148  (__orbital_angmom + lconv_par)
149  *
150  std::sqrt(
151  repeated
152  -
153  std::pow(__initial_lconv_perp, 2)
154  )
155  +
156  __initial_lconv_perp * lconv_perp
157  )
158  /
159  repeated
160  );
161  }
162 
163 public:
166  const Core::OneArgumentDiffFunction &lconv_evol,
167 
169  const ConservedLEConvObliquityEvolution &conv_obliq_evol,
170 
172  double orbital_angmom,
173 
175  double disk_lifetime
176  ) :
177  __lconv_evol(lconv_evol),
178  __conv_obliq_evol(conv_obliq_evol),
179  __orbital_angmom(orbital_angmom),
180  __initial_obliquity(conv_obliq_evol(disk_lifetime)),
181  __initial_lconv_perp(lconv_evol(disk_lifetime)
182  *
183  std::sin(__initial_obliquity)),
184  __disk_lifetime(disk_lifetime)
185  {}
186 
187  double operator()(double age) const
188  {
189  return (age < __disk_lifetime
190  ? 0.0
191  : value(__lconv_evol(age), __conv_obliq_evol(age)));
192  }
193 
194  double range_high() const {return std::min(__lconv_evol.range_high(),
195  __conv_obliq_evol.range_high());}
196  double range_low() const {return std::max(__lconv_evol.range_low(),
197  __conv_obliq_evol.range_low());}
198 
202  {
203  throw Core::Error::Runtime(
204  "Solving ConservedLERadObliquityEvolution not implemented!"
205  );
206  };
207 
214  const Core::FunctionDerivatives *deriv(double) const
215  {
216  throw Core::Error::Runtime(
217  "Differentiating ConservedLERadObliquityEvolution not implemented!"
218  );
219  }
220 };
221 
222 #endif
double __disk_lifetime
The lifetime to assume for the disk before evolution starts.
double __orbital_angmom
The orbital angular momentum (does not evolve).
double range_low() const
The upper end of the range over which the function is defined.
const Core::OneArgumentDiffFunction & __lconv_evol
The evolution of the convective zone angular momentum.
Definition: Common.cpp:10
double operator()(double age) const
The value of the function at the given abscissa.
A class representing a once differentiable function of a single argument.
Definition: Functions.h:104
double operator()(double age) const
The value of the function at the given abscissa.
double __initial_lconv_perp
The initial component of the convective zone angular momentum perpendicular to the orbital angular mo...
const Core::OneArgumentDiffFunction & __lconv_evol
The evolution of the convective zone angular momentum.
const Core::FunctionDerivatives * deriv(double) const
Returns a pointer to the derivative of the function.
Any runtime error.
Definition: Error.h:61
virtual double order(unsigned deriv_order=1) const =0
Derivative of the given order of the function with respect to its argument.
An iterator over a set of solutions to an interpolating function.
double __orbital_angmom
The orbital angular momentum magnitude (does not evolve).
Core::InterpSolutionIterator crossings(double=0) const
An iterator over the abscissas where the function takes the given y value.
ConservedLEConvObliquityEvolution(const Core::OneArgumentDiffFunction &lconv_evol, double orbital_angmom, double total_angmom, double disk_lifetime)
double value(double lconv) const
The value of the obliquity for the given convective angular momentum.
double value(double lconv, double conv_obliq) const
The radiative zone obliquity for the given parameters.
double __initial_obliquity
The obliquity at the time the disk dissipates.
double range_low() const
The upper end of the range over which the function is defined.
A class representing arbitrary order derivatives of a function.
Definition: Functions.h:66
Core::InterpSolutionIterator crossings(double=0) const
An iterator over the abscissas where the function takes the given y value.
A class for the derivatives of a cubic spline (=0 for order>2).
Definition: Functions.h:77
double __disk_lifetime
See ConservedLEConvObliquityEvolution::__disk_lifetime.
ConservedLERadObliquityEvolution(const Core::OneArgumentDiffFunction &lconv_evol, const ConservedLEConvObliquityEvolution &conv_obliq_evol, double orbital_angmom, double disk_lifetime)
double range_high() const
The lower end of the range over which the function is defined.
const Core::FunctionDerivatives * deriv(double age) const
Returns a pointer to the derivative of the function.
double range_high() const
The lower end of the range over which the function is defined.
const ConservedLEConvObliquityEvolution & __conv_obliq_evol
The evolution of the convective zone obliquity.
virtual const FunctionDerivatives * deriv(double x) const =0
Returns a pointer to the derivative of the function.
virtual InputDataType range_high() const =0
The lower end of the range over which the function is defined.
virtual InputDataType range_low() const =0
The upper end of the range over which the function is defined.