KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVRungeKutta.h
Go to the documentation of this file.
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 
49 class KVRungeKutta : public KVBase {
50  static Double_t a2, a3, a4, a5, a6, b21;
51  static Double_t b31, b32, b41, b42, b43;
52  static Double_t b51, b52, b53, b54;
53  static Double_t b61, b62, b63;
54  static Double_t b64, b65, c1 ;
55  static Double_t c3, c4, c6;
56  static Double_t dc5;
57 protected:
63 
66  Double_t* ak2, *ak3, *ak4, *ak5, *ak6;
70  virtual void rkqs(Double_t htry);
71  virtual void rkck(Double_t h);
72 
73 public:
75  KVRungeKutta(Int_t N, Double_t PREC = 1.e-8, Double_t MINSTEP = 0.0);
76  virtual ~KVRungeKutta();
77 
78  virtual void Integrate(Double_t* ystart, Double_t x1, Double_t x2, Double_t h1);
79 
83  virtual void CalcDerivs(Double_t X, Double_t* Y, Double_t* DYDX) = 0;
84 
86  {
88  return nok;
89  }
91  {
93  return nbad;
94  }
95  Bool_t IsOK() const
96  {
98  return fOK;
99  }
100 
101  ClassDef(KVRungeKutta, 0) //Adaptive step-size 4th order Runge-Kutta ODE integrator from Numerical Recipes
102 };
103 
104 #endif
int Int_t
bool Bool_t
double Double_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:141
Adaptive step-size 4th order Runge-Kutta ODE integrator from Numerical Recipes.
Definition: KVRungeKutta.h:49
static Double_t a3
Definition: KVRungeKutta.h:50
Int_t GetNGoodSteps() const
Definition: KVRungeKutta.h:85
static Double_t b31
Definition: KVRungeKutta.h:51
virtual void rkck(Double_t h)
Int_t nvar
number of independent variables/equations
Definition: KVRungeKutta.h:58
Bool_t IsOK() const
Definition: KVRungeKutta.h:95
static Double_t b54
Definition: KVRungeKutta.h:52
Bool_t fInitialDeriv
Definition: KVRungeKutta.h:69
virtual void CalcDerivs(Double_t X, Double_t *Y, Double_t *DYDX)=0
static Double_t dc5
Definition: KVRungeKutta.h:56
Double_t * dydx
Definition: KVRungeKutta.h:64
static Double_t a2
Definition: KVRungeKutta.h:50
Double_t * yout
Definition: KVRungeKutta.h:64
static Double_t b32
Definition: KVRungeKutta.h:51
Double_t eps
precision required
Definition: KVRungeKutta.h:59
static Double_t b52
Definition: KVRungeKutta.h:52
Double_t * ak5
Definition: KVRungeKutta.h:66
virtual void rkqs(Double_t htry)
Double_t * ak2
Definition: KVRungeKutta.h:66
static Double_t b51
Definition: KVRungeKutta.h:52
Double_t hdid
Definition: KVRungeKutta.h:65
Double_t * ak4
Definition: KVRungeKutta.h:66
Double_t hnext
Definition: KVRungeKutta.h:65
static Double_t b41
Definition: KVRungeKutta.h:51
Double_t * ytemp
Definition: KVRungeKutta.h:64
Double_t * yscal
Definition: KVRungeKutta.h:64
static Double_t b53
Definition: KVRungeKutta.h:52
static Double_t c4
Definition: KVRungeKutta.h:55
static Double_t b65
Definition: KVRungeKutta.h:54
Double_t hmin
minimum allowed step size
Definition: KVRungeKutta.h:60
static Double_t b63
Definition: KVRungeKutta.h:53
Double_t dc6
Definition: KVRungeKutta.h:67
static Double_t b42
Definition: KVRungeKutta.h:51
static Double_t c6
Definition: KVRungeKutta.h:55
static Double_t b61
Definition: KVRungeKutta.h:53
static Double_t b21
Definition: KVRungeKutta.h:50
static Double_t b64
Definition: KVRungeKutta.h:54
static Double_t b62
Definition: KVRungeKutta.h:53
Int_t nbad
number of bad steps taken
Definition: KVRungeKutta.h:62
Double_t dc4
Definition: KVRungeKutta.h:67
static Double_t a5
Definition: KVRungeKutta.h:50
Double_t * yerr
Definition: KVRungeKutta.h:64
static Double_t b43
Definition: KVRungeKutta.h:51
virtual ~KVRungeKutta()
Destructor.
static Double_t a6
Definition: KVRungeKutta.h:50
static Double_t c1
Definition: KVRungeKutta.h:54
Int_t GetNBadSteps() const
Definition: KVRungeKutta.h:90
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:61
static Double_t a4
Definition: KVRungeKutta.h:50
Double_t dc3
Definition: KVRungeKutta.h:67
Double_t * ak3
Definition: KVRungeKutta.h:66
Double_t dc1
Definition: KVRungeKutta.h:67
Double_t x
Definition: KVRungeKutta.h:65
Double_t * y
Definition: KVRungeKutta.h:64
Double_t * ak6
Definition: KVRungeKutta.h:66
static Double_t c3
Definition: KVRungeKutta.h:55