In almost all previous examples we only connected two connectors. In fact, there is in general no limitation to the number of connections that can be made to a single connector, apart from connector classes that very specifically limits the cardinality of the connections. In the class ResistorCircuit three resistors are connected at one node.
model ResistorCircuit
Modelica.Electrical.Analog.Basic.Resistor R1(R = 100);
Modelica.Electrical.Analog.Basic.Resistor R2(R = 200);
Modelica.Electrical.Analog.Basic.Resistor R3(R = 300);
equation
connect(R1.p, R2.p);
connect(R1.p, R3.p);
end ResistorCircuit;
As usual the special operator connect produces equations by taking into account what kind of variables , flow or non-flow, that are involved. The generated equations, based on equal potential at a connection point and Kirchhoff's current law, are as follows for this particular example:
R1.p.v = R2.p.v;
R1.p.v = R3.p.v;
R1.p.i + R2.p.i + R3.p.i = 0;
The model TripleSprings has three connected springs.
model TripleSprings
Modelica.Mechanics.Rotational.Spring spring1(c = 1, s_rel0 = 0.1);
Modelica.Mechanics.Rotational.Spring spring2(c = 1, s_rel0 = 0.1);
Modelica.Mechanics.Rotational.Spring spring3(c = 1, s_rel0 = 0.1);
equation
connect(spring1.flange_a, spring2.flange_a);
connect(spring1.flange_a, spring3.flange_a);
end TripleSprings;