XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ Ylaga()

Sub Ylaga ( I As  Long,
N As  Long,
T As  Double,
Y() As  Double,
Phi As  LongPtr,
Cont() As  Double,
ICont() As  Long,
Optional Info As  Long 
)

Initial value problem of delay differential equations (5(4)-th order Dorman-Prince method) (Computation of back-values of solution)

Purpose
This program is the support program which computes the back-values of the solution by interpolation for solving an initial value problem of the delay differential equations by Retard.

A system of first order delay ordinary differential equations of the form
dy/dt = f(t, y(t), y(t - τ), y(t - τ2), ...), y = y0 at t = t0
where f depends on the values at previous points y(t - τ), y(t - τ2), .... These values can be computed by using this program.

This code is the rewritten version of YLAG used for the 5(4)-th order Dormand-Prince code for delay equations, RETARD (Reference (1)).
Parameters
[in]IElement number of y to be interpolated. (1 <= I <= N or I = 0)
1 <= I <= N: Only the I-th element of y is computed.
I = 0: All elements of y (Y(0) 〜 Y(N - 1)) are computed.
[in]NNumber of differential equations. (N >= 1)
[in]TIndependent variable t. To compute back-value y(t - τ), for example, T = t - τ is given to this argument.
[out]Y()Array Y(LY - 1) (LY >= 1 (1 <= I <= N), LY >= N (I = 0))
The values of dependent variable y at T (interpolation of numerical solution).
1 <= I <= N: The computed I-th element of y is returned in Y(0).
I = 0: All computed elements are returned in Y(0) 〜 Y(N - 1).
[in]PhiThe user supplied subroutine, which returns the values of y at t < t0, defined as follows.
Sub Phi(I As Long, N As Long, T As Double, Y() As Double, Info As Long)
y() = values of y at T (where t0 - τ < T < t0).
Info = 0
End Sub
If I = 0, all elements must be stored in Y(0) 〜 Y(N - 1). Otherwise, I-th element must be stored in Y(0). Only the values of I, which are used in Ylaga by the user, may be supported. Ylaga will terminate if Phi returns Info <> 0.
[in]Cont()Array Cont(LCont - 1)
Control information area. The contents of this array must not be altered. The same array which is used when calling Retarda or Retarda_r.
[in]ICont()Array Icont(LICont - 1) (LICont >= 50)
Integer control information area. The contents of this array must not be altered. The same array which is used when calling Retarda or Retarda_r.
[out]Info(Optional)
Return code.
= 0: Successful exit.
< 0: The (-Info)-th argument is invalid.
= 11: (Error) Invalid control information.
= 12: (Error) t is too small. Mxst of Retarda may be too small.
= 13: (Error) t is too large.
= Others: Phi returnd this value (<> 0) as Info.
Reference
(1) E. Hairer, S.P. Norsett and G. Wanner, "Solving Ordinary Differential Equations. Nonstiff Problems. 2nd edition", Springer Series in Computational Mathematics, Springer-Verlag (1993)
Example Program
See example program of Retarda.