YANEFramework 1.1.0

Class of Runge Kutta 4 solver for differential equation systems.
Public Member Functions  
virtual int  acceptedSteps () 
Function to obtain the number of accepted steps of the solver.  
void  calc (double t, double *rpar=0, int *ipar=0) 
Function to compute the solution of the dynamic.  
virtual OdeSolveFirst *  clone () 
Function to construct a clone of the object derived from the class yane::OdeSolve::OdeSolve.  
virtual int  computedSteps () 
Function to obtain the number of computed steps of the solver.  
virtual int  functionEvalCount () 
Function to obtain the number of function evaluations.  
void  init (double t0, double *y0) 
Function to set the initial values for the differential or difference equation system solver.  
void  refreshConfig () 
Function to refresh the configuration of the object.  
virtual int  rejectedSteps () 
Function to obtain the number of rejected steps of the solver.  
void  reset (OdeFunction *func, OdeConfig *config) 
Function to initialize the object.  
void  resize (int dimension) 
Function to change the size of the dynamic of the system.  
RK4 (double h)  
Constructor.  
virtual void  setStepsize (double h) 
Function to set the step size of the Runge Kutta 4 method.  
virtual double  stepsize (void) 
Function to obtain the stepsize.  
Protected Member Functions  
virtual void  abstractCalc (double t, double *rpar=0, int *ipar=0) 
Function to abstract the computation of the solution of the differential equation or difference equation.  
virtual void  assertConfig () 
Function to check the configuration of the object.  
virtual void  assertMemory () 
Function to abstract the allocation of memory which are required by object classes derived from this class.  
virtual void  assertValidDGL (OdeFunction *dgl) 
Function to check whether the current differential equation or difference equation can be solved by the yane::OdeSolve::OdeSolve object.  
Protected Attributes  
double  _atol 
Absolute error tolerance.  
double *  _atol_vec 
Vector of absolute error tolerances.  
OdeConfig *  _config 
Pointer of the configuration object.  
yane::Utils::Uuid *  _config_id 
Pointer for configuration identifier.  
int  _did 
Error flag:
 
int  _dimension 
Dimension of the state variable of the system.  
OdeFunction *  _func 
Pointer of the differential or difference equation.  
double  _h 
Step size.  
bool  _initial_value_set 
Decision variable to check if an initial value has been assigned.  
int  _itol 
Decision variable
 
int *  _iwork 
Array for integer variables.  
int  _liwork 
Size of array for integer variables.  
int  _lwork 
Size of array for double variables.  
T_ODEPARAMS  _paramdata 
Structure of differential equation or difference equation data.  
double  _rtol 
Relative error tolerance.  
double *  _rtol_vec 
Vector of relative error tolerances.  
int  _steps 
Step counter.  
double  _t 
Current time instance.  
double *  _work 
Array for double variables.  
double *  _y 
Current state vector.  
double *  _y2 
Auxilliary variables to save the state vector. 
LIB_EXPORT yane::OdeSolve::RK4::RK4  (  double  h  ) 
h  Step size of the Heun method 
LIB_EXPORT void yane::OdeSolve::RK4::abstractCalc  (  double  t, 
double *  rpar = 0 , 

int *  ipar = 0 

)  [protected, virtual] 
t  Terminal time for solving the differential or difference equation problem 
rpar  Array of double parameters 
ipar  Array of integer parameters 
NoInitialValueException  Is thrown if no initial value has been supplied 
WrongSolverInputException  Is thrown if parameters are incorrect 
TooManyStepsException  Is thrown if the maximal allowed number of steps is reached 
TooSmallStepSizeException  Is thrown if the current step size becomes too small 
StiffException  Is thrown if the system appears to be too stiff for the solver 
yane::Utils::NotInitializedException  Is thrown if the solver has not been initialized 
Implements yane::OdeSolve::OdeSolve.
LIB_EXPORT int yane::OdeSolve::RK4::acceptedSteps  (  )  [virtual] 
Implements yane::OdeSolve::OdeSolve.
LIB_EXPORT void yane::OdeSolve::RK4::assertValidDGL  (  OdeFunction *  dgl  )  [protected, virtual] 
IncompatibleDGLException  Is thrown if the current differential equation or difference equation cannot be solved by the yane::OdeSolve::OdeSolve object 
Reimplemented from yane::OdeSolve::OdeSolve.
LIB_EXPORT void yane::OdeSolve::OdeSolve::calc  (  double  t, 
double *  rpar = 0 , 

int *  ipar = 0 

)  [inherited] 
This function solves the differential or difference equation problem up to a supplied time instant. Internally, the function calls the function yane::OdeSolve::OdeSolve::abstractCalc which is given by the solver supplied to this object.
t  Terminal time for solving the differential or difference equation problem 
rpar  Array of double parameters 
ipar  Array of integer parameters 
noInitialValueException  Is thrown if no initial value has been supplied 
yane::Utils::NotInitializedException  Is thrown if the solver has not been initialized 
LIB_EXPORT yane::OdeSolve::OdeSolveFirst * yane::OdeSolve::RK4::clone  (  )  [virtual] 
This abstract function clone the object derived from the yane::OdeSolve::OdeSolve. Note that the new instance is constructed but not initialized. Hence, the function yane::OdeSolve::OdeSolve::reset and yane::OdeSolve::OdeSolve::init must be called prior to using this object. In a similar manner, the user must delete this object himself. It is not delete if the object which has been cloned is deleted.
Implements yane::OdeSolve::OdeSolveFirst.
LIB_EXPORT int yane::OdeSolve::RK4::computedSteps  (  )  [virtual] 
Implements yane::OdeSolve::OdeSolve.
LIB_EXPORT int yane::OdeSolve::RK4::functionEvalCount  (  )  [virtual] 
Implements yane::OdeSolve::OdeSolve.
LIB_EXPORT void yane::OdeSolve::OdeSolveFirst::init  (  double  t0, 
double *  y0  
)  [inherited] 
t0  Initial time 
y0  Initial state vector. On exit, this variable contrains the solution at the terminal time instance. 
yane::Utils::NotInitializedException  Is thrown if the solver has not been initialized 
LIB_EXPORT void yane::OdeSolve::OdeSolve::refreshConfig  (  )  [inherited] 
This function refreshed the configuration of the object. This may be necessary if the user cannot be sure that data within the yane::OdeSolve::OdeConfig object have been changed since the last call of yane::OdeSolve::OdeSolve::reset. Hence, this data should be handed over to the solver.
The function checks if the configuration has been changed and refreshes it using the internal function yane::OdeSolve::OdeSolve::assertConfig.
yane::Utils::NotInitializedException  Is thrown if the solver has not been initialized 
LIB_EXPORT int yane::OdeSolve::RK4::rejectedSteps  (  )  [virtual] 
Implements yane::OdeSolve::OdeSolve.
LIB_EXPORT void yane::OdeSolve::OdeSolve::reset  (  OdeFunction *  func, 
OdeConfig *  config  
)  [inherited] 
This function initializes the object and provides the dynamic of the system as well as the configuration. The size of the problem is set according to the data contained in the OdeFunction object.
func  Pointer of the dynamic of the system 
config  Pointer of the configuration object 
yane::Utils::MemoryException  Is thrown if the memory allocation failed 
WrongSolverInputException  Is thrown if a null pointer is provided to the routine 
OdeSolEx  Is thrown if an error occured during the allocation or configuration of the differential equation solver 
IncompatibleConfigException  Is thrown if an error occured during the configuration of the differential equation solver 
LIB_EXPORT void yane::OdeSolve::OdeSolve::resize  (  int  dimension  )  [inherited] 
This function can be used to efficiently change the size of the dynamic of the system. The size of the dynamic must ont be larger than the dimension of the problem set within the yane::OdeSolve::OdeFunction object. Note that the object must be initialized with a call of yane::OdeSolve::OdeSolve::reset and that calling this method results in an update of the configuration of the object.
dimension  New size of the dynamic of the problem 
WrongSolverInputException  Is thrown if the new size or the system is too large or less or equal to zero 
yane::Utils::NotInitializedException  Is thrown if the solver has not been initialized 
LIB_EXPORT void yane::OdeSolve::RK4::setStepsize  (  double  h  )  [virtual] 
h  Step size of the Heun method 