nag_ode_ivp_rkts_interp (d02psc) computes the solution of a system of ordinary differential equations using interpolation anywhere on an integration step taken by
nag_ode_ivp_rkts_onestep (d02pfc).
nag_ode_ivp_rkts_interp (d02psc) and its associated functions (
nag_ode_ivp_rkts_onestep (d02pfc),
nag_ode_ivp_rkts_setup (d02pqc),
nag_ode_ivp_rkts_reset_tend (d02prc),
nag_ode_ivp_rkts_diag (d02ptc) and
nag_ode_ivp_rkts_errass (d02puc)) solve the initial value problem for a first-order system of ordinary differential equations. The functions, based on Runge–Kutta methods and derived from RKSUITE (see
Brankin et al. (1991)), integrate
where
is the vector of
solution components and
is the independent variable.
nag_ode_ivp_rkts_onestep (d02pfc) computes the solution at the end of an integration step. Using the information computed on that step nag_ode_ivp_rkts_interp (d02psc) computes the solution by interpolation at any point on that step. It cannot be used if
was specified in the call to setup function
nag_ode_ivp_rkts_setup (d02pqc).
Brankin R W, Gladwell I and Shampine L F (1991) RKSUITE: A suite of Runge–Kutta codes for the initial value problems for ODEs SoftReport 91-S1 Southern Methodist University
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: for , .
- NE_INT_2
-
On entry, and .
Constraint: .
- NE_INT_3
-
On entry, , and .
Constraint: for , .
- NE_INT_CHANGED
-
On entry, , but the value passed to the setup function was .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NE_MISSING_CALL
-
You cannot call this function before you have called the step integrator.
- NE_PREV_CALL
-
On entry, a previous call to the setup function has not been made or the communication arrays have become corrupted, or a catastrophic error has already been detected elsewhere.
You cannot continue integrating the problem.
- NE_PREV_CALL_INI
-
You cannot call this function after the integrator has returned an error.
- NE_RK_INVALID_CALL
-
You cannot call this function when you have specified, in the setup function, that the range integrator will be used.
- NE_RK_NO_INTERP
-
in setup, but interpolation is not available for this method. Either use in setup or use reset function to force the integrator to step to particular points.
The computed values will be of a similar accuracy to that computed by
nag_ode_ivp_rkts_onestep (d02pfc).
nag_ode_ivp_rkts_interp (d02psc) is not threaded by NAG in any implementation.
nag_ode_ivp_rkts_interp (d02psc) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
This example solves the equation
reposed as
over the range
with initial conditions
and
. Relative error control is used with threshold values of
for each solution component.
nag_ode_ivp_rkts_onestep (d02pfc) is used to integrate the problem one step at a time and nag_ode_ivp_rkts_interp (d02psc) is used to compute the first component of the solution and its derivative at intervals of length
across the range whenever these points lie in one of those integration steps. A low order Runge–Kutta method (
) is also used with tolerances
and
in turn so that solutions may be compared.