Hi! In the MTK documentation, specifically page Contextual Variable Types · ModelingToolkit.jl (sciml.ai) it reads:
In many engineering systems some variables act like “flows” while others do not. For example, in circuit models you have current which flows, and the related voltage which does not. Or in thermal models you have heat flows. In these cases, the
connect
statement enforces conservation of flow between all of the connected components.
I first came across this in the Acausal Component-Based Modeling · ModelingToolkit.jl (sciml.ai) tutorial:
@connector function Pin(;name)
sts = @variables v(t)=1.0 i(t)=1.0 [connect = Flow]
ODESystem(Equation[], t, sts, []; name=name)
end
I’ve come across Connectors · Issue #814 · SciML/ModelingToolkit.jl (github.com).
I understand there’s three different options for the connect
metadata, Equality
, Flow
, and Stream
, as shown in the source: ModelingToolkit.jl/variables.jl at master · SciML/ModelingToolkit.jl · GitHub.
Can someone explain what these three options represent and how they could be used? Thanks ^^