Modelica.Electrical.Analog.Examples.Lines

Examples of line models

Information

This package contains demo experiments of the line models.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Modelica.Electrical.Analog.Examples.Lines.CompareLosslessLines CompareLosslessLines Compare lossless lines with different load
Modelica.Electrical.Analog.Examples.Lines.SmoothStep SmoothStep Compares oLine and tLine behaviour
Modelica.Electrical.Analog.Examples.Lines.CompareLineTrunks CompareLineTrunks Compares oLine and tLine splitting lines into trunks
Modelica.Electrical.Analog.Examples.Lines.LightningLosslessTransmissionLine LightningLosslessTransmissionLine Lightning on a lossless transmission line
Modelica.Electrical.Analog.Examples.Lines.LightningSegmentedTransmissionLine LightningSegmentedTransmissionLine Lightning on a segmented transmission line

Modelica.Electrical.Analog.Examples.Lines.CompareLosslessLines Modelica.Electrical.Analog.Examples.Lines.CompareLosslessLines

Compare lossless lines with different load

Information

This example compares three lossless lines with different loads. Inductance per meter (l=250 nH/m) and capacitance per meter (c=100 pF/m) are estimated for an average coaxial cable with characteristic impedance z0=√(l/c)=50 Ω. The speed of the electromagnetic wave is given by c0=1/√(l*c)=2*108 m/s. Using a cable with a length of len=1 m, we obtain a delay td=len/c0=5 ns. The sources impress a single voltage pulse with height=10 V and length=td/2, starting at td/2. Due to the inner resistances of the sources ri=z0 the pulse at the input of the line (v1) has a height of 5 V. Simulate for 20 ns and compare for each of the lines: v1, v2 and i1, i2.

1. load = idle

The voltage pulse at the beginning of the line (line1.v1) starts at 2.5 ns and lasts for 2.5 ns. It arrives at 7.5 ns at the end of the line (line1.v2), and is reflected giving a pulse of 10 V (superposition of arriving and reflected pulse). At 12.5 ns the reflected pulse arrives at the beginning of the line, with a height of 5 V (voltage divider of z0 and ri). Bear in mind that the source voltage is zero at that time, i.e. a short. The current at the end of the line (line1.i2) is zero since the load is implemented as an idle. The current at the beginning of the line, line1.i1, is 5 V/z0=100 mA at 2.5 mA and 12.5 ns.

2. load = z0

The voltage pulse at the beginning of the line (line2.v1) starts at 2.5 ns and lasts for 2.5 ns. It arrives at 7.5 ns at the end of the line (line2.v2). Due to load resistance=z0 no reflection occurs. The current at the beginning of the line, line2.i1, is 5 V/z0=100 mA at 2.5 ns. The current at the end of the line, line2.i2 is -5 V/z0=100 mA at 7.5 ns.

3. load = short

The voltage pulse at the beginning of the line (line3.v1) starts at 2.5 ns and lasts for 2.5 ns. Since the load is implemented as a short, the voltage at the end of the line (line3.v2) is zero. This is possible due to a reflection with negative sign, i.e. the superposition of arriving and reflected pulse gives zero. The reflected voltage pulse arrives at 12.5 ns at the beginning of the line. The current pulse at the beginning of the line (line3.i1) is 5 V/z0=100 mA at 2.5 ns. At the end of the line (line3.i2) a reflection occurs at 7.5 ns giving a current pulse of 200 mA (superposition of arriving and reflected pulse). The reflected pulse (100 mA) arrives at 12.5 ns at the beginning of the line (line3.i1).

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
lInductance per meter [H/m]
cCapacitance per meter [F/m]
lenLength of line [m]
c0Speed of EM wave [m/s]
tdTransmission delay [s]
z0Characteristic impedance [Ohm]

Modelica.Electrical.Analog.Examples.Lines.SmoothStep Modelica.Electrical.Analog.Examples.Lines.SmoothStep

Compares oLine and tLine behaviour

Information

This example shows a comparison of a multi-segment OLine model with the distributed-parameter line model TLine.

If resistances and conductances are negligible, with OLine the results should become closer and closer as the number of segments increases.

Suggested tests:

Steep step

Use the model as it is (it has firstOrder.T=1e-9 s) and compare R1.v, R5.v, R50.v, Rdistr.v: Rdistr.v is the ideal voltage of the receiving-end resistor for a lossless line, while the others are approximations with 1, 5, 50 cascaded segment models.

The step in this case is nearly ideal, and therefore is a very tough test for cascaded segments, and in fact they are not very good in approximating the real line behaviour.

Smoother step

Repeat the simulation using firstOrder.T=20e-6 s. You will see that the OLine compliance with the reference result given by TLine is much better, and 50 segments are probably adequate for several applications; in comparison with, they add the option of evaluating losses.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
RloadLoad resistance [Ohm]
r1Resistance per meter [Ohm/m]
g1Conductance per meter [S/m]
l1Inductance per meter [H/m]
c1Capacitance per meter [F/m]
lenLength of line [m]
N1Number of lumped segments of oline1
N5Number of lumped segments of oline5
N50Number of lumped segments of oline50
cSpeed of EM wave [m/s]
tdTransmission delay [s]
z0Characteristic impedance for very high frequency [Ohm]

Modelica.Electrical.Analog.Examples.Lines.CompareLineTrunks Modelica.Electrical.Analog.Examples.Lines.CompareLineTrunks

Compares oLine and tLine splitting lines into trunks

Information

This example shows a way to look at the traveling wave moving along a power line.

This wave can be seen looking at intermediate points of the line, looking at both OLine (several segments per line trunk) and TLine models.

OLine in the lossless case is less accurate, since shows oscillations that are not present in a distributed parameter line but, since it allows the addition of resistances and conductances, allows evaluation of losses.

Suggested tests:

7 segments per trunk, lossless

Run the model as it is. Since resistances and conductances are very small in OLine, the simulation is substantially lossless.

Show in the same plot ramp.y, oLine1.p2.v, oLine2.p2.v, oLine3.p2.v, oLine4.p2.v.

Show in another plot, simultaneously, ramp.y, tLine1.p2.v, tLine2.p2.v, tLine3.p2.v, tLine4.p2.v. Here oLine shows unreal oscillations, which, however, reduce if the number of segments per trunk increases.

50 segments per trunk, lossless

Try increasing this number from 7 to 50 using parameter segsPerTrunk, and look at the same plots as per test 1

50 segments per trunk, losses

Leave segsPerTrunk=50, change r1 to 1e-3 Ω, re-simulate: the effect of losses is visible only on the oLine plot.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
RloadLoad resistance [Ohm]
r1Resistance per meter [Ohm/m]
g1Conductance per meter [S/m]
l1Inductance per meter [H/m]
c1Capacitance per meter [F/m]
lenLength of line [m]
segsPerTrunkSegments per trunk
cSpeed of EM wave [m/s]
tdTransmission delay [s]
z0Characteristic impedance for very high frequency [Ohm]

Modelica.Electrical.Analog.Examples.Lines.LightningLosslessTransmissionLine Modelica.Electrical.Analog.Examples.Lines.LightningLosslessTransmissionLine

Lightning on a lossless transmission line

Information

This example shows what happens when a lightning hits a transmission line. We consider a lossless single-phase equivalent circuit with two parts of the transmission line, each 50 km long. The RMS voltage is 380 kV / √3, the RMS load current is roughly 1090 A. Realistic parameters of the 380 kV transmission line are used. Note that after the source starts, the traveling wave arrives at the load 350 µs later. After 20 ms, a lightning (10/350 µs) with an amplitude of 10 kA hits the transmission line just in the middle. Note that the traveling wave hits source and load approximately 200 µs after the lightning hits the transmission line. Plot voltage and current at the load. Without overvoltage protection, the load would be destroyed. One could compare the results with that obtained by using a transmission line model taking losses into account.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
RloadLoad resistance [Ohm]
rResistance per meter [Ohm/m]
gConductance per meter [S/m]
lInductance per meter [H/m]
cCapacitance per meter [F/m]
lenLength of line [m]
c0Speed of EM wave [m/s]
tdTransmission delay [s]
z0Characteristic impedance for very high frequency [Ohm]

Modelica.Electrical.Analog.Examples.Lines.LightningSegmentedTransmissionLine Modelica.Electrical.Analog.Examples.Lines.LightningSegmentedTransmissionLine

Lightning on a segmented transmission line

Information

This example shows what happens when a lightning hits a transmission line. We consider a segmented single-phase equivalent circuit taking losses into account with two parts of the transmission line, each 50 km long. The RMS voltage is 380 kV / √3, the RMS load current is roughly 1090 A. Realistic parameters of the 380 kV transmission line are used. Note that after the source starts, the traveling wave arrives at the load 350 µs later. After 20 ms, a lightning (10/350 µs) with an amplitude of 10 kA hits the transmission line just in the middle. Note that the traveling wave hits source and load approximately 200 µs after the lightning hits the transmission line. Plot voltage and current at the load. Without overvoltage protection, the load would be destroyed. Note that using a sparse solver saves some simulation time. Using a lossless transmission line model simulates even much quicker.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
RloadLoad resistance [Ohm]
rResistance per meter [Ohm/m]
gConductance per meter [S/m]
lInductance per meter [H/m]
cCapacitance per meter [F/m]
lenLength of line [m]
NNumber of segments
Automatically generated Tue Feb 24 16:59:07 2026.