#include <ode_iv_solve.h>
Definition at line 44 of file ode_iv_solve.h.
Public Member Functions | |
int | set_adapt_step (adapt_step< param_t, func_t, vec_t, alloc_vec_t, alloc_t > &as) |
Set the adaptive stepper to use. | |
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. | |
template<class mat_t > | |
int | solve_grid_derivs (double x0, double x1, double h, size_t n, vec_t &ystart, size_t nsol, vec_t &xsol, mat_t &ysol, mat_t &dydx_sol, param_t &pa, func_t &derivs) |
Solve the initial-value problem from x0 to x1 over a grid storing derivatives. | |
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. | |
int | solve_final_value_derivs (double x0, double x1, double h, size_t n, vec_t &ystart, vec_t ¥d, vec_t &dydx_start, vec_t &dydx_end, param_t &pa, func_t &derivs) |
Solve the initial-value problem to get the final value and derivative. | |
virtual const char * | type () |
Return the type, "ode_iv_solve" . | |
Data Fields | |
int | verbose |
Set output level. | |
size_t | nsteps_out |
Number of output points if verbose is greater than zero (default 10). | |
int | ntrial |
Maximum number of steps for solve_final_value() (default 1000). | |
bool | exit_on_fail |
If true, stop the solution if the adaptive stepper fails. | |
gsl_astep< param_t, func_t, vec_t, alloc_vec_t, alloc_t > | gsl_astp |
The default adaptive stepper. | |
Protected Member Functions | |
virtual int | print_iter (double x, size_t nv, vec_t &y) |
Print out iteration information. | |
Protected Attributes | |
alloc_vec_t | dydx |
Derivative. | |
alloc_t | ao |
Memory allocator. | |
adapt_step< param_t, func_t, vec_t, alloc_vec_t, alloc_t > * | astp |
The adaptive stepper. |
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.
If verbose is greater than zero, The solution at less than or approximately equal to nsteps_out points will be written to std::cout
. If verbose is greater than one, a character will be required after each selected point.
The solution fails if more than ntrial steps are required.
Definition at line 503 of file ode_iv_solve.h.
int solve_final_value_derivs | ( | double | x0, | |
double | x1, | |||
double | h, | |||
size_t | n, | |||
vec_t & | ystart, | |||
vec_t & | yend, | |||
vec_t & | dydx_start, | |||
vec_t & | dydx_end, | |||
param_t & | pa, | |||
func_t & | derivs | |||
) | [inline] |
Solve the initial-value problem to get the final value and derivative.
If verbose is greater than zero, The solution at less than or approximately equal to nsteps_out points will be written to std::cout
. If verbose is greater than one, a character will be required after each selected point.
The solution fails if more than ntrial steps are required.
This function will also fail if x1>x0
and h<0
or if x1<x0
but h>0
.
Definition at line 534 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 matrix
of size [nsol][n]. This function never takes a step larger than the grid size, but will take a step smaller than the grid size in order to ensure accuracy.
If verbose is greater than zero, The 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 200 of file ode_iv_solve.h.
int solve_grid_derivs | ( | double | x0, | |
double | x1, | |||
double | h, | |||
size_t | n, | |||
vec_t & | ystart, | |||
size_t | nsol, | |||
vec_t & | xsol, | |||
mat_t & | ysol, | |||
mat_t & | dydx_sol, | |||
param_t & | pa, | |||
func_t & | derivs | |||
) | [inline] |
Solve the initial-value problem from x0
to x1
over a grid storing derivatives.
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.
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 294 of file ode_iv_solve.h.
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 (e.g. omatrix) 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
.
If verbose is greater than zero, The solution at each internal point will be written to std::cout
. If verbose is greater than one, a character will be required after each point.
If the given value of h
is small enough, the solution may generate more points than the space initially allocated and the full solution will not be generated.
Definition at line 125 of file ode_iv_solve.h.
bool exit_on_fail |
If true, stop the solution if the adaptive stepper fails.
If this is false, then failures in the adaptive stepper are ignored.
Definition at line 684 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