KaliVeda
Toolkit for HIC analysis
KVRungeKutta.h
1 
4 #ifndef __KVRUNGEKUTTA_H
5 #define __KVRUNGEKUTTA_H
6 
7 #include "KVBase.h"
8 
9 #define SAFETY 0.9
10 #define PGROW -0.2
11 #define PSHRNK -0.25
12 #define ERRCON 1.89e-4
13 #define MAXSTP 10000
14 #define TINY 1.0e-30
15 
16 /*The value ERRCON equals (5/SAFETY) raised to the power (1/PGROW), see use below.*/
17 
50 class KVRungeKutta : public KVBase {
51  static Double_t a2, a3, a4, a5, a6, b21;
52  static Double_t b31, b32, b41, b42, b43;
53  static Double_t b51, b52, b53, b54;
54  static Double_t b61, b62, b63;
55  static Double_t b64, b65, c1 ;
56  static Double_t c3, c4, c6;
57  static Double_t dc5;
58 protected:
64 
67  Double_t* ak2, *ak3, *ak4, *ak5, *ak6;
71  virtual void rkqs(Double_t htry);
72  virtual void rkck(Double_t h);
73 
74 public:
76  KVRungeKutta(Int_t N, Double_t PREC = 1.e-8, Double_t MINSTEP = 0.0);
77  virtual ~KVRungeKutta();
78 
79  virtual void Integrate(Double_t* ystart, Double_t x1, Double_t x2, Double_t h1);
80 
84  virtual void CalcDerivs(Double_t X, Double_t* Y, Double_t* DYDX) = 0;
85 
87  {
89  return nok;
90  }
92  {
94  return nbad;
95  }
96  Bool_t IsOK() const
97  {
99  return fOK;
100  }
101 
102  ClassDef(KVRungeKutta, 0) //Adaptive step-size 4th order Runge-Kutta ODE integrator from Numerical Recipes
103 };
104 
105 #endif
int Int_t
bool Bool_t
double Double_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:142
Adaptive step-size 4th order Runge-Kutta ODE integrator from Numerical Recipes.
Definition: KVRungeKutta.h:50
static Double_t a3
Definition: KVRungeKutta.h:51
Int_t GetNGoodSteps() const
Definition: KVRungeKutta.h:86
static Double_t b31
Definition: KVRungeKutta.h:52
virtual void rkck(Double_t h)
Int_t nvar
number of independent variables/equations
Definition: KVRungeKutta.h:59
Bool_t IsOK() const
Definition: KVRungeKutta.h:96
static Double_t b54
Definition: KVRungeKutta.h:53
Bool_t fInitialDeriv
Definition: KVRungeKutta.h:70
virtual void CalcDerivs(Double_t X, Double_t *Y, Double_t *DYDX)=0
static Double_t dc5
Definition: KVRungeKutta.h:57
Double_t * dydx
Definition: KVRungeKutta.h:65
static Double_t a2
Definition: KVRungeKutta.h:51
Double_t * yout
Definition: KVRungeKutta.h:65
static Double_t b32
Definition: KVRungeKutta.h:52
Double_t eps
precision required
Definition: KVRungeKutta.h:60
static Double_t b52
Definition: KVRungeKutta.h:53
Double_t * ak5
Definition: KVRungeKutta.h:67
virtual void rkqs(Double_t htry)
Double_t * ak2
Definition: KVRungeKutta.h:67
static Double_t b51
Definition: KVRungeKutta.h:53
Double_t hdid
Definition: KVRungeKutta.h:66
Double_t * ak4
Definition: KVRungeKutta.h:67
Double_t hnext
Definition: KVRungeKutta.h:66
static Double_t b41
Definition: KVRungeKutta.h:52
Double_t * ytemp
Definition: KVRungeKutta.h:65
Double_t * yscal
Definition: KVRungeKutta.h:65
static Double_t b53
Definition: KVRungeKutta.h:53
static Double_t c4
Definition: KVRungeKutta.h:56
static Double_t b65
Definition: KVRungeKutta.h:55
Double_t hmin
minimum allowed step size
Definition: KVRungeKutta.h:61
static Double_t b63
Definition: KVRungeKutta.h:54
Double_t dc6
Definition: KVRungeKutta.h:68
static Double_t b42
Definition: KVRungeKutta.h:52
static Double_t c6
Definition: KVRungeKutta.h:56
static Double_t b61
Definition: KVRungeKutta.h:54
static Double_t b21
Definition: KVRungeKutta.h:51
static Double_t b64
Definition: KVRungeKutta.h:55
static Double_t b62
Definition: KVRungeKutta.h:54
Int_t nbad
number of bad steps taken
Definition: KVRungeKutta.h:63
Double_t dc4
Definition: KVRungeKutta.h:68
static Double_t a5
Definition: KVRungeKutta.h:51
Double_t * yerr
Definition: KVRungeKutta.h:65
static Double_t b43
Definition: KVRungeKutta.h:52
virtual ~KVRungeKutta()
Destructor.
static Double_t a6
Definition: KVRungeKutta.h:51
static Double_t c1
Definition: KVRungeKutta.h:55
Int_t GetNBadSteps() const
Definition: KVRungeKutta.h:91
virtual void Integrate(Double_t *ystart, Double_t x1, Double_t x2, Double_t h1)
Int_t nok
number of good steps taken
Definition: KVRungeKutta.h:62
static Double_t a4
Definition: KVRungeKutta.h:51
Double_t dc3
Definition: KVRungeKutta.h:68
Double_t * ak3
Definition: KVRungeKutta.h:67
Double_t dc1
Definition: KVRungeKutta.h:68
Double_t x
Definition: KVRungeKutta.h:66
Double_t * y
Definition: KVRungeKutta.h:65
Double_t * ak6
Definition: KVRungeKutta.h:67
static Double_t c3
Definition: KVRungeKutta.h:56