#include "utl/RK5ODEIntegrator.h"
Public Member Functions | |
template<class VectorType > | |
AdaptiveRK5Iterator < DerivativeFunctor, VectorType > | AdaptiveBegin (const double x, const double dx, const VectorType &y, const double accuracy=1e-5) |
template<class VectorType , class ErrorScalingPolicy > | |
AdaptiveRK5Iterator < DerivativeFunctor, VectorType, ErrorScalingPolicy > | AdaptiveBegin (const double x, const double dx, const VectorType &y, const double accuracy, ErrorScalingPolicy &es) |
template<class VectorType > | |
RK5Iterator< DerivativeFunctor, VectorType > | Begin (const double x, const VectorType &y) |
DerivativeFunctor & | GetDerivativeFunctor () |
RK5ODEIntegrator (DerivativeFunctor &d) | |
Private Attributes | |
DerivativeFunctor & | fDerivativeFunctor |
This class prepares the integration of the Ordinary Differential Equations (ODE) of the form
for .
ODE is defined through an function class with operator() defined (usualy such classes are called functor in C++). This functor has to define the operator() and unsigned int cast operator:
Operator() calculates derivatives of variables
with respect to the independent variable x.
The cast operator unsigned int() returns number of OD equations (in this example 10).
The class RK5ODEIntegrator returns an iterator that can be advanced with operator += dx for some step dx in independent variable.
Next to the iterator (similar to the RK4Iterator) there is also AdaptiveRK5Iterator available which maintains the accuracy of the result by taking steps of optimal size;
Note that the suitable candidates for template parameter VectorType are vector classes with fixed size (std::vector<> is not appropriate since the default constructor leaves the object with zero size) that support the operator[] for element access. You can use the C-style arrays double[n] or Offline class utl::SVectorType<n>.
See also utl::RK4ODEIntegrator and testODEIntegrator.cc for a real examples.
Definition at line 407 of file RK5ODEIntegrator.h.
|
inline |
Definition at line 409 of file RK5ODEIntegrator.h.
|
inline |
Definition at line 423 of file RK5ODEIntegrator.h.
References utl::RK5ODEIntegrator< DerivativeFunctor >::fDerivativeFunctor.
Referenced by main(), and TestODEIntegrator::TestAdaptiveRK5().
|
inline |
Definition at line 435 of file RK5ODEIntegrator.h.
References utl::RK5ODEIntegrator< DerivativeFunctor >::fDerivativeFunctor.
|
inline |
Definition at line 414 of file RK5ODEIntegrator.h.
References utl::RK5ODEIntegrator< DerivativeFunctor >::fDerivativeFunctor.
Referenced by main(), TestODEIntegrator::TestRK5(), and TestODEIntegrator::TestRK5SVector().
|
inline |
Definition at line 444 of file RK5ODEIntegrator.h.
References utl::RK5ODEIntegrator< DerivativeFunctor >::fDerivativeFunctor.
|
private |
Definition at line 448 of file RK5ODEIntegrator.h.
Referenced by utl::RK5ODEIntegrator< DerivativeFunctor >::AdaptiveBegin(), utl::RK5ODEIntegrator< DerivativeFunctor >::Begin(), and utl::RK5ODEIntegrator< DerivativeFunctor >::GetDerivativeFunctor().