-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Re-enable conservation laws for NonlinearSystem
s
#1206
Conversation
NonlinearSystem
sNonlinearSystem
s
But it gets rid of singular Jacobians? |
No, you are right, I just didn't look through things properly yet 😅 |
ext/CatalystHomotopyContinuationExtension/homotopy_continuation_extension.jl
Show resolved
Hide resolved
Have you tried using the standard MTK HC interface? I would hope the Catalyst one isn't needed anymore, and it should make things like hill functions now handled through the rationalization passes. |
Doesn't that still eliminate all but one of the solutions though? Last time I checked it only returned a single solution, which mostly defeated the purpose of using it (it might have been updated since, but cannot find anything about it). Long-term using the MTK interface is still the plan though. |
@ChrisRackauckas can you point us to the official documentation on the MTK interface? Searching the last MTK release's docs for homotopy doesn't seem to give any results? |
In either case, we can keep the Catalyst interface for now, and when the MTK interface is documented update the tutorial to show its usage too (or recommend it as the preferred approach if it encompasses all the Catalyst functionality). Adding that wouldn't be breaking, so can wait to be handled till post V15 being released. |
It's now just a solver alg in NonlinearSolve.jl https://docs.sciml.ai/NonlinearSolve/stable/api/homotopycontinuation/ We do need to figure out how to document that better. The AllRoots option controls the return @TorkelE . |
Though for the depolynomialization you'll want to target it through https://github.com/SciML/ModelingToolkit.jl/blob/master/src/systems/nonlinear/homotopy_continuation.jl#L536. I'll chalk this up to the fact that MTK kind of needs a complete doc structure overhaul. Maybe we can dedicate one of the upcoming symbolic numerics thrusday meetings to that and just get it done. @TorkelE did you de-register the Hill functions? Since that would be required for the rationalization. |
That would be great, especially in clarifying what is public API for Catalyst (or other libraries) to use, and what is internal MTK API. |
still registered, but we can probably change. Not sure what the wider implications for various cases would be though. |
If one happen, drop me a note and I can come by as well |
Note that if we deregister it does mean we will no longer have the future ability to trivially detect these functions in symbolic expressions. Perhaps we should instead expand these functions by default when converting to other system types? |
(Also, we should probably move these discussions to issues.) |
NonlinearSystem
sNonlinearSystem
s
@TorkelE I had some merge issues on the tests when updating to master given the divergence between the PR and master now, please double check the tests are ok now. |
Right, yeah, I probably should make a commit making these tests up to date (also running some of the new |
I think I'm done, but now I'm not sure if tests will fail due to them being out of sync with the code or something. I guess we shall see! |
Yes! I will have a look at the tests. |
@TorkelE if everything passes and the doc build looks ok I am happy to merge this (and will do so). |
Needs some checking, but this should re-enable the use of conservation law elimination for
NonlinearSystem
s using the approach in SciML/ModelingToolkit.jl#3458 (comment). Basically requires:initialization_eqs
with the conservation laws (but with species replaced with their initial value parameter.EDIT, this is not actually the case, my mistake: The updated approach will not enable us to deal with singular Jacobians, which sucks. In the case of Bifurcation diagrams and homotopy continuation this is handled separately though so no problem there (but a problem for normal non-linear system solving).