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

Implement SemilinearODEProblem #1506

Open RickDW opened 2 years ago

RickDW commented 2 years ago

Could be used as an alternative to DAEProblem/ODAEProblem/ODEProblem -> quoting Chris Rackauckas in the Julia slack

ChrisRackauckas commented 2 years ago

@shashi added Symbolics.semilinear_form to take a function f and split it into f = Au + f_n i.e. split out the linear part efficiently. This could be used to generate a SplitODEProblem https://diffeq.sciml.ai/stable/types/split_ode_types/ which could be a much more efficient solver for some types of equations (such as partial differential equations). Also, it would reduce compile times in many models which are "mostly linear".

It would be nice to then also have a semiquadratic form f = Au + u'Bu + f_n as well. No ODE solvers that I know of make use of this information right now, so it would still just be a SplitODEProblem, but it could still have some pretty massive compile time benefits. This is because the only thing that would really have to compile would be the big f_n, but in many cases, like mass-action kinetics, have the majority of terms captured by the linear and quadratic terms. This would leave only the "truly nonlinear stuff" to f_n, making the function much smaller and much more managable. Future ODE solver research could improve the usage of this as well.