SciML / ModelingToolkit.jl

An acausal modeling framework for automatically parallelized scientific machine learning (SciML) in Julia. A computer algebra system for integrated symbolics for physics-informed machine learning and automated transformations of differential equations
https://mtk.sciml.ai/dev/
Other
1.39k stars 199 forks source link

Clarify in the docs the limitations / regime of applicability of structural simplification #965

Open isaacsas opened 3 years ago

isaacsas commented 3 years ago

There have been many issues such as https://github.com/SciML/ModelingToolkit.jl/issues/958 from confusion about when structural simplification should work / what it does. It would be nice to have, right up front on the first page or tutorial, clarification of when it should work and what it is aimed at.

In the chemistry context one thinks of simplifying systems of (fully-determined) chemical rate equation ODEs as detection of linear conservation laws and exploiting them to reduce the number of states. I don't think it is surprising then that people coming from this area expect structural simplification to do this (which last time I checked it does not do), and then think that perhaps what is need is to explicitly list the conservation law as an extra algebraic equation (making the system over-determined). It would potentially head off such confusion to more explicitly point out what simplification currently handles / requires about the system, and note clear cases such as these that it does not cover.

Just a thought!

isaacsas commented 3 years ago

Longer-term, it would be even better if there was functionality for detecting linear conservation laws and using them to reduce systems. We can do this in Catalyst, and probably will think about it at some point, but it seems like maybe it makes sense at the ODESystem level too.

ChrisRackauckas commented 3 years ago

Agreed, it would be good to add to the docstring.

It would be interesting to use some deficiency theory for learning conservation laws:

https://reaction-networks.net/wiki/Deficiency_theory#:~:text=Deficiency%20theory%20in%20chemical%20reaction,pertain%20to%20mass%20action%20systems. http://web.mit.edu/~jadbabai/www/ESE680/Fei87a.pdf https://www.math.wisc.edu/~anderson/RecentTalks/2008/MBI2008.pdf

kaandocal commented 3 years ago

I'm currently working on a package that uses Catalyst/MT and uses some matrix stuff to automatically find all linear conservation laws, see src/fspsystem.jl in the repo. Maybe this could just be incorporated into Catalyst?

ChrisRackauckas commented 3 years ago

That would be fantastic.

isaacsas commented 3 years ago

Yes, that is something we've had planned for Catalyst and would great to house there. It would go well with https://github.com/SciML/Catalyst.jl/pull/326, which I've been working on cleaning up for merging (along with finally starting to work on your two outstanding PRs!).