[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Translating ODE from Matlab to Octave
From: |
Torsten |
Subject: |
Re: Translating ODE from Matlab to Octave |
Date: |
Tue, 26 Nov 2013 19:44:05 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 |
On 26.11.2013 19:33, c. wrote:
>
> 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
>
You are right.
I did not want to recommend ode45 for this specific simulation case. I
just wanted to confirm your statement that odepkg provides a matlab
compatible interface. Sorry if my post was misleading.
Torsten