Skip to content

Commit ad5ecf0

Browse files
committed
Added non-sliced states to transmission line models
1 parent 6c412bc commit ad5ecf0

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

ScalableTestSuite/Electrical/TransmissionLine.mo

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ package TransmissionLine "Models of transmission lines"
7878
"Transmission line circuit - Direct implementation by equations"
7979
import SIunits =
8080
Modelica.Units.SI;
81-
parameter Integer N = 1 "number of segments";
81+
parameter Integer N = 2 "number of segments";
8282
parameter SIunits.Length L "length of the transmission line";
8383
final parameter SIunits.Length l = L / N "length of the each segment";
8484
parameter SIunits.Resistance res "resistance per meter";
@@ -94,6 +94,7 @@ package TransmissionLine "Models of transmission lines"
9494
SIunits.Voltage Vstep = if time > 0 then 1 else 0 "input step voltage";
9595
SIunits.Current cur[N](each start = 0)
9696
"current values at the nodes of the transmission line";
97+
SIunits.Current cur_x[N-1] "current state variables";
9798
SIunits.Voltage vol[N](each start = 0)
9899
"voltage values at the nodes of the transmission line";
99100
Real vvol "derivative of input voltage";
@@ -103,12 +104,13 @@ package TransmissionLine "Models of transmission lines"
103104
Vstep = vol[1] + 2 * (1 / w) * der(vol[1]) + 1 / w ^ 2 * der(vvol);
104105
vol[N] = cur[N] * RL;
105106
for i in 1:N - 1 loop
107+
cur[i] = cur_x[i];
106108
cap * der(vol[i + 1]) = (cur[i] - cur[i + 1]) / l;
107-
ind * der(cur[i]) = (-res * cur[i]) - (vol[i + 1] - vol[i]) / l;
109+
ind * der(cur_x[i]) = (-res * cur[i]) - (vol[i + 1] - vol[i]) / l;
108110
end for;
109111
initial equation
110112
vol = zeros(N);
111-
cur[1:N-1] = zeros(N-1);
113+
cur_x = zeros(N-1);
112114
vvol = 0;
113115
annotation(Documentation(info = "<html><p>In this model, a transmission line circuit is implemented by equations. Transmission line circuit is represented as in the figure below. The application is the same as the TransmissionLineModelica model.</p><p><img src=\"modelica://ScalableTestSuite/Resources/Images/TransmissionLine/TransmissionLineModelica.png\"/></p><p>Considering the nodes of the discrete transmission line(implemented in Electrical.Models.TransmissionLine), circuit equations are described. In the transmission line, there are N segments, therefore, there will be N+1 nodes and N+1 voltage and current variables.</p><p><img src=\"modelica://ScalableTestSuite/Resources/Images/TransmissionLine/tlmequation.png\"/></p><p>where j= 2,..,N and Rx is the resistance per meter, Cx is the capacitance per meter and Lx is the inductance per meter.</p><p>output voltage is described as:</p><p><img src=\"modelica://ScalableTestSuite/Resources/Images/TransmissionLine/tlmequation1.png\"/></p><p>Moreover, considering the form of the second order low pass filter, equation of the filter to a step input can be defined in the following way:</p><p><img src=\"modelica://ScalableTestSuite/Resources/Images/TransmissionLine/tlmequation2.png\"/></p><p>where Vstep is the step voltage and v1is the output voltage of the filter. The parameters of the TransmissionLineEquations are:</p><table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
114116
<tr>
@@ -267,15 +269,15 @@ package TransmissionLine "Models of transmission lines"
267269
<th>Parameters</th>
268270
<th>Comment</th>
269271
</tr>
270-
<tr>
272+
<tr>
271273
<td valign=\"top\">N</td>
272274
<td valign=\"top\">number of segments</td>
273275
</tr>
274-
<tr>
276+
<tr>
275277
<td valign=\"top\">L</td>
276278
<td valign=\"top\">length of the transmission line</td>
277279
</tr>
278-
<tr>
280+
<tr>
279281
<td valign=\"top\">res</td>
280282
<td valign=\"top\">resistance per meter</td>
281283
</tr>
@@ -287,24 +289,24 @@ package TransmissionLine "Models of transmission lines"
287289
<td valign=\"top\">ind</td>
288290
<td valign=\"top\">inductance per meter</td>
289291
</tr>
290-
<tr>
292+
<tr>
291293
<td valign=\"top\">RL</td>
292294
<td valign=\"top\">load resistance</td>
293295
</tr>
294-
<tr>
296+
<tr>
295297
<td valign=\"top\">w</td>
296298
<td valign=\"top\">cut-off frequency</td>
297299
</tr>
298-
<tr>
300+
<tr>
299301
<td valign=\"top\">TD</td>
300302
<td valign=\"top\">time delay of the transmission line</td>
301303
</tr>
302-
<tr>
304+
<tr>
303305
<td valign=\"top\">v</td>
304306
<td valign=\"top\">velocity of the signal</td>
305307
</tr>
306-
</table>
307-
</html>"));
308+
</table>
309+
</html>"));
308310
end TransmissionLineCheck;
309311
end Verification;
310312

0 commit comments

Comments
 (0)