-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rodas methods do not error control the interpolation of the algebraic variables #2054
Comments
I think, we have two problems:
|
Looking at rosenbrock_perform_step.jl, I see: line 119/120
and line 241/242
but line 389
Do I understand correctly that algebraic variables are excluded from the error estimation? I can only assume that this is because R(\infty)>1 applies to the stability function of the method of order p=3 and therefore it is not convergent for DAEs. Maybe we should try to improve the method, I will start working on this topic. |
Indeed, that behavior comes from:
And you're right. The underlying problem is that the 3rd order method used in the error estimation is not stable, and therefore it's not convergent in the algebraic variables and you get a wonky error estimate. This means that the only realistic way to handle them given the mathematical structure of the method is to exclude the algebraic variables from the error estimate, since otherwise you just always get I would be interested if there was a second order Rosenbrock that was adaptive and more stable though, but non RosW. Rosenbrock23 is quite a workhorse method in the ODE case in that space but indeed the instability of its error estimator sometimes makes it wonky (even for ODEs), but Shampine must have made a compromise there for a reason. |
We should probably throw a warning in general on Rosenbrock23 for DAEs given that behavior then? It might be a sensible thing to do. #2050 we could change that to just always warn on DAEs. It's still a nice method for a lot of situations though.
If you're looking for the higher value topic, I think this one is it. I don't know of a single Rosenbrock that does residual adaptivity. A good example to look at is: https://www.sciencedirect.com/science/article/abs/pii/S0168927404001187 (1-s2.0-S0168927404001187-main.pdf) In code terms this is: If we can just derive the maxima and minima points on the interpolation error and do something similar, this would be a good option to enable on DAEs. It does add extra The derivation I think isn't too hard? It's just finding the critical points of the interpolation and hardcoding the error estimate to evaluate at each critical point. This would also make Rosenbrocks in DDEs better, which is a nice extra touch as well. |
"We should probably throw a warning in general on Rosenbrock23 for DAEs given that behavior then? "
Regarding an alternative to Rosenbrock23:
Regarding residual adaptivity for rosenbrock methods: I will study this ... |
Wow, on paper that sounds strictly better than Rosenbrock23. |
When implementing the new method, I came across a bug in Rodas3. It produces big errors for the example above.
must be
and in line 844
must included. |
Interesting. Thanks for handling that. It's surprising that dropping that stage passed the 3rd order convergence tests, but I guess it just fell onto a different 3rd or method which is rare but possible. |
Adds a separate error term for Rosenbrock23 when the mass matrix is not `I` in order to account for the fact that the algebraic conditions are not error controlled. They are added via doing error control on the absolute tolerance of the residual in the algebraic conditions. There isn't a sensible definition of relative tolerance here so leaving it at that. Note that this technique is not applicable to the Rodas / stiffly stable methods since they always exactly satisfy the algebraic conditions by design, i.e. this term is just zero. Those methods will need to use a different strategy like residual control. Handles part of #2054.
#2079 handles Rosenbrock23, so I'm going to update this title to just be about the remaining issue with interpolations. |
New methods Rodas23W / Rodas3P with error test for interpolation, see issue 2054 #2054
In methods Rodas4, 42, 4P, 4P2, 5, 5P we could include an additional error test for ||M y' - f(t,y)|| / abstol < 1. |
See recent Preprint and tests in https://github.com/hbrs-cse/RosenbrockMethods A pull request concerning Rodas5Pr and Rodas5Pe will come soon. |
Concerning issue: SciML#2054
Modifications Rodas5Pe, Rodas5Pr of Rodas5P concerning issue #2054 and minor bug fixes of Rodas3P/23W
This is in essence the same problem as #2045, except that differential variables are present but evolve far too slowly to provide indirect error control for algebraic variables.
Solve and plot with a variety of solvers:
results in:
In summary:
sol.t
but is heavily under-sampledsol.t
The text was updated successfully, but these errors were encountered: