Faster than ODE45

조회 수: 17 (최근 30일)
Liber-T
Liber-T 2011년 6월 16일
I would like to go faster than ode45 and ode 23 is there a way to change the input in:
[t,y]=ode23tb(@Gi,[0.000001;a],[1,0]);
so I could run my programs faster. I don't care if the precision drop a little bit. Thanks

채택된 답변

Matt Tearle
Matt Tearle 2011년 6월 16일
ode23tb is more efficient for cruder tolerances, so make sure you use odeset to set the tolerances appropriately. RelTol and AbsTol are the settings to look at. (The defaults are 1e-3 and 1e-6, respectively.)
Also, ode23tb is for stiff systems. I assume you've already established that this is the case. If not, ode23 will be more efficient (again, setting RelTol and/or AbsTol appropriately).
opts = odeset('AbsTol',1e-3);
[t,y]=ode23tb(@Gi,[0.000001;a],[1,0],opts);
Creates a structure opts that contains the option settings, then passes that into ode23tb.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by