Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to integrate DDE for different sets of histroy function?

1 vue (au cours des 30 derniers jours)
sourabh mittal
sourabh mittal le 4 Oct 2018
Clôturé : MATLAB Answer Bot le 20 Août 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 commentaires
Torsten
Torsten le 4 Oct 2018
Modifié(e) : Torsten le 4 Oct 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
sourabh mittal
sourabh mittal le 4 Oct 2018
Thank You

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by