[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Translating ODE from Matlab to Octave
From: |
c. |
Subject: |
Re: Translating ODE from Matlab to Octave |
Date: |
Tue, 26 Nov 2013 18:09:31 +0100 |
On 26 Nov 2013, at 17:18, Bård Skaflestad <address@hidden> wrote:
>> no, you can't call 'lsode' like that.
>>
>> 'lsode' does not return the time vector 't',
>
> Thanks a lot for alerting me to that fact. Now I just have to ask
> myself why I didn't derive that conclusion from the documentation...
The documentation [1] gives two possibilities for calling lsode:
— Loadable Function: [x, istate, msg] = lsode (fcn, x_0, t)
— Loadable Function: [x, istate, msg] = lsode (fcn, x_0, t, t_crit)
where 'istate' and æmsg' are flags describing the succes / failure of the
integration. a
As you see there is no 't' in the list of outputs, maybe you just assumed it
would work that way because matlab ode solvers do ...
'lsode' does not have a matlab compatible interface because there is no 'lsode'
function in matlab, you can find other solvers with
more matlab-like interface in the odepkg forge package [2].
a matlab compatible ode15s is not implemented yet and it won't be in 3.8
either, but that is a planned feature that might be in 4.0.
> Are you saying that LSODE does not support automatic step size selection
> or does the solver "simply" not expose the selected time steps to the
> caller?
lsode does use internally adaptive time-stepping but only returns the solution
evaluated at a set of requested time steps.
c.
[1]
http://www.gnu.org/software/octave/doc/interpreter/Ordinary-Differential-Equations.html#Ordinary-Differential-Equations
[2] http://octave.sourceforge.net/odepkg/