First off, the new functionality for connecting systems in ModelingToolkit is really powerful, awesome job!
I have a few issues with it that I can’t solve, however…
Suppose I have a ModelingToolkit ODESystem
To interactively access a state V(t) or a state W(t) in the subsystem sub, I need only write the following code
How should I non-interactively access these variables? IE I want to build functions of the form
return_state(od, "V") ## gives od.V(t) return substate(od, "sub", "W") ## gives od.sub.W(t) and not sub.W(t).
The difference between od.sub.W(t) and sub.W(t) seems to be important when connecting subsubsystems to other ODESystems.
Struggling to build such functions.
Thanks a lot in advance!
Also, to be a bit more informative as to why this is useful, I have a system with states x_1(t) … x_N(t). These are a subset of all the system states, and their position in the system.states array is variable. I need a function which takes in an integer i, and returns od.x_i(t)