Mackey Glass equation and ddesd

1 visualización (últimos 30 días)
Amir Mahmoudi
Amir Mahmoudi el 19 de Sept. de 2023
Comentada: Amir Mahmoudi el 20 de Sept. de 2023
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.

Respuesta aceptada

Steven Lord
Steven Lord el 19 de Sept. de 2023
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 comentarios
Torsten
Torsten el 19 de Sept. de 2023
Editada: Torsten el 19 de Sept. de 2023
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 el 20 de Sept. de 2023
This is what i was looking for. Thanks a lot.

Iniciar sesión para comentar.

Más respuestas (1)

Torsten
Torsten el 19 de Sept. de 2023
Movida: Torsten el 19 de Sept. de 2023
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.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by