How to define state-dependent delay in delayed differential equations solver in Julia?


#1

Dear All,

I’m transferring from Matlab to Julia to solve delayed differential equations.

I read documentation and notice it says define state-dependent delay by

prob = DDEProblem(bc_model,u0,h,tspan; dependent_lags = ((u,p,t) -> tau,))

but how can I define tau with time t?

for example: lag = sin(t)?

Thank you very much!


#2
prob = DDEProblem(bc_model,u0,h,tspan; dependent_lags = ((u,p,t) -> sin(t),))

Or you don’t declare the lags. The MATLAB ddesd algorithm is equivalent to undeclared lags with MethodOfSteps(RK4()). Usually not declaring lags is bad for performance and accuracy though, so we don’t recommend it.


#3

Hello! I have a modified system of Rossler:
h(p, t) = [1.0,1.0,1.0, 1.0, 0.2]
u0 = [1.0,1.0,1.0, 1.0, 0.2]
tspan = (0.0, 10.0)
function bc_model(du,u,h,p,t)
du[1]=-u[2]-u[3]
du[2]=u[1]+0.2u[2]+u[5](h(p,t-u[4])[2]-u[2])
du[3]=0.2+u[3](u[1]-5.7)
du[4]=0.02
(u[2]-h(p,t-u[4])[2]-u[2])
du[5]=0.01*(u[2]-h(p,t-u[4])[2]-u[2])^2
end
Here u[4] definites delay function.
How I can describe dependent_lags in DDEProble, in my situation?