Solve an initial-value ODE problems on a grid given an adaptive ODE stepper. More...
#include <ode_iv_solve.h>
This class works as similar to ode_iv_solve::solve_store() except that the solution is stored on a grid of points in the independent variable specified by the user, at the cost of taking extra steps to ensure that function values, derivatives, and errors are computed at each grid point.
There is an example for the usage of this class in examples/ex_ode.cpp
documented in the Ordinary differential equations example section.
Definition at line 673 of file ode_iv_solve.h.
Public Attributes | |
bool | err_nonconv |
If true, call the error handler if the solution does not converge (default true) | |
Protected Member Functions | |
virtual int | print_iter (double x, size_t nv, mat_row_t &y) |
Print out iteration information. | |
Protected Attributes | |
astep_base< mat_row_t, mat_row_t, mat_row_t, func_t > * | astp |
The adaptive stepper. | |
Main solver function | |
int | verbose |
Set output level. | |
size_t | ntrial |
Maximum number of applications of the adaptive stepper (default 1000) | |
size_t | nsteps |
Number of adaptive steps employed. | |
template<class vec_t , class mat_t > | |
int | solve_grid (double h, size_t n, size_t nsol, vec_t &xsol, mat_t &ysol, mat_t &err_sol, mat_t &dydx_sol, func_t &derivs) |
Solve the initial-value problem from x0 to x1 over a grid storing derivatives and errors. More... | |
The adaptive stepper | |
bool | exit_on_fail |
If true, stop the solution if the adaptive stepper fails (default true) | |
astep_gsl< mat_row_t, mat_row_t, mat_row_t, func_t > | gsl_astp |
The default adaptive stepper. | |
int | set_astep (astep_base< mat_row_t, mat_row_t, mat_row_t, func_t > &as) |
Set the adaptive stepper to use. | |
virtual const char * | type () |
Return the type, "ode_iv_solve" . | |
|
inline |
Initially, xsol
should be an array of size nsol
, and ysol
should be a ubmatrix
of size [nsol][n]. This function never takes a step larger than the grid size.
If verbose is greater than zero, The solution at each grid point will be written to std::cout
. If verbose is greater than one, a character will be required after each point.
Definition at line 733 of file ode_iv_solve.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).