Re: solving ode with smaller step
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 11:27:20 -0400
"Akram AlMoussa" <akramalmoussa@xxxxxxxxx> wrote in message
news:fsqio5$a0j$1@xxxxxxxxxxxxxxxxxxxxx
Dear All:
I solved three ODE using ode45 solver, but I need to solve
it with smaller step which means more no. of calculation
points. I would like to solve it with 0.005 . Any body can
help, I am a beginner in Matlab.
Thanks
ODE45 is an adaptive solver, so it chooses what time steps it needs in order
to satisfy the tolerances you specified. There's no way to control the size
of the steps it takes. There are two ways to do what I believe you want:
1) Specify a vector with more than two elements as the TSPAN input to ODE45.
While this won't control the time steps ODE45 uses internally, it will cause
ODE45 to output the function values at those specified time steps. For
instance, if you want to integrate from t = 0 to t = 1 in steps of 0.005,
use a tspan of 0:0.005:1.
2) Solve your ODE as normal, specifying one output argument (so that it's
the struct output argument) and use the DEVAL function to evaluate that
solution at the specified points. I prefer using the first approach, but if
you've already solved your ODE and have the solution structure available,
this will avoid having to solve it again.
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- References:
- solving ode with smaller step
- From: Akram AlMoussa
- solving ode with smaller step
- Prev by Date: One-dimensional array for activeX
- Next by Date: Re: Visual Basic Express2008 and matlab
- Previous by thread: solving ode with smaller step
- Next by thread: How to trigger the OK bottom of a GUI Interface of the running external program from matlab
- Index(es):
Relevant Pages
|