-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Radau solver really slow when adaptive time stepping and collocation solver don't play nicely #14080
Comments
I suspect we'll need a small self-contained example to make progress on this. That kind of thing seems like a bug to me. |
Would you be able to provide a standalone example that does not use Cantera ? I don't know if there is a simple enough mechanism that you can code yourself (like one global reaction) and still produces the issue. Are you sure you do not come near a singularity, for example M going close to 1 ? |
Hi, Evaluating the ODE function (time derivatives) at the last point reached by the solver, I get time derivatives on the order of 1e17 to 1e20 for the pressure and the density... |
Thanks for diving into this! The singularity at M=1 is expected and the solution should be fine up until this point. But I suppose you are right, the effect illustrated in my example can be simply tied to approaching this singularity. Interestingly, I never encountered the above message about the time step being too small. Are you running my exact example? Which version of python/scipy? Maybe making |
Just to dig this out again with some additional info: The persistence of this issue caused me to reimplement the whole problem in Julia. This gave me access to the wide variety of implicit solvers that |
I am using CalTechs shock and detonation toolbox to solve some ODE's that describe the spatio-temporal structure of a detonation wave with detailed chemistry using cantera.
Since this is a very stiff problem, the default ODE solver is SciPy's Radau. For some initial conditions, this works flawlessly and reasonably fast. However, in many cases I encounter a behavior that increases integration time significantly and can even cause failure of the integration.
In these cases, the following pattern can be observed:
solve_collocation_system
is unable to solve the implicit equation system for this increased step sizeOnce this pattern has established, each time step is extremely small and additionally takes many internal loops to be accepted. Playing around with tolerances can often help to avoid this unfortunate loop, but that means some trial an error for each initial condition I would like to examine.
I am neither a mathematician nor a computer scientist, so I am unsure whether this behavior is to some extent unavoidable when dealing with stiff ODE systems, or whether I might be able to tweak the solver to avoid this.
The text was updated successfully, but these errors were encountered: