DynamicalSystem class solves system of differential equations.
More...
#include <DynamicalSystem.hxx>
|
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...
|
|
DynamicalSystem class solves system of differential equations.
A DynamicalSystem is a base class that solves system differential equations of 1st order.
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
◆ DynamicalSystem() [1/2]
DynamicalSystem::DynamicalSystem |
( |
| ) |
|
◆ DynamicalSystem() [2/2]
◆ ~DynamicalSystem()
DynamicalSystem::~DynamicalSystem |
( |
| ) |
|
|
virtual |
◆ AdaptStepSize()
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 |
◆ BuildEqns()
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 IM_RK4.
◆ GetNumberOfEquationSize()
int DynamicalSystem::GetNumberOfEquationSize |
( |
| ) |
|
|
inline |
return the number of equations.
◆ RK4()
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 |
◆ RungeKutta()
void DynamicalSystem::RungeKutta |
( |
double * |
YStart, |
|
|
double |
t1, |
|
|
double |
t2, |
|
|
int |
EquationNumber |
|
) |
| |
Runge Kutta calling method.
- Parameters
-
YStart | input : the initial condition Y(t1) ; output the final value Y(t2) |
t1 | initial time |
t2 | final time |
◆ SetForbidNegativeValue()
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.
◆ SetNumberOfEquationSize()
void DynamicalSystem::SetNumberOfEquationSize |
( |
int |
n | ) |
|
|
inline |
set the number of equations.
◆ SetPrecision()
void DynamicalSystem::SetPrecision |
( |
double |
eps = 1e-5 | ) |
|
|
inline |
set RK precision to change the integration step
◆ fHestimate
double DynamicalSystem::fHestimate |
|
protected |
◆ fHmin
double DynamicalSystem::fHmin |
|
protected |
◆ fIsNegativeValueAllowed
bool DynamicalSystem::fIsNegativeValueAllowed |
|
protected |
whether or not negative value are physical.
◆ fMaxHdid
double DynamicalSystem::fMaxHdid |
|
protected |
store the effective RK max step
◆ fMinHdid
double DynamicalSystem::fMinHdid |
|
protected |
store the effective RK min step
◆ fNVar
int DynamicalSystem::fNVar |
|
protected |
The size of the composition vector and /or number of ZAIs involved.
◆ fPrecision
double DynamicalSystem::fPrecision |
|
protected |
Precision of the RungeKutta.
The documentation for this class was generated from the following files: