TLine2

model TLine2 "Lossless transmission line with characteristic impedance Z0, frequency F and normalized length NL"
    extends Modelica.Electrical.Analog.Interfaces.TwoPort;

    parameter SI.Resistance Z0(start = 1) "Characteristic impedance";
    parameter SI.Frequency F(start = 1) "Frequency";
    parameter Real NL(start = 1) "Normalized length";
protected
    SI.Voltage er;
    SI.Voltage es;
    parameter SI.Time TD = NL / F;
equation
    assert(0 < F, "F has to be positive");
    assert(0 < NL, "NL has to be positive");
    assert(0 < Z0, "Z0 has to be positive");
    er = 2 * delay(v1, TD) - delay(es, TD);
    es = 2 * delay(v2, TD) - delay(er, TD);
    i1 = (v1 - es) / Z0;
    i2 = (v2 - er) / Z0;

    annotation (
        defaultComponentName = "line",
        Documentation(
            info = "<html>\n<p>Lossless transmission line with characteristic impedance Z0, frequency F and normalized length NL The lossless transmission line TLine2 is a two Port. Both port branches consist of a resistor with the value of the characteristic impedance Z0 and a controlled voltage source that takes into consideration the transmission delay. For further details see Branin&#39;s article below. Resistance R&#39; and conductance C&#39; per meter are assumed to be zero. The characteristic impedance Z0 can be derived from inductance and capacitance per length (L&#39; resp. C&#39;), i. e. Z0 = sqrt(L&#39;/C&#39;). The normalized length NL is equal to the length of the line divided by the wavelength corresponding to the frequency F, i. e. the transmission delay TD is the quotient of NL and F.</p>\n<p><strong>References:</strong></p>\n<dl><dt>Branin Jr., F. H.</dt>\n<dd>Transient Analysis of Lossless Transmission Lines. Proceedings of the IEEE 55(1967), 2012 - 2013</dd>\n<dt>Hoefer, E. E. E.; Nielinger, H.</dt>\n<dd>SPICE : Analyseprogramm fuer elektronische Schaltungen. Springer-Verlag, Berlin, Heidelberg, New York, Tokyo, 1985. </dd>\n</dl></html>",
            revisions = "<html>\n<dl>\n<dt><em>1998</em></dt>\n<dd>by Joachim Haase initially implemented</dd>\n</dl>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {-150, 150}, 
                        {150, 110}},
                    textString = "%name",
                    lineColor = {0, 0, 255}), 
                Rectangle(
                    extent = {
                        {-80, 80}, 
                        {80, -80}},
                    lineColor = {0, 0, 255},
                    fillPattern = FillPattern.Solid,
                    fillColor = {255, 255, 255}), 
                Line(
                    points = {
                        {60, -100}, 
                        {90, -100}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {60, 100}, 
                        {90, 100}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {-60, 100}, 
                        {-90, 100}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {-60, -100}, 
                        {-90, -100}},
                    color = {0, 0, 255}), 
                Text(
                    extent = {
                        {-70, -10}, 
                        {70, -50}},
                    textString = "TLine2"), 
                Line(points = {
                    {-40, 40}, 
                    {-40, 20}}), 
                Line(points = {
                    {40, 30}, 
                    {-40, 30}}), 
                Line(points = {
                    {40, 40}, 
                    {40, 20}}), 
                Line(
                    points = {
                        {-60, 100}, 
                        {-60, 80}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {60, 100}, 
                        {60, 80}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {60, -80}, 
                        {60, -100}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {-60, -80}, 
                        {-60, -100}},
                    color = {0, 0, 255})}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {-100, 100}, 
                        {100, 70}},
                    textString = "TLine2",
                    lineColor = {0, 0, 255})}));
end TLine2;