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

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!

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.

2 Likes