7void NewtonRadauIIA5::f_Newton (
double *x,
double *y) {
14 for (n=0; n<
nk_; n++) {
16 for (i=0; i<
neq_; i++) {
27void NewtonRadauIIA5::J_Newton (
double *x,
double **J) {
36 for (n=0; n<
nk_; n++) {
39 for (i=0; i<
neq_; i++) {
47 for (i=0; i<
neq_; i++) {
48 for (j=0; j<
neq_; j++) {
49 for (m=0; m<
nk_; m++) {
68 for (
int i=0; i<nk; i++) a[i] =
new double[nk];
73 a[0][0] = (88 - 7*r)/360; a[0][1] = (296 - 169*r)/1800; a[0][2] = (-2 + 3*r)/225;
74 a[1][0] = (296 + 169*r)/1800; a[1][1] = (88 + 7*r)/360; a[1][2] = (-2 - 3*r)/225;
75 a[2][0] = (16 - r)/36; a[2][1] = (16 + r)/36; a[2][2] = 1.0/9;
77 b[0] = (16 - r)/36; b[1] = (16 + r)/36; b[2] = 1.0/9;
84 for (
int i=0; i<
nk_; i++)
delete [] a[i];
89void OdeRadauIIA5::step_ (
double dt) {
97 for (i=0; i<
neq_; i++)
sol_[i] += dt*(b[0]*
k_[0][i]
Nonlinear system solver for OdeRadauIIA5.
Base class implementing solver functions with adaptive time steps.
unsigned long neq_
number of equations in the system of ODEs
std::string method_
the "name" of the solver/method, as in "Euler" or "RK4"
double * sol_
array for the solution, changing over time
Provides a large vector containing the slope values of all stages with pointers to each of the indivi...
double ** k_
individual k arrays for each stage
int nk_
number of RK stages
double * kall_
pointer to single array storing all stage k values
double ** Jac_
pointer to the solver's Jacobian matrix
void fun(double *solin, double *fout)
wrapper around system evaluation function
unsigned long neq_
ODE system size.
double * dt_
pointer to time step member
void jac(double *solin, double **Jout)
wrapper around Jacobian evaluation function
double * ftemp_
temporary values for evaluation of Newton function
double * sol_
pointer to the solver's solution vector
double * soltemp_
temporary solution values
void set_modified(bool modified)
sets whether modified Newtion's is being used
int solve_Newton(double *x)
Solve the system of equations.
bool get_modified()
gets whether modified Newtion's is being used
int nk_
number of stages or k vectors
double ** a
pointer to tableau coefficients
double ** k_
pointer to the stage slopes of RK methods
OdeRadauIIA5(unsigned long neq)
constructs