ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
Array of components
Is there an example of how to use arrays of components in the documentation❓
From a presentation, I've seen the the syntax:
@components begin
resistor[1:n] = Resistor()
end
I don't know if this is a standard notation or not. I've tried to use it, but have problems when I add equations where the instances have fields, such...
@equations begin
resistor[1].R ~ 3
end
would not work.
However,
@components begin
resistor_1 = Resistor()
end
#
@equations begin
resistor_1.R ~ 3
end
would work.