Matlab ode function help!!!
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi. I am using the Matlab ode45 function for my program:
[t,X]=ode15s('odefunc',[tstart:tspan:tfinal],Xinit); %ode function say tstart=0;tspan=100;tfinal=40,000
Now, my problem is I want to divide the calculations within this ode function into several cycles, say one cycle=2000seconds. How do I do that in Matlab?
댓글 수: 0
채택된 답변
Jan
2011년 9월 22일
It seems, like you are not using ODE45, but ODE15S.
Currently you divide the simulation in 401 parts by using [tstart:tspan:tfinal]. (btw. you can omit the square brackets. a:b:c is a vector already). Now you want to divide it to 2000 seconds. If your tfinal is measured in seconds, why not simply use tspan=2000 ?
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!