Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
TransformedSolution.cpp
1 #include "TransformedSolution.h"
2 
3 namespace Evolve {
4 
6  const std::vector<const Core::OneArgumentDiffFunction *> &transforms,
7  double change_age
8  )
9  {
10  for(unsigned q = 0; q < NUM_REAL_QUANTITIES - 1; ++q)
11  __transforms[q].push_back(transforms[q]);
12 
13  __change_ages.push_back(change_age);
14  }
15 
16  const std::vector< const std::list<double> * > &
18  const std::vector< const std::list<double> * > &solution
19  )
20  {
22  __transformed_orbit[AGE] = solution[AGE];
23 
24  for(unsigned q = 0; q < NUM_REAL_QUANTITIES - 1; ++q) {
25 
27 
28  if(solution[q]) {
29  std::list<double>::const_iterator
30  change_i = __change_ages.begin();
31  change_i++;
32  std::list<const Core::OneArgumentDiffFunction *>::const_iterator
33  transform_i = __transforms[q].begin();
34 
35  std::list<double> *transformed_quantity = new std::list<double>();
36  for(
37  std::list<double>::const_iterator
38  var_i = solution[q]->begin(),
39  // deriv_i = deriv->begin(),
40  t_i = solution[AGE]->begin();
41  var_i != solution[q]->end();
42  ++var_i,
43  // ++deriv_i,
44  ++t_i
45  ) {
46  if(change_i != __change_ages.end() && *t_i >= *change_i) {
47  ++transform_i;
48  ++change_i;
49  }
50  transformed_quantity->push_back((**transform_i)(*var_i));
51  /* const FunctionDerivatives *dvar = (*transform_i)->deriv(*var_i);
52  __transformed_orbit[var_type].push_back(dvar->order(0));
53  __transformed_deriv[var_type].push_back(dvar->order(1)
54  *
55  (*deriv_i));*/
56  }
57  __transformed_orbit[q] = transformed_quantity;
58  } else {
59  __transformed_orbit[q] = NULL;
60  }
61  }
62  return __transformed_orbit;
63  }
64 
66  {
67  for(unsigned q = 0; q < NUM_REAL_QUANTITIES - 1; ++q)
69  }
70 
71 }//End Evolve namespace.
const std::vector< const std::list< double > *> & operator()(const std::vector< const std::list< double > * > &solution)
Apply this transformatiot to the given solution.
Declare a class that transforms an orbital solution before checking.
std::vector< const std::list< double > * > __transformed_orbit
The transformed orbit values.
Orientations of zones of bodies in a binary system.
AGE
The derivative w.r.t. age, excluding the dependence through the body&#39;s radius and the moments of iner...
std::list< double > __change_ages
The boundaries between consecutive trasformation functions.
std::vector< std::list< const Core::OneArgumentDiffFunction * > > __transforms
The transformed derivatives.
~TransformedSolution()
The derivative of a transformed variable at the tabulated ages.
void add_transformation(const std::vector< const Core::OneArgumentDiffFunction *> &transforms, double change_age)
Add more pieces to the transformation.