Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to integrate DDE for different sets of histroy function?

1 Ansicht (letzte 30 Tage)
sourabh mittal
sourabh mittal am 4 Okt. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
% 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 Kommentare
Torsten
Torsten am 4 Okt. 2018
Bearbeitet: Torsten am 4 Okt. 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

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by