Connectors
Connectors
The Modelica standard library defines the most important elementary connectors in various domains. If any possible, a user should utilize these connectors in order that components from the Modelica Standard Library and from other libraries can be combined without problems. The following elementary connectors are defined (potential variables are connector variables without the flow attribute, flow variables are connector variables that have the flow attribute):
| domain | pot. variables | flow variables | connector definition | icons |
| electrical analog |
electrical potential | electrical current | Modelica.Electrical.Analog.Interfaces
Pin, PositivePin, NegativePin |
![]() |
| electrical multi-phase |
vector of electrical pins | Modelica.Electrical.MultiPhase.Interfaces
Plug, PositivePlug, NegativePlug |
![]() | |
| electrical sphace phasor |
2 electrical potentials | 2 electrical currents | Modelica.Electrical.Machines.Interfaces
SpacePhasor |
![]() |
| magnetic | magnetic potential | magnetic flux |
Modelica.Magnetic.FluxTubes.Interfaces
MagneticPort, PositiveMagneticPort, NegativeMagneticPort |
![]() |
| translational | distance | cut-force | Modelica.Mechanics.Translational.Interfaces
Flange_a, Flange_b |
![]() |
| rotational | angle | cut-torque | Modelica.Mechanics.Rotational.Interfaces
Flange_a, Flange_b |
![]() |
| 3-dim. mechanics |
position vector orientation object |
cut-force vector cut-torque vector |
Modelica.Mechanics.MultiBody.Interfaces
Frame, Frame_a, Frame_b, Frame_resolve |
![]() |
| simple fluid flow |
pressure specific enthalpy |
mass flow rate enthalpy flow rate |
Modelica.Thermal.FluidHeatFlow.Interfaces
FlowPort, FlowPort_a, FlowPort_b |
![]() |
| heat transfer |
temperature | heat flow rate | Modelica.Thermal.HeatTransfer.Interfaces
HeatPort, HeatPort_a, HeatPort_b |
![]() |
| block diagram |
Real variable Integer variable Boolean variable |
--- | Modelica.Blocks.Interfaces
RealSignal, RealInput, RealOutput IntegerSignal, IntegerInput, IntegerOutput BooleanSignal, BooleanInput, BooleanOutput |
![]() |
| state machine |
Boolean variables (occupied, set, available, reset) |
--- | Modelica.StateGraph.Interfaces
Step_in, Step_out, Transition_in, Transition_out |
![]() |
| Connectors from other libraries | ||||
| hydraulic | pressure | volume flow rate | HyLibLight.Interfaces
Port_A, Port_b |
![]() |
| pneumatic | pressure | mass flow rate | PneuLibLight.Interfaces
Port_1, Port_2 |
![]() |
In all domains, usually 2 connectors are defined. The variable declarations are identical, only the icons are different in order that it is easy to distinguish connectors of the same domain that are attached at the same component.
Modelica supports also hierarchical connectors, in a similar way as hierarchical models. As a result, it is, e.g., possible, to collect elementary connectors together. For example, an electrical plug consisting of two electrical pins can be defined as:
connector Plug import Modelica.Electrical.Analog.Interfaces; Interfaces.PositivePin phase; Interfaces.NegativePin ground; end Plug;
With one connect(..) equation, either two plugs can be connected (and therefore implicitly also the phase and ground pins) or a Pin connector can be directly connected to the phase or ground of a Plug connector, such as "connect(resistor.p, plug.phase)".













