#include <ode_iv_solve.h>
astepper
shouldn't be a member pointer instead of having the type adapt_step
be a template parameter. The present code certainly works, but prevents the user from changing the adaptive stepper for the ODE solver at runtime.astep_derivs()
?Definition at line 60 of file ode_iv_solve.h.
Public Member Functions | |
ode_iv_solve () | |
virtual | ~ode_iv_solve () |
template<class mat_t> | |
int | solve_table (double x0, double x1, double h, size_t n, vec_t &ystart, size_t &nsol, vec_t &xsol, mat_t &ysol, param_t &pa, func_t &derivs) |
Solve the initial-value problem and output a table. | |
template<class mat_t> | |
int | solve_grid (double x0, double x1, double h, size_t n, vec_t &ystart, size_t nsol, vec_t &xsol, mat_t &ysol, param_t &pa, func_t &derivs) |
Solve the initial-value problem from x0 to x1 over a grid. | |
int | solve_final_value (double x0, double x1, double h, size_t n, vec_t &ystart, vec_t ¥d, param_t &pa, func_t &derivs) |
Solve the initial-value problem to get the final value. | |
virtual const char * | type () |
Return the type, "ode_iv_solve" . | |
Data Fields | |
int | verbose |
Set output level. | |
int | ntrial |
Maximum number of steps for solve_final_value() (default 1000). | |
adapt_step | astepper |
The adaptive stepper utilized. | |
Protected Member Functions | |
virtual int | print_iter (double x, size_t nv, vec_t &y) |
Print out iteration information. |
int solve_table | ( | double | x0, | |
double | x1, | |||
double | h, | |||
size_t | n, | |||
vec_t & | ystart, | |||
size_t & | nsol, | |||
vec_t & | xsol, | |||
mat_t & | ysol, | |||
param_t & | pa, | |||
func_t & | derivs | |||
) | [inline] |
Solve the initial-value problem and output a table.
Initially, xsol
should be a vector of size nsol
, and ysol
should be a two-dimensional array (i.e. omatrix_view) of size [nsol][n]. On exit,
nsol
will will be the size of the solution table, less than or equal to the original value of nsol
.
Definition at line 82 of file ode_iv_solve.h.
int solve_grid | ( | double | x0, | |
double | x1, | |||
double | h, | |||
size_t | n, | |||
vec_t & | ystart, | |||
size_t | nsol, | |||
vec_t & | xsol, | |||
mat_t & | ysol, | |||
param_t & | pa, | |||
func_t & | derivs | |||
) | [inline] |
Solve the initial-value problem from x0
to x1
over a grid.
Initially, xsol
should be an array of size nsol
, and ysol
should be a omatrix
of size [nsol][n].
This function never takes a step larger than the grid size. This could cause inaccuracy if the grid size is too fine.
Definition at line 127 of file ode_iv_solve.h.
int solve_final_value | ( | double | x0, | |
double | x1, | |||
double | h, | |||
size_t | n, | |||
vec_t & | ystart, | |||
vec_t & | yend, | |||
param_t & | pa, | |||
func_t & | derivs | |||
) | [inline] |
Solve the initial-value problem to get the final value.
For a partiular adaptive stepper, this will likely be the fastest approach, but it provides no information about the solution other than the final value at x=x1.
Definition at line 181 of file ode_iv_solve.h.
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page