Closed topolarity closed 5 months ago
The theory of a higher order method assumes a sufficiently smooth solution. Here the solution is not continuously differentiable, which can lead to problems. Therefore, lower order methods may provide equally good or better solutions. However, a sufficiently accurate solution can be generated by adjusting reltol, e.g. reltol = 1.0e-7. An error check of the interpolation would also be helpful, see issue #2054 and new method Rodas3P.
This is just a repeat.
I'm fine with that conclusion - but we should perhaps broaden the scope of #2054 to make it less about the algebraic variables.
The same problem happens here for the fully-explicit ODE x' ~ triangle(t)
It's going to happen on any exactly integrated equation, so any equation that's a polynomial in t
less than the power of the order will also apply for the same reason.
Right, anything that appears to have smooth derivatives at low-orders but whose global behavior is not well-determined by those derivatives (e.g. piecewise functions and also infinitely smooth but non-analytic functions like f(t) = t <= 0 ? 0.0 : exp(-1/t)
)
Is there a name for the kind of error control that seems to prevent this problem in ROS34PRw?
Describe the bug 🐞
The example here is essentially
x' ~ f(t)
(in semi-explicit DAE form) wheref(t)
is a continuous, piecewise-linear function with a strongly discontinuous derivative, for which Rodas5P gives poor results.This is arguably a duplicate of https://github.com/SciML/OrdinaryDiffEq.jl/issues/2054, except:
Anyway, here's the MWE:
Minimal Reproducible Example 👇
The error gets worse as u0 increases, since u[1] is less affected by
reltol
.Rodas5P takes only 21 timesteps but seems over-optimistic about the quality of its solution:
For reference, the new
ROS34PRw
solver does much better (with 103 timesteps):A few other notes:
x' ~ triangle(t)
performs about the same)u0
offset is made large enoughx' ~ sin(t), u(0) = 100.0
Environment:
using Pkg; Pkg.status()