forked from imark83/rkcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrk.hpp
33 lines (26 loc) · 1.01 KB
/
rk.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __RK_HPP__
#define __RK_HPP__
// performs an RK step. Returns -1 if rejected,
// otherwise returns FACTOR for next step size
// typedef void (*cardioFun)(double, double*, double*, double*);
#include "variable.hpp"
#define MAX(i,j) ( ((i) > (j)) ? (i) : (j) )
#define MIN(i,j) ( ((i) > (j)) ? (j) : (i) )
void computeStages (int nvar, // number of variables
Variable rkStage[], // RK stages
Variable x[], // integrated variable
double t, // integration variable
double h, // step size
double *pars); // parameters
// cardioFun f);
//
void rk(int nvar, // number of variables of dependent variable
Variable x[], // dependent variable
double t0, // initial time
double tf, // end time
double denseStep, // dense step for output
double *pars, // parameters
double tol, // parameters
int event, // variable to compute poincare sections. -1 none
double eventVal); // poincare section value
#endif