Star

model Star "Star-connection"
    parameter Integer m(final min = 1) = 3 "Number of phases";
    Interfaces.PositivePlug plug_p(final m = m) annotation (Placement(transformation(extent = {
        {-110, -10}, 
        {-90, 10}})));
    Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (Placement(transformation(extent = {
        {90, -10}, 
        {110, 10}})));
equation
    for j in 1:m loop
        plug_p.pin[j].v = pin_n.v;
    end for;
    sum(plug_p.pin.i) + pin_n.i = 0;

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = false,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {-150, 70}, 
                        {150, 110}},
                    textString = "%name",
                    lineColor = {0, 0, 255}), 
                Line(
                    points = {
                        {80, 0}, 
                        {0, 0}},
                    thickness = 0.5,
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {0, 0}, 
                        {-39, 68}},
                    thickness = 0.5,
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {0, 0}, 
                        {-38, -69}},
                    thickness = 0.5,
                    color = {0, 0, 255}), 
                Text(
                    extent = {
                        {-150, -110}, 
                        {150, -70}},
                    textString = "m=%m"), 
                Line(
                    points = {
                        {-90, 0}, 
                        {-40, 0}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {80, 0}, 
                        {90, 0}},
                    color = {0, 0, 255})}),
        Documentation(info = "<html>\n<p>\nConnects all pins of plug_p to pin_n, thus establishing a so-called star-connection.\n</p>\n\n<h4>See also</h4>\n<p>\n<a href=\"modelica://Modelica.Electrical.MultiPhase.Basic.Delta\">Delta</a>,\n<a href=\"modelica://Modelica.Electrical.MultiPhase.Basic.MultiStar\">MultiStar</a>,\n<a href=\"modelica://Modelica.Electrical.MultiPhase.Basic.MultiDelta\">MultiDelta</a>\n</p>\n\n</html>"));
end Star;