# naginterfaces.library.ode.ivp_​rkts_​interp¶

naginterfaces.library.ode.ivp_rkts_interp(n, twant, ideriv, nwant, f, comm, data=None)[source]

ivp_rkts_interp computes the solution of a system of ordinary differential equations using interpolation anywhere on an integration step taken by ivp_rkts_onestep().

For full information please refer to the NAG Library document for d02ps

https://www.nag.com/numeric/nl/nagdoc_28.6/flhtml/d02/d02psf.html

Parameters
nint

, the number of ordinary differential equations in the system to be solved by the integration function.

twantfloat

, the value of the independent variable where a solution is desired.

iderivint

Determines whether the solution and/or its first derivative are to be computed

compute approximate solution.

compute approximate first derivative.

compute approximate solution and first derivative.

nwantint

The number of components of the solution to be computed. The first components are evaluated.

fcallable yp = f(t, y, data=None)

must evaluate the functions (that is the first derivatives ) for given values of the arguments .

It must be the same procedure as supplied to ivp_rkts_onestep().

Parameters
tfloat

, the current value of the independent variable.

yfloat, ndarray, shape

The current values of the dependent variables, , for .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
ypfloat, array-like, shape

The values of , for .

commdict, communication object, modified in place

Communication structure.

This argument must have been initialized by a prior call to ivp_rkts_setup().

dataarbitrary, optional

User-communication data for callback functions.

Returns
ywantfloat, ndarray, shape

An approximation to the first components of the solution at if or . Otherwise is not defined.

ypwantfloat, ndarray, shape

An approximation to the first components of the first derivative at if or . Otherwise is not defined.

Raises
NagValueError
(errno )

You cannot call this function after the integrator has returned an error.

(errno )

You cannot call this function before you have called the step integrator.

(errno )

You cannot call this function when you have specified, in the setup function, that the range integrator will be used.

(errno )

or in setup, but interpolation is not available for this method. Either use or in setup or use reset function to force the integrator to step to particular points.

(errno )

On entry, , but the value passed to the setup function was .

(errno )

On entry, .

Constraint: , or .

(errno )

On entry, and .

Constraint: .

(errno )

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.

Notes

ivp_rkts_interp and its associated functions (ivp_rkts_setup(), ivp_rkts_onestep(), ivp_rkts_reset_tend(), ivp_rkts_diag() and ivp_rkts_errass()) 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.

ivp_rkts_onestep() computes the solution at the end of an integration step. Using the information computed on that step ivp_rkts_interp computes the solution by interpolation at any point on that step. It cannot be used if or was specified in the call to setup function ivp_rkts_setup().

References

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