13 gam = 0.33414236706805043;
15 a21 = 0.66828473413610087;
16 a31 = 0.5852480389573658; a32 = -0.048594008221492802;
17 a41 = -0.61719233202999775; a42 = -0.83995264476522158; a43 = 0.62641917900148600;
18 a51 = 3.5406887484552165; a52 = 0.65991497772646308; a53 = -0.63661180895697222; a54 = -1.1945984675295562;
19 a61 = 0.80783664328582613; a62 = 0.10194631616818569; a63 = -0.078396778850607012; a64 = -0.044341977375427388; a65 = 0.013074732797453325;
21 c21 = -5.8308828523185086;
22 c31 = -4.0175939515896193; c32 = 0.43970131925236112;
23 c41 = 7.7228006257490299; c42 = 4.3368108251435758; c43 = -2.8219574578033366;
24 c51 = -1.0516225114542007; c52 = -0.58853585181331353; c53 = 2.0433794587212771; c54 = 5.0098631723809151;
25 c61 = -6.7357785372199458; c62 = -0.53593889506199845; c63 = 0.38622517020810987; c64 = 0.21066472713931598; c65 = -0.053546655670373728;
27 m1 = 11.358660043232931; m2 = -6.9896898855829058; m3 = -4.5967580421042947; m4 = -3.7220984696531517; m5 = 0.96012685868421520; m6 = 12.953396234292936;
30void OdeROW6A::step_ (
double dt) {
55 for (i=0; i<
neq_; i++)
rhs_[i] = dt*
k_[1][i] + c21*
k_[0][i];
68 for (i=0; i<
neq_; i++)
rhs_[i] = dt*
k_[2][i] + c31*
k_[0][i]
83 for (i=0; i<
neq_; i++)
rhs_[i] = dt*
k_[3][i] + c41*
k_[0][i]
100 for (i=0; i<
neq_; i++)
rhs_[i] = dt*
k_[4][i] + c51*
k_[0][i]
119 for (i=0; i<
neq_; i++)
rhs_[i] = dt*
k_[5][i] + c61*
k_[0][i]
130 for (i=0; i<
neq_; i++)
Base class implementing solver functions with adaptive time steps.
void ode_jac_(double *solin, double **Jout)
wrapper, calls ode_jac() and increments nJac;
unsigned long neq_
number of equations in the system of ODEs
double ** Jac_
storage for the ODE system's Jacobian matrix, only allocated for the methods that need it
std::string method_
the "name" of the solver/method, as in "Euler" or "RK4"
double * sol_
array for the solution, changing over time
void ode_fun_(double *solin, double *fout)
wrapper, calls ode_fun() and increases the neval counter by one
OdeROW6A(unsigned long neq)
constructs
Base class for Rosenbrock methods.
void prep_jac(double **Jac, unsigned long n, double dt, int *p)
do necessary arithmetic with the Jacobian then lu factor it
int * p_
permutation array for LU factorization
double ** k_
stage derivatives
double * soltemp_
temporary sol vector
double * rhs_
right hand side of matrix equations
double gam
parameter multipying Jacobian or single diagonal gamma
void ode_solve_LU(double **LU, int *p, double *b, int n, double *out)
Solves a matrix equation where the matrix has already be crout LU decomposed.