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

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

[Octave-bug-tracker] [bug #55031] lsode doesn't integrate correctly if t


From: Rik
Subject: [Octave-bug-tracker] [bug #55031] lsode doesn't integrate correctly if the right side of the equation is not continuous in t
Date: Sun, 18 Nov 2018 23:44:18 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063

Follow-up Comment #6, bug #55031 (project octave):

If you have an exceedlingly difficult equation for the right side (lots of
singularities or discontinuities) then no algorithm is going to work very
well.

You might need to look at breaking the integration in to pieces where for each
piece the integrand is continuous.  You can then match boundary conditions for
each interval.

You might also want to take a look at the fourth argument to lsode for which I
quote the documentation.


The fourth argument is optional, and may be used to specify a set
of times that the ODE solver should not integrate past.  It is
useful for avoiding difficulties with singularities and points
where there is a discontinuity in the derivative.


The square function certainly looks like it is introducing discontinuities,
but at known points.

Finally, I tried freq = 1e5, 1e6, 1e7, 1e8, 1e9 and the plots looked mostly
the same to me.  If there was supposed to be a dramatic difference around 1e7
I didn't see it.

Antother idea would be to tune the parameters for the lsode solver using the
function lsode_options().  In particular, you might want to set "integration
method" to "adams" to stop using a finite-difference calculated Jacobian. 
There are other options ('help lsode_options') which might also be useful for
your particular problem.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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