text
stringlengths 1
4.74k
| code
stringlengths 69
637k
|
---|---|
AC DC converter. This model represents a simplified conversion between a three-phase
balanced AC system and a DC systems. | within AixLib.Electrical.AC.ThreePhasesBalanced.Conversion;
model ACDCConverter "AC DC converter"
extends AixLib.Electrical.AC.OnePhase.Conversion.ACDCConverter(
redeclare Interfaces.Terminal_n terminal_n);
end ACDCConverter; |
Package with transformers and converter models for three-phase balanced AC systems | within AixLib.Electrical.AC.ThreePhasesBalanced;
package Conversion "Package with transformers and converter models for three-phase balanced AC systems"
extends Modelica.Icons.Package;
end Conversion; |
This example illustrates how to use the AC/AC converter model. This example illustrates the use of a model that converts AC voltage to AC voltage.
The transformer model assumes a linear loss when transmitting the power. | within AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.Examples;
model ACACConverter
"This example illustrates how to use the AC/AC converter model"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACConverter
conACAC(eta=0.9, conversionFactor=120/480) "ACAC transformer"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou(
definiteReference=true,
f=60,
V=480) "Voltage source"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Inductive load(
mode=AixLib.Electrical.Types.Load.VariableZ_P_input,
V_nominal=120) "Load model"
Modelica.Blocks.Sources.Ramp ramp(
duration=0.5,
startTime=0.3,
height=2000,
offset=-1000) "Power consumed by the model"
equation
connect(sou.terminal, conACAC.terminal_n)
connect(conACAC.terminal_p, load.terminal)
connect(ramp.y, load.Pow)
end ACACConverter; |
This example illustrates how to use the AC/AC simplified transformer model. This example illustrates the use of the AC/AC transformer model.
The example shows three different configurations: | within AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.Examples;
model ACACTransformer
"This example illustrates how to use the AC/AC simplified transformer model"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformer tra_load(
Zperc=0.03,
VABase=4000,
XoverR=8,
VHigh=480,
VLow=120) "Transformer with load"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou(
definiteReference=true,
f=60,
V=480) "Voltage source"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Inductive load(
mode=AixLib.Electrical.Types.Load.VariableZ_P_input,
pf=0.8,
V_nominal=120) "Load model"
Modelica.Blocks.Sources.Ramp ramp(
duration=0.5,
startTime=0.3,
offset=0,
height=-4000*0.8) "Load power consumption profile"
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformer tra_cc(
XoverR=8,
Zperc=0.03,
VABase=4000,
VHigh=480,
VLow=120) "Transformer with short circuit"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Impedance shortCircuit(R=1e-8)
"Short circuit"
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformer tra_void(
XoverR=8,
Zperc=0.03,
VABase=4000,
VHigh=480,
VLow=120) "Transformer with secondary not connected"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou1(
definiteReference=true,
f=60,
V=480) "Voltage source for open and short circuit tests"
equation
connect(sou.terminal, tra_load.terminal_n)
connect(tra_load.terminal_p, load.terminal)
connect(ramp.y, load.Pow)
connect(tra_cc.terminal_p, shortCircuit.terminal)
connect(sou1.terminal, tra_cc.terminal_n)
connect(sou1.terminal, tra_void.terminal_n)
end ACACTransformer; |
This example illustrates how to use the AC/AC transformer model. This example illustrates the use of the AC/AC transformer model
that includes losses at the primary and secondary side and magnetization
effects.
The example shows three different configurations: | within AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.Examples;
model ACACTransformerFull
"This example illustrates how to use the AC/AC transformer model"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformerFull tra_load(
R1=0.0001,
L1=0.0001,
R2=0.0001,
L2=0.0001,
VABase=4000,
magEffects=true,
Rm=10,
Lm=10,
VHigh=480,
VLow=120,
f=60) "Transformer with load"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou(
definiteReference=true,
f=60,
V=480) "Voltage source"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Inductive load(
mode=AixLib.Electrical.Types.Load.VariableZ_P_input,
pf=0.8,
V_nominal=120) "Load"
Modelica.Blocks.Sources.Ramp ramp(
duration=0.5,
startTime=0.3,
offset=0,
height=-4000*0.8) "Load power consumption profile"
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformerFull tra_cc(
VABase=4000,
R1=0.01,
L1=0.01,
R2=0.01,
L2=0.01,
magEffects=false,
Rm=100,
Lm=100,
VHigh=480,
VLow=120,
f=60) "Transformer with short circuit connection"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Impedance shortCircuit(R=1e-8)
"Short circuit"
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformerFull tra_void(
VABase=4000,
R1=0.01,
L1=0.01,
R2=0.01,
L2=0.01,
magEffects=false,
Rm=100,
Lm=100,
VHigh=480,
VLow=120,
f=60) "Transformer with open connection"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou1(
definiteReference=true,
f=60,
V=480) "Voltage source for short circuit and open tests"
equation
connect(sou.terminal, tra_load.terminal_n)
connect(tra_load.terminal_p, load.terminal)
connect(ramp.y, load.Pow)
connect(tra_cc.terminal_p, shortCircuit.terminal)
connect(sou1.terminal, tra_cc.terminal_n)
connect(sou1.terminal, tra_void.terminal_n)
end ACACTransformerFull; |
This example illustrates how to use the AC/DC converter model. This example illustrates the use of a model that converts AC voltage to DC voltage.
The transformer model assumes a linear loss when transmitting the power. | within AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.Examples;
model ACDCConverter
"This example illustrates how to use the AC/DC converter model"
extends Modelica.Icons.Example;
AixLib.Electrical.DC.Loads.Resistor res(
R=1,
V_nominal=120,
i(each start=0))
"Resistive load"
AixLib.Electrical.AC.ThreePhasesBalanced.Conversion.ACDCConverter conversion(
eta=0.9,
ground_AC=false,
ground_DC=true,
conversionFactor=120/480) "AC/DC transformer"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou(
definiteReference=true,
f=60,
V=480) "Voltage source"
AixLib.Electrical.DC.Loads.Conductor load(
mode=AixLib.Electrical.Types.Load.VariableZ_P_input,
V_nominal=120) "Variable resistive load"
Modelica.Blocks.Sources.Ramp pow(
duration=0.5,
startTime=0.2,
offset=-200,
height=5200) "Variable load profile"
equation
connect(sou.terminal, conversion.terminal_n)
connect(conversion.terminal_p, res.terminal)
connect(conversion.terminal_p, load.terminal)
connect(pow.y, load.Pow)
end ACDCConverter; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesBalanced.Conversion;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
Package interfaces for three-phase balanced AC systems | within AixLib.Electrical.AC.ThreePhasesBalanced;
package Interfaces "Package interfaces for three-phase balanced AC systems"
extends Modelica.Icons.InterfacesPackage;
end Interfaces; |
AC three-phase balanced terminal ('negative') | within AixLib.Electrical.AC.ThreePhasesBalanced.Interfaces;
connector Terminal_n "AC three-phase balanced terminal ('negative')"
extends AixLib.Electrical.Interfaces.Terminal(
redeclare replaceable package PhaseSystem = PhaseSystems.OnePhase);
end Terminal_n; |
AC three-phase balanced terminal ('positive') | within AixLib.Electrical.AC.ThreePhasesBalanced.Interfaces;
connector Terminal_p "AC three-phase balanced terminal ('positive')"
extends AixLib.Electrical.Interfaces.Terminal(
redeclare replaceable package PhaseSystem = PhaseSystems.OnePhase);
end Terminal_p; |
Model of an electrical line. This model represents a cable for three-phase balanced AC systems. The model is based on
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesBalanced.Lines.TwoPortRLC\">
AixLib.Electrical.AC.ThreePhasesBalanced.Lines.TwoPortRLC</a>
and provides functionalities to parametrize the values of <i>R</i>, <i>L</i> and <i>C</i> either
using commercial cables or using default values. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
model Line "Model of an electrical line"
extends AixLib.Electrical.AC.OnePhase.Lines.Line(
redeclare Interfaces.Terminal_n terminal_n,
redeclare Interfaces.Terminal_p terminal_p,
V_nominal(start=480),
redeclare TwoPortRLC line(
R=R,
L=L,
C=C,
V_nominal=V_nominal));
end Line; |
Three phases balanced AC network. This model represents a generalized electrical AC three-phase balanced network. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
model Network "Three phases balanced AC network"
extends AixLib.Electrical.Transmission.BaseClasses.PartialNetwork(
V_nominal(start = 480),
redeclare Interfaces.Terminal_p terminal,
redeclare replaceable Transmission.Grids.TestGrid2Nodes grid,
redeclare Lines.Line lines(
redeclare replaceable
AixLib.Electrical.Transmission.LowVoltageCables.Generic commercialCable=grid.cables));
Modelica.Units.SI.Voltage VAbs[grid.nNodes] "RMS voltage of the grid nodes";
equation
for i in 1:grid.nLinks loop
connect(lines[i].terminal_p, terminal[grid.fromTo[i,1]]);
connect(lines[i].terminal_n, terminal[grid.fromTo[i,2]]);
end for;
for i in 1:grid.nNodes loop
VAbs[i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].v);
end for;
end Network; |
Package with line models for three-phase balanced AC systems | within AixLib.Electrical.AC.ThreePhasesBalanced;
package Lines "Package with line models for three-phase balanced AC systems"
extends Modelica.Icons.Package;
end Lines; |
Model of an inductance with two electrical ports. Inductance that connects two AC three-phase
balanced interfaces. This model can be used to represent a
cable in a three-phase balanced AC system. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
model TwoPortInductance "Model of an inductance with two electrical ports"
extends AixLib.Electrical.AC.OnePhase.Lines.TwoPortInductance(
redeclare Interfaces.Terminal_n terminal_n,
redeclare Interfaces.Terminal_p terminal_p);
end TwoPortInductance; |
Model of a resistance with two electrical ports. Resistance that connects two AC three-phase
balanced interfaces. This model can be used to represent a
cable in a three-phase balanced AC system. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
model TwoPortResistance "Model of a resistance with two electrical ports"
extends AixLib.Electrical.AC.OnePhase.Lines.TwoPortResistance(
redeclare Interfaces.Terminal_n terminal_n,
redeclare Interfaces.Terminal_p terminal_p);
end TwoPortResistance; |
Model of a resistive-inductive element with two electrical ports. Resistive-inductive impedance that connects two AC three-phase
balanced interfaces. This model can be used to represent a
cable in a three-phase balanced AC system. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
model TwoPortRL
"Model of a resistive-inductive element with two electrical ports"
extends AixLib.Electrical.AC.OnePhase.Lines.TwoPortRL(
redeclare Interfaces.Terminal_n terminal_n,
redeclare Interfaces.Terminal_p terminal_p);
end TwoPortRL; |
Model of a RLC element with two electrical ports. RLC impedance that connects two AC three-phase
balanced interfaces. This model can be used to represent a
cable in a three-phase balanced AC system. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
model TwoPortRLC "Model of a RLC element with two electrical ports"
extends AixLib.Electrical.AC.OnePhase.Lines.TwoPortRLC(
redeclare Interfaces.Terminal_n terminal_n,
redeclare Interfaces.Terminal_p terminal_p);
end TwoPortRLC; |
Test model for single phase lines that use commercial cables. This example demonstrates how to use a line model to connect
a source to a load that uses commercial cables. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACLine "Test model for single phase lines that use commercial cables"
extends Modelica.Icons.Example;
ThreePhasesBalanced.Sources.FixedVoltage E(definiteReference=true,
f=60,
V=480) "Voltage source"
ThreePhasesBalanced.Loads.Impedance R1(R=10) "Resistive load 1"
ThreePhasesBalanced.Lines.Line line_1(
P_nominal=5000,
l=2000,
mode=Types.CableMode.commercial,
commercialCable=Transmission.LowVoltageCables.Cu50(),
V_nominal=480) "Resistive line that connects to load 1"
ThreePhasesBalanced.Lines.Line line_2a(
P_nominal=5000,
mode=Types.CableMode.commercial,
commercialCable=Transmission.LowVoltageCables.Cu50(),
l=1000,
V_nominal=480) "Resistive line that connects to load 2"
ThreePhasesBalanced.Loads.Impedance R2(R=10) "Resistive load 2"
ThreePhasesBalanced.Lines.Line line_2b(
P_nominal=5000,
mode=Types.CableMode.commercial,
commercialCable=Transmission.LowVoltageCables.Cu50(),
l=1000,
V_nominal=480) "Resistive line that connects to load 2"
ThreePhasesBalanced.Lines.Line line_3a(
P_nominal=5000,
mode=Types.CableMode.commercial,
commercialCable=Transmission.LowVoltageCables.Cu50(),
l=4000,
V_nominal=480) "Resistive line that connects to load 3"
ThreePhasesBalanced.Lines.Line line_3b(
P_nominal=5000,
mode=Types.CableMode.commercial,
commercialCable=Transmission.LowVoltageCables.Cu50(),
l=4000,
V_nominal=480) "Resistive line that connects to load 3"
ThreePhasesBalanced.Loads.Impedance R3(R=10) "Resistive load 3"
ThreePhasesBalanced.Lines.Line line_sc(
P_nominal=5000,
l=2000,
mode=Types.CableMode.commercial,
commercialCable=Transmission.LowVoltageCables.Cu50(),
V_nominal=480) "Line that connects the source and the short circuit"
ThreePhasesBalanced.Loads.Impedance load_sc(R=0) "Short circuit"
equation
connect(line_1.terminal_p, R1.terminal)
connect(E.terminal, line_1.terminal_n)
connect(E.terminal, line_2a.terminal_n)
connect(line_2a.terminal_p, line_2b.terminal_n)
connect(line_2b.terminal_p, R2.terminal)
connect(line_3a.terminal_p, R3.terminal)
connect(line_3b.terminal_p, R3.terminal)
connect(E.terminal, line_3a.terminal_n)
connect(E.terminal, line_3b.terminal_n)
connect(line_sc.terminal_p, load_sc.terminal)
connect(E.terminal, line_sc.terminal_n)
end ACLine; |
Test model for a single phase line that uses medium voltage commercial cable information . This example demonstrates how to use a line model to connect
a source to a load that uses medium voltage commercial cable information. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACLineMedium
"Test model for a single phase line that uses medium voltage commercial cable information "
extends Modelica.Icons.Example;
ThreePhasesBalanced.Sources.FixedVoltage E(definiteReference=true, V=15000,
f=60) "Voltage source"
ThreePhasesBalanced.Loads.Impedance R1(R=10) "Resistive load 1"
ThreePhasesBalanced.Lines.Line line_1(
P_nominal=5000,
l=2000,
redeclare AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = AixLib.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10(),
V_nominal=15000) "Resistive line that connects to load 1"
ThreePhasesBalanced.Lines.Line line_2a(
P_nominal=5000,
l=1000,
redeclare AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = AixLib.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10(),
V_nominal=15000) "Resistive line that connects to load 2"
ThreePhasesBalanced.Loads.Impedance R2(R=10) "Resistive load 2"
ThreePhasesBalanced.Lines.Line line_2b(
P_nominal=5000,
l=1000,
redeclare AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = AixLib.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10(),
V_nominal=15000) "Resistive line that connects to load 2"
ThreePhasesBalanced.Lines.Line line_3a(
P_nominal=5000,
l=4000,
redeclare AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = AixLib.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10(),
V_nominal=15000) "Resistive line that connects to load 3"
ThreePhasesBalanced.Lines.Line line_3b(
P_nominal=5000,
l=4000,
redeclare AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = AixLib.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10(),
V_nominal=15000) "Resistive line that connects to load 3"
ThreePhasesBalanced.Loads.Impedance R3(R=10) "Resistive load 3"
ThreePhasesBalanced.Lines.Line line_sc(
P_nominal=5000,
l=2000,
redeclare AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = AixLib.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10(),
V_nominal=15000) "Line that connects the source and the short circuit"
ThreePhasesBalanced.Loads.Impedance load_sc(R=0) "Short circuit"
equation
connect(line_1.terminal_p, R1.terminal)
connect(E.terminal, line_1.terminal_n)
connect(E.terminal, line_2a.terminal_n)
connect(line_2a.terminal_p, line_2b.terminal_n)
connect(line_2b.terminal_p, R2.terminal)
connect(line_3a.terminal_p, R3.terminal)
connect(line_3b.terminal_p, R3.terminal)
connect(E.terminal, line_3a.terminal_n)
connect(E.terminal, line_3b.terminal_n)
connect(line_sc.terminal_p, load_sc.terminal)
connect(E.terminal, line_sc.terminal_n)
end ACLineMedium; |
Test model for single phase inductive lines. This example demonstrates how to use a purely inductive line model to connect
a source to a load. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACLine_L "Test model for single phase inductive lines"
extends Modelica.Icons.Example;
parameter Modelica.Units.SI.Inductance Lbase=10/2/Modelica.Constants.pi/60
"Base value for the line inductances";
ThreePhasesBalanced.Sources.FixedVoltage E(definiteReference=true,
f=60,
V=480) "Voltage source"
ThreePhasesBalanced.Loads.Impedance R1(R=10) "Resistive load 1"
ThreePhasesBalanced.Loads.Impedance R2(R=10) "Resistive load 2"
ThreePhasesBalanced.Loads.Impedance R3(R=10) "Resistive load 3"
ThreePhasesBalanced.Loads.Impedance load_sc(R=0) "Short circuit"
ThreePhasesBalanced.Lines.TwoPortInductance Lline_sc(L=Lbase)
"Inductive line connected to the short circuit"
ThreePhasesBalanced.Lines.TwoPortInductance Lline_1(L=Lbase)
"Inductive line connected to load 1"
ThreePhasesBalanced.Lines.TwoPortInductance Lline_2a(L=0.5*Lbase)
"Inductive line connected to load 2"
ThreePhasesBalanced.Lines.TwoPortInductance Lline_2b(L=0.5*Lbase)
"Inductive line connected to load 2"
ThreePhasesBalanced.Lines.TwoPortInductance Lline_3(L=2*Lbase)
"Inductive line connected to load 3"
ThreePhasesBalanced.Lines.TwoPortInductance Lline_3b(L=2*Lbase)
"Inductive line connected to load 3"
equation
connect(E.terminal, Lline_sc.terminal_n)
connect(Lline_sc.terminal_p, load_sc.terminal)
connect(E.terminal, Lline_1.terminal_n)
connect(Lline_1.terminal_p, R1.terminal)
connect(E.terminal, Lline_2a.terminal_n)
connect(Lline_2a.terminal_p, Lline_2b.terminal_n)
connect(Lline_2b.terminal_p, R2.terminal)
connect(E.terminal, Lline_3.terminal_n)
connect(E.terminal, Lline_3b.terminal_n)
connect(Lline_3.terminal_p, R3.terminal)
connect(Lline_3b.terminal_p, R3.terminal)
end ACLine_L; |
Test model for single phase resistive lines. This example demonstrates how to use a resistive line model to connect
a source to a load. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACLine_R "Test model for single phase resistive lines"
extends Modelica.Icons.Example;
ThreePhasesBalanced.Sources.FixedVoltage E(definiteReference=true,
f=60,
V=480) "Voltage source"
ThreePhasesBalanced.Loads.Impedance R1(R=10) "Resistive load 1"
ThreePhasesBalanced.Loads.Impedance R2(R=10) "Resistive load 2"
ThreePhasesBalanced.Loads.Impedance R3(R=10) "Resistive load 3"
ThreePhasesBalanced.Loads.Impedance sc_load(R=0) "Short circuit load"
ThreePhasesBalanced.Lines.TwoPortResistance Rline_sc(R=10, useHeatPort=false)
"Resistive line that connects to the short circuit"
ThreePhasesBalanced.Lines.TwoPortResistance Rline_1(R=10)
"Resistive line that connects to load 1"
ThreePhasesBalanced.Lines.TwoPortResistance Rline_2a(R=5)
"Resistive line that connects to load 2"
ThreePhasesBalanced.Lines.TwoPortResistance Rline_2b(R=5)
"Resistive line that connects to load 2"
ThreePhasesBalanced.Lines.TwoPortResistance Rline_3a(R=20)
"Resistive line that connects to load 3"
ThreePhasesBalanced.Lines.TwoPortResistance Rline_3b(R=20)
"Resistive line that connects to load 3"
equation
connect(E.terminal, Rline_sc.terminal_n)
connect(Rline_sc.terminal_p, sc_load.terminal)
connect(E.terminal, Rline_1.terminal_n)
connect(Rline_1.terminal_p, R1.terminal)
connect(E.terminal, Rline_2a.terminal_n)
connect(Rline_2a.terminal_p, Rline_2b.terminal_n)
connect(Rline_2b.terminal_p, R2.terminal)
connect(E.terminal, Rline_3a.terminal_n)
connect(E.terminal, Rline_3b.terminal_n)
connect(Rline_3a.terminal_p, R3.terminal)
connect(Rline_3b.terminal_p, R3.terminal)
end ACLine_R; |
Test model for single phase inductive-resistive lines. This example demonstrates how to use a resistive-inductive line model to connect
a source to a load. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACLine_RL "Test model for single phase inductive-resistive lines"
extends Modelica.Icons.Example;
parameter Modelica.Units.SI.Resistance Rbase=10
"Base value for the line resistance";
parameter Modelica.Units.SI.Inductance Lbase=Rbase/2/Modelica.Constants.pi/60
"Base value for the line inductance";
ThreePhasesBalanced.Sources.FixedVoltage E(definiteReference=true,
f=60,
V=480) "Voltage source"
ThreePhasesBalanced.Loads.Impedance load_sc_1(R=0) "Short circuit 1"
ThreePhasesBalanced.Loads.Impedance load_sc_2(R=0) "Short circuit 2"
ThreePhasesBalanced.Lines.TwoPortRL RL_2(R=Rbase, L=Lbase)
"Resistive-Inductive line connected to short circuit 2"
ThreePhasesBalanced.Lines.TwoPortResistance R_1(R=Rbase)
"Resistance line connected to short circuit 1"
ThreePhasesBalanced.Lines.TwoPortInductance L_1(L=Lbase)
"Inductance line connected to short circuit 1"
ThreePhasesBalanced.Lines.TwoPortRL RL_3(
R=Rbase,
L=Lbase,
mode=AixLib.Electrical.Types.Load.FixedZ_dynamic)
"Dynamic resistive-inductive line connected to short circuit 3"
ThreePhasesBalanced.Loads.Impedance load_sc_3(R=0) "Short circuit 3"
equation
connect(E.terminal, R_1.terminal_n)
connect(R_1.terminal_p, L_1.terminal_n)
connect(L_1.terminal_p, load_sc_1.terminal)
connect(E.terminal, RL_2.terminal_n)
connect(RL_2.terminal_p, load_sc_2.terminal)
connect(E.terminal, RL_3.terminal_n)
connect(RL_3.terminal_p, load_sc_3.terminal)
end ACLine_RL; |
Test model for a network model. This example demonstrates how to use a network model to connect
a source to a load. In this simple case the network has two nodes
that are connected by a commercial line cable. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACSimpleGrid "Test model for a network model"
extends Modelica.Icons.Example;
ThreePhasesBalanced.Lines.Network network(
redeclare AixLib.Electrical.Transmission.Grids.TestGrid2Nodes grid,
V_nominal=480)
"Network model that represents the connection between the source and the load"
ThreePhasesBalanced.Loads.Inductive load(
P_nominal=2500,
mode=Types.Load.VariableZ_P_input,
V_nominal=480) "Load connected to the network"
ThreePhasesBalanced.Sources.FixedVoltage E(f=60, V=480) "Voltage source"
Modelica.Blocks.Sources.Ramp load_inputs(
height=5000,
duration=2,
offset=-2000,
startTime=0.5) "Input signal for the power consumption of the loads"
equation
connect(load.terminal, network.terminal[2])
connect(E.terminal, network.terminal[1])
connect(load_inputs.y, load.Pow)
end ACSimpleGrid; |
Test model for a network model with medium voltage. This example demonstrates how to use a network model to connect
a source to a load (using a medium voltage cable). In this simple case the network has two nodes
that are connected by a commercial line cable. | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines.Examples;
model ACSimpleGridMedium "Test model for a network model with medium voltage"
extends Modelica.Icons.Example;
ThreePhasesBalanced.Lines.Network network(
redeclare AixLib.Electrical.Transmission.Grids.TestGrid2NodesMedium grid,
lines(redeclare
AixLib.Electrical.Transmission.MediumVoltageCables.Generic
commercialCable = network.grid.cables,
each V_nominal = network.V_nominal),
V_nominal=15000)
"Network model that represents the connection between the source and the load"
ThreePhasesBalanced.Loads.Inductive load(mode=Types.Load.VariableZ_P_input,
P_nominal=250000,
V_nominal=15000) "Load connected to the network"
ThreePhasesBalanced.Sources.FixedVoltage E(V=15000, f=60) "Voltage source"
Modelica.Blocks.Sources.Ramp load_inputs(
height=5000,
duration=2,
offset=-2000,
startTime=0.5) "Input signal for the power consumption of the loads"
equation
connect(load.terminal, network.terminal[2])
connect(E.terminal, network.terminal[1])
connect(load_inputs.y, load.Pow)
end ACSimpleGridMedium; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesBalanced.Lines;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
Model of a capacitive and resistive load. Model of a capacitive load. See
<a href=\"modelica://AixLib.Electrical.AC.OnePhase.Loads.Capacitive\">
AixLib.Electrical.AC.OnePhase.Loads.Capacitive</a> for more information. | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads;
model Capacitive "Model of a capacitive and resistive load"
extends AixLib.Electrical.AC.OnePhase.Loads.Capacitive(
redeclare Interfaces.Terminal_n terminal,
V_nominal(start=480));
end Capacitive; |
Model of a resistive load | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads;
model Impedance "Model of a resistive load"
extends AixLib.Electrical.Interfaces.Impedance(
redeclare package PhaseSystem = PhaseSystems.OnePhase,
redeclare Interfaces.Terminal_n terminal);
parameter Boolean star = true
"Type of load connection: true = star, false = triangle"
protected
Modelica.Units.SI.Angle theRef "Absolute angle of rotating reference system";
Modelica.Units.SI.AngularVelocity omega
"Frequency of the quasi-stationary sine waves";
Modelica.Units.SI.Reactance X(start=1) "Complex component of the impedance";
equation
theRef = PhaseSystem.thetaRef(terminal.theta);
omega = der(theRef);
// Inductance of each line
if inductive then
X = omega*L_internal;
else
X = -1/(omega*C_internal);
end if;
// Ohm's law
if star then
terminal.v = {{R_internal,-X}*terminal.i, {X,R_internal}*terminal.i};
else
terminal.v = {{R_internal/3,-X/3}*terminal.i, {X/3,R_internal/3}*terminal.i};
end if;
end Impedance; |
Model of an inductive and resistive load. Model of an inductive load. See
<a href=\"modelica://AixLib.Electrical.AC.OnePhase.Loads.Inductive\">
AixLib.Electrical.AC.OnePhase.Loads.Inductive</a> for more information. | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads;
model Inductive "Model of an inductive and resistive load"
extends AixLib.Electrical.AC.OnePhase.Loads.Inductive(
redeclare Interfaces.Terminal_n terminal,
V_nominal(start=480));
end Inductive; |
Package with load models for three-phase balanced AC systems | within AixLib.Electrical.AC.ThreePhasesBalanced;
package Loads "Package with load models for three-phase balanced AC systems"
extends Modelica.Icons.VariantsPackage;
end Loads; |
Model of a resistive load. Model of a resistive load. See
<a href=\"modelica://AixLib.Electrical.AC.OnePhase.Loads.Resistive\">
AixLib.Electrical.AC.OnePhase.Loads.Resistive</a> for more information. | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads;
model Resistive "Model of a resistive load"
extends AixLib.Electrical.AC.OnePhase.Loads.Resistive(
redeclare Interfaces.Terminal_n terminal,
V_nominal(start=480));
end Resistive; |
Example that illustrates the use of the impedance models. This model illustrates the use of the impedance models.
The impedances have unitary values such that the RMS value of the voltage and of the current are the same. | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Examples;
model Impedances "Example that illustrates the use of the impedance models"
extends Modelica.Icons.Example;
Sources.FixedVoltage sou(f=60, V=480) "Voltage source"
Impedance Z1(R=0,
inductive=true,
L=1/(2*Modelica.Constants.pi*60),
star=true) "Impedance purely inductive"
Impedance Z2(R=1, star=true) "Impedance purely resistive"
Impedance Z3(R=0,
inductive=false,
C=1/(2*Modelica.Constants.pi*60),
star=true) "Impedance purely capacitive"
Impedance Z4(
inductive=false,
R=1,
C=1/(2*Modelica.Constants.pi*60),
star=true) "Impedance capacitive"
Impedance Z5(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60),
star=true) "Impedance inductive"
equation
connect(sou.terminal, Z1.terminal)
connect(sou.terminal, Z2.terminal)
connect(sou.terminal, Z3.terminal)
connect(sou.terminal, Z4.terminal)
connect(sou.terminal, Z5.terminal)
end Impedances; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
Example that illustrates the use of the load models. This model illustrates the use of the three-phase unbalanced load models. | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Examples;
model ParallelLoads "Example that illustrates the use of the load models"
extends Modelica.Icons.Example;
Sources.FixedVoltage E(f=60, V=480) "Voltage source"
Resistive R(P_nominal=-2000, V_nominal=480) "Resistive load"
Inductive RL_pf(
pf=0.8,
P_nominal=-2000,
use_pf_in=true,
V_nominal=480) "Inductive load with variable power factor"
Modelica.Blocks.Sources.Ramp load( startTime=0.2, duration=0.3)
"Power signal profile"
Inductive varRL_y( P_nominal=-2000,
V_nominal=480,
mode=AixLib.Electrical.Types.Load.VariableZ_y_input)
"Inductive load with y as input"
Capacitive varRC_y( P_nominal=-2000,
V_nominal=480,
mode=AixLib.Electrical.Types.Load.VariableZ_y_input)
"Capacitive load with y as input"
Inductive varRL_P(pf=0.8,
V_nominal=480,
mode=AixLib.Electrical.Types.Load.VariableZ_P_input)
"Inductive load with P as input"
Modelica.Blocks.Sources.Ramp pow(
startTime=0.2,
duration=0.3,
height=4000,
offset=-2000) "Power consumption profile"
Modelica.Blocks.Sources.Ramp pf(
height=0.2,
duration=0.2,
offset=0.8,
startTime=0.7) "Power factor profile"
equation
connect(E.terminal, R.terminal)
connect(E.terminal, RL_pf.terminal)
connect(E.terminal, varRL_y.terminal)
connect(E.terminal, varRC_y.terminal)
connect(load.y, varRL_y.y)
connect(load.y, varRC_y.y)
connect(E.terminal, varRL_P.terminal)
connect(pow.y, varRL_P.Pow)
connect(pf.y, RL_pf.pf_in)
end ParallelLoads; |
Example that provides a comparison between AC one phase and three-phase balanced. This model illustrates the use of the impedance models and how the three-phase balanced model
can reproduce the same results obtained using three separate one phase circuits. | within AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Examples;
model ThreePhases
"Example that provides a comparison between AC one phase and three-phase balanced"
extends Modelica.Icons.Example;
Modelica.Units.SI.Power errorY=sqrt((sen_Y.S[1] - (sen_a.S[1] + sen_b.S[1] +
sen_c.S[1]))^2 + (sen_Y.S[2] - (sen_a.S[2] + sen_b.S[2] + sen_c.S[2]))^2)
"Difference of the power consumption in the star (Y) connection";
Modelica.Units.SI.Power errorD=sqrt((sen_D.S[1] - (sen_ab.S[1] + sen_bc.S[1]
+ sen_ca.S[1]))^2 + (sen_D.S[2] - (sen_ab.S[2] + sen_bc.S[2] + sen_ca.S[
2]))^2)
"Difference of the power consumption in the triangle (D) connection";
Sources.FixedVoltage sou(definiteReference=true,
f=60,
V=480) "Three phases balanced voltage source"
Impedance RL_star(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance with Y connection"
OnePhase.Sources.FixedVoltage sou_a(V=480/sqrt(3), definiteReference=true,
f=60) "Voltage source phase a"
OnePhase.Sources.FixedVoltage sou_b(
V=480/sqrt(3),
definiteReference=true,
phiSou=2.0943951023932,
f=60) "Voltage source phase b"
OnePhase.Sources.FixedVoltage sou_c(
V=480/sqrt(3),
definiteReference=true,
phiSou=-2.0943951023932,
f=60) "Voltage source phase c"
OnePhase.Loads.Impedance RL_a(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance on phase A"
OnePhase.Loads.Impedance RL_b(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance on phase B"
OnePhase.Loads.Impedance RL_c(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance on phase C"
Impedance RL_tri(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60),
star=false) "Impedance with D connection"
OnePhase.Sources.FixedVoltage sou_ab(
V=480,
phiSou=-0.5235987755983,
definiteReference=true,
f=60) "Voltage source line ab"
OnePhase.Sources.FixedVoltage sou_bc(
phiSou=1.5707963267949,
V=480,
definiteReference=true,
f=60) "Voltage source line bc"
OnePhase.Sources.FixedVoltage sou_ca(
phiSou=-3.6651914291881,
V=480,
definiteReference=true,
f=60) "Voltage source line ca"
OnePhase.Loads.Impedance RL_ab(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance on line AB"
OnePhase.Loads.Impedance RL_bc(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance on line BC"
OnePhase.Loads.Impedance RL_c1(
R=1,
inductive=true,
L=1/(2*Modelica.Constants.pi*60)) "Impedance on linease CA"
OnePhase.Sensors.GeneralizedSensor sen_a
"Sensor located on phase A (Y connection)"
OnePhase.Sensors.GeneralizedSensor sen_ab
"Sensor located on line AB (D connection)"
Sensors.GeneralizedSensor sen_Y "Sensor for Y connection (balanced case)"
Sensors.GeneralizedSensor sen_D "Sensor for D connection (balanced case)"
OnePhase.Sensors.GeneralizedSensor sen_b
"Sensor located on phase B (Y connection)"
OnePhase.Sensors.GeneralizedSensor sen_c
"Sensor located on phase C (Y connection)"
OnePhase.Sensors.GeneralizedSensor sen_bc
"Sensor located on line BC (D connection)"
OnePhase.Sensors.GeneralizedSensor sen_ca
"Sensor located on line CA (D connection)"
equation
connect(sou_a.terminal, sen_a.terminal_n)
connect(sen_a.terminal_p, RL_a.terminal)
connect(sou_ab.terminal, sen_ab.terminal_n)
connect(sen_ab.terminal_p, RL_ab.terminal)
connect(sou.terminal, sen_Y.terminal_n)
connect(sen_Y.terminal_p, RL_star.terminal)
connect(sou.terminal, sen_D.terminal_n)
connect(sen_D.terminal_p, RL_tri.terminal)
connect(sou_b.terminal, sen_b.terminal_n)
connect(sen_b.terminal_p, RL_b.terminal)
connect(sou_c.terminal, sen_c.terminal_n)
connect(sen_c.terminal_p, RL_c.terminal)
connect(sou_bc.terminal, sen_bc.terminal_n)
connect(sen_bc.terminal_p, RL_bc.terminal)
connect(sou_ca.terminal, sen_ca.terminal_n)
connect(sen_ca.terminal_p, RL_c1.terminal)
end ThreePhases; |
Sensor for power, voltage and current | within AixLib.Electrical.AC.ThreePhasesBalanced.Sensors;
model GeneralizedSensor "Sensor for power, voltage and current"
extends AixLib.Electrical.Icons.GeneralizedSensor;
extends AixLib.Electrical.Interfaces.PartialTwoPort(
redeclare package PhaseSystem_p = PhaseSystems.OnePhase,
redeclare package PhaseSystem_n = PhaseSystems.OnePhase,
redeclare Interfaces.Terminal_n terminal_n(redeclare package PhaseSystem =
PhaseSystem_n),
redeclare Interfaces.Terminal_p terminal_p(redeclare package PhaseSystem =
PhaseSystem_p));
Modelica.Blocks.Interfaces.RealOutput V(
final quantity="ElectricPotential",
final unit="V")=
AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal_n.v)
"Voltage"
Modelica.Blocks.Interfaces.RealOutput I(
final quantity="ElectricCurrent",
final unit="A")=
AixLib.Electrical.PhaseSystems.OnePhase.systemCurrent(terminal_n.i)
"Current"
Modelica.Blocks.Interfaces.RealOutput S[PhaseSystems.OnePhase.n](
each final quantity="Power",
each final unit="W")=
AixLib.Electrical.PhaseSystems.OnePhase.phasePowers_vi(v=terminal_n.v, i=terminal_n.i)
"Phase powers"
equation
connect(terminal_n, terminal_p)
end GeneralizedSensor; |
Package with sensors models for three-phase balanced AC systems | within AixLib.Electrical.AC.ThreePhasesBalanced;
package Sensors "Package with sensors models for three-phase balanced AC systems"
extends Modelica.Icons.SensorsPackage;
end Sensors; |
Model of a probe that measures RMS voltage and angle. This model represents a probe that measures the RMS voltage and the angle
of the voltage phasor at a given point. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sensors;
model Probe "Model of a probe that measures RMS voltage and angle"
extends OnePhase.Sensors.Probe(
redeclare AixLib.Electrical.AC.ThreePhasesBalanced.Interfaces.Terminal_n term,
V_nominal(start=480));
end Probe; |
Example model for generalized sensor. This example illustrates the use of the generalized sensor. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sensors.Examples;
model GeneralizedSensor "Example model for generalized sensor"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Sensors.GeneralizedSensor
sen "Sensor model"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Capacitive loa(
V_nominal=480, P_nominal=-100) "Constant load"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage
sou(f=60, V=480) "Voltage source"
equation
connect(sen.terminal_p, loa.terminal)
connect(sen.terminal_n, sou.terminal)
end GeneralizedSensor; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesBalanced.Sensors;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
This example illustrates how to use the probe model. This example illustrates the use of the probe model. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sensors.Examples;
model Probe "This example illustrates how to use the probe model"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Capacitive loaRC(
mode=AixLib.Electrical.Types.Load.FixedZ_steady_state,
P_nominal=-10000,
V_nominal=480) "Constant load"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou(f=60, V=
480) "Voltage source"
AixLib.Electrical.AC.ThreePhasesBalanced.Lines.TwoPortResistance res1(R=0.1)
"First line resistance"
AixLib.Electrical.AC.ThreePhasesBalanced.Sensors.Probe probe_source(V_nominal=
480) "Probe that measures at the voltage source"
AixLib.Electrical.AC.ThreePhasesBalanced.Sensors.Probe probe_loadRC(V_nominal=
480) "Probe that measures at the RC load"
AixLib.Electrical.AC.ThreePhasesBalanced.Lines.TwoPortResistance res2(R=0.1)
"Second line resistance"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Inductive loaRL(
mode=AixLib.Electrical.Types.Load.FixedZ_steady_state,
P_nominal=-10000,
V_nominal=480) "Constant load"
AixLib.Electrical.AC.ThreePhasesBalanced.Sensors.Probe probe_loadRL(V_nominal=
480) "Probe that measures at the RL load"
equation
connect(sou.terminal, res1.terminal_n)
connect(res1.terminal_p, loaRC.terminal)
connect(sou.terminal, probe_source.term)
connect(loaRC.terminal, probe_loadRC.term)
connect(sou.terminal, res2.terminal_n)
connect(res2.terminal_p, loaRL.terminal)
connect(loaRL.terminal, probe_loadRL.term)
end Probe; |
Fixed three-phase balanced AC voltage source. This is a constant voltage source, specifying the complex voltage
by the RMS voltage and the phase shift. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sources;
model FixedVoltage "Fixed three-phase balanced AC voltage source"
extends AixLib.Electrical.AC.OnePhase.Sources.FixedVoltage(
redeclare Interfaces.Terminal_p terminal,
f(start=60),
V(start=480));
end FixedVoltage; |
Model of a generator. Model of an inductive generator. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sources;
model Generator "Model of a generator"
extends AixLib.Electrical.AC.OnePhase.Sources.Generator(
redeclare Interfaces.Terminal_p terminal,
f(start=60));
end Generator; |
Electrical grid. Model that can be used to represent the electrical grid supply.
See <a href=\"modelica://AixLib.Electrical.AC.OnePhase.Sources.Grid\">
AixLib.Electrical.AC.OnePhase.Sources.Grid</a> for
more information. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sources;
model Grid "Electrical grid"
extends AixLib.Electrical.AC.OnePhase.Sources.Grid(
redeclare Interfaces.Terminal_p terminal,
f(start=60),
V(start=480),
redeclare AixLib.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou);
end Grid; |
Package with source models for three-phase balanced AC systems | within AixLib.Electrical.AC.ThreePhasesBalanced;
package Sources "Package with source models for three-phase balanced AC systems"
extends Modelica.Icons.SourcesPackage;
end Sources; |
This example illustrates how using a fixed voltage source. This example shows how to use a fixed voltage generator model. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sources.Examples;
model FixedVoltageSource
"This example illustrates how using a fixed voltage source"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Inductive RL(
P_nominal=-300, mode=AixLib.Electrical.Types.Load.FixedZ_steady_state,
V_nominal=480) "Load model"
ThreePhasesBalanced.Sources.FixedVoltage grid(
f=60,
V=480,
phiSou=0.34906585039887) "AC one phase electrical grid"
ThreePhasesBalanced.Sensors.Probe sen(V_nominal=480)
"Probe that measures the voltage at the load"
equation
connect(grid.terminal, RL.terminal)
connect(grid.terminal, sen.term)
end FixedVoltageSource; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesBalanced.Sources;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
This example illustrates how using a variable power source. This example shows how to use a variable generator model. The generator model has to be used
together with a voltage source generator, which is in this example the
grid model. | within AixLib.Electrical.AC.ThreePhasesBalanced.Sources.Examples;
model VariablePowerSource
"This example illustrates how using a variable power source"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.Generator generator(f=60,
phiGen=0.26179938779915) "AC generator model"
Modelica.Blocks.Sources.Sine generation(
offset=200,
startTime=1,
amplitude=100,
f=0.05) "Generated power"
AixLib.Electrical.AC.ThreePhasesBalanced.Loads.Inductive RL(mode=Types.Load.VariableZ_y_input,
P_nominal=-300,
V_nominal=480) "Load model"
AixLib.Electrical.AC.ThreePhasesBalanced.Sources.Grid grid(f=60, V=480)
"AC one phase electrical grid"
Modelica.Blocks.Sources.Trapezoid load(
rising=2,
width=3,
falling=3,
period=10,
startTime=1,
amplitude=0.8,
offset=0.2) "Power consumption profile"
equation
connect(generation.y, generator.P)
connect(generator.terminal, RL.terminal)
connect(grid.terminal, RL.terminal)
connect(load.y, RL.y)
end VariablePowerSource; |
Three phases unbalanced AC systems | within AixLib.Electrical.AC;
package ThreePhasesUnbalanced "Three phases unbalanced AC systems"
extends Modelica.Icons.VariantsPackage;
end ThreePhasesUnbalanced; |
AC AC converter single phase systems (YY). This is an AC AC converter, based on a power balance between both circuit sides.
The parameter <i>conversionFactor</i> defines the ratio between the RMS voltages | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACConverter "AC AC converter single phase systems (YY)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterYY(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACConverter conv1(
conversionFactor=conversionFactor,
eta=eta,
ground_1=ground_1,
ground_2=ground_2),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACConverter conv2(
conversionFactor=conversionFactor,
eta=eta,
ground_1=ground_1,
ground_2=ground_2),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACConverter conv3(
conversionFactor=conversionFactor,
eta=eta,
ground_1=ground_1,
ground_2=ground_2));
parameter Real conversionFactor
"Ratio of QS rms voltage on side 2 / QS rms voltage on side 1";
parameter Modelica.Units.SI.Efficiency eta(max=1)
"Converter efficiency, pLoss = (1-eta) * Ptr";
parameter Boolean ground_1 = false "Connect side 1 of converter to ground"
parameter Boolean ground_2 = true "Connect side 2 of converter to ground"
end ACACConverter; |
AC AC transformer simplified equivalent circuit (YY). This is a simplified equivalent transformer model.
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance <i>R</i> and an
inductance <i>L</i>. The resistance and the inductance represent both the
effects of the secondary and primary side of the transformer. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformer "AC AC transformer simplified equivalent circuit (YY)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterYY(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv1(
VHigh=VHigh/sqrt(3),
VLow=VLow/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
phi_1=0),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv2(
VHigh=VHigh/sqrt(3),
VLow=VLow/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
phi_1=-2.0943951023932),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv3(
VHigh=VHigh/sqrt(3),
VLow=VLow/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
phi_1=2.0943951023932));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Real XoverR
"Ratio between the complex and real components of the impedance (XL/R)";
parameter Real Zperc "Short circuit impedance";
parameter Boolean ground_1 = false "Connect side 1 of transformer to ground"
parameter Boolean ground_2 = true "Connect side 2 of transformer to ground"
equation
end ACACTransformer; |
AC AC transformer simplified equivalent circuit (DD). This is a simplified equivalent transformer model with Delta-Delta connection.
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance <i>R</i> and an
inductance <i>L</i>. The resistance and the inductance represent the
effects of the secondary and primary side of the transformer. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformerDD "AC AC transformer simplified equivalent circuit (DD)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterDD(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv1(
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VHigh=VHigh,
VLow=VLow,
phi_1=0.5235987755983),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv2(
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VHigh=VHigh,
VLow=VLow,
phi_1=-1.5707963267949),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv3(
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VHigh=VHigh,
VLow=VLow,
phi_1=2.6179938779915));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Real XoverR
"Ratio between the complex and real components of the impedance (XL/R)";
parameter Real Zperc "Short circuit impedance";
parameter Boolean ground_1 = false "Connect side 1 of transformer to ground"
parameter Boolean ground_2 = true "Connect side 2 of transformer to ground"
equation
end ACACTransformerDD; |
AC AC transformer detailed equivalent circuit (YY). This is a detailed transformer model that takes into accounts the winding Joule losses,
and the leakage reactances on the primary and secondary side. The model also takes into account
the core or iron losses and the losses due to magnetization effects. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformerFull "AC AC transformer detailed equivalent circuit (YY)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterYY(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformerFull conv1(
VHigh=VHigh/sqrt(3),
VLow=VLow/sqrt(3),
f = f,
VABase=VABase,
R1=R1,L1=L1,R2=R2,L2=L2,
magEffects=magEffects,
Rm=Rm,Lm=Lm,
ground_1=ground_1,
ground_2=ground_2),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformerFull conv2(
VHigh=VHigh/sqrt(3),
VLow=VLow/sqrt(3),
f = f,
VABase=VABase,
R1=R1,L1=L1,R2=R2,L2=L2,
magEffects=magEffects,
Rm=Rm,Lm=Lm,
ground_1=ground_1,
ground_2=ground_2),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformerFull conv3(
VHigh=VHigh/sqrt(3),
VLow=VLow/sqrt(3),
f = f,
VABase=VABase,
R1=R1,L1=L1,R2=R2,L2=L2,
magEffects=magEffects,
Rm=Rm,Lm=Lm,
ground_1=ground_1,
ground_2=ground_2));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Modelica.Units.SI.Frequency f(start=60) "Nominal frequency";
parameter AixLib.Electrical.Types.PerUnit R1(min=0)
"Resistance on side 1 of the transformer (pu)";
parameter AixLib.Electrical.Types.PerUnit L1(min=0)
"Inductance on side 1 of the transformer (pu)";
parameter AixLib.Electrical.Types.PerUnit R2(min=0)
"Resistance on side 2 of the transformer (pu)";
parameter AixLib.Electrical.Types.PerUnit L2(min=0)
"Inductance on side 2 of the transformer (pu)";
parameter Boolean magEffects = false
"If =true introduce magnetization effects"
parameter AixLib.Electrical.Types.PerUnit Rm(min=0,start=0)
"Magnetization resistance (pu)"
parameter AixLib.Electrical.Types.PerUnit Lm(min=0,start=0)
"Magnetization inductance (pu)"
parameter Boolean ground_1 = false "Connect side 1 of converter to ground"
parameter Boolean ground_2 = true "Connect side 2 of converter to ground"
end ACACTransformerFull; |
AC AC transformer simplified equivalent circuit (DY step down). This is a simplified equivalent transformer model with Y-Delta connection
(voltage step down).
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance <i>R</i> and an
inductance <i>L</i>. The resistance and the inductance represent the
effects of the secondary and primary side of the transformer. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformerStepDownDY
"AC AC transformer simplified equivalent circuit (DY step down)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterStepDownDY(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv1(
VHigh=VHigh,
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=-VLow/sqrt(3),
phi_1=2.6179938779915),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv2(
VHigh=VHigh,
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=-VLow/sqrt(3),
phi_1=0.5235987755983),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv3(
VHigh=VHigh,
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=-VLow/sqrt(3),
phi_1=-1.5707963267949));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Real XoverR
"Ratio between the complex and real components of the impedance (XL/R)";
parameter Real Zperc "Short circuit impedance";
parameter Boolean ground_1 = false "Connect side 1 of transformer to ground"
parameter Boolean ground_2 = true "Connect side 2 of transformer to ground"
equation
end ACACTransformerStepDownDY; |
AC AC transformer simplified equivalent circuit (YD step down). This is a simplified equivalent transformer model with Y-Delta connection
(voltage step down).
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance <i>R</i> and an
inductance <i>L</i>. The resistance and the inductance represent the
effects of the secondary and primary side of the transformer. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformerStepDownYD
"AC AC transformer simplified equivalent circuit (YD step down)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterStepDownYD(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv1(
VHigh=VHigh/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=VLow,
phi_1=0),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv2(
VHigh=VHigh/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=VLow,
phi_1=-2.0943951023932),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv3(
VHigh=VHigh/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=VLow,
phi_1=2.0943951023932));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Real XoverR
"Ratio between the complex and real components of the impedance (XL/R)";
parameter Real Zperc "Short circuit impedance";
parameter Boolean ground_1 = false "Connect side 1 of transformer to ground"
parameter Boolean ground_2 = true "Connect side 2 of transformer to ground"
equation
end ACACTransformerStepDownYD; |
AC AC transformer simplified equivalent circuit (DY step up). This is a simplified equivalent transformer model with Delta-Y connection
(voltage step up).
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance <i>R</i> and an
inductance <i>L</i>. The resistance and the inductance represent the
effects of the secondary and primary side of the transformer. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformerStepUpDY
"AC AC transformer simplified equivalent circuit (DY step up)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterStepUpDY(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv1(
VHigh=VHigh,
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=VLow/sqrt(3),
phi_1=0.5235987755983),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv2(
VHigh=VHigh,
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=VLow/sqrt(3),
phi_1=-1.5707963267949),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv3(
VHigh=VHigh,
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=VLow/sqrt(3),
phi_1=2.6179938779915));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Real XoverR
"Ratio between the complex and real components of the impedance (XL/R)";
parameter Real Zperc "Short circuit impedance";
parameter Boolean ground_1 = false "Connect side 1 of transformer to ground"
parameter Boolean ground_2 = true "Connect side 2 of transformer to ground"
equation
end ACACTransformerStepUpDY; |
AC AC transformer simplified equivalent circuit (YD step up). This is a simplified equivalent transformer model with Y-Delta connection
(voltage step up).
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance <i>R</i> and an
inductance <i>L</i>. The resistance and the inductance represent the
effects of the secondary and primary side of the transformer. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
model ACACTransformerStepUpYD
"AC AC transformer simplified equivalent circuit (YD step up)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverterStepUpYD(
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv1(
VHigh=VHigh/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=-VLow,
phi_1=0),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv2(
VHigh=VHigh/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=-VLow,
phi_1=-2.0943951023932),
redeclare AixLib.Electrical.AC.OnePhase.Conversion.ACACTransformer conv3(
VHigh=VHigh/sqrt(3),
XoverR=XoverR,
Zperc=Zperc,
ground_1=ground_1,
ground_2=ground_2,
VABase=VABase/3,
VLow=-VLow,
phi_1=2.0943951023932));
parameter Modelica.Units.SI.Voltage VHigh
"Rms voltage on side 1 of the transformer (primary side)";
parameter Modelica.Units.SI.Voltage VLow
"Rms voltage on side 2 of the transformer (secondary side)";
parameter Modelica.Units.SI.ApparentPower VABase
"Nominal power of the transformer";
parameter Real XoverR
"Ratio between the complex and real components of the impedance (XL/R)";
parameter Real Zperc "Short circuit impedance";
parameter Boolean ground_1 = false "Connect side 1 of transformer to ground"
parameter Boolean ground_2 = true "Connect side 2 of transformer to ground"
equation
end ACACTransformerStepUpYD; |
Package with converter and transformer models for three-phase
unbalanced AC systems | within AixLib.Electrical.AC.ThreePhasesUnbalanced;
package Conversion "Package with converter and transformer models for three-phase
unbalanced AC systems"
extends Modelica.Icons.Package;
end Conversion; |
Package with base class models | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
package BaseClasses "Package with base class models"
extends Modelica.Icons.BasesPackage;
end BaseClasses; |
Partial model of a transformer | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverter "Partial model of a transformer"
extends AixLib.Electrical.Icons.RefAngleConversion;
replaceable AixLib.Electrical.Interfaces.PartialConversion
conv1 constrainedby AixLib.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
AixLib.Electrical.PhaseSystems.OnePhase,
redeclare package PhaseSystem_n =
AixLib.Electrical.PhaseSystems.OnePhase,
redeclare Electrical.AC.OnePhase.Interfaces.Terminal_n terminal_n,
redeclare Electrical.AC.OnePhase.Interfaces.Terminal_p terminal_p)
"Transformer phase 1"
replaceable AixLib.Electrical.Interfaces.PartialConversion
conv2 constrainedby AixLib.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
AixLib.Electrical.PhaseSystems.OnePhase,
redeclare package PhaseSystem_n =
AixLib.Electrical.PhaseSystems.OnePhase,
redeclare Electrical.AC.OnePhase.Interfaces.Terminal_n terminal_n,
redeclare Electrical.AC.OnePhase.Interfaces.Terminal_p terminal_p)
"Transformer phase 2"
replaceable AixLib.Electrical.Interfaces.PartialConversion
conv3 constrainedby AixLib.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
AixLib.Electrical.PhaseSystems.OnePhase,
redeclare package PhaseSystem_n =
AixLib.Electrical.PhaseSystems.OnePhase,
redeclare Electrical.AC.OnePhase.Interfaces.Terminal_n terminal_n,
redeclare Electrical.AC.OnePhase.Interfaces.Terminal_p terminal_p)
"Transformer phase 3"
Interfaces.Terminal_n terminal_n "Electrical connector side N"
Interfaces.Terminal_p terminal_p "Electrical connector side P"
end PartialConverter; |
Model of a transformer with D connection primary side and D
connection secondary side. Partial model that represents a three-phase unbalanced
transformer with delta connection on both primary and secondary side. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverterDD "Model of a transformer with D connection primary side and D
connection secondary side"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter;
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta wye_to_delta
"Delta to wye connection"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta delta_to_wye
"Delta to wye connection"
protected
Interfaces.Adapter3to3 ada_n "Adapter"
Interfaces.Adapter3to3 ada_p "Adapter"
equation
connect(delta_to_wye.wye, terminal_n)
connect(wye_to_delta.wye, terminal_p)
connect(delta_to_wye.delta, ada_n.terminal)
connect(wye_to_delta.delta, ada_p.terminal)
connect(conv1.terminal_n, ada_n.terminals[1])
connect(conv2.terminal_n, ada_n.terminals[2])
connect(conv3.terminal_n, ada_n.terminals[3])
connect(conv1.terminal_p, ada_p.terminals[1])
connect(conv2.terminal_p, ada_p.terminals[2])
connect(conv3.terminal_p, ada_p.terminals[3])
end PartialConverterDD; |
Model of a transformer with D connection primary side and
Y connection secondary side (Voltage step down). Partial model that represents a three-phase unbalanced
transformer with delta connection on the primary and Y connection on
the secondary side. The configuration is for voltage step down. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverterStepDownDY "Model of a transformer with D connection primary side and
Y connection secondary side (Voltage step down)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter;
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToWyeGround wye_to_wyeg
"Wye to wye grounded connection"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta delta_to_wye
"Delta to wye connection"
protected
Interfaces.Adapter3to3 ada3to3_n "Adapter for connections"
Interfaces.Adapter3to3 ada3to3_p "Adapter for connections"
equation
connect(delta_to_wye.wye, terminal_n)
connect(wye_to_wyeg.wye, terminal_p)
connect(conv1.terminal_n, ada3to3_n.terminals[3])
connect(conv2.terminal_n, ada3to3_n.terminals[1])
connect(conv3.terminal_n, ada3to3_n.terminals[2])
connect(delta_to_wye.delta, ada3to3_n.terminal)
connect(conv1.terminal_p, ada3to3_p.terminals[1])
connect(conv2.terminal_p, ada3to3_p.terminals[2])
connect(conv3.terminal_p, ada3to3_p.terminals[3])
connect(ada3to3_p.terminal, wye_to_wyeg.wyeg)
end PartialConverterStepDownDY; |
Model of a transformer with Y connection primary side and D
connection secondary side (Voltage step down). Partial model that represents a three-phase unbalanced
transformer with Y connection on primary and delta connection on
the secondary one. The configuration is for voltage step down. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverterStepDownYD "Model of a transformer with Y connection primary side and D
connection secondary side (Voltage step down)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter;
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToWyeGround wye_to_wyeg
"Wye to wye grounded connection"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta delta_to_wye
"Delta to wye connection "
protected
Interfaces.Adapter3to3 ada3to3_n "Adapter for connections"
Interfaces.Adapter3to3 ada3to3_p "Adapter for connections"
equation
connect(delta_to_wye.wye, terminal_p)
connect(wye_to_wyeg.wye, terminal_n)
connect(conv1.terminal_n, ada3to3_n.terminals[1])
connect(conv2.terminal_n, ada3to3_n.terminals[2])
connect(conv3.terminal_n, ada3to3_n.terminals[3])
connect(conv1.terminal_p, ada3to3_p.terminals[1])
connect(conv2.terminal_p, ada3to3_p.terminals[2])
connect(conv3.terminal_p, ada3to3_p.terminals[3])
connect(ada3to3_p.terminal, delta_to_wye.delta)
connect(wye_to_wyeg.wyeg, ada3to3_n.terminal)
end PartialConverterStepDownYD; |
Model of a transformer with D connection primary side and Y connection
secondary side (Voltage step up). Partial model that represents a three-phase unbalanced
transformer with delta connection on the primary and Y connection on
the secondary side. The configuration is for voltage step up. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverterStepUpDY "Model of a transformer with D connection primary side and Y connection
secondary side (Voltage step up)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter;
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToWyeGround wye_to_wyeg
"Wye to wye grounded connection"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta delta_to_wye
"Delta to wye connection"
protected
Interfaces.Adapter3to3 ada3to3_n "Adapter for connections"
Interfaces.Adapter3to3 ada3to3_p "Adapter for connections"
equation
connect(delta_to_wye.wye, terminal_n)
connect(wye_to_wyeg.wye, terminal_p)
connect(conv1.terminal_n,ada3to3_n. terminals[1])
connect(conv2.terminal_n,ada3to3_n. terminals[2])
connect(conv3.terminal_n,ada3to3_n. terminals[3])
connect(conv1.terminal_p,ada3to3_p. terminals[1])
connect(conv2.terminal_p,ada3to3_p. terminals[2])
connect(conv3.terminal_p,ada3to3_p. terminals[3])
connect(ada3to3_p.terminal, wye_to_wyeg.wyeg)
connect(delta_to_wye.delta, ada3to3_n.terminal)
end PartialConverterStepUpDY; |
Model of a transformer with Y connection primary side and D connection
secondary side (Voltage step up). Partial model that represents a three-phase unbalanced
transformer with Y connection on the primary and delta connection on
the secondary side. The configuration is for voltage step up. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverterStepUpYD "Model of a transformer with Y connection primary side and D connection
secondary side (Voltage step up)"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter;
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToWyeGround wye_to_wyeg
"Wye to wye grounded connection"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta delta_to_wye
"Delta to wye connection"
protected
Interfaces.Adapter3to3 ada3to3_n "Adapter for connections"
Interfaces.Adapter3to3 ada3to3_p "Adapter for connections"
equation
connect(delta_to_wye.wye, terminal_p)
connect(wye_to_wyeg.wye, terminal_n)
connect(conv1.terminal_n,ada3to3_n. terminals[1])
connect(conv2.terminal_n,ada3to3_n. terminals[2])
connect(conv3.terminal_n,ada3to3_n. terminals[3])
connect(wye_to_wyeg.wyeg, ada3to3_n.terminal)
connect(conv1.terminal_p, ada3to3_p.terminals[3])
connect(conv2.terminal_p, ada3to3_p.terminals[1])
connect(conv3.terminal_p, ada3to3_p.terminals[2])
connect(ada3to3_p.terminal, delta_to_wye.delta)
end PartialConverterStepUpYD; |
Model of a transformer with Y connection primary side and Y
connection secondary side. Partial model that represents a three-phase unbalanced
transformer with Y connection on both primary and secondary side. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses;
partial model PartialConverterYY "Model of a transformer with Y connection primary side and Y
connection secondary side"
extends
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter;
Interfaces.Connection3to3Ground_n connection3to4_n
"Conversion between 3 to 4 connectors"
Interfaces.Connection3to3Ground_p connection3to4_p
"Conversion between 3 to 4 connectors"
OnePhase.Basics.Ground ground_n "Ground reference"
OnePhase.Basics.Ground ground_p "Ground reference"
protected
Interfaces.Adapter3to3 ada3to3_n "Adapter for connections"
Interfaces.Adapter3to3 ada3to3_p "Adapter for connections"
equation
connect(terminal_p, connection3to4_p.terminal3)
connect(terminal_n, connection3to4_n.terminal3)
connect(connection3to4_p.ground4, ground_p.terminal)
connect(ground_n.terminal, connection3to4_n.ground4)
connect(connection3to4_n.terminal4, ada3to3_n.terminal)
connect(ada3to3_n.terminals[1], conv1.terminal_n)
connect(ada3to3_n.terminals[2], conv2.terminal_n)
connect(ada3to3_n.terminals[3], conv3.terminal_n)
connect(conv1.terminal_p, ada3to3_p.terminals[1])
connect(conv2.terminal_p, ada3to3_p.terminals[2])
connect(conv3.terminal_p, ada3to3_p.terminals[3])
connect(ada3to3_p.terminal, connection3to4_p.terminal4)
end PartialConverterYY; |
Test for the AC/AC converter model. This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACConverter\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACConverter</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model Converter "Test for the AC/AC converter model"
extends BaseClasses.TransformerExample(
V_primary = 480,
V_secondary = 240,
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACConverter
tra(conversionFactor=0.5,eta=0.9));
equation
connect(probe_2.term, tra.terminal_p)
end Converter; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
Test for the AC/AC transformer model. This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformer\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformer</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model Transformer "Test for the AC/AC transformer model"
extends BaseClasses.TransformerExample(
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformer
tra(VHigh=V_primary,
VLow=V_secondary,
XoverR=6,
Zperc=sqrt(0.01^2 + 0.06^2),
VABase=6000000));
equation
connect(probe_2.term, load.terminal)
end Transformer; |
Test for the AC/AC transformer model with Delta-Delta configuration. This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerDD\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerDD</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model TransformerDD
"Test for the AC/AC transformer model with Delta-Delta configuration"
extends BaseClasses.TransformerExample(
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeDelta probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerDD
tra(VHigh=V_primary,
VLow=V_secondary,
XoverR=6,
Zperc=sqrt(0.01^2 + 0.06^2),
VABase=6000000));
equation
connect(probe_2.term, load.terminal)
end TransformerDD; |
Test for the AC/AC transformer full model. This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerFull\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerFull</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model TransformerFull "Test for the AC/AC transformer full model"
extends BaseClasses.TransformerExample(
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerFull
tra(VHigh=V_primary,
VLow=V_secondary,
VABase=6000000,
f=60,
R1=0.005,
L1=0.005*6,
R2=0.005,
L2=0.005*6,
magEffects=true,
Rm=10,
Lm=10),
load(initMode=AixLib.Electrical.Types.InitMode.linearized));
equation
connect(probe_2.term, load.terminal)
end TransformerFull; |
Test for the AC/AC transformer model with Delta-Wye configuration (step-down voltage). This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepDownDY\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepDownDY</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model TransformerStepDownDY
"Test for the AC/AC transformer model with Delta-Wye configuration (step-down voltage)"
extends BaseClasses.TransformerExample(
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepDownDY
tra(VHigh=V_primary,
VLow=V_secondary,
XoverR=6,
Zperc=sqrt(0.01^2 + 0.06^2),
VABase=6000000));
equation
connect(probe_2.term, load.terminal)
end TransformerStepDownDY; |
Test for the AC/AC transformer model with Wye-Delta configuration (step-down voltage). This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepDownYD\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepDownYD</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model TransformerStepDownYD
"Test for the AC/AC transformer model with Wye-Delta configuration (step-down voltage)"
extends BaseClasses.TransformerExample(
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeDelta probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepDownYD
tra(VHigh=V_primary,
VLow=V_secondary,
XoverR=6,
Zperc=sqrt(0.01^2 + 0.06^2),
VABase=6000000));
equation
connect(probe_2.term, load.terminal)
end TransformerStepDownYD; |
Test for the AC/AC transformer model with Delta-Wye configuration (step-up voltage). This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepUpDY\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepUpDY</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model TransformerStepUpDY
"Test for the AC/AC transformer model with Delta-Wye configuration (step-up voltage)"
extends BaseClasses.TransformerExample(
V_primary = 4160,
V_secondary = 12470,
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepUpDY
tra(VHigh=V_primary,
VLow=V_secondary,
XoverR=6,
Zperc=sqrt(0.01^2 + 0.06^2),
VABase=6000000));
equation
connect(probe_2.term, load.terminal)
end TransformerStepUpDY; |
Test for the AC/AC transformer model with Wye-Delta configuration (step-up voltage). This example model tests the
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepUpYD\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepUpYD</a> model. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
model TransformerStepUpYD
"Test for the AC/AC transformer model with Wye-Delta configuration (step-up voltage)"
extends BaseClasses.TransformerExample(
V_primary = 4160,
V_secondary = 12470,
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeDelta probe_2,
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.ACACTransformerStepUpYD
tra(VHigh=V_primary,
VLow=V_secondary,
XoverR=6,
Zperc=sqrt(0.01^2 + 0.06^2),
VABase=6000000));
equation
connect(probe_2.term, load.terminal)
end TransformerStepUpYD; |
This package contains base classes inherited by the examples | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples;
package BaseClasses "This package contains base classes inherited by the examples"
extends Modelica.Icons.BasesPackage;
end BaseClasses; |
This example represents the basic test for a transformer model. This model is the base classes used by the examples that are part of the package
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples</a>. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.Examples.BaseClasses;
model TransformerExample
"This example represents the basic test for a transformer model"
extends Modelica.Icons.Example;
parameter Modelica.Units.SI.Voltage V_primary=12470
"RMS Voltage on the primary side of the transformer";
parameter Modelica.Units.SI.Voltage V_secondary=4160
"RMS Voltage on the secondary side of the transformer";
Sources.FixedVoltage sou(
f=60,
V=V_primary) "Voltage source"
replaceable
AixLib.Electrical.AC.ThreePhasesUnbalanced.Conversion.BaseClasses.PartialConverter
tra "Transformer model"
Loads.Resistive load(
loadConn=AixLib.Electrical.Types.LoadConnection.wye_to_wyeg,
P_nominal=-1800e3,
V_nominal=V_secondary,
linearized=true) "Load model"
Sensors.ProbeWye probe_Y_1(perUnit=false, V_nominal = V_primary)
"Probe that measures the voltage in Y configuration, primary side"
Sensors.ProbeDelta probe_D_1(perUnit=false, V_nominal = V_primary)
"Probe that measures the voltage in D configuration, primary side"
replaceable Sensors.BaseClasses.GeneralizedProbe probe_2 constrainedby
Sensors.BaseClasses.GeneralizedProbe(perUnit=false,
V_nominal=V_secondary)
"Probe that measures the voltage at the secondary side"
equation
connect(sou.terminal, tra.terminal_n)
connect(probe_Y_1.term, tra.terminal_n)
connect(probe_D_1.term, tra.terminal_n)
connect(tra.terminal_p, load.terminal)
end TransformerExample; |
Adapter from 3 single phase connectors to a connector with 3 phases | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model Adapter3to3
"Adapter from 3 single phase connectors to a connector with 3 phases"
extends Modelica.Blocks.Icons.Block;
AixLib.Electrical.Interfaces.Terminal terminals[3](
redeclare final package PhaseSystem = PhaseSystems.OnePhase)
"Generalized terminal"
Interfaces.Terminal_p terminal "Connector with 3 lines"
equation
for i in 1:3 loop
terminal.phase[i].v = terminals[i].v;
terminal.phase[i].i = -terminals[i].i;
Connections.branch(terminal.phase[i].theta, terminals[i].theta);
terminal.phase[i].theta = terminals[i].theta;
end for;
end Adapter3to3; |
Adapter between Terminal4 (3 phases and ground) and Terminal3 N. Adapter between electric connectors type n for AC three-phase unbalanced systems.
This adapter connects a connector without neutral cable to a connector without
neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model Connection3to3Ground_n
"Adapter between Terminal4 (3 phases and ground) and Terminal3 N"
Terminal_n terminal4 "Connector for side with neutral"
AixLib.Electrical.AC.OnePhase.Interfaces.Terminal_n ground4
"Connector for neutral"
Terminal_n terminal3 "Connector without neutral"
equation
// Connection branches required to propagate the reference angle
Connections.branch(terminal4.phase[1].theta, ground4.theta);
terminal4.phase[1].theta = ground4.theta;
for i in 1:3 loop
Connections.branch(terminal3.phase[i].theta, terminal4.phase[i].theta);
terminal3.phase[i].theta = terminal4.phase[i].theta;
end for;
// KVL and KCL
terminal3.phase[1].v[:] = terminal4.phase[1].v[:] - ground4.v[:];
terminal3.phase[2].v[:] = terminal4.phase[2].v[:] - ground4.v[:];
terminal3.phase[3].v[:] = terminal4.phase[3].v[:] - ground4.v[:];
terminal4.phase[1].i[:] + terminal4.phase[2].i[:] = -terminal4.phase[3].i[:] - ground4.i[:];
terminal4.phase[1].i[:] = - terminal3.phase[1].i[:];
terminal4.phase[2].i[:] = - terminal3.phase[2].i[:];
terminal4.phase[3].i[:] = - terminal3.phase[3].i[:];
end Connection3to3Ground_n; |
Adapter between Terminal4 (3 phases and ground) and Terminal3 P. Adapter between electric connectors type p for AC three-phase unbalanced systems.
This adapter connects a connector without neutral cable to a connector without
neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model Connection3to3Ground_p
"Adapter between Terminal4 (3 phases and ground) and Terminal3 P"
Terminal_p terminal4 "Connector with neutral"
AixLib.Electrical.AC.OnePhase.Interfaces.Terminal_p ground4
"Connector for neutral"
Terminal_p terminal3 "Connector without neutral"
equation
// Connection branches required to propagate the reference angle
Connections.branch(terminal4.phase[1].theta, ground4.theta);
terminal4.phase[1].theta = ground4.theta;
for i in 1:3 loop
Connections.branch(terminal3.phase[i].theta, terminal4.phase[i].theta);
terminal3.phase[i].theta = terminal4.phase[i].theta;
end for;
// KVL and KCL
terminal3.phase[1].v[:] = terminal4.phase[1].v[:] - ground4.v[:];
terminal3.phase[2].v[:] = terminal4.phase[2].v[:] - ground4.v[:];
terminal3.phase[3].v[:] = terminal4.phase[3].v[:] - ground4.v[:];
terminal4.phase[1].i[:] + terminal4.phase[2].i[:] = -terminal4.phase[3].i[:] - ground4.i[:];
terminal4.phase[1].i[:] = - terminal3.phase[1].i[:];
terminal4.phase[2].i[:] = - terminal3.phase[2].i[:];
terminal4.phase[3].i[:] = - terminal3.phase[3].i[:];
end Connection3to3Ground_p; |
Adapter between Terminal4 and Terminal3 N. Adapter between electric connectors type n for AC three-phase unbalanced systems.
This adapter connects a connector without neutral cable with a one that has it | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model Connection3to4_n "Adapter between Terminal4 and Terminal3 N"
Terminal4_n terminal4 "Connector with neutral"
Terminal_n terminal3 "Connector without neutral"
equation
// Connection branches required to propagate the reference angle
Connections.branch(terminal4.phase[1].theta, terminal4.phase[4].theta);
terminal4.phase[1].theta = terminal4.phase[4].theta;
for i in 1:3 loop
Connections.branch(terminal3.phase[i].theta, terminal4.phase[i].theta);
terminal3.phase[i].theta = terminal4.phase[i].theta;
end for;
// KVL and KCL
terminal3.phase[1].v[:] = terminal4.phase[1].v[:] - terminal4.phase[4].v[:];
terminal3.phase[2].v[:] = terminal4.phase[2].v[:] - terminal4.phase[4].v[:];
terminal3.phase[3].v[:] = terminal4.phase[3].v[:] - terminal4.phase[4].v[:];
terminal4.phase[1].i[:] + terminal4.phase[2].i[:] = -terminal4.phase[3].i[:] - terminal4.phase[4].i[:];
terminal4.phase[1].i[:] = - terminal3.phase[1].i[:];
terminal4.phase[2].i[:] = - terminal3.phase[2].i[:];
terminal4.phase[3].i[:] = - terminal3.phase[3].i[:];
end Connection3to4_n; |
Adapter between Terminal4 and Terminal3 P. Adapter between electric connectors type p for AC three-phase unbalanced systems.
This adapter connects two connectors without and without a neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model Connection3to4_p "Adapter between Terminal4 and Terminal3 P"
Terminal4_p terminal4 "Connector with neutral"
Terminal_p terminal3 "Connector without neutral"
equation
// Connection branches required to propagate the reference angle
Connections.branch(terminal4.phase[1].theta, terminal4.phase[4].theta);
terminal4.phase[1].theta = terminal4.phase[4].theta;
for i in 1:3 loop
Connections.branch(terminal3.phase[i].theta, terminal4.phase[i].theta);
terminal3.phase[i].theta = terminal4.phase[i].theta;
end for;
// KVL and KCL
terminal3.phase[1].v[:] = terminal4.phase[1].v[:] - terminal4.phase[4].v[:];
terminal3.phase[2].v[:] = terminal4.phase[2].v[:] - terminal4.phase[4].v[:];
terminal3.phase[3].v[:] = terminal4.phase[3].v[:] - terminal4.phase[4].v[:];
terminal4.phase[1].i[:] + terminal4.phase[2].i[:] = -terminal4.phase[3].i[:] - terminal4.phase[4].i[:];
terminal4.phase[1].i[:] = - terminal3.phase[1].i[:];
terminal4.phase[2].i[:] = - terminal3.phase[2].i[:];
terminal4.phase[3].i[:] = - terminal3.phase[3].i[:];
end Connection3to4_p; |
Package with interfaces for three-phase unbalanced AC models | within AixLib.Electrical.AC.ThreePhasesUnbalanced;
package Interfaces "Package with interfaces for three-phase unbalanced AC models"
extends Modelica.Icons.InterfacesPackage;
end Interfaces; |
Partial model interface for a two port component without neutral cable. Interface model for an AC three-phase unbalanced component with two ports
and without neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
partial model TwoPort
"Partial model interface for a two port component without neutral cable"
Terminal_p terminal_p "Electric terminal side p"
Terminal_n terminal_n "Electric terminal side n"
end TwoPort; |
Partial model interface for a two port component with neutral cable. Interface model for an AC three-phase unbalanced component with two ports
and with neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
partial model TwoPort_N
"Partial model interface for a two port component with neutral cable"
Terminal4_p terminal_p "Electric terminal side p"
Terminal4_n terminal_n "Electric terminal side n"
end TwoPort_N; |
This model represent a connection between wye to delta. Adapter from Wye (Y) to Delta (D) connector.
A three-phase unbalanced connector has three AC single phase
connectors. Each AC single phase connector contains the phase voltage,
which is measured between the phase and the neutral.
This model converts the phase voltage to the line voltage, measured between
the phases. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model WyeToDelta "This model represent a connection between wye to delta"
Terminal_n wye "Terminal Y"
Terminal_n delta "Terminal D"
equation
for i in 1:3 loop
Connections.branch(wye.phase[i].theta, delta.phase[i].theta);
wye.phase[i].theta = delta.phase[i].theta;
end for;
delta.phase[1].v[:] = wye.phase[1].v[:] - wye.phase[2].v[:];
delta.phase[2].v[:] = wye.phase[2].v[:] - wye.phase[3].v[:];
delta.phase[3].v[:] = wye.phase[3].v[:] - wye.phase[1].v[:];
-wye.phase[1].i[:] + delta.phase[3].i[:] = delta.phase[1].i[:];
-wye.phase[2].i[:] + delta.phase[1].i[:] = delta.phase[2].i[:];
-wye.phase[3].i[:] + delta.phase[2].i[:] = delta.phase[3].i[:];
end WyeToDelta; |
This model represent a connection between wye to wye grounded. Adapter from wye (Y) to wye grounded (Yg) connector.
A three-phase unbalanced connector has three AC single phase
connectors. Each AC single phase connector contains a the phase voltage,
which is measured
between the phase and the neutral. This model assures that the voltage of the neutral
cable is equal to zero. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
model WyeToWyeGround
"This model represent a connection between wye to wye grounded"
Terminal_n wye "Terminal Y"
Terminal_n wyeg "Terminal Y with ground connection"
Connection3to3Ground_n connection3to4
"Adapter between Termina3 and Terminal4"
AixLib.Electrical.AC.OnePhase.Basics.Ground ground "Ground reference"
equation
connect(wye, connection3to4.terminal3)
connect(connection3to4.terminal4, wyeg)
connect(connection3to4.ground4, ground.terminal)
end WyeToWyeGround; |
Package with example models | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces;
package Examples "Package with example models"
extends Modelica.Icons.ExamplesPackage;
end Examples; |
Test for Y to D connection. This simple example shows how to use a Y to D adapter. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.Examples;
model WyeToDelta "Test for Y to D connection"
extends Modelica.Icons.Example;
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.WyeToDelta wyeToDelta
"Conversion of the voltages from Y to D"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Sources.FixedVoltage V1(f=60, V=
480) "Voltage source"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probe_Y(perUnit=
false, V_nominal=480)
"Probe that measures the voltage and the angles on each phase"
AixLib.Electrical.AC.ThreePhasesUnbalanced.Sensors.ProbeWye probeD(perUnit=
false, V_nominal=480)
"Probe that measures the voltage and the angles on each phase"
equation
connect(V1.terminal, wyeToDelta.wye)
connect(probe_Y.term, wyeToDelta.wye)
connect(probeD.term, wyeToDelta.delta)
end WyeToDelta; |
Model of an electrical line without neutral cable. This model represents an AC three-phase unbalanced cable without
neutral connection. The model is based on
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines.TwoPortRLC\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines.TwoPortRLC</a>
and provides functionalities to parametrize the values of <i>R</i>, <i>L</i> and <i>C</i>
using either commercial cables or default values. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model Line "Model of an electrical line without neutral cable"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort(
terminal_p(phase(v(each nominal = V_nominal))),
terminal_n(phase(v(each nominal = V_nominal))));
extends AixLib.Electrical.Transmission.BaseClasses.PartialBaseLine(
V_nominal(start = 480),
commercialCable = AixLib.Electrical.Transmission.Functions.selectCable_low(P_nominal, V_nominal));
OnePhase.Lines.TwoPortRL phase1(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final R=R/3,
final L=L/3,
final mode=modelMode) "Impedance line 1"
OnePhase.Lines.TwoPortRL phase2(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final R=R/3,
final L=L/3,
final mode=modelMode) "Impedance line 2"
OnePhase.Lines.TwoPortRL phase3(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final R=R/3,
final L=L/3,
final mode=modelMode) "Impedance line 3"
equation
connect(cableTemp.port, phase1.heatPort)
connect(cableTemp.port, phase2.heatPort)
connect(cableTemp.port, phase3.heatPort)
connect(terminal_n.phase[1], phase1.terminal_n)
connect(terminal_n.phase[2], phase2.terminal_n)
connect(terminal_n.phase[3], phase3.terminal_n)
connect(phase1.terminal_p, terminal_p.phase[1])
connect(phase2.terminal_p, terminal_p.phase[2])
connect(phase3.terminal_p, terminal_p.phase[3])
end Line; |
Model of an electrical line with neutral cable. This model represents an AC three-phase unbalanced cable with
neutral connection. The model is based on
<a href=\"modelica://AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines.TwoPortRLC\">
AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines.TwoPortRLC</a>
and provides functionalities to parametrize the values of <i>R</i>, <i>L</i> and <i>C</i>
using either commercial cables or default values. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model Line_N "Model of an electrical line with neutral cable"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort_N(
terminal_p(phase(v(each nominal = V_nominal))),
terminal_n(phase(v(each nominal = V_nominal))));
extends AixLib.Electrical.Transmission.BaseClasses.PartialBaseLine(
V_nominal(start = 480),
commercialCable = AixLib.Electrical.Transmission.Functions.selectCable_low(P_nominal, V_nominal));
OnePhase.Lines.TwoPortRL phase1(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final mode=modelMode,
final R=R/3,
final L=L/3) "Impedance line 1"
OnePhase.Lines.TwoPortRL phase2(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final mode=modelMode,
final R=R/3,
final L=L/3) "Impedance line 1"
OnePhase.Lines.TwoPortRL phase3(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final mode=modelMode,
final R=R/3,
final L=L/3) "Impedance line 1"
OnePhase.Lines.TwoPortRL neutral(
final useHeatPort=true,
final T_ref=T_ref,
final M=M,
final mode=modelMode,
final R=R/3,
final L=L/3) "Impedance of the neutral cable"
equation
connect(cableTemp.port, phase1.heatPort)
connect(cableTemp.port, phase2.heatPort)
connect(cableTemp.port, phase3.heatPort)
connect(terminal_n.phase[1], phase1.terminal_n)
connect(terminal_n.phase[2], phase2.terminal_n)
connect(terminal_n.phase[3], phase3.terminal_n)
connect(phase1.terminal_p, terminal_p.phase[1])
connect(phase2.terminal_p, terminal_p.phase[2])
connect(phase3.terminal_p, terminal_p.phase[3])
connect(cableTemp.port, neutral.heatPort)
// Neutral cable connection
connect(terminal_n.phase[4], neutral.terminal_n)
connect(terminal_p.phase[4], neutral.terminal_p)
end Line_N; |
Three phases unbalanced AC network without neutral cable. This model represents a generalized electrical AC three-phase unbalanced network
without neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model Network "Three phases unbalanced AC network without neutral cable"
extends Transmission.BaseClasses.PartialNetwork(
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.Terminal_p terminal,
redeclare replaceable Transmission.Grids.TestGrid2Nodes grid,
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines.Line lines(commercialCable=grid.cables));
Modelica.Units.SI.Voltage VAbs[3,grid.nNodes] "RMS voltage of the grid nodes";
equation
for i in 1:grid.nLinks loop
connect(lines[i].terminal_p, terminal[grid.fromTo[i,1]]);
connect(lines[i].terminal_n, terminal[grid.fromTo[i,2]]);
end for;
for i in 1:grid.nNodes loop
VAbs[1,i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].phase[1].v);
VAbs[2,i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].phase[2].v);
VAbs[3,i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].phase[3].v);
end for;
end Network; |
Three phases unbalanced AC network with neutral cable. This model represents a generalized electrical AC three-phase unbalanced network
with neutral cable. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model Network_N "Three phases unbalanced AC network with neutral cable"
extends Transmission.BaseClasses.PartialNetwork(
redeclare
AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.Terminal4_p terminal,
redeclare replaceable Transmission.Grids.TestGrid2Nodes grid,
redeclare AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines.Line_N lines(
commercialCable=grid.cables));
Modelica.Units.SI.Voltage VAbs[3,grid.nNodes] "RMS voltage of the grid nodes";
equation
for i in 1:grid.nLinks loop
connect(lines[i].terminal_p, terminal[grid.fromTo[i,1]]);
connect(lines[i].terminal_n, terminal[grid.fromTo[i,2]]);
end for;
for i in 1:grid.nNodes loop
VAbs[1,i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].phase[1].v - terminal[i].phase[4].v);
VAbs[2,i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].phase[2].v - terminal[i].phase[4].v);
VAbs[3,i] = AixLib.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].phase[3].v - terminal[i].phase[4].v);
end for;
end Network_N; |
Package with transmission line models for three-phase unbalanced AC systems | within AixLib.Electrical.AC.ThreePhasesUnbalanced;
package Lines "Package with transmission line models for three-phase unbalanced AC systems"
extends Modelica.Icons.Package;
end Lines; |
Model of an inductance with two electrical ports. Inductive model that connects two AC three-phase
unbalanced interfaces. This model can be used to represent a
cable in a three-phase unbalanced AC system. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortInductance "Model of an inductance with two electrical ports"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort;
parameter Modelica.Units.SI.Inductance L "Inductance";
OnePhase.Lines.TwoPortInductance phase1(
final L=L/3) "Inductance line 1"
OnePhase.Lines.TwoPortInductance phase2(
final L=L/3) "Inductance line 2"
OnePhase.Lines.TwoPortInductance phase3(
final L=L/3) "Inductance line 3"
equation
connect(terminal_n.phase[1], phase1.terminal_n)
connect(terminal_n.phase[2], phase2.terminal_n)
connect(terminal_n.phase[3], phase3.terminal_n)
connect(phase1.terminal_p, terminal_p.phase[1])
connect(phase2.terminal_p, terminal_p.phase[2])
connect(phase3.terminal_p, terminal_p.phase[3])
end TwoPortInductance; |
Model of an inductance with two electrical ports and neutral line cable. Inductive model that connects two AC three-phase
unbalanced interfaces with neutral line. This model can be used to represent a
cable in a three-phase unbalanced AC system. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortInductance_N
"Model of an inductance with two electrical ports and neutral line cable"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort_N;
parameter Modelica.Units.SI.Inductance L "Inductance";
parameter Modelica.Units.SI.Inductance Ln "Inductance of neutral cable";
OnePhase.Lines.TwoPortInductance phase1(
final L=L/3) "Inductance line 1"
OnePhase.Lines.TwoPortInductance phase2(
final L=L/3) "Inductance line 2"
OnePhase.Lines.TwoPortInductance phase3(
final L=L/3) "Inductance line 3"
OnePhase.Lines.TwoPortInductance phase4(
final L=L/3) "Inductance line 3"
equation
connect(terminal_n.phase[1], phase1.terminal_n)
connect(terminal_n.phase[2], phase2.terminal_n)
connect(terminal_n.phase[3], phase3.terminal_n)
connect(phase1.terminal_p, terminal_p.phase[1])
connect(phase2.terminal_p, terminal_p.phase[2])
connect(phase3.terminal_p, terminal_p.phase[3])
connect(phase4.terminal_p, terminal_p.phase[4])
connect(phase4.terminal_n, terminal_n.phase[4])
end TwoPortInductance_N; |
Model of an RL line parameterized with impedance matrices. Resistive-inductive model that connects two AC three-phase
unbalanced interfaces. This model can be used to represent a
cable in a three-phase unbalanced AC system.
The voltage between the ports is | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortMatrixRL
"Model of an RL line parameterized with impedance matrices"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort(
terminal_p(phase(v(each nominal = V_nominal))),
terminal_n(phase(v(each nominal = V_nominal))));
parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=480)
"Nominal voltage (V_nominal >= 0)"
parameter Modelica.Units.SI.Impedance Z11[2]
"Element [1,1] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z12[2]
"Element [1,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z13[2]
"Element [1,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z22[2]
"Element [2,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z23[2]
"Element [2,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z33[2]
"Element [3,3] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z21=Z12
"Element [2,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z31=Z13
"Element [3,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z32=Z23
"Element [3,1] of impedance matrix";
Modelica.Units.SI.Current i1[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[1].i "Current in line 1";
Modelica.Units.SI.Current i2[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[2].i "Current in line 2";
Modelica.Units.SI.Current i3[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[3].i "Current in line 3";
Modelica.Units.SI.Voltage v1_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_n.phase[1].v
"Voltage in line 1 at connector N";
Modelica.Units.SI.Voltage v2_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[2].v
"Voltage in line 2 at connector N";
Modelica.Units.SI.Voltage v3_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[3].v
"Voltage in line 3 at connector N";
Modelica.Units.SI.Voltage v1_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_p.phase[1].v
"Voltage in line 1 at connector P";
Modelica.Units.SI.Voltage v2_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[2].v
"Voltage in line 2 at connector P";
Modelica.Units.SI.Voltage v3_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[3].v
"Voltage in line 3 at connector P";
protected
function productAC1p = AixLib.Electrical.PhaseSystems.OnePhase.product
"Product between complex quantities";
equation
// Link the connectors to propagate the overdetermined variable
for i in 1:3 loop
Connections.branch(terminal_p.phase[i].theta, terminal_n.phase[i].theta);
terminal_p.phase[i].theta = terminal_n.phase[i].theta;
// No current losses, they are preserved in each line
terminal_p.phase[i].i = - terminal_n.phase[i].i;
end for;
// Voltage drop caused by the impedance matrix
v1_n - v1_p = productAC1p(Z11, i1) + productAC1p(Z12, i2) + productAC1p(Z13, i3);
v2_n - v2_p = productAC1p(Z21, i1) + productAC1p(Z22, i2) + productAC1p(Z23, i3);
v3_n - v3_p = productAC1p(Z31, i1) + productAC1p(Z32, i2) + productAC1p(Z33, i3);
end TwoPortMatrixRL; |
PI model of a line parameterized with impedance and admittance matrices. RLC line model (π-model) that connects two AC three-phase
unbalanced interfaces. This model can be used to represent a
cable in a three-phase unbalanced AC system. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortMatrixRLC
"PI model of a line parameterized with impedance and admittance matrices"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort(
terminal_p(phase(v(each nominal = V_nominal))),
terminal_n(phase(v(each nominal = V_nominal))));
parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=480)
"Nominal voltage (V_nominal >= 0)"
parameter Modelica.Units.SI.Impedance Z11[2]
"Element [1,1] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z12[2]
"Element [1,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z13[2]
"Element [1,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z22[2]
"Element [2,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z23[2]
"Element [2,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z33[2]
"Element [3,3] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z21=Z12
"Element [2,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z31=Z13
"Element [3,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z32=Z23
"Element [3,1] of impedance matrix";
parameter Modelica.Units.SI.Admittance B11
"Element [1,1] of admittance matrix";
parameter Modelica.Units.SI.Admittance B12
"Element [1,2] of admittance matrix";
parameter Modelica.Units.SI.Admittance B13
"Element [1,3] of admittance matrix";
parameter Modelica.Units.SI.Admittance B22
"Element [2,2] of admittance matrix";
parameter Modelica.Units.SI.Admittance B23
"Element [2,3] of admittance matrix";
parameter Modelica.Units.SI.Admittance B33
"Element [3,3] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B21=B12
"Element [2,1] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B31=B13
"Element [3,1] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B32=B23
"Element [3,2] of admittance matrix";
Modelica.Units.SI.Voltage v1_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_n.phase[1].v
"Voltage in line 1 at connector N";
Modelica.Units.SI.Voltage v2_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[2].v
"Voltage in line 2 at connector N";
Modelica.Units.SI.Voltage v3_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[3].v
"Voltage in line 3 at connector N";
Modelica.Units.SI.Voltage v1_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_p.phase[1].v
"Voltage in line 1 at connector P";
Modelica.Units.SI.Voltage v2_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[2].v
"Voltage in line 2 at connector P";
Modelica.Units.SI.Voltage v3_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[3].v
"Voltage in line 3 at connector P";
protected
function productAC1p = AixLib.Electrical.PhaseSystems.OnePhase.product
"Product between complex quantities";
Modelica.Units.SI.Current Isr[3,2](start=zeros(3, AixLib.Electrical.PhaseSystems.OnePhase.n),
each stateSelect=StateSelect.prefer)
"Currents that pass through the lines";
Modelica.Units.SI.Current Ish_p[3,2](start=zeros(3, AixLib.Electrical.PhaseSystems.OnePhase.n),
each stateSelect=StateSelect.prefer) "Shunt current on side p";
Modelica.Units.SI.Current Ish_n[3,2](start=zeros(3, AixLib.Electrical.PhaseSystems.OnePhase.n),
each stateSelect=StateSelect.prefer) "Shunt current on side n";
equation
// Link the connectors to propagate the overdetermined variable
for i in 1:3 loop
Connections.branch(terminal_p.phase[i].theta, terminal_n.phase[i].theta);
terminal_p.phase[i].theta = terminal_n.phase[i].theta;
end for;
// Kirkoff current law for the terminal n (left side)
Isr[1,:] = terminal_n.phase[1].i - Ish_n[1,:];
Isr[2,:] = terminal_n.phase[2].i - Ish_n[2,:];
Isr[3,:] = terminal_n.phase[3].i - Ish_n[3,:];
// Kirkoff current law for the terminal p (right side)
Isr[1,:] + terminal_p.phase[1].i = Ish_p[1,:];
Isr[2,:] + terminal_p.phase[2].i = Ish_p[2,:];
Isr[3,:] + terminal_p.phase[3].i = Ish_p[3,:];
// Voltage drop caused by the impedance matrix
terminal_n.phase[1].v - terminal_p.phase[1].v = productAC1p(Z11, terminal_n.phase[1].i)
+ productAC1p(Z12, terminal_n.phase[2].i)
+ productAC1p(Z13, terminal_n.phase[3].i);
terminal_n.phase[2].v - terminal_p.phase[2].v = productAC1p(Z21, terminal_n.phase[1].i)
+ productAC1p(Z22, terminal_n.phase[2].i)
+ productAC1p(Z23, terminal_n.phase[3].i);
terminal_n.phase[3].v - terminal_p.phase[3].v = productAC1p(Z31, terminal_n.phase[1].i)
+ productAC1p(Z32, terminal_n.phase[2].i)
+ productAC1p(Z33, terminal_n.phase[3].i);
// Current loss at the terminal n
Ish_n[1,:] = productAC1p({0, B11/2}, v1_n)
+ productAC1p({0, B12/2}, v2_n)
+ productAC1p({0, B13/2}, v3_n);
Ish_n[2,:] = productAC1p({0, B21/2}, v1_n)
+ productAC1p({0, B22/2}, v2_n)
+ productAC1p({0, B23/2}, v3_n);
Ish_n[3,:] = productAC1p({0, B31/2}, v1_n)
+ productAC1p({0, B32/2}, v2_n)
+ productAC1p({0, B33/2}, v3_n);
// Current loss at the terminal n
Ish_p[1,:] = productAC1p({0, B11/2}, v1_p)
+ productAC1p({0, B12/2}, v2_p)
+ productAC1p({0, B13/2}, v3_p);
Ish_p[2,:] = productAC1p({0, B21/2}, v1_p)
+ productAC1p({0, B22/2}, v2_p)
+ productAC1p({0, B23/2}, v3_p);
Ish_p[3,:] = productAC1p({0, B31/2}, v1_p)
+ productAC1p({0, B32/2}, v2_p)
+ productAC1p({0, B33/2}, v3_p);
end TwoPortMatrixRLC; |
PI model of a line parameterized with impedance and admittance matrices and neutral line. RLC line model (π-model) that connects two AC three-phase
unbalanced interfaces and neutral line. This model can be used to represent a
cable in a three-phase unbalanced AC system. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortMatrixRLC_N
"PI model of a line parameterized with impedance and admittance matrices and neutral line"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort_N(
terminal_p(phase(v(each nominal = V_nominal))),
terminal_n(phase(v(each nominal = V_nominal))));
parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=480)
"Nominal voltage (V_nominal >= 0)"
parameter Modelica.Units.SI.Impedance Z11[2]
"Element [1,1] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z12[2]
"Element [1,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z13[2]
"Element [1,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z14[2]
"Element [1,4] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z22[2]
"Element [2,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z23[2]
"Element [2,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z24[2]
"Element [2,4] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z33[2]
"Element [3,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z34[2]
"Element [3,4] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z44[2]
"Element [4,4] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z21=Z12
"Element [2,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z31=Z13
"Element [3,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z32=Z23
"Element [3,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z41=Z14
"Element [4,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z42=Z24
"Element [4,2] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z43=Z34
"Element [4,3] of impedance matrix";
parameter Modelica.Units.SI.Admittance B11
"Element [1,1] of admittance matrix";
parameter Modelica.Units.SI.Admittance B12
"Element [1,2] of admittance matrix";
parameter Modelica.Units.SI.Admittance B13
"Element [1,3] of admittance matrix";
parameter Modelica.Units.SI.Admittance B14
"Element [1,4] of admittance matrix";
parameter Modelica.Units.SI.Admittance B22
"Element [2,2] of admittance matrix";
parameter Modelica.Units.SI.Admittance B23
"Element [2,3] of admittance matrix";
parameter Modelica.Units.SI.Admittance B24
"Element [2,4] of admittance matrix";
parameter Modelica.Units.SI.Admittance B33
"Element [3,3] of admittance matrix";
parameter Modelica.Units.SI.Admittance B34
"Element [3,4] of admittance matrix";
parameter Modelica.Units.SI.Admittance B44
"Element [4,4] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B21=B12
"Element [2,1] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B31=B13
"Element [3,1] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B32=B23
"Element [3,2] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B41=B14
"Element [4,1] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B42=B24
"Element [4,2] of admittance matrix";
final parameter Modelica.Units.SI.Admittance B43=B34
"Element [4,3] of admittance matrix";
Modelica.Units.SI.Voltage v1_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_n.phase[1].v
"Voltage in line 1 at connector N";
Modelica.Units.SI.Voltage v2_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[2].v
"Voltage in line 2 at connector N";
Modelica.Units.SI.Voltage v3_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[3].v
"Voltage in line 3 at connector N";
Modelica.Units.SI.Voltage v4_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(0),
each stateSelect=StateSelect.never) = terminal_n.phase[4].v
"Voltage in line 4 (neutral) at connector N";
Modelica.Units.SI.Voltage v1_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_p.phase[1].v
"Voltage in line 1 at connector P";
Modelica.Units.SI.Voltage v2_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[2].v
"Voltage in line 2 at connector P";
Modelica.Units.SI.Voltage v3_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[3].v
"Voltage in line 3 at connector P";
Modelica.Units.SI.Voltage v4_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(0),
each stateSelect=StateSelect.never) = terminal_p.phase[4].v
"Voltage in line 4 (neutral) at connector P";
protected
function productAC1p = AixLib.Electrical.PhaseSystems.OnePhase.product
"Product between complex quantities";
Modelica.Units.SI.Current Isr[4,2](each stateSelect=StateSelect.prefer)
"Currents that pass through the lines";
Modelica.Units.SI.Current Ish_p[4,2](each stateSelect=StateSelect.prefer)
"Shunt current on side p";
Modelica.Units.SI.Current Ish_n[4,2](each stateSelect=StateSelect.prefer)
"Shunt current on side n";
equation
// Link the connectors to propagate the overdetermined variable
for i in 1:4 loop
Connections.branch(terminal_p.phase[i].theta, terminal_n.phase[i].theta);
terminal_p.phase[i].theta = terminal_n.phase[i].theta;
end for;
// Kirkoff current law for the terminal n (left side)
Isr[1,:] = terminal_n.phase[1].i - Ish_n[1,:];
Isr[2,:] = terminal_n.phase[2].i - Ish_n[2,:];
Isr[3,:] = terminal_n.phase[3].i - Ish_n[3,:];
Isr[4,:] = terminal_n.phase[4].i - Ish_n[4,:];
// Kirkoff current law for the terminal p (right side)
Isr[1,:] + terminal_p.phase[1].i = Ish_p[1,:];
Isr[2,:] + terminal_p.phase[2].i = Ish_p[2,:];
Isr[3,:] + terminal_p.phase[3].i = Ish_p[3,:];
Isr[4,:] + terminal_p.phase[4].i = Ish_p[4,:];
// Voltage drop caused by the impedance matrix
terminal_n.phase[1].v - terminal_p.phase[1].v = productAC1p(Z11, terminal_n.phase[1].i)
+ productAC1p(Z12, terminal_n.phase[2].i)
+ productAC1p(Z13, terminal_n.phase[3].i)
+ productAC1p(Z14, terminal_n.phase[4].i);
terminal_n.phase[2].v - terminal_p.phase[2].v = productAC1p(Z21, terminal_n.phase[1].i)
+ productAC1p(Z22, terminal_n.phase[2].i)
+ productAC1p(Z23, terminal_n.phase[3].i)
+ productAC1p(Z24, terminal_n.phase[4].i);
terminal_n.phase[3].v - terminal_p.phase[3].v = productAC1p(Z31, terminal_n.phase[1].i)
+ productAC1p(Z32, terminal_n.phase[2].i)
+ productAC1p(Z33, terminal_n.phase[3].i)
+ productAC1p(Z34, terminal_n.phase[4].i);
terminal_n.phase[4].v - terminal_p.phase[4].v = productAC1p(Z41, terminal_n.phase[1].i)
+ productAC1p(Z42, terminal_n.phase[2].i)
+ productAC1p(Z43, terminal_n.phase[3].i)
+ productAC1p(Z44, terminal_n.phase[4].i);
// Current loss at the terminal n
Ish_n[1,:] = productAC1p({0, B11/2}, v1_n)
+ productAC1p({0, B12/2}, v2_n)
+ productAC1p({0, B13/2}, v3_n)
+ productAC1p({0, B14/2}, v4_n);
Ish_n[2,:] = productAC1p({0, B21/2}, v1_n)
+ productAC1p({0, B22/2}, v2_n)
+ productAC1p({0, B23/2}, v3_n)
+ productAC1p({0, B24/2}, v4_n);
Ish_n[3,:] = productAC1p({0, B31/2}, v1_n)
+ productAC1p({0, B32/2}, v2_n)
+ productAC1p({0, B33/2}, v3_n)
+ productAC1p({0, B34/2}, v4_n);
Ish_n[4,:] = productAC1p({0, B41/2}, v1_n)
+ productAC1p({0, B42/2}, v2_n)
+ productAC1p({0, B43/2}, v3_n)
+ productAC1p({0, B44/2}, v4_n);
// Current loss at the terminal n
Ish_p[1,:] = productAC1p({0, B11/2}, v1_p)
+ productAC1p({0, B12/2}, v2_p)
+ productAC1p({0, B13/2}, v3_p)
+ productAC1p({0, B14/2}, v4_p);
Ish_p[2,:] = productAC1p({0, B21/2}, v1_p)
+ productAC1p({0, B22/2}, v2_p)
+ productAC1p({0, B23/2}, v3_p)
+ productAC1p({0, B24/2}, v4_p);
Ish_p[3,:] = productAC1p({0, B31/2}, v1_p)
+ productAC1p({0, B32/2}, v2_p)
+ productAC1p({0, B33/2}, v3_p)
+ productAC1p({0, B34/2}, v4_p);
Ish_p[4,:] = productAC1p({0, B41/2}, v1_p)
+ productAC1p({0, B42/2}, v2_p)
+ productAC1p({0, B43/2}, v3_p)
+ productAC1p({0, B44/2}, v4_p);
end TwoPortMatrixRLC_N; |
Model of an RL line parameterized with impedance matrices and neutral line. Resistive-inductive model that connects two AC three-phase
unbalanced interfaces with neutral line. This model can be used to represent a
cable in a three-phase unbalanced AC system.
The voltage between the ports is | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortMatrixRL_N
"Model of an RL line parameterized with impedance matrices and neutral line"
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort_N(
terminal_p(phase(v(each nominal = V_nominal))),
terminal_n(phase(v(each nominal = V_nominal))));
parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=480)
"Nominal voltage (V_nominal >= 0)"
parameter Modelica.Units.SI.Impedance Z11[2]
"Element [1,1] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z12[2]
"Element [1,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z13[2]
"Element [1,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z14[2]
"Element [1,4] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z22[2]
"Element [2,2] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z23[2]
"Element [2,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z24[2]
"Element [2,4] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z33[2]
"Element [3,3] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z34[2]
"Element [3,4] of impedance matrix";
parameter Modelica.Units.SI.Impedance Z44[2]
"Element [4,4] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z21=Z12
"Element [2,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z31=Z13
"Element [3,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z32=Z23
"Element [3,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z41=Z14
"Element [4,1] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z42=Z24
"Element [4,2] of impedance matrix";
final parameter Modelica.Units.SI.Impedance[2] Z43=Z34
"Element [4,3] of impedance matrix";
Modelica.Units.SI.Current i1[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[1].i "Current in line 1";
Modelica.Units.SI.Current i2[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[2].i "Current in line 2";
Modelica.Units.SI.Current i3[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[3].i "Current in line 3";
Modelica.Units.SI.Current i4[2](each stateSelect=StateSelect.prefer)=
terminal_n.phase[4].i "Current in line 4 (neutral)";
Modelica.Units.SI.Voltage v1_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_n.phase[1].v
"Voltage in line 1 at connector N";
Modelica.Units.SI.Voltage v2_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[2].v
"Voltage in line 2 at connector N";
Modelica.Units.SI.Voltage v3_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_n.phase[3].v
"Voltage in line 3 at connector N";
Modelica.Units.SI.Voltage v4_n[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(0),
each stateSelect=StateSelect.never) = terminal_n.phase[4].v
"Voltage in line 4 (neutral) at connector N";
Modelica.Units.SI.Voltage v1_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=0),
each stateSelect=StateSelect.never) = terminal_p.phase[1].v
"Voltage in line 1 at connector P";
Modelica.Units.SI.Voltage v2_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=-2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[2].v
"Voltage in line 2 at connector P";
Modelica.Units.SI.Voltage v3_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(V_nominal/
sqrt(3), phi=2*Modelica.Constants.pi/3),
each stateSelect=StateSelect.never) = terminal_p.phase[3].v
"Voltage in line 3 at connector P";
Modelica.Units.SI.Voltage v4_p[2](
start=AixLib.Electrical.PhaseSystems.OnePhase.phaseVoltages(0),
each stateSelect=StateSelect.never) = terminal_p.phase[4].v
"Voltage in line 4 (neutral) at connector P";
protected
function productAC1p = AixLib.Electrical.PhaseSystems.OnePhase.product
"Product between complex quantities";
equation
// Link the connectors to propagate the overdetermined variable
for i in 1:4 loop
Connections.branch(terminal_p.phase[i].theta, terminal_n.phase[i].theta);
terminal_p.phase[i].theta = terminal_n.phase[i].theta;
// No current losses, they are preserved in each line
terminal_p.phase[i].i = - terminal_n.phase[i].i;
end for;
// Voltage drop caused by the impedance matrix
v1_n - v1_p = productAC1p(Z11, i1) + productAC1p(Z12, i2) + productAC1p(Z13, i3)+ productAC1p(Z14, i4);
v2_n - v2_p = productAC1p(Z21, i1) + productAC1p(Z22, i2) + productAC1p(Z23, i3)+ productAC1p(Z24, i4);
v3_n - v3_p = productAC1p(Z31, i1) + productAC1p(Z32, i2) + productAC1p(Z33, i3)+ productAC1p(Z34, i4);
v4_n - v4_p = productAC1p(Z41, i1) + productAC1p(Z42, i2) + productAC1p(Z43, i3)+ productAC1p(Z44, i4);
end TwoPortMatrixRL_N; |
Model of a resistance with two electrical ports. Resistive model that connects two AC three-phase
unbalanced interfaces. This model can be used to represent a
cable in a three-phase unbalanced AC system. | within AixLib.Electrical.AC.ThreePhasesUnbalanced.Lines;
model TwoPortResistance "Model of a resistance with two electrical ports"
extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort;
extends AixLib.Electrical.AC.ThreePhasesUnbalanced.Interfaces.TwoPort;
parameter Modelica.Units.SI.Temperature T_ref=298.15 "Reference temperature"
parameter Modelica.Units.SI.Temperature M=507.65
"Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"
parameter Modelica.Units.SI.Resistance R "Resistance at temperature T_ref";
OnePhase.Lines.TwoPortResistance phase1(
final T_ref=T_ref,
final M=M,
final R=R/3,
final useHeatPort=useHeatPort) "Resistance line 1"
OnePhase.Lines.TwoPortResistance phase2(
final T_ref=T_ref,
final M=M,
final R=R/3,
final useHeatPort=useHeatPort) "Resistance line 2"
OnePhase.Lines.TwoPortResistance phase3(
final T_ref=T_ref,
final M=M,
final R=R/3,
final useHeatPort=useHeatPort) "Resistance line 3"
equation
// Joule Losses
LossPower = phase1.LossPower + phase2.LossPower + phase3.LossPower;
connect(terminal_n.phase[1], phase1.terminal_n)
connect(terminal_n.phase[2], phase2.terminal_n)
connect(terminal_n.phase[3], phase3.terminal_n)
connect(phase1.terminal_p, terminal_p.phase[1])
connect(phase2.terminal_p, terminal_p.phase[2])
connect(phase3.terminal_p, terminal_p.phase[3])
connect(phase1.heatPort, heatPort)
connect(phase3.heatPort, heatPort)
connect(phase2.heatPort, heatPort)
end TwoPortResistance; |