bugGNU Octave - Bugs: bug #49417, ode solvers should return state at...


bug #49417: ode solvers should return state at automatically selected timesteps only when invoked with only one output

Submitter:  Carlo de Falco <cdf>
Submitted:  Sat 22 Oct 2016 08:46:00 PM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Mon 24 Oct 2016 10:24:01 AM UTC, comment #2: 

I did more study about the behaviour of Matlab ode solvers when only one output is requested.
It seems what we do now must be completely changed,
but this hack is OK for 4.2, I'll submit a new ticket that can be worked on in the stable branch.

Carlo de Falco <cdf>
Project Member
Mon 24 Oct 2016 04:37:51 AM UTC, comment #1: 

Something of a hack, but I checked in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/56d7d423aff9). 

Fixed, closing report.

Rik <rik5>
Project Administrator
Sat 22 Oct 2016 08:46:00 PM UTC, original submission:  

When invoked with only one struct output, the
ode solvers in Matlab only return the state
evaluated at automatically selected timesteps.

Octave on the other hand returns the solution
at manually specified timesteps if tspan has more
than two entries.

Octave :

sol = ode45 (@(t, x) 1, [0 .4  1], 1)
sol =
  scalar structure containing the fields:
    x =
       0.00000   0.40000   1.00000
    y =
       1.0000   1.4000   2.0000
    solver = ode45

Matlab :

>> sol = ode45 (@(t, x) -10 * x, [0 .4  1], 1)
sol =
     solver: 'ode45'
    extdata: [1x1 struct]
          x: [0 0.0201 0.1023 0.1807 0.2593 0.3380 0.4166 0.4953 0.5739 0.6525 0.7312 0.8098 0.8950 1]
          y: [1 0.8180 0.3598 0.1642 0.0748 0.0341 0.0155 0.0071 0.0032 0.0015 6.6905e-04 3.0481e-04 1.3005e-04 4.5600e-05]
      stats: [1x1 struct]
      idata: [1x1 struct]

Notice that Matlab also returns additional undocumented
fields in the result structure that are needed by deval.

Carlo de Falco <cdf>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cdf (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.





    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-24 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.9