Faster than ODE45

20 visualizaciones (últimos 30 días)
Liber-T
Liber-T el 16 de Jun. de 2011
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

Respuesta aceptada

Matt Tearle
Matt Tearle el 16 de Jun. de 2011
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.

Más respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by