CLASS  5.1
Fuel Cycle Simulator
DynamicalSystem.hxx
Go to the documentation of this file.
1 #ifndef _DynamicalSystem_
2 #define _DynamicalSystem_
3 
8 #include <math.h>
9 #include <vector>
10 
11 
12 using namespace std;
13 
14 //-----------------------------------------------------------------------------//
15 
16 
17 
19 
31 //________________________________________________________________________
32 
34 {
35  public :
36 
37  DynamicalSystem();
38  DynamicalSystem(const DynamicalSystem & DS);
39  virtual ~DynamicalSystem();
40 
45  int GetNumberOfEquationSize(){return fNVar;}
46  void SetNumberOfEquationSize(int n){fNVar = n;}
47 
48 
54 
55  void SetPrecision(double eps = 1e-5){fPrecision = eps;}
56 
58 
64  void SetForbidNegativeValue(){fIsNegativeValueAllowed = false;}
65 
67 
72  void RungeKutta(double *YStart, double t1, double t2, int EquationNumber);
73 
75 
81  virtual void BuildEqns(double t, double *Y, double *dYdt){}
82 
84 
89 
91 
92  protected :
94 
102  void RK4(double *y, double *dydx, double x, double h, double *yout);
104 
115  void AdaptStepSize(double *y, double *dydx, double *x, double htry, double eps, double *yscal, double *hdid, double *hnext);
116 
117  int fNVar;
118  double fPrecision;
119  double fHestimate;
120  double fHmin;
121  double fMaxHdid;
122  double fMinHdid;
124 };
125 
126 #endif
127 
void SetPrecision(double eps=1e-5)
set RK precision to change the integration step
Definition: DynamicalSystem.hxx:55
int GetNumberOfEquationSize()
return the number of equations.
Definition: DynamicalSystem.hxx:45
double fPrecision
Precision of the RungeKutta.
Definition: DynamicalSystem.hxx:118
double fMaxHdid
store the effective RK max step
Definition: DynamicalSystem.hxx:121
Definition: CLASSBackEndDict.cxx:37
double fMinHdid
store the effective RK min step
Definition: DynamicalSystem.hxx:122
double fHestimate
RK Step estimation.
Definition: DynamicalSystem.hxx:119
virtual void BuildEqns(double t, double *Y, double *dYdt)
Builds the equations for integration.
Definition: DynamicalSystem.hxx:81
void SetNumberOfEquationSize(int n)
set the number of equations.
Definition: DynamicalSystem.hxx:46
DynamicalSystem class solves system of differential equations.
Definition: DynamicalSystem.hxx:33
void SetForbidNegativeValue()
Forbid negative value during integration.
Definition: DynamicalSystem.hxx:64
double fHmin
RK minimum Step.
Definition: DynamicalSystem.hxx:120
int fNVar
The size of the composition vector and /or number of ZAIs involved.
Definition: DynamicalSystem.hxx:117
bool fIsNegativeValueAllowed
whether or not negative value are physical.
Definition: DynamicalSystem.hxx:123