bugGNU Octave - Bugs: bug #49846, ode45 initial call to event...

 
 

bug #49846: ode45 initial call to event function uses wrong time value

Submitter:  None
Submitted:  Thu 15 Dec 2016 06:14:30 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  BP Minaker Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Dec 2016 04:37:05 PM UTC, comment #5: 

@Carlo: See bug #49919.  If the solver stops immediately, it lists the event time as tfinal rather than tinit which is incorrect.  I fixed that with the cset in comment #3.

Rik <rik5>
Group administrator
Fri 16 Dec 2016 06:23:57 AM UTC, comment #4: 

Hi,

I cannot seem to find any description of this in Matlab docs.

Could you please also provide an example of how this works in Matlab and what the current implementation was doing wrong?

We can then use the example as a test in the octave ode solvers ...



Carlo de Falco <cdf>
Group Member
Thu 15 Dec 2016 11:25:09 PM UTC, comment #3: 

I checked in a change on stable to use the start time, rather than the end time, to initialize the Event function (http://hg.savannah.gnu.org/hgweb/octave/rev/544dac72d414).

Rik <rik5>
Group administrator
Thu 15 Dec 2016 10:06:04 PM UTC, comment #2: 

Well, I didn't know where it was actually calling from, but yes, I think that would be more appropriate, and would be compatible with Matlab.


Anonymous
Thu 15 Dec 2016 09:54:23 PM UTC, comment #1: 

To be clear, are you talking about the function scripts/ode/private/integrate_adaptive.m?

I see the following in that m-file:


  ## Initialize the EventFcn
  if (! isempty (options.Events))
    ode_event_handler (options.Events, tspan(end), x,
                       "init", options.funarguments{:});
  endif


Is the suggestion to change tspan(end) to tspan(1)?


Rik <rik5>
Group administrator
Thu 15 Dec 2016 06:14:30 AM UTC, original submission:  

If ode45 is used with an optional event function to check for stopping conditions, the very first call to the event function, before the solution process actually gets underway, is called with the end time of the solution interval rather than the start time.    I'm pretty sure that this is not the intended behaviour.  It can lead to incorrect event function value and early stopping of solver.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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 cdf (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (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 group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-26 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2016-12-16 cdf Item GroupRegression Incorrect Result
        StatusFixed Need Info
        Open/ClosedClosed Open
    2016-12-15 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Releasedev 4.2.0
    2016-12-15 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code