필터 지우기
필터 지우기

Mackey Glass equation and ddesd

조회 수: 4 (최근 30일)
Amir Mahmoudi
Amir Mahmoudi 2023년 9월 19일
댓글: Amir Mahmoudi 2023년 9월 20일
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에서 Delay Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by