octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #59063] Event Handling different between Ode-S


From: Hg200
Subject: [Octave-bug-tracker] [bug #59063] Event Handling different between Ode-Solvers (especially ode15s)
Date: Wed, 11 Nov 2020 16:00:20 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

Follow-up Comment #9, bug #59063 (project octave):

I have taken a closer look at the time based event problem. A minimal test
code showing the problem is attached. In the attached example the integration
should stop after 1 second, but it does not. Debugging in __ode15__.c shows
that during integration "IDA::event" does not return a "true" status when the
event value in the callback function becomes zero (__ode15__.c around 653). 

Further investigation of IDA::event shows that the "val" - values from the
callback function are available and that they are complete. The problem is
rather in line 789 in IDA::event:

++
if ((val(i) > 0 && oldval(i) < 0 && dir(i) != -1) // increasing
     || (val(i) < 0 && oldval(i) > 0 && dir(i) != 1)) // decreasing
--

If the event hits exactly the output timestamp, "val" or "oldval" becomes
exactly zero. But then this code falls through, because a crossing through
"zero" is not recognized. An equal check "=" check is missing for this. I made
a "quick" build check and this seems to solve the problem. If i find some time
i will prepare a patch.

(file #50253)
    _______________________________________________________

Additional Item Attachment:

File name: odemwe.m                       Size:1 KB
    <https://file.savannah.gnu.org/file/odemwe.m?file_id=50253>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59063>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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