Simple symbolic equation manipulation with ModelingToolkit.jl

I simply would like to isloate a variable from an expression/equation, e.g.:

using ModelingToolkit
@variables a b c
eqs = 0 ~ a + b + c

I want to solve this for variable ‘a’ (isolate ‘a’ on the left hand side).
As I understand, Modeling Toolkit is mainly intended for coupling of symbolic and numeric math and optimize the latter. However, I would like to use it for this kind of (or more complicated) equation solving instead of doing it by hand.
Thanks!

1 Like

It’s not fully documented yet, but the alias elimination code is how we do it:

https://github.com/SciML/ModelingToolkit.jl/blob/91043dc66f6e8fb8724060ef40ba8e4c0e04110e/src/systems/reduction.jl

You might want to wait until it’s documented or use that to write the docs, taking into account any changes in https://github.com/SciML/ModelingToolkit.jl/pull/720

3 Likes

Thank you Chris! I am new to Julia and don’t understand what the function does exactly. So I’ll wait for the documenation.