I am trying to solve a system of delay of differential equations that has two constant delays and one state dependent delay. When I used ddesd, it did not give me the expected answer and so I tried to check if it was giving the correct result with three constant delays instead. If I pass the constant delays as a vector input directly into the arguments of ddesd, it works fine. However, if I pass the delays as a function is gives the wrong answer. I would really appreciate help on what may be going wrong. I call ddesd as follows:
sol = ddesd(@ddede2,@ddestatedelay,@ddehist,[tstart, tend]);
and my dde delay function is as follows:
function d = ddedelay(t,y)
d = [2; 3.5; 2.2];
Thank you in advance.