Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

How to integrate DDE for different sets of histroy function?

1 visualizzazione (ultimi 30 giorni)
% code
function dydt = ddex1(t,y,Z)
ylag = Z(:,1);
dydt(1) = 0.5y(1)*(1-ylag(2))
dydt(2) = -0.5y(2)*(1-ylag(1))
end
suppose i want to integrate this system for different- different sets of history function. for eg.
%code
function S = history(t)
for a = 0.1 : 0.1 : 1
for b = 0.1 : 0.1 : 1
S = [a,b];
end
I want to integrate my dydt for all sets of history function.
%code
function Main
sol = dde23(@ddex1, [2] , @history,[0,100]) %%(function, lag , history, [tstart,tend])
end
how should i call history function so that in one run i can compute for all history function.
  2 Commenti
Torsten
Torsten il 4 Ott 2018
Modificato: Torsten il 4 Ott 2018
Your loop over a and b must be in "Main", not in "history":
i=0;
for a = 0.1 : 0.1 : 1
i=i+1;
j=0;
for b = 0.1 : 0.1 : 1
j=j+1;
sol{(i-1)*10+j} = dde23(@ddex1, [2] , @(t)history(t,a,b),[0,100])
end
end
function S = history(t,a,b)
S = [a,b];
end

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by