Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
InverseLinearLconvEvolution.h
Go to the documentation of this file.
1 
10 #ifndef __INVERSE_LINEAR_LCONV_EVOLUTION_H
11 #define __INVERSE_LINEAR_LCONV_EVOLUTION_H
12 
13 #include "InverseFunction.h"
14 
15 template<class LINEAR_QUANTITY_TYPE>
17 private:
18  double
21 
25 
28  LINEAR_QUANTITY_TYPE __linear_quantity;
29 
32 
33 public:
36  double disk_lifetime,
37 
39  double total_angmom,
40 
42  double orbital_angmom,
43 
45  double initial_conv_angmom,
46 
48  double evolution_rate
49  ) :
50  __disk_lifetime(disk_lifetime),
51  __evolution_rate(evolution_rate),
52  __linear_quantity(total_angmom, orbital_angmom, initial_conv_angmom),
53  __find_lconv(__linear_quantity,
54  (
55  (total_angmom - orbital_angmom)
56  *
57  (1.0 + 100.0 * std::numeric_limits<double>::epsilon())
58  ),
59  initial_conv_angmom)
60  {}
61 
64  double operator()(double age) const
65  {
66  return __find_lconv(
67  std::min(0.0, -(age - __disk_lifetime) * __evolution_rate)
68  );
69  }
70 
72  double disk_lifetime() const {return __disk_lifetime;}
73 
74  double range_high() const
75  {return __find_lconv.range_high() / __evolution_rate;}
76 
77  double range_low() const
78  {return -Core::Inf;}
79 
83  {
85  "Finding all solutinos of ConservedLELconvEvolution not supported!"
86  );
87  };
88 
95  const Core::FunctionDerivatives *deriv(double age) const
96  {
97  if(age <= __disk_lifetime)
99  0.0,
100  0.0);
101  const Core::FunctionDerivatives *scaled_deriv = __find_lconv.deriv(
102  -(age - __disk_lifetime) * __evolution_rate
103  );
104  double value = scaled_deriv->order(0),
105  order1 = -scaled_deriv->order(1) * __evolution_rate,
106  order2 = scaled_deriv->order(2) * std::pow(__evolution_rate, 2);
107  delete scaled_deriv;
108  return new Core::CubicSplineDerivatives(value, order1, order2);
109  }
110 };
111 
112 
113 #endif
InverseLinearLconvEvolution(double disk_lifetime, double total_angmom, double orbital_angmom, double initial_conv_angmom, double evolution_rate)
Declarses a class for functions that are the inverse of some analytical function. ...
Definition: Common.cpp:10
A class representing a once differentiable function of a single argument.
Definition: Functions.h:104
double operator()(double age) const
Return the expected value for the stellar convective angular momentum at the given age...
Core::InterpSolutionIterator crossings(double=0) const
An iterator over the abscissas where the function takes the given y value.
InverseFunction __find_lconv
Evaluates to Lconv given .
double range_high() const
The lower end of the range over which the function is defined.
double __disk_lifetime
The lifetime of the protoplanetary disk.
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 range_high() const
The lower end of the range over which the function is defined is uknown.
A class representing arbitrary order derivatives of a function.
Definition: Functions.h:66
double __evolution_rate
The rate at which the linear quantity (see for example Oblique10LinearQuantity) evolves.
double range_low() const
The upper end of the range over which the function is defined.
A class for the derivatives of a cubic spline (=0 for order>2).
Definition: Functions.h:77
The invrse of an existing function.
LINEAR_QUANTITY_TYPE __linear_quantity
A function of the convective zone angular momentum which evolves linearly with time.
const Core::FunctionDerivatives * deriv(double x) const
Returns a pointer to the derivative of the function.
double disk_lifetime() const
The disk lifetime specified at construction.
const Core::FunctionDerivatives * deriv(double age) const
Returns a pointer to the derivative of the function.