Mackey Glass equation and ddesd

1 次查看(过去 30 天)
I am trying to extract Mackey-Glass attrcator through ddesd package. Initially, I need the series, so here are my codes
sol = ddesd(@ddefun,@delay,@history,[0 30000]);
t = sol.x;
x = sol.y;
plot(t,x);
x0 = rand;
function dxdt = ddefun(t,x,Z)
dxdt = 2*Z/(1 + Z^(9.65)) - x;
end
function d = delay(t,x)
d = t - 2;
end
function v = history(t)
v = 0;
end
Sadly, I get no series. I do not know what I have missed out. I genuinely ask for your help.

采纳的回答

Steven Lord
Steven Lord 2023-9-19
So in these equations you're using the Equation 2 form where is 2, θ is 1, n is 9.65, τ is 2, and γ is 1?
If the density of the cells starts off at P(t) = 0 (as is the case based on your history function) why do you expect any cells to spontaneously come into existence? If I changed your history and the time over which I solved the system (to fit in the time restrictions of MATLAB Answers) I got a non-constant answer. Whether or not this is correct is something for you to determine.
If you're going to generalize this I'd define the parameters as constant values in ddefun (or have ddefun accept them as additional parameters) to make it easier to modify the equations (simply by changing the parameter values, rather than changing the equations.) I did this for two of the parameters, n and tau.
sol = ddesd(@ddefun,@delay,@history,[0 30]); % Changed from 30000 to 30
t = sol.x;
x = sol.y;
plot(t,x);
function dxdt = ddefun(t,x,Z)
n = 9.65;
dxdt = 2*Z/(1 + Z^n) - x;
end
function d = delay(t,x)
tau = 2;
d = t - tau;
end
function v = history(t)
v = 0.5; % Changed from 0 to 0.5
end
  3 个评论
Torsten
Torsten 2023-9-19
编辑:Torsten 2023-9-19
sol = ddesd(@ddefun,@delay,@history,[0 30]); % Changed from 30000 to 30
t = sol.x;
x = sol.y;
tint = 0:0.01:30;
xint = deval(sol,tint);
for i = 1:numel(tint)
if tint(i) <= 2
xintm2(i) = history(tint(i)-2);
else
xintm2(i) = deval(sol,tint(i)-2);
end
end
plot(xint,xintm2)
function dxdt = ddefun(t,x,Z)
n = 9.65;
dxdt = 2*Z/(1 + Z^n) - x;
end
function d = delay(t,x)
tau = 2;
d = t - tau;
end
function v = history(t)
v = 0.5; % Changed from 0 to 0.5
end
Amir Mahmoudi
Amir Mahmoudi 2023-9-20
This is what i was looking for. Thanks a lot.

请先登录,再进行评论。

更多回答(1 个)

Torsten
Torsten 2023-9-19
移动:Torsten 2023-9-19
I'm not sure what you are exactly asking for, but for a history v = 0, the solution is v = 0 for all times t > 0.
So the plot you get is correct.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by