Hi. I’m trying to figure out to use DifferentialEquations.jl to solve a system of DDEs that depend not only on the values at previous times, but on the time derivatives of those values at previous times. For example, suppose that instead of solving this system (the Lotka-Volterra system)

For the first system, we could set it up using DifferentialEquations like this:

function lv_model(du,u,h,p,t)
tau = p
hist1 = h(p, t-tau)[1]
hist2 = h(p, t-tau)[2]
du[1] = 0.5*u[1]*(1 - hist2)
du[2] = -0.5*u[2]*(1 - hist1)
end

and that works fine when building the DDEProblem. How could the second system be constructed? Is there a way to get the derivatives at a previous time from h(p, t-tau)?

Thanks in advance for any help. I’m still relatively new to Julia.

Thanks so much for the quick response! Given how well-thought out everything in Julia seems to be, I assumed there’d be an easy answer and it looks like there is.