Dynamically switching connect in Modelica
问题 Assume I have a large connector involving all kinds of base types (Real, Integer, String, Boolean). How can I switch connections based on state events? I would like to do something like this: model switch input ComplicatedConnector icon[2]; output ComplicatedConnector ocon; input Real x; equation if x >= 0 then connect(ocon, icon[1]); else connect(ocon, icon[2]); end if; end switch; This does not work. How can it be properly expressed in Modelica? Answer based on comment by Adrian Pop. model