SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
smile::COrbitRuntimeTrajectory Class Reference

Class for recording orbit trajectory and doing various analysis (frequency, Lyapunov exponent, etc). More...

#include <orbitan.h>

Inheritance diagram for smile::COrbitRuntimeTrajectory:
Inheritance graph
[legend]
Collaboration diagram for smile::COrbitRuntimeTrajectory:
Collaboration graph
[legend]

Public Member Functions

 COrbitRuntimeTrajectory (const COrbit *_orbit)
 constructor for an empty orbit
 
template<typename NumT >
 COrbitRuntimeTrajectory (const COrbit *_orbit, const std::vector< CPosVelPoint< NumT > > &_traj, double _timeStep)
 constructor for an existing trajectory
 
virtual FNCTYPE FncType () const
 derived classes return their type
 
virtual STEPRESULT Timestep (const double told, const double t, CPosVelPoint< double > *vars)
 the following method is called after each timestep. More...
 
virtual CBasicInformationgetData () const
 returns the collected data as an instance of an information object
 
template<typename NumT >
COrbitInformation< NumT > * analyzeOrbit (size_t start, size_t count, CSpectrum *spec_lines=NULL, vectord *spec_ampl=NULL) const
 extract frequencies and perform orbit classification. More...
 
size_t getTrajSize () const
 returns the number of points in recorded trajectory
 
const CPosVelPoint< double > & getTraj (size_t index) const
 retrieve a point from trajectory
 
double getTimeStep () const
 return time interval between consecutive trajectory points
 
double getLnDevVec (size_t index) const
 return the logarithm of magnitude of the deviation vector
 
double getMaxDist (size_t start=0, size_t count=0) const
 return max distance between adjacent points in the given interval
 
- Public Member Functions inherited from smile::CBasicOrbitRuntimeFnc
 CBasicOrbitRuntimeFnc (const COrbit *_orbit)
 constructs instance and initializes some internal data
 
virtual ~CBasicOrbitRuntimeFnc ()
 destroys all necessary internal data
 
virtual void Finish ()
 called when integration is finished, performs cleanup/postprocessing but doesn't destroy collected data
 

Public Attributes

vectord energy
 
vectord enertime
 

Private Member Functions

double calcLambda () const
 estimate Lyapunov exponent
 
std::string performOrbitAnalysis (size_t start, size_t count, CSpectrum spec_lines[N_DIM], vectord spec_ampl[N_DIM], double Lavg[N_DIM], double Lvar[N_DIM]) const
 perform orbit classification based on its spectrum and angular momentum More...
 
void findLines (size_t start, size_t count, CSpectrum spec_lines[N_DIM], vectord spec_ampl[N_DIM]) const
 finds spectral lines in each coordinate. More...
 
void calcLFCCoverInterval (size_t start, size_t count, double leadfreq[N_DIM]) const
 calculate LFCCs over a part of orbit or the entire orbit. More...
 
double calcLFCCdiffusion (size_t start, size_t count) const
 evaluate the rate of diffusion of leading frequencies over a given interval (entire orbit by default)
 
void calcInertiaOverInterval (size_t start, size_t count, double inertia[N_DIM]) const
 compute the inertia tensor of the orbit or part of it. More...
 

Private Attributes

const unsigned int N_dim
 copied from orbit->potential->N_dim, for convenience
 
double timeUnit
 
double timeStep
 copied from orbit->timeUnit, timeUnit*samplingInterval
 
CPosVelDataDouble traj
 stores entire trajectory
 
vectord lnw
 stores ln(|w|) - norm of deviation vector, lambda - finite-time Lyapunov exponent
 
double Einit
 
double Ediff
 initial energy and energy conservation error by the end of integration
 
unsigned int numSteps
 counts the number of steps taken, to check energy conservation every Ncheck-th step
 

Additional Inherited Members

- Public Types inherited from smile::CBasicOrbitRuntimeFnc
enum  FNCTYPE {
  FT_TRAJ_ANALYSIS, FT_TRAJ_SAMPLE, FT_POINCARE, FT_PERICENTER,
  FT_SCHW, FT_VEL_PERTURBER
}
 lists all possible runtime functions More...
 
enum  STEPRESULT { SR_CONTINUE, SR_TERMINATE, SR_REINIT }
 result of processing of a timestep More...
 
- Protected Attributes inherited from smile::CBasicOrbitRuntimeFnc
const COrbitorbit
 pointer to the orbit that is being integrated
 

Detailed Description

Class for recording orbit trajectory and doing various analysis (frequency, Lyapunov exponent, etc).

It records the trajectory at equal intervals of time (specified by timeStep), and upon completion performs frequency analysis and extracts other information, like the orbit class, chaotic properties, etc. The trajectory itself is used in computing these properties, but not returned in the COrbitInformation class.

Member Function Documentation

template<typename NumT >
template COrbitInformation< double > * smile::COrbitRuntimeTrajectory::analyzeOrbit< double > ( size_t  start,
size_t  count,
CSpectrum spec_lines = NULL,
vectord spec_ampl = NULL 
) const

extract frequencies and perform orbit classification.

by default operate on the entire whole orbit, but may use part of orbit as well.

Returns
a COrbitInformation object with all computed parameters
Parameters
[in]startthe first point of the interval to be analyzed
[in]countduration of the interval to be analyzed; 0 means entire orbit
[out]spec_lineslist of spectral lines found for each coordinate; if NULL then no output is given
[out]spec_amplentire spectrum (amplitudes only) for each coordinate; if NULL then no output is given
void smile::COrbitRuntimeTrajectory::calcInertiaOverInterval ( size_t  start,
size_t  count,
double  inertia[N_DIM] 
) const
private

compute the inertia tensor of the orbit or part of it.

Parameters
[in]startis the first point to analyze,
[in]countis the length of the interval to analyze;
[out]inertiais the array of mean-square values of each coordinate, which are directly related to the components of inertia tensor.
void smile::COrbitRuntimeTrajectory::calcLFCCoverInterval ( size_t  start,
size_t  count,
double  leadfreq[N_DIM] 
) const
private

calculate LFCCs over a part of orbit or the entire orbit.

Parameters
[in]startis the first point to analyze,
[in]countis the length of the interval to analyze;
[out]leadfreqis the array of leading frequencies in Cartesian coordinates.
void smile::COrbitRuntimeTrajectory::findLines ( size_t  start,
size_t  count,
CSpectrum  spec_lines[N_DIM],
vectord  spec_ampl[N_DIM] 
) const
private

finds spectral lines in each coordinate.

uses CBasicSpectrumAnalyzer to find all lines, then sort them in appropriate order taking into account axis ordering and base frequency of a long-axis orbit.

Parameters
[in]startis the first point to analyze,
[in]countis the length of the interval to analyze;
[out]spec_linesis the array of sorted spectral lines;
[out]spec_amplcontains the amplitudes of entire spectrum if not NULL.
std::string smile::COrbitRuntimeTrajectory::performOrbitAnalysis ( size_t  start,
size_t  count,
CSpectrum  spec_lines[N_DIM],
vectord  spec_ampl[N_DIM],
double  Lavg[N_DIM],
double  Lvar[N_DIM] 
) const
private

perform orbit classification based on its spectrum and angular momentum

Returns
a string with the description of orbit class
Parameters
[in]startspecifies the first point of the interval to be analyzed
[in]countduration of the interval to analyze
[out]spec_lineslist of spectral lines found for each coordinate
[out]spec_amplentire spectrum (amplitudes only) for each coordinate; if NULL then no output is given
[out]Lavgaverage values of angular momentum for each coordinate
[out]Lvarstd.dev. of angular momentum in each coord
CBasicOrbitRuntimeFnc::STEPRESULT smile::COrbitRuntimeTrajectory::Timestep ( const double  told,
const double  tcur,
CPosVelPoint< double > *  vars 
)
virtual

the following method is called after each timestep.

Parameters
[in]toldis the value of time at the beginning of the timestep
[in]tcuris the time at the end of timestep
[in,out]varsare the phase-space variables at the end of timestep; the function may change them and return SR_REINIT to indicate that the ODE integrator needs to be restarted.

This procedure may call orbit->getPos() and orbit->getVel() to get interpolated coordinates on the interval [told, tcur].

Returns
true if integration may be finished right now [default], false if needs to continue. (the ultimate decision is taken by orbit integration routine and may ignore the demands of runtime functions)

Implements smile::CBasicOrbitRuntimeFnc.


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