model PlugToPin_n "Connect one (negative) pin"
parameter Integer m(final min = 1) = 3 "Number of phases";
parameter Integer k(final min = 1, final max = m) = 1 "Phase index";
Interfaces.NegativePlug plug_n(final m = m) annotation (Placement(transformation(extent = {
{-30, -10},
{-10, 10}})));
QuasiStationary.SinglePhase.Interfaces.NegativePin pin_n annotation (Placement(transformation(extent = {
{10, -10},
{30, 10}})));
equation
for j in 1:m loop
plug_n.pin[j].i = if j == k then -pin_n.i else Complex(0);
end for;
Connections.branch(plug_n.reference, pin_n.reference);
pin_n.v = plug_n.pin[k].v;
plug_n.reference.gamma = pin_n.reference.gamma;
annotation (
defaultComponentName = "plugToPin",
Icon(graphics = {
Rectangle(
extent = {
{-20, 20},
{40, -20}},
fillColor = {215, 215, 215},
fillPattern = FillPattern.Solid),
Ellipse(
extent = {
{-40, 20},
{0, -20}},
fillColor = {215, 215, 215},
fillPattern = FillPattern.Solid),
Text(
extent = {
{-150, 50},
{150, 90}},
textString = "%name",
lineColor = {0, 0, 255}),
Text(
extent = {
{-150, -40},
{150, -80}},
textString = "k = %k")}),
Documentation(info = "<html>\n<p>\nConnects the single phase (negative) pin <code>k</code> of the multi phase (negative) plug to a single phase (negative) pin.\n</p>\n<h4>See also</h4>\n<p>\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.MultiPhase.Basic.PlugToPin_p\">PlugToPin_p</a>,\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.MultiPhase.Basic.PlugToPins_p\">PlutToPins_p</a>,\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.MultiPhase.Basic.PlugToPins_n\">PlugToPins_n</a>\n</p>\n</html>"));
end PlugToPin_n;