Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Evolve::EccentricityExpansionCoefficients Class Reference

A class which reads-in and provides a convenient interface to the \(p_{m,s}\) coefficients. More...

#include <EccentricityExpansionCoefficients.h>

+ Collaboration diagram for Evolve::EccentricityExpansionCoefficients:

Public Member Functions

 EccentricityExpansionCoefficients ()
 Create an uninitialized object. More...
 
void prepare (const std::string &tabulated_pms_fname, double precision, bool pre_load, bool disable_precision_fail=false)
 Reads in tabulated expansion coefficients, making this object useable. More...
 
double get_expansion_precision () const
 Return the expansion precision set by the last call to prepare() More...
 
double interp_precision (int m, int s) const
 The guaranteed interpolation precision for a given \(p_{m,s}\). More...
 
int required_expansion_order (double e, int m) const
 Return the smallest s value such that all \(p_{m,s'}\) for. More...
 
int max_expansion_order () const
 The largest s for which \(p_{m,s'}\) is known. More...
 
std::pair< double, double > get_expansion_range (int m, int max_s) const
 Return the range of eccentricities (min, max) over which an expansion going up to given max s is valid and required. More...
 
double operator() (int m, int s, double e, bool deriv) const
 Approximate the value of \(p_{m,s}(e)\). More...
 

Private Member Functions

std::vector< double > load_coefficient (sqlite3 *db, int m, int s)
 
void set_max_s (sqlite3 *db)
 TODO: use smallest max s over m=+-2 and m=0. More...
 
void load_metadata (sqlite3 *db)
 Read the metadata for the available \(p_{m,s}\) coefficients from the databate. More...
 
void load_max_ignore_eccentricity (sqlite3 *db, double precision)
 Fill the __max_ignore_eccentricity member per the database. More...
 
double load_specific_e (int m, int s, int e_step) const
 
void get_interp_data (sqlite3 *db)
 The callback SQL function that updates the above values (__pms_interp_data) More...
 
double get_specific_e (int m, int s, int e_step) const
 Return a single tabulated value of \(p_{m,s}\). More...
 
std::vector< double > find_pms_boundary_values (int m, int s, double e) const
 
double return_known_e (int m, int s, double e) const
 
bool check_known_e (int m, int s, double e) const
 
int e_to_nearest_step (int m, int s, double e, bool flr) const
 
double step_to_e (int m, int s, int step) const
 
int current_largest_s (int m)
 
int local_index (int m, int s) const
 
std::vector< double > * which_list (int m)
 
int * which_order (int m)
 

Private Attributes

bool __useable
 
bool __allow_precision_fail
 See do_not_fail argument to prepare(). More...
 
std::vector< std::vector< double > > __pms_interp_data
 The expansion coefficients for all \(p_{m,s}\). More...
 
int __max_s
 The largest s (second) index at which all three \(p_{m,s}\) coefficients are tabulated. More...
 
double __expansion_precision
 The currently defined expansion precision (see prepare()) More...
 
bool __load_all
 Whether we load the whole database at the start (true) or part of it as needed (false) More...
 
std::vector< int > __db_pms_id
 The identifiers of particular \(p_{m,s}\) coefficients in the database. More...
 
std::vector< double > __min_e
 
std::vector< int > __num_steps
 The number of e values at which each \(p_{m,s}\) coefficient is tabulated. More...
 
std::vector< double > __max_e
 The maximum eccentricity at which each \(p_{m,s}\) coefficient can be reliably interpolated. More...
 
std::vector< double > __interp_precision
 The guaranteed interpolation precision for each \(p_{m,s}\) u coefficient. More...
 
std::string __file_name
 The name of the file contanining the interpolatiod sqlite database. More...
 
std::vector< double > __max_ignore_eccentricity
 The maximum eccentricity at which a given \(p_{m,s}\) can be ignored. More...
 

Detailed Description

A class which reads-in and provides a convenient interface to the \(p_{m,s}\) coefficients.

Definition at line 29 of file EccentricityExpansionCoefficients.h.

Constructor & Destructor Documentation

◆ EccentricityExpansionCoefficients()

Evolve::EccentricityExpansionCoefficients::EccentricityExpansionCoefficients ( )
inline

Create an uninitialized object.

Definition at line 135 of file EccentricityExpansionCoefficients.h.

Member Function Documentation

◆ get_expansion_precision()

double Evolve::EccentricityExpansionCoefficients::get_expansion_precision ( ) const
inline

Return the expansion precision set by the last call to prepare()

Definition at line 159 of file EccentricityExpansionCoefficients.h.

◆ get_expansion_range()

std::pair< double, double > Evolve::EccentricityExpansionCoefficients::get_expansion_range ( int  m,
int  max_s 
) const

Return the range of eccentricities (min, max) over which an expansion going up to given max s is valid and required.

For eccentricities below the minimum (first value of returned pair) at least \(p_{m,max_s}\) can be excluded from the expansion without violating the precision requirement. For eccentricities at or above maximum (second value of returned pair) at least \(p_{m,max_s+1}\) must be included in the series in order to satisfy the precision requirement.

Definition at line 483 of file EccentricityExpansionCoefficients.cpp.

◆ get_interp_data()

void Evolve::EccentricityExpansionCoefficients::get_interp_data ( sqlite3 *  db)
private

The callback SQL function that updates the above values (__pms_interp_data)

Definition at line 270 of file EccentricityExpansionCoefficients.cpp.

◆ get_specific_e()

double Evolve::EccentricityExpansionCoefficients::get_specific_e ( int  m,
int  s,
int  e_step 
) const
private

Return a single tabulated value of \(p_{m,s}\).

Parameters
mThe m (first) index of the expansion coefficient to get.
sThe s (second) index of the expansion coefficient to get.
e_stepThe index within the tabulated values to get

Definition at line 280 of file EccentricityExpansionCoefficients.cpp.

◆ interp_precision()

double Evolve::EccentricityExpansionCoefficients::interp_precision ( int  m,
int  s 
) const

The guaranteed interpolation precision for a given \(p_{m,s}\).

Definition at line 441 of file EccentricityExpansionCoefficients.cpp.

◆ load_max_ignore_eccentricity()

void Evolve::EccentricityExpansionCoefficients::load_max_ignore_eccentricity ( sqlite3 *  db,
double  precision 
)
private

Fill the __max_ignore_eccentricity member per the database.

Definition at line 129 of file EccentricityExpansionCoefficients.cpp.

◆ load_metadata()

void Evolve::EccentricityExpansionCoefficients::load_metadata ( sqlite3 *  db)
private

Read the metadata for the available \(p_{m,s}\) coefficients from the databate.

Definition at line 84 of file EccentricityExpansionCoefficients.cpp.

◆ max_expansion_order()

int Evolve::EccentricityExpansionCoefficients::max_expansion_order ( ) const
inline

The largest s for which \(p_{m,s'}\) is known.

Definition at line 171 of file EccentricityExpansionCoefficients.h.

◆ operator()()

double Evolve::EccentricityExpansionCoefficients::operator() ( int  m,
int  s,
double  e,
bool  deriv 
) const

Approximate the value of \(p_{m,s}(e)\).

Parameters
mThe first index (0 or +-2).
sThe second index.
eThe value of the eccentricity to use.
derivIf true the result is differentiated w.r.t. to eccentricity.

Definition at line 515 of file EccentricityExpansionCoefficients.cpp.

◆ prepare()

void Evolve::EccentricityExpansionCoefficients::prepare ( const std::string &  tabulated_pms_fname,
double  precision,
bool  pre_load,
bool  disable_precision_fail = false 
)

Reads in tabulated expansion coefficients, making this object useable.

Parameters
tabulated_pms_fnameThe name of the file to read pre-tabulated coefficients from.
precisionOnly reads the coefficients of the expansion which most closely achieves the indicated precision, erring on the side of being more precise.
pre_loadShould all data from the database be pre-loaded to avoid query each time a coefficient is evaluated. Setting to true means we keep a 9 GB database in memory.
disable_precision_failDo not throw exception if specified precision is unattainable with given tabulated coefficients, just use highest availabre order.

Definition at line 396 of file EccentricityExpansionCoefficients.cpp.

◆ required_expansion_order()

int Evolve::EccentricityExpansionCoefficients::required_expansion_order ( double  e,
int  m 
) const

Return the smallest s value such that all \(p_{m,s'}\) for.

precision requirements.

Definition at line 456 of file EccentricityExpansionCoefficients.cpp.

◆ set_max_s()

void Evolve::EccentricityExpansionCoefficients::set_max_s ( sqlite3 *  db)
private

TODO: use smallest max s over m=+-2 and m=0.

Return the highest s available for requested precision. TODO: what is this? It is possible for file to accommodate precision but only for s=0

Definition at line 54 of file EccentricityExpansionCoefficients.cpp.

Member Data Documentation

◆ __allow_precision_fail

bool Evolve::EccentricityExpansionCoefficients::__allow_precision_fail
private

See do_not_fail argument to prepare().

Definition at line 36 of file EccentricityExpansionCoefficients.h.

◆ __db_pms_id

std::vector<int> Evolve::EccentricityExpansionCoefficients::__db_pms_id
private

The identifiers of particular \(p_{m,s}\) coefficients in the database.

Definition at line 63 of file EccentricityExpansionCoefficients.h.

◆ __expansion_precision

double Evolve::EccentricityExpansionCoefficients::__expansion_precision
private

The currently defined expansion precision (see prepare())

Definition at line 55 of file EccentricityExpansionCoefficients.h.

◆ __file_name

std::string Evolve::EccentricityExpansionCoefficients::__file_name
private

The name of the file contanining the interpolatiod sqlite database.

Definition at line 83 of file EccentricityExpansionCoefficients.h.

◆ __interp_precision

std::vector<double> Evolve::EccentricityExpansionCoefficients::__interp_precision
private

The guaranteed interpolation precision for each \(p_{m,s}\) u coefficient.

Definition at line 80 of file EccentricityExpansionCoefficients.h.

◆ __load_all

bool Evolve::EccentricityExpansionCoefficients::__load_all
private

Whether we load the whole database at the start (true) or part of it as needed (false)

Definition at line 59 of file EccentricityExpansionCoefficients.h.

◆ __max_e

std::vector<double> Evolve::EccentricityExpansionCoefficients::__max_e
private

The maximum eccentricity at which each \(p_{m,s}\) coefficient can be reliably interpolated.

Definition at line 75 of file EccentricityExpansionCoefficients.h.

◆ __max_ignore_eccentricity

std::vector<double> Evolve::EccentricityExpansionCoefficients::__max_ignore_eccentricity
private

The maximum eccentricity at which a given \(p_{m,s}\) can be ignored.

The order is the same as __pms_interp_data.

Definition at line 89 of file EccentricityExpansionCoefficients.h.

◆ __max_s

int Evolve::EccentricityExpansionCoefficients::__max_s
private

The largest s (second) index at which all three \(p_{m,s}\) coefficients are tabulated.

If you're seeing this, it means I haven't properly sorted out new documentation stuff or moved new variables/functions into a better place

Definition at line 52 of file EccentricityExpansionCoefficients.h.

◆ __min_e

std::vector<double> Evolve::EccentricityExpansionCoefficients::__min_e
private

The smallest value of e for which each \(p_{m,s}\) coefficient has tabulated values.

Definition at line 67 of file EccentricityExpansionCoefficients.h.

◆ __num_steps

std::vector<int> Evolve::EccentricityExpansionCoefficients::__num_steps
private

The number of e values at which each \(p_{m,s}\) coefficient is tabulated.

Definition at line 71 of file EccentricityExpansionCoefficients.h.

◆ __pms_interp_data

std::vector< std::vector<double> > Evolve::EccentricityExpansionCoefficients::__pms_interp_data
private

The expansion coefficients for all \(p_{m,s}\).

Stored in the order m=-2,0,+2 for increasing s (m changes faster).

Definition at line 43 of file EccentricityExpansionCoefficients.h.

◆ __useable

bool Evolve::EccentricityExpansionCoefficients::__useable
private

Has this class been properly linked to a database with interpolation data?

Definition at line 33 of file EccentricityExpansionCoefficients.h.


The documentation for this class was generated from the following files: