Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
StellarEvolution::PolynomialEvolutionQuantity Class Reference

An EvolvingStellar quantity that uses a polynomial instead of interpolating. More...

#include <PolynomialEvolution.h>

+ Inheritance diagram for StellarEvolution::PolynomialEvolutionQuantity:
+ Collaboration diagram for StellarEvolution::PolynomialEvolutionQuantity:

Public Member Functions

 PolynomialEvolutionQuantity (const std::valarray< double > &coefficients, double range_low, double range_high, double derivative_x=NaN)
 Create an evolving quantity or its derivative. More...
 
void select_interpolation_region (double) const
 
double operator() (double x) const
 Evaluates the polynomial at the given age. More...
 
double range_low () const
 The lower end of the range where the function is defined. More...
 
double range_high () const
 The upper end of the range where the function is defined. More...
 
virtual const std::vector< double > & discontinuities () const
 The ages at which the quantity may be discontinuous. More...
 
virtual double previous_discontinuity () const
 See StellarEvolution::EvolvingStellarQuantity::prevous_discontinuity() More...
 
virtual double next_discontinuity () const
 See StellarEvolution::EvolvingStellarQuantity::next_discontinuity() More...
 
virtual void enable_next_interpolation_region () const
 Set up the interpolation over the next interpolation region (between consecutive discontinuities.) More...
 
const Core::FunctionDerivativesderiv (double x) const
 The derivatives. More...
 
double order (unsigned deriv_order=1) const
 The order-th derivative. More...
 
std::string kind () const
 A string identifying the type of quantity this is. More...
 
- Public Member Functions inherited from StellarEvolution::EvolvingStellarQuantity
 EvolvingStellarQuantity ()
 Default constructor (only useful for derived classes which do not use the interpolation). More...
 
 EvolvingStellarQuantity (double mass, const std::valarray< double > &track_masses, The(\f$[Fe/H]\f$) for which evolution tracks are given. const std::valarray< double > &track_feh, The evolution tracks of the relevant quantity on the grid defined by \p track_masses and \p track_feh. The const std::vector< const OneArgumentDiffFunction *> &evolution_tracks, Whether the track uses log(age) as the independent argument instead of age. bool log_age=true, Whether the track is uses log(quantity) as the dependent argument instead of quantity. bool log_quantity=true, Whether this is a quantity that is identically zero below some age and turns on afterwards bool starts_zero=false)
 Create an evolving quantity that interpolates to the given mass. More...
 
brief Prepare the quantity for interpolation around the given age After calling this requesting values or derivatives outside the range of the continuous region containing this age (see ::discontinuities) fails an assert. virtual void select_interpolation_region(double age) const
 
An iterator over the ages (in Gyr) where the quantity takes the given y value. InterpSolutionIterator crossings(double=0) const
 
- Public Member Functions inherited from Core::OneArgumentFunction< double, double >
virtual InterpSolutionIterator crossings (double y=0) const=0
 An iterator over the abscissas where the function takes the given y value. More...
 
virtual ~OneArgumentFunction ()
 Provide a virtual destructor for a virtual class. More...
 

Private Attributes

std::valarray< double > __poly_coef
 The coefficients of the polynomial giving the evolution. More...
 
double __xmin
 The lower limit of the age at which this quantity can be evaluated. More...
 
double __xmax
 The upper limit of the age at which this quantity can be evaluated. More...
 
double __deriv_x
 The location at which the derivative has been requested. More...
 
std::vector< double > __empty_vector
 An empty vector to serve as the list of discontinuities. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const PolynomialEvolutionQuantity &track)
 Prints an expression of the polynomial that this track represents. More...
 

Additional Inherited Members

- Public Attributes inherited from StellarEvolution::EvolvingStellarQuantity
brief Prepare the quantity for interpolation around the given age After calling this method
 
- Protected Member Functions inherited from StellarEvolution::EvolvingStellarQuantity
virtual double age_to_interp_param (double age, double mass, double feh) const
 Return the interpoltaion parameter given age, mass and [Fe/H]. More...
 
virtual double interp_param_to_age (double interp_param, double mass, double feh) const
 Return the age in Gyrs given an interpolation parameter, mass, and [Fe/H]. More...
 
- Private Member Functions inherited from Core::FunctionDerivatives
virtual ~FunctionDerivatives ()
 Clean up. More...
 

Detailed Description

An EvolvingStellar quantity that uses a polynomial instead of interpolating.

It also serves as its own derivative.

Definition at line 28 of file PolynomialEvolution.h.

Constructor & Destructor Documentation

◆ PolynomialEvolutionQuantity()

StellarEvolution::PolynomialEvolutionQuantity::PolynomialEvolutionQuantity ( const std::valarray< double > &  coefficients,
double  range_low,
double  range_high,
double  derivative_x = NaN 
)
inline

Create an evolving quantity or its derivative.

Parameters
coefficientsThe coefficients defining the polynomial that gives the evolution of the quantity.
range_lowThe lower end of the range for which the quantity is defined.
range_highThe upper end of the range for which the quantity is defined.
derivative_xThe abscissa at which the derivatives are to be evaluated.

Definition at line 51 of file PolynomialEvolution.h.

Member Function Documentation

◆ deriv()

const Core::FunctionDerivatives* StellarEvolution::PolynomialEvolutionQuantity::deriv ( double  x) const
inlinevirtual

The derivatives.

Reimplemented from StellarEvolution::EvolvingStellarQuantity.

Definition at line 103 of file PolynomialEvolution.h.

◆ discontinuities()

virtual const std::vector<double>& StellarEvolution::PolynomialEvolutionQuantity::discontinuities ( ) const
inlinevirtual

The ages at which the quantity may be discontinuous.

Reimplemented from StellarEvolution::EvolvingStellarQuantity.

Definition at line 86 of file PolynomialEvolution.h.

◆ enable_next_interpolation_region()

virtual void StellarEvolution::PolynomialEvolutionQuantity::enable_next_interpolation_region ( ) const
inlinevirtual

Set up the interpolation over the next interpolation region (between consecutive discontinuities.)

Definition at line 99 of file PolynomialEvolution.h.

◆ kind()

std::string StellarEvolution::PolynomialEvolutionQuantity::kind ( ) const
inline

A string identifying the type of quantity this is.

Definition at line 119 of file PolynomialEvolution.h.

◆ next_discontinuity()

virtual double StellarEvolution::PolynomialEvolutionQuantity::next_discontinuity ( ) const
inlinevirtual

See StellarEvolution::EvolvingStellarQuantity::next_discontinuity()

Definition at line 95 of file PolynomialEvolution.h.

◆ operator()()

double StellarEvolution::PolynomialEvolutionQuantity::operator() ( double  x) const
inlinevirtual

Evaluates the polynomial at the given age.

Throws an exception if age is outside the range over which the quantity is defined.

Reimplemented from StellarEvolution::EvolvingStellarQuantity.

Definition at line 77 of file PolynomialEvolution.h.

◆ order()

double StellarEvolution::PolynomialEvolutionQuantity::order ( unsigned  deriv_order = 1) const
virtual

The order-th derivative.

Implements Core::FunctionDerivatives.

Definition at line 5 of file PolynomialEvolution.cpp.

◆ previous_discontinuity()

virtual double StellarEvolution::PolynomialEvolutionQuantity::previous_discontinuity ( ) const
inlinevirtual

See StellarEvolution::EvolvingStellarQuantity::prevous_discontinuity()

Definition at line 91 of file PolynomialEvolution.h.

◆ range_high()

double StellarEvolution::PolynomialEvolutionQuantity::range_high ( ) const
inlinevirtual

The upper end of the range where the function is defined.

Reimplemented from StellarEvolution::EvolvingStellarQuantity.

Definition at line 83 of file PolynomialEvolution.h.

◆ range_low()

double StellarEvolution::PolynomialEvolutionQuantity::range_low ( ) const
inlinevirtual

The lower end of the range where the function is defined.

Reimplemented from StellarEvolution::EvolvingStellarQuantity.

Definition at line 80 of file PolynomialEvolution.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const PolynomialEvolutionQuantity track 
)
friend

Prints an expression of the polynomial that this track represents.

Member Data Documentation

◆ __deriv_x

double StellarEvolution::PolynomialEvolutionQuantity::__deriv_x
mutableprivate

The location at which the derivative has been requested.

Definition at line 44 of file PolynomialEvolution.h.

◆ __empty_vector

std::vector<double> StellarEvolution::PolynomialEvolutionQuantity::__empty_vector
private

An empty vector to serve as the list of discontinuities.

Definition at line 47 of file PolynomialEvolution.h.

◆ __poly_coef

std::valarray<double> StellarEvolution::PolynomialEvolutionQuantity::__poly_coef
private

The coefficients of the polynomial giving the evolution.

Definition at line 32 of file PolynomialEvolution.h.

◆ __xmax

double StellarEvolution::PolynomialEvolutionQuantity::__xmax
private

The upper limit of the age at which this quantity can be evaluated.

Definition at line 37 of file PolynomialEvolution.h.

◆ __xmin

double StellarEvolution::PolynomialEvolutionQuantity::__xmin
private

The lower limit of the age at which this quantity can be evaluated.

Definition at line 37 of file PolynomialEvolution.h.


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