필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Struggling at events of ode function

조회 수: 1 (최근 30일)
Felix Lauwaert
Felix Lauwaert 2015년 10월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello,
I'm trying to use events function to find the coordinates of a ODE function of n variables. What I want is to find the results of x(i)=certain value m times.
I've read the help about events but I don't get how to implement it. I've also seen other posts and the ball bounce example but what I want to know is how to tell the program that the event is x(2)=0. At the moment I have:
[value,isterminal,direction] = events(t,y);
incT=[t0,t0+step];
i=0;
resu=zeros(talls,length(condIni)+1);
while i<talls
[T,Y,TPS,YPS,~] = ode45( fun,tspan,condIni,options );
if isempty(TPS)~=1
i=i+1;
incT=[T(end) T(end)+step];
condIni=YPS;
resu(i,1)=TPS;
resu(i,2:end)=YPS;
end
end
This is part of my code, apparently not defined variables as 'talls' or 'step' are defined previously.
Thanks

답변 (0개)

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by