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 thatsolves system of 1st order of differential equations.
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::DynamicalSystem |
( |
| ) |
|
DynamicalSystem::~DynamicalSystem |
( |
| ) |
|
|
virtual |
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
double DynamicalSystem::fHestimate |
|
protected |
double DynamicalSystem::fHmin |
|
protected |
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: