Skip to content

Commit

Permalink
Added non-sliced states to transmission line models
Browse files Browse the repository at this point in the history
  • Loading branch information
casella committed Jan 5, 2023
1 parent 6c412bc commit ad5ecf0
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions ScalableTestSuite/Electrical/TransmissionLine.mo
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ package TransmissionLine "Models of transmission lines"
"Transmission line circuit - Direct implementation by equations"
import SIunits =
Modelica.Units.SI;
parameter Integer N = 1 "number of segments";
parameter Integer N = 2 "number of segments";
parameter SIunits.Length L "length of the transmission line";
final parameter SIunits.Length l = L / N "length of the each segment";
parameter SIunits.Resistance res "resistance per meter";
Expand All @@ -94,6 +94,7 @@ package TransmissionLine "Models of transmission lines"
SIunits.Voltage Vstep = if time > 0 then 1 else 0 "input step voltage";
SIunits.Current cur[N](each start = 0)
"current values at the nodes of the transmission line";
SIunits.Current cur_x[N-1] "current state variables";
SIunits.Voltage vol[N](each start = 0)
"voltage values at the nodes of the transmission line";
Real vvol "derivative of input voltage";
Expand All @@ -103,12 +104,13 @@ package TransmissionLine "Models of transmission lines"
Vstep = vol[1] + 2 * (1 / w) * der(vol[1]) + 1 / w ^ 2 * der(vvol);
vol[N] = cur[N] * RL;
for i in 1:N - 1 loop
cur[i] = cur_x[i];
cap * der(vol[i + 1]) = (cur[i] - cur[i + 1]) / l;
ind * der(cur[i]) = (-res * cur[i]) - (vol[i + 1] - vol[i]) / l;
ind * der(cur_x[i]) = (-res * cur[i]) - (vol[i + 1] - vol[i]) / l;
end for;
initial equation
vol = zeros(N);
cur[1:N-1] = zeros(N-1);
cur_x = zeros(N-1);
vvol = 0;
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\">
<tr>
Expand Down Expand Up @@ -267,15 +269,15 @@ package TransmissionLine "Models of transmission lines"
<th>Parameters</th>
<th>Comment</th>
</tr>
<tr>
<tr>
<td valign=\"top\">N</td>
<td valign=\"top\">number of segments</td>
</tr>
<tr>
<tr>
<td valign=\"top\">L</td>
<td valign=\"top\">length of the transmission line</td>
</tr>
<tr>
<tr>
<td valign=\"top\">res</td>
<td valign=\"top\">resistance per meter</td>
</tr>
Expand All @@ -287,24 +289,24 @@ package TransmissionLine "Models of transmission lines"
<td valign=\"top\">ind</td>
<td valign=\"top\">inductance per meter</td>
</tr>
<tr>
<tr>
<td valign=\"top\">RL</td>
<td valign=\"top\">load resistance</td>
</tr>
<tr>
<tr>
<td valign=\"top\">w</td>
<td valign=\"top\">cut-off frequency</td>
</tr>
<tr>
<tr>
<td valign=\"top\">TD</td>
<td valign=\"top\">time delay of the transmission line</td>
</tr>
<tr>
<tr>
<td valign=\"top\">v</td>
<td valign=\"top\">velocity of the signal</td>
</tr>
</table>
</html>"));
</table>
</html>"));
end TransmissionLineCheck;
end Verification;

Expand Down

0 comments on commit ad5ecf0

Please sign in to comment.