XLPack 6.1
Excel VBA Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ DerkfInt()

Sub DerkfInt ( N As  Long,
T As  Double,
Y() As  Double,
Cont As  LongPtr,
Optional Info As  Long 
)

Initial value problem of a system of first order ordinary differential equations (5(4)-th order Runge-Kutta-Fehlberg method) (Interpolation for dense output)

Purpose
This is the support routine which interpolates the solution for dense output when an initial value problem of a system of ordinary differential equations is solved by Derkf (or Derkf_r). For the details of interpolants used here, refer to the reference below.

Derkf must be called with setting parameter Mode = 2 to enable dense output. Additional function evaluation for dense output is not required.
When returned from Derkf with Info = 2 (Info = 1 for last step) after accepted step, the interpolated solution within latest step interval can be computed by using this routine.
Parameters
[in]NNumber of differential equations. (N >= 1)
[in]TT at which the interpolated solution is computed.
T must be in the interval of the last step. That is, T1 <= T <= T2 where T1 is the value of T on the previous return from Derkf with Info = 2, and T2 is the value on the last return with Info = 2.
[out]Y()Array Y(LY - 1) (LY >= N)
Interpolated solution at t.
[in]ContControl information for dense output.
Obtained value from option parameter Cont of Derkf.
[out]Info(Optional)
= 0: Successful exit.
= -1: The argument N had an illegal value. (N < 1)
= -3: The argument Y() is invalid.
Reference
W H Enright et al. "Interpolants for Runge-Kutta Formulas" ACM Transactions on Mathematical Software Vol.12, No.3, 1986, pp.193-218
Example Program
See example program (2) of Derkf and Derkf_r.