model MultiTerminalBox "Terminal box Y/D-connection"
parameter Integer m(min = 1) = 3 "Number of phases";
final parameter Integer mSystems = Electrical.MultiPhase.Functions.numberOfSymmetricBaseSystems(m);
final parameter Integer mBasic = integer(m / mSystems);
parameter String terminalConnection(start = "Y") "Choose Y=star/D=delta"
annotation (choices(
choice = "Y" "Star connection",
choice = "D" "Delta connection"));
Modelica.Electrical.QuasiStationary.MultiPhase.Interfaces.PositivePlug plug_sp(final m = m) "To positive stator plug"
annotation (Placement(
transformation(extent = {
{50, -50},
{70, -70}}),
iconTransformation(extent = {
{50, -50},
{70, -70}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Interfaces.NegativePlug plug_sn(final m = m) "To negative stator plug"
annotation (Placement(
transformation(extent = {
{-70, -50},
{-50, -70}}),
iconTransformation(extent = {
{-70, -50},
{-50, -70}})));
Electrical.QuasiStationary.MultiPhase.Basic.MultiStar multiStar(final m = m) if terminalConnection <> "D" annotation (Placement(transformation(
origin = {-70, -80},
extent = {
{-10, 10},
{10, -10}},
rotation = 180)));
Electrical.QuasiStationary.MultiPhase.Basic.MultiDelta multiDelta(final m = m) if terminalConnection == "D" annotation (Placement(transformation(extent = {
{-20, -70},
{-40, -50}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Interfaces.PositivePlug plugSupply(final m = m) "To grid"
annotation (Placement(
transformation(extent = {
{-10, -30},
{10, -50}}),
iconTransformation(extent = {
{-10, -30},
{10, -50}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Interfaces.NegativePlug starpoint(final m = mSystems) if terminalConnection <> "D" annotation (Placement(
transformation(extent = {
{-110, -50},
{-90, -30}}),
iconTransformation(extent = {
{-110, -50},
{-90, -30}})));
equation
connect(starpoint,multiStar.starpoints) annotation (Line(
points = {
{-100, -40},
{-86, -40},
{-86, -80},
{-80, -80}},
color = {85, 170, 255}));
connect(plugSupply,plug_sp) annotation (Line(
points = {
{0, -40},
{0, -60},
{60, -60}},
color = {85, 170, 255}));
connect(multiStar.plug_p,plug_sn) annotation (Line(
points = {
{-60, -80},
{-60, -60}},
color = {85, 170, 255}));
connect(multiDelta.plug_n,plug_sn) annotation (Line(
points = {
{-40, -60},
{-40, -60},
{-60, -60}},
color = {85, 170, 255}));
connect(multiDelta.plug_p,plug_sp) annotation (Line(
points = {
{-20, -60},
{60, -60},
{60, -60}},
color = {85, 170, 255}));
annotation (
defaultComponentName = "terminalBox",
Icon(
coordinateSystem(
preserveAspectRatio = false,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Polygon(
points = {
{-74, -40},
{-80, -46},
{-80, -80},
{-40, -100},
{40, -100},
{80, -70},
{80, -44},
{76, -40},
{-74, -40}},
lineColor = {95, 95, 95},
fillColor = {135, 135, 135},
fillPattern = FillPattern.CrossDiag),
Text(
extent = {
{-40, -50},
{40, -90}},
textString = "%terminalConnection")}),
Documentation(info = "<html>\nTerminalBox: at the bottom connected to both machine plugs, connect at the top to the grid as usual,<br>\nchoosing Y-connection (StarDelta=Y) or D-connection (StarDelta=D).\n</html>"));
end MultiTerminalBox;