octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ode output orientation


From: Rik
Subject: Re: ode output orientation
Date: Fri, 21 Oct 2016 09:20:39 -0700

On 10/21/2016 03:39 AM, Carlo de Falco wrote:
> Rik,
>
> This issue does not look like it is bad enough to block the release.
>
> I'd like to look at the one below though:
>
> This es example says everything:
> fvdb = @(vt,vy) [vy(2); (1 - vy(1)^2) * vy(2) - vy(1)];
> sol=ode23(fvdb,[0 40],[2 0]);
> size(sol.x)
> %[309 1] instead of [1 309] in Matlab
> size(sol.y)
> %[309 2] instead of [2 309] in Matlab
>
> Patch for ode23 is here https://savannah.gnu.org/bugs/index.php?49402
>
> Thanks to Sebastian for reminding of this one.
>

What version of Matlab was this?  The documentation
http://www.mathworks.com/help/matlab/ref/ode23.html clearly states that the
time variable is a column vector (Nx1).  It also says that each row of the
output solution corresponds to an entry in t (Nx#_of_ode_vars).

If Matlab has changed things around not only the outputs needs to be
transposed, but also Octave's documentation needs to be updated.  And what
about ode45?

-- Code --
fvdb = @(vt,vy) [vy(2); (1 - vy(1)^2) * vy(2) - vy(1)];
sol=ode45(fvdb,[0 40],[2 0]);
size(sol.x)
ans =

   100     1
-- End Code --

It seems like this would need a fix at a lower level than either ode23.m or
ode45.m.  The very end of integrate_adaptive.m is

-- Code --
  ## Set up return structure
  solution.t = t(:);
  solution.x = x.';

endfunction
-- End Code --

Why not undo the transposing here?

If this is confirmed with a modern version of Matlab then I agree we should
commit a patch before the 4.2.0 release.

--Rik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]