[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 19:33:11 +0100 |
On 26 Nov 2013, at 18:53, Torsten <address@hidden> wrote:
>
> And odepkg provides the mass matrix parameter "Mass" in case there might
> be numerical issues with the inverse of M. I use ode45 on a regular
> basis on octave and matlab systems (without code modifications).
ode45 uses the one-step explicit RK45 method which is not a viable choice for
integrating stiff systems,
and even more so if the system to be integrated is a set of DAEs which may be
roughly considered as
"infinitely stiff" ODEs.
Indeed I see in the source code of ode45 [3] that an inversion of the mass
matrix is used, which cannot work for DAEs.
There are other matlab compatible solvers in odepkg that are intended for
solving stiff problems, e.g. ode23s [1],
but I am quite sure ode23s won't work for DAEs, as I see in the code that an
inversion of the mass matrix [2] is used in the algorithm.
There are other solvers in odepkg that do work for DAEs [4] but I'm not sure
whether they are matlab compatible.
The recomended solver to use for DAEs in matlab is ode15s [4], which is not
(yet?) implemented in Octave or Octave Forge, but
the algorithm used by daspk is exactly the same as that of ode15s so I'd
recommennd using daspk for solving DAEs in Octave.
> Torsten
c.
[1] http://octave.sourceforge.net/odepkg/function/ode23s.html
[2] http://sourceforge.net/p/octave/odepkg/ci/default/tree/inst/ode23s.m#l179
[3] http://sourceforge.net/p/octave/odepkg/ci/default/tree/inst/ode45.m#l342
[4] see the 5th table in the page
http://www.mathworks.it/it/help/matlab/ref/ode15s.html