This model is a simple test case that show how to use a line model
and parametrize it using a commercial cable.
model DCLine
"Example model to test the DC lines"
extends Modelica.Icons.Example;
Line line(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=100)
"Transmission line";
Sources.ConstantVoltage E(V=50)
"Voltage source";
Line line1(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=100)
"Transmission line";
Line line2(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=100)
"Transmission line";
Modelica.Electrical.Analog.Basic.Ground ground;
Loads.Conductor load1(mode=Types.Load.VariableZ_y_input,
V_nominal=50,
linearized=false,
P_nominal=-50)
"Variable load";
Loads.Conductor load2(
V_nominal=50,
linearized=false,
P_nominal=-150)
"Load";
Loads.Conductor load3(
V_nominal=50,
linearized=false,
P_nominal=-200)
"Load";
Modelica.Blocks.Sources.Ramp varLoad(
height=0.8,
duration=0.5,
offset=0.2,
startTime=0.3)
"Load consumption profile";
equation
connect(E.terminal, line.terminal_n);
connect(E.terminal, line1.terminal_n);
connect(E.terminal, line2.terminal_n);
connect(load1.terminal, line.terminal_p);
connect(line1.terminal_p, load2.terminal);
connect(line2.terminal_p, load3.terminal);
connect(varLoad.y, load1.y);
connect(E.n, ground.p);
end DCLine;
This model shows a DC grid with 10 loads and 16 cables.
Each cable is of length l = 10 meters, a parameter that can be modified.
Each load can be either be a full nonlinear model, or be replaced by the
linearized version. The parameter linearLoads = false
can be used to switch between linear and nonlinear implementation.
This model can be used to test how the linearized loads are affected by the voltage drop
caused by the lines. The longer the distance between the load and the source,
the bigger is the voltage drop and thus the error introduced by the linearization.
model DCLines
"Example model to test the possible combinations between line and load models"
extends Modelica.Icons.Example;
parameter Boolean linearLoads = false
"Flag that selects between linearized or nonlinear load models";
parameter Real L = 10
"Lenght of each cable";
Modelica.SIunits.Power Sloads = load1.S[1] + load2.S[1] +load3.S[1] +load4.S[1] +
load5.S[1] +load6.S[1] +load7.S[1] +load8.S[1] +load9.S[1] +
load10.S[1]
"Sum of the power consumed by the loads";
Line line(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Sources.ConstantVoltage E(V=50)
"Voltage source";
Line line1(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line2(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Modelica.Electrical.Analog.Basic.Ground ground;
Loads.Conductor load1(mode=Types.Load.VariableZ_y_input,
V_nominal=50,
linearized=linearLoads,
P_nominal=-150)
"Load";
Loads.Conductor load2(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-120)
"Load";
Loads.Conductor load3(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-200)
"Load";
Modelica.Blocks.Sources.Trapezoid
varLoad1(
offset=0.4,
amplitude=0.6,
rising=600,
width=1000,
falling=800,
period=3600,
startTime=1800)
"Power consumption profile";
Loads.Conductor load4(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-120)
"Load";
Line line3(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line4(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line5(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line0(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Modelica.Blocks.Sources.Trapezoid
varLoad2(
startTime=1800,
amplitude=0.8,
rising=400,
width=1300,
falling=900,
period=4000,
offset=0.1)
"Power consumption profile";
Line line6(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Loads.Conductor load5(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-200)
"Load";
Modelica.Blocks.Sources.Trapezoid
varLoad3(
amplitude=0.7,
rising=660,
width=900,
falling=300,
period=3700,
offset=0.3,
startTime=200)
"Power consumption profile";
Loads.Conductor load6(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-120)
"Load";
Line line7(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line8(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line9(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Loads.Conductor load7(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-200)
"Load";
Modelica.Blocks.Sources.Trapezoid
varLoad4(
rising=600,
width=1000,
falling=800,
period=3600,
amplitude=0.1,
offset=0.8,
startTime=3300)
"Power consumption profile";
Loads.Conductor load8(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-120)
"Load";
Line line10(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line11(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line12(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Loads.Conductor load9(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-200)
"Load";
Modelica.Blocks.Sources.Trapezoid
varLoad5(
falling=800,
amplitude=0.5,
rising=800,
width=800,
period=3000,
offset=0.5,
startTime=0)
"Power consumption profile";
Loads.Conductor load10(
V_nominal=50,
mode=Types.Load.VariableZ_y_input,
linearized=linearLoads,
P_nominal=-120)
"Load";
Line line13(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=L)
"Transmission line";
Line line14(
P_nominal=500,
V_nominal=50,
mode=Types.CableMode.commercial,
commercialCable=
Transmission.LowVoltageCables.PvcAl16(),
l=100)
"Transmission line";
equation
connect(load1.terminal, line.terminal_p);
connect(line1.terminal_p, line.terminal_n);
connect(line2.terminal_p, line3.terminal_n);
connect(line3.terminal_p, load3.terminal);
connect(line1.terminal_p, line4.terminal_n);
connect(line4.terminal_p, load2.terminal);
connect(load4.terminal, line5.terminal_p);
connect(line5.terminal_n, line3.terminal_n);
connect(E.terminal, line0.terminal_n);
connect(line0.terminal_p, line1.terminal_n);
connect(varLoad1.y, load3.y);
connect(varLoad1.y, load4.y);
connect(varLoad2.y, load1.y);
connect(varLoad2.y, load2.y);
connect(line6.terminal_p,line7. terminal_n);
connect(line7.terminal_p,load5. terminal);
connect(load6.terminal,line8. terminal_p);
connect(line8.terminal_n,line7. terminal_n);
connect(varLoad3.y,load5. y);
connect(varLoad3.y,load6. y);
connect(line9.terminal_p, line10.terminal_n);
connect(line10.terminal_p, load7.terminal);
connect(load8.terminal, line11.terminal_p);
connect(line11.terminal_n, line10.terminal_n);
connect(varLoad4.y,load7. y);
connect(varLoad4.y,load8. y);
connect(line12.terminal_p, line13.terminal_n);
connect(line13.terminal_p, load9.terminal);
connect(load10.terminal, line14.terminal_p);
connect(line14.terminal_n, line13.terminal_n);
connect(varLoad5.y,load9. y);
connect(varLoad5.y, load10.y);
connect(line2.terminal_n, line4.terminal_n);
connect(line6.terminal_n, line3.terminal_n);
connect(line9.terminal_n, line7.terminal_n);
connect(line12.terminal_n, line10.terminal_n);
connect(E.n, ground.p);
end DCLines;
This model shows how to use a two port resistance-capacitance model.
The example also shows a comparison between the dynamic and steady state version model
that can be selected by changing the boolean flag use_C
.
In this example the RC connects an ideal constant voltage source with
a short circuit. The steady state current value passing through the RC
model depends just on the value of R.
thus the duration of transient period is about 10 seconds.
This model shows how to use a two port resistance.
In this example the resistance connects an ideal constant voltage source with
a short circuit. The current flowing through the circuit depends just
on the value of the two port resistance.