Declare flow (through) variable, which have to sum up to zero in connections


connector Pin
  Modelica.Units.SI.Voltage v;
  flow Modelica.Units.SI.Current i;
end Pin;

model A
  Pin p;
end A;

model Composition
  A a;
  A b;
  A c;
  connect(a.p, b.p);
  connect(a.p, c.p);
end Composition;

From the connect statements in model Composition, the following connect equations are derived:

a.p.v = b.p.v;
a.p.v = c.p.v;
a.p.i + b.p.i + c.p.i = 0;


See section on type_prefix in the Modelica Grammar.


The flow prefix is used in order to generate equations for through variables, which sum up to zero in connections, whereas variables without the flow prefix are identical in a connection.

Generated at 2024-04-12T18:15:54Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos