MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DynamicalSystem Class Reference

DynamicalSystem class solves system of differential equations. More...

#include <DynamicalSystem.hxx>

Inheritance diagram for DynamicalSystem:
EvolutiveSystem

Public Member Functions

 DynamicalSystem ()
 Normal Constructor. More...
 
 DynamicalSystem (const DynamicalSystem &DS)
 Copy Constructor. More...
 
virtual ~DynamicalSystem ()
 Destructor. More...
 
Mains attributes of the DynamicalSystem
int GetNumberOfEquationSize ()
 return the number of equations. More...
 
void SetNumberOfEquationSize (int n)
 set the number of equations. More...
 
Runge-Kutta related methods

Algorithms are taken from Numerical Receipes.

void SetPrecision (double eps=1e-5)
 set RK precision to change the integration step More...
 
void SetForbidNegativeValue ()
 Forbid negative value during integration. More...
 
void RungeKutta (double *YStart, double t1, double t2)
 Runge Kutta calling method. More...
 
virtual void BuildEqns (double t, double *Y, double *dYdt)
 Builds the equations for integration. More...
 

Protected Member Functions

void RK4 (double *y, double *dydx, double x, double h, double *yout)
 Runge Kutta main method. More...
 
void AdaptStepSize (double *y, double *dydx, double *x, double htry, double eps, double *yscal, double *hdid, double *hnext)
 Adaptative Step Size method for RK. More...
 

Protected Attributes

int fNVar
 The size of the composition vector and /or number of ZAIs involved. More...
 
double fPrecision
 Precision of the RungeKutta. More...
 
double fHestimate
 RK Step estimation. More...
 
double fHmin
 RK minimum Step. More...
 
double fMaxHdid
 store the effective RK max step More...
 
double fMinHdid
 store the effective RK min step More...
 
bool fIsNegativeValueAllowed
 whether or not negative value are physical. More...
 

Detailed Description

DynamicalSystem class solves system of differential equations.

A DynamicalSystem is a base class thatsolves system of 1st order of differential equations.

\[ \frac{d\vec{Y}}{dt}=A\vec{Y}\]

The differential equations are built in DynamicalSystem::BuildEqns ; the method MUST be defined in the derived classes. In this first version only Runge-Kutta method is implemented, but the aim of this class is to provide also other methods such as CRAM (Chebyshev rational approximation method).

Author
PTO.
Version
1.0

Constructor & Destructor Documentation

DynamicalSystem::DynamicalSystem ( )

Normal Constructor.

DynamicalSystem::DynamicalSystem ( const DynamicalSystem DS)

Copy Constructor.

DynamicalSystem::~DynamicalSystem ( )
virtual

Destructor.

Member Function Documentation

void DynamicalSystem::AdaptStepSize ( double *  y,
double *  dydx,
double *  x,
double  htry,
double  eps,
double *  yscal,
double *  hdid,
double *  hnext 
)
protected

Adaptative Step Size method for RK.

Call by RK4

Parameters
y: initial values to integrate
dydx: ode's equations (variable is x)
x: new value of the variable after the adaptative step
htry: try step size for integration
eps: precision
yscal: result after hdid step integration
hdid: did step size for integration
hnext: next step size for integration
virtual void DynamicalSystem::BuildEqns ( double  t,
double *  Y,
double *  dYdt 
)
inlinevirtual

Builds the equations for integration.

This method is an abstract method ; it MUST be overwritten by derived classes.
Parameters
t: time at which the equations are built
Y: array of variable at time t
dYdt: ode's variable.

Reimplemented in EvolutiveSystem.

int DynamicalSystem::GetNumberOfEquationSize ( )
inline

return the number of equations.

void DynamicalSystem::RK4 ( double *  y,
double *  dydx,
double  x,
double  h,
double *  yout 
)
protected

Runge Kutta main method.

Call by RungeKutta

Parameters
y: initial values to integrate
dydx: ode's equations (variable is x)
x: variable of integration
h: step size for integration
yout: result after integration
void DynamicalSystem::RungeKutta ( double *  YStart,
double  t1,
double  t2 
)

Runge Kutta calling method.

Parameters
YStart: input : the initial condition Y(t1) ; output the final value Y(t2)
t1: initial time
t2: final time
void DynamicalSystem::SetForbidNegativeValue ( )
inline

Forbid negative value during integration.

For some quantities (such as nuclei composition), negative values are forbidden. But, due to integration step and very fast variation of the integrated variables Runge-Kutta wil produce very small negative value. This method is used to force negative value to be zero.

void DynamicalSystem::SetNumberOfEquationSize ( int  n)
inline

set the number of equations.

void DynamicalSystem::SetPrecision ( double  eps = 1e-5)
inline

set RK precision to change the integration step

Member Data Documentation

double DynamicalSystem::fHestimate
protected

RK Step estimation.

double DynamicalSystem::fHmin
protected

RK minimum Step.

bool DynamicalSystem::fIsNegativeValueAllowed
protected

whether or not negative value are physical.

double DynamicalSystem::fMaxHdid
protected

store the effective RK max step

double DynamicalSystem::fMinHdid
protected

store the effective RK min step

int DynamicalSystem::fNVar
protected

The size of the composition vector and /or number of ZAIs involved.

double DynamicalSystem::fPrecision
protected

Precision of the RungeKutta.


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

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014