RungeKutta4 Class Reference
[Mathematical algorithms]

#include <RungeKutta4.hpp>

Inheritance diagram for RungeKutta4:

Inheritance graph
[legend]
Collaboration diagram for RungeKutta4:

Collaboration graph
[legend]
List of all members.

Detailed Description

The RungeKutta4 class provides a collection of integration routines that work on a Matrix of doubles.

Integrations use a fixed step-size.

Definition at line 50 of file RungeKutta4.hpp.

Public Member Functions

 RungeKutta4 (const Matrix< double > &initialState, double initialTime=0, double timeEpsilon=1e-18)
 Constructor.
void integrateTo (double nextTime, double stepSize=0)
 The classic Runge Kutta 4th Order Integration Algorithm.
void integrateTo (double nextTime, Matrix< double > &error, double stepSize=0)
 The classic Runge Kutta 4th-5th Order Integration Algorithm.
virtual gpstk::Matrix< double > & derivative (long double time, const gpstk::Matrix< double > &inState, gpstk::Matrix< double > &inStateDot)=0
 This is the function to be integrated.
double getTime (void)
 Return the currnet time of the system.
const Matrix< double > & getState (void)
 Return the current state of the system.

Protected Attributes

double currentTime
 Current time of the system.
gpstk::Matrix< double > currentState
 State of the system at the current time.
double teps
int M
int N


Constructor & Destructor Documentation

RungeKutta4 const Matrix< double > &  initialState,
double  initialTime = 0,
double  timeEpsilon = 1e-18
[inline]
 

Constructor.

Parameters:
initalState a reference to the original Matrix to work on that is copied to an internal Matrix.
initialTime the time at which to begin integrations
timeEpsilon how close the final internal timestep must match the specified final time of an integration

Definition at line 60 of file RungeKutta4.hpp.


Member Function Documentation

virtual gpstk::Matrix<double>& derivative long double  time,
const gpstk::Matrix< double > &  inState,
gpstk::Matrix< double > &  inStateDot
[pure virtual]
 

This is the function to be integrated.

Parameters:
time the time at which to evaluate the derivative
inState the Matrix to evaluate the derivative of at /a time.
inStateDot the derivative of /a inState evaluated at /a time.
Returns:
a reference to /a inStateDot

Implemented in PendulumIntegrator.

Referenced by RungeKutta4::integrateTo().

const Matrix<double>& getState void   )  [inline]
 

Return the current state of the system.

Definition at line 107 of file RungeKutta4.hpp.

Referenced by main().

double getTime void   )  [inline]
 

Return the currnet time of the system.

Definition at line 103 of file RungeKutta4.hpp.

Referenced by main().

void integrateTo double  nextTime,
Matrix< double > &  error,
double  stepSize = 0
 

The classic Runge Kutta 4th-5th Order Integration Algorithm.

This function integrates by applying a 4th order Runge Kutta algorithm multiple times. This provides two benefits. First, an estimate of the truncation error is returned. Second, the multiple 4th order estimates are combined to produce the 5th order estimate.

Parameters:
nextTime the time to integrate to
error the Matrix of estimated integration error (one for each element)
stepSize the amount time between internal integration steps

Definition at line 78 of file RungeKutta4.cpp.

References RungeKutta4::currentState, and RungeKutta4::integrateTo().

void integrateTo double  nextTime,
double  stepSize = 0
 

The classic Runge Kutta 4th Order Integration Algorithm.

This routine integrates using a Runge Kutta 4th order algorithm with a fixed step from the internal time to nextTime.

Parameters:
nextTime the time to integrate to
stepSize the amount time between internal integration steps

Definition at line 34 of file RungeKutta4.cpp.

References RungeKutta4::currentState, and RungeKutta4::derivative().

Referenced by RungeKutta4::integrateTo(), and main().


Member Data Documentation

gpstk::Matrix<double> currentState [protected]
 

State of the system at the current time.

Definition at line 116 of file RungeKutta4.hpp.

Referenced by RungeKutta4::integrateTo().

double currentTime [protected]
 

Current time of the system.

Definition at line 113 of file RungeKutta4.hpp.

int M [protected]
 

Definition at line 119 of file RungeKutta4.hpp.

int N [protected]
 

Definition at line 120 of file RungeKutta4.hpp.

double teps [protected]
 

Definition at line 118 of file RungeKutta4.hpp.


The documentation for this class was generated from the following files:
Generated on Wed Sep 8 03:31:43 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1