KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVRungeKutta.h
1
3
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
50class 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;
58protected:
64
71 virtual void rkqs(Double_t htry);
72 virtual void rkck(Double_t h);
73
74public:
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.
static Double_t a3
Int_t GetNGoodSteps() const
static Double_t b31
virtual void rkck(Double_t h)
Int_t nvar
number of independent variables/equations
Bool_t IsOK() const
static Double_t b54
Bool_t fInitialDeriv
virtual void CalcDerivs(Double_t X, Double_t *Y, Double_t *DYDX)=0
static Double_t dc5
Double_t * dydx
static Double_t a2
Double_t * yout
static Double_t b32
Double_t eps
precision required
static Double_t b52
Double_t * ak5
virtual void rkqs(Double_t htry)
Double_t * ak2
static Double_t b51
Double_t hdid
Double_t * ak4
Double_t hnext
static Double_t b41
Double_t * ytemp
Double_t * yscal
static Double_t b53
static Double_t c4
static Double_t b65
Double_t hmin
minimum allowed step size
static Double_t b63
Double_t dc6
static Double_t b42
static Double_t c6
static Double_t b61
static Double_t b21
static Double_t b64
static Double_t b62
Int_t nbad
number of bad steps taken
Double_t dc4
static Double_t a5
Double_t * yerr
static Double_t b43
virtual ~KVRungeKutta()
Destructor.
static Double_t a6
static Double_t c1
Int_t GetNBadSteps() const
virtual void Integrate(Double_t *ystart, Double_t x1, Double_t x2, Double_t h1)
Int_t nok
number of good steps taken
static Double_t a4
Double_t dc3
Double_t * ak3
Double_t dc1
Double_t * y
Double_t * ak6
static Double_t c3