필터 지우기
필터 지우기

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

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by