フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to integrate DDE for different sets of histroy function?

1 回表示 (過去 30 日間)
sourabh mittal
sourabh mittal 2018 年 10 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
% 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 件のコメント
Torsten
Torsten 2018 年 10 月 4 日
編集済み: Torsten 2018 年 10 月 4 日
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 2018 年 10 月 4 日
Thank You

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by