For an ODE, the data to pass to the solver are the ODE function f(t,y)
, the initial point y(t_0)=y_0
and the end t_f
of the integration interval.
For a DDE solver, the additional data needed to drive the evaluation of the DDE are the delays td[0..s]
, and the history function h(t)
which also assumes the role of the initial values. The DDE "right-side" function f(t,y,yd)
itself takes as inputs the current state y
and the state vectors yd[i]=y(t-td[i])
at the delayed times.
To implement the solver you can take any method where you have an interpolation procedure, aka "dense output", of the same order as the method. This procedure or interpolator object contains the data from the previous integration steps and defaults to the history function h(t)
for times before the start of the integration interval. Then during the solver stages this interpolation is used to compute the yd
values, and after each integration step the interpolation data is updated to contain the new data.
Everything else proceeds as usual, the only restriction is that the time steps have to be smaller than the minimal delay so that all delayed states are inside the historical data of the interpolator.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…