|
From: | Jacopo Corno |
Subject: | Re: matlab compatibility of od45 with adaptive stepping |
Date: | Sun, 11 Oct 2015 12:13:40 +0200 |
Il 11/Ott/2015 12:04, "Sebastian Schoeps" <address@hidden> ha scritto:
>
> I think, we just need to call dense output as already implemented by Jacopo?!
>
> Sebastian
>
I guess Carlo's point is that Matlab by default returns the automatic timesteps used (and we do the same) but if one requires specific times then it only returns those ones in the output.
What we do in Octave is returning those timesteps together with the automatic ones (ie one would probably get 458 st in the example below). That was what I understood reading Matlab's documentation...
However it shouldn't be that complicated to change in the code isn't it? I guess it's just a change in the handling of the outputs...
Jacopo
> --
> Prof. Dr. rer. nat. Sebastian Schoeps
> Technische Universität Darmstadt
> Graduate School of Computational Engineering
> Dolivostraße 15
> 64293 Darmstadt / Germany
>
> Office: S4|10-321
> Phone: +49 6151 16 - 70948
> Fax: +49 6151 16 - 4459
> Email: address@hidden
>
> Am 11.10.2015 um 09:50 schrieb Carlo De Falco <address@hidden>:
>
>>
>> On 11 Oct 2015, at 09:36, Sebastian Schöps <address@hidden> wrote:
>>
>>>> I don't have access to matlab right now, so could
>>>>
>>>> someone please try the following and report the results?
>>>>
>>>>
>>>> fun = @(t, x) cos (t);
>>>>
>>>> o = odeset ('AbsTol', 1e-11, 'RelTol', 1e-11);
>>>>
>>>> [t, x] = ode45 (fun, [0, 2*pi], 0, o);
>>>>
>>>> size (t), size (x)
>>>>
>>>> [t, x] = ode45 (fun, [0, pi, 2*pi], 0, o);
>>>>
>>>> size (t), size (x)
>>>
>>>
>>> ans =
>>>
>>> 457 1
>>>
>>> ans =
>>>
>>> 457 1
>>>
>>> ans =
>>>
>>> 3 1
>>>
>>> ans =
>>>
>>> 3 1
>>>
>>>
>>>> My interpratation of the documentation is that size (t) should be [3, 1] in the second case ...
>>>
>>>
>>> It seems you are right :)
>>
>>
>> Unfortunately, this also means that integrate_adaptive needs an almost complete rewrite :(
>> c.
>>
>>
[Prev in Thread] | Current Thread | [Next in Thread] |