SMILE
v2.5
Schwarzschild Modelling Interactive expLoratory Environment
|
Class for recording orbit trajectory and doing various analysis (frequency, Lyapunov exponent, etc). More...
#include <orbitan.h>
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 CBasicInformation * | getData () 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 COrbit * | orbit |
pointer to the orbit that is being integrated | |
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.
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.
[in] | start | the first point of the interval to be analyzed |
[in] | count | duration of the interval to be analyzed; 0 means entire orbit |
[out] | spec_lines | list of spectral lines found for each coordinate; if NULL then no output is given |
[out] | spec_ampl | entire spectrum (amplitudes only) for each coordinate; if NULL then no output is given |
|
private |
compute the inertia tensor of the orbit or part of it.
[in] | start | is the first point to analyze, |
[in] | count | is the length of the interval to analyze; |
[out] | inertia | is the array of mean-square values of each coordinate, which are directly related to the components of inertia tensor. |
|
private |
calculate LFCCs over a part of orbit or the entire orbit.
[in] | start | is the first point to analyze, |
[in] | count | is the length of the interval to analyze; |
[out] | leadfreq | is the array of leading frequencies in Cartesian coordinates. |
|
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.
[in] | start | is the first point to analyze, |
[in] | count | is the length of the interval to analyze; |
[out] | spec_lines | is the array of sorted spectral lines; |
[out] | spec_ampl | contains the amplitudes of entire spectrum if not NULL. |
|
private |
perform orbit classification based on its spectrum and angular momentum
[in] | start | specifies the first point of the interval to be analyzed |
[in] | count | duration of the interval to analyze |
[out] | spec_lines | list of spectral lines found for each coordinate |
[out] | spec_ampl | entire spectrum (amplitudes only) for each coordinate; if NULL then no output is given |
[out] | Lavg | average values of angular momentum for each coordinate |
[out] | Lvar | std.dev. of angular momentum in each coord |
|
virtual |
the following method is called after each timestep.
[in] | told | is the value of time at the beginning of the timestep |
[in] | tcur | is the time at the end of timestep |
[in,out] | vars | are 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].
Implements smile::CBasicOrbitRuntimeFnc.