Multiple Connections to a Single Connector


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.


x
 
1
model ResistorCircuit
2
  Modelica.Electrical.Analog.Basic.Resistor R1(R = 100);
3
  Modelica.Electrical.Analog.Basic.Resistor R2(R = 200);
4
  Modelica.Electrical.Analog.Basic.Resistor R3(R = 300);
5
equation
6
  connect(R1.p, R2.p);
7
  connect(R1.p, R3.p);
8
end ResistorCircuit;
9


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.


9
 
1
model TripleSprings
2
  Modelica.Mechanics.Rotational.Spring spring1(c = 1, s_rel0 = 0.1);
3
  Modelica.Mechanics.Rotational.Spring spring2(c = 1, s_rel0 = 0.1);
4
  Modelica.Mechanics.Rotational.Spring spring3(c = 1, s_rel0 = 0.1);
5
equation
6
  connect(spring1.flange_a, spring2.flange_a);
7
  connect(spring1.flange_a, spring3.flange_a);
8
end TripleSprings;
9