Use SubsetReplace for Symbolic implementation #401
Labels
evolution
Modifies code for running the evolution of the model
optimization
Does not change functionality but makes code faster
wolfram language
Requires Wolfram Language implementation
The problem
Wolfram Language (
Method -> "Symbolic"
) implementation is currently quite complex and inefficient. Since it was introduced, however, a new Wolfram Language version was released, which now hasSubsetReplace
. It's more efficient than the current implementation, supports arbitrary WL patterns, and we should use it in the symbolic implementation.Note, that it is not sufficient to simply use
SubsetReplace
instead of, say,WolframModel
becauseWolframModel
offers more evolution options (such as step limits based on different properties of the states), and analysis tools (such as causal graphs).Possible solution
Using
SubsetReplace
should eliminate the need fortoNormalRules
, however, incorporating it is not as simple as calling it insetReplace$wl
because we still need to care about evolution order.SubsetReplace
does not offer many options to control evolution, and we will need to find a way around that.Alternative solutions
We could also modify the C++ implementation to call back Wolfram Kernel and support arbitrary expressions. That would eliminate a lot of code duplication. However, that is also non-trivial to do, and having two independent implementations is useful for testing.
The text was updated successfully, but these errors were encountered: