From 4e98117faebc508f909435eb296165711ade91e8 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 27 Dec 2015 02:07:42 -0500 Subject: [PATCH 1/2] Added a lossless transmission line element class and an example in the docs. --- PySpice/Spice/BasicElement.py | 64 +++++++++++++++++- doc/sphinx/source/examples/index.rst | 1 + .../examples/transmission-lines/index.rst | 11 +++ .../transmission-lines/time_delay.png | Bin 0 -> 12703 bytes .../transmission-lines/time_delay.rst | 43 ++++++++++++ examples/transmission-lines/time_delay.py | 27 ++++++++ 6 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 doc/sphinx/source/examples/transmission-lines/index.rst create mode 100644 doc/sphinx/source/examples/transmission-lines/time_delay.png create mode 100644 doc/sphinx/source/examples/transmission-lines/time_delay.rst create mode 100644 examples/transmission-lines/time_delay.py diff --git a/PySpice/Spice/BasicElement.py b/PySpice/Spice/BasicElement.py index 53e062383..d6070862e 100644 --- a/PySpice/Spice/BasicElement.py +++ b/PySpice/Spice/BasicElement.py @@ -952,7 +952,7 @@ def __str__(self): if self.table is not None: # TABLE {expression} = (x0, y0) (x1, y1) ... table = ['({}, {})'.format(x, y) for x, y in self.table] - spice_element += ' TABLE {%s} = %s' % (self.expression, join_list(table)) + spice_element += ' TABLE {%s} = %s' % (self.expression, join_list(table)) return spice_element #################################################################################################### @@ -1420,6 +1420,68 @@ def source(self): def substrate(self): return self.pins[3] +#################################################################################################### + +class TransmissionLine(TwoPortElement): + + """This class implements a lossless transmission line. + + Spice syntax:: + + TXXXXXXX N1 N2 N3 N4 Z0=VALUE > + + where TD or F,NL must be specified. + + Keyword Parameters: + + :attr:`impedance` + alias:`Z0` + + :attr:`time_delay` + alias:`TD` + + :attr:`frequency` + alias:`F` + + :attr:`normalized_length` + alias:`NL` + + Attributes: + + :attr:`impedance` + + :attr:`time_delay` + + :attr:`frequency` + + :attr:`normalized_length` + + Note: Either time_delay or frequency must be given. + + """ + + alias = 'TransmissionLine' + prefix = 'T' + + def __init__(self, name, + input_node_plus, input_node_minus, + output_node_plus, output_node_minus, + *args, **kwargs): + + if not (('time_delay' in kwargs) ^ + (('frequency' in kwargs) & ('normalized_length' in kwargs))): + raise NameError('Either TD or F,NL must be specified') + + super().__init__(name, + input_node_plus, input_node_minus, + output_node_plus, output_node_minus, + *args, **kwargs) + + impedance = FloatKeyParameter('Z0', default=50) + time_delay = FloatKeyParameter('TD') + frequency = FloatKeyParameter('F') + normalized_length = FloatKeyParameter('NL') + #################################################################################################### # # End diff --git a/doc/sphinx/source/examples/index.rst b/doc/sphinx/source/examples/index.rst index 286c853c4..b1f1281bb 100644 --- a/doc/sphinx/source/examples/index.rst +++ b/doc/sphinx/source/examples/index.rst @@ -19,3 +19,4 @@ This section has 13 sub-topics and 25 examples. spice-parser/index.rst transformer/index.rst transistor/index.rst + transmission-lines/index.rst diff --git a/doc/sphinx/source/examples/transmission-lines/index.rst b/doc/sphinx/source/examples/transmission-lines/index.rst new file mode 100644 index 000000000..4bc1a289a --- /dev/null +++ b/doc/sphinx/source/examples/transmission-lines/index.rst @@ -0,0 +1,11 @@ + +==================== + Transmission Lines +==================== +This section has 1 example. + + +.. toctree:: + :maxdepth: 1 + + time_delay.rst diff --git a/doc/sphinx/source/examples/transmission-lines/time_delay.png b/doc/sphinx/source/examples/transmission-lines/time_delay.png new file mode 100644 index 0000000000000000000000000000000000000000..884cb260d00251bc0e1e96e60dac9aa160e842ee GIT binary patch literal 12703 zcmb7r2~<8N?L!b` zQdE!!At(f742pu0NyP*iQ#62#fiTIK@4f&UZGZo@zOLnpX8Po} zs;|EP3WA_j_#=nRA!u0)1WAN^`33ktLk;hfz{@h9pYfJog8u@)Jn;v3FLmaKtq%mP z_!j#k@v<#=27-Qo@P`gqo=+TTqvmzOzN%CFox66W{&7lnY4|wHmXC4&?Z_ytfPI+3~{yy6)JE)zjr)qZo>1shqSaQM2 zzaP%zP8^W)mYKTSob7Lpe78OZ?M=j0$y0xVgSNAFM9&;TI0T(c#`r^Yst_&O!kR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YZi~bgJ(pH1?Wq+uIPGvW(OM@m^`bLgnp9zv|yCQ zXwd0sU#17R=a=MbT+YK<;`NT_&x%Xj|5Z1-Som=-+Q2oQJidK@bzEoYk)~c-9l-J& zG&mbQeMC@-ORwFnfPEqMblQL@vue_9Q|2@opN<(m+|8`sytU?*SEmD<^r7;P{;|5N z7B}7gXug^Buk@~z9PxNmpI8O6*TTLgaFA!A%WqVThuw9OmhA9#bHa8u?CTM(=A3QG zZi2_yXpzU?8WxQND@&mAad6awh@w385E6~{cGzW6y^$b0(zHAkk7%g|+)#5 zKbB-Kz2kYy{ayS)&Nv6Ny&b3#*<`FaFV+RUv}x<{+DrKMzi~8%5zw6@w3Ui9a63_AK^L zKD}ibP=Bi2-foY?*pJmE^=MB$^3Tpvu~pJ|*%;ngyq~f6S(w;LD85Oy$x)g)jR5Vt z%9>qK9O(YZ49^FLI;z0L%2p2pG37N z1s0POy?+aSooi8lN@RE?WMt7aMdY`@B->*YFlq?4gwqu#Pid|zsXHy=PEGI6eR50p z{=HR_HoxM%Rat!bCV5thO6#t(0i=PP;A0i8-DMU{<^^Xs&a2pD)r=xV3Z5xqQ*!XCgYXujt z+`JT0Gjx;J1~a`=2-j4QHgG<&8>dbA!^v;M8_*hOI|^WlgxXLdb~YNr{jW*^O4Z%0aD7N3VgVUh_#28hDwTn)rT6G6f1lFD3U#tWeA z!R25K!SR}l{)fC71)w*nqBqUhOb3_$$o-ADWE-k8dRTlMxF!ZZQI`>M$(yDGY= zck3g**%3jCX0h_D9_-8KG*7Ijwnapjq@v?bE6FnC4SMIml`n9&+;b*yI24^SN30bl zJ8|S}RER`sB#j{U8XbKDNs)?WL^aFH7_*3;?r;THd0iWY$-?*cFkTvA&k-8~i&`Jpqu}HI#WtL}T&wlf?MfKTDVvN}MfWj)lkB=YWuh@P|zgW&iB- G>;D7Deh;<) literal 0 HcmV?d00001 diff --git a/doc/sphinx/source/examples/transmission-lines/time_delay.rst b/doc/sphinx/source/examples/transmission-lines/time_delay.rst new file mode 100644 index 000000000..60b80f545 --- /dev/null +++ b/doc/sphinx/source/examples/transmission-lines/time_delay.rst @@ -0,0 +1,43 @@ + +.. include:: /project-links.txt +.. include:: /abbreviation.txt + +=============================================== +True-time Delay with Lossless Transmission Line +=============================================== + +.. getthecode:: time_delay.py + :language: python + +.. code-block:: python + + import PySpice.Logging.Logging as Logging + from PySpice.Spice.Netlist import Circuit + import matplotlib.pyplot as plt + from PySpice.Probe.Plot import plot + + logger = Logging.setup_logging() + + #################################################################################################### + + circuit = Circuit('Transmission Line') + circuit.Pulse('pulse', 'input', circuit.gnd, 0, 1, 1e-9, 1e-6) + circuit.R('load', 'output', circuit.gnd, 50) + circuit.TransmissionLine('delay', 'input', circuit.gnd, 'output', circuit.gnd, impedance=50, time_delay=40e-9) + + simulator = circuit.simulator(temperature=25, nominal_temperature=25) + analysis = simulator.transient(step_time=1e-11, end_time=100e-9) + + #################################################################################################### + + plt.figure(None, (20, 6)) + plot(analysis['input']) + plot(analysis['output']) + plt.xlabel('Time [s]') + plt.ylabel('Voltage (V)') + plt.grid() + plt.legend(['input', 'output'], loc='upper right') + plt.show() + +.. image:: time_delay.png + :align: center diff --git a/examples/transmission-lines/time_delay.py b/examples/transmission-lines/time_delay.py new file mode 100644 index 000000000..af5c46cdc --- /dev/null +++ b/examples/transmission-lines/time_delay.py @@ -0,0 +1,27 @@ +import PySpice.Logging.Logging as Logging +from PySpice.Spice.Netlist import Circuit +import matplotlib.pyplot as plt +from PySpice.Probe.Plot import plot + +logger = Logging.setup_logging() + +#################################################################################################### + +circuit = Circuit('Transmission Line') +circuit.Pulse('pulse', 'input', circuit.gnd, 0, 1, 1e-9, 1e-6) +circuit.R('load', 'output', circuit.gnd, 50) +circuit.TransmissionLine('delay', 'input', circuit.gnd, 'output', circuit.gnd, impedance=50, time_delay=40e-9) + +simulator = circuit.simulator(temperature=25, nominal_temperature=25) +analysis = simulator.transient(step_time=1e-11, end_time=100e-9) + +#################################################################################################### + +plt.figure(None, (20, 6)) +plot(analysis['input']) +plot(analysis['output']) +plt.xlabel('Time [s]') +plt.ylabel('Voltage (V)') +plt.grid() +plt.legend(['input', 'output'], loc='upper right') +plt.show() From d3fb6a975d47acc8fe2494a44bfb3eb1903d12c8 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 27 Dec 2015 04:30:02 -0500 Subject: [PATCH 2/2] changing input order for consistency. --- PySpice/Spice/BasicElement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PySpice/Spice/BasicElement.py b/PySpice/Spice/BasicElement.py index d6070862e..d06a883aa 100644 --- a/PySpice/Spice/BasicElement.py +++ b/PySpice/Spice/BasicElement.py @@ -1473,8 +1473,8 @@ def __init__(self, name, raise NameError('Either TD or F,NL must be specified') super().__init__(name, - input_node_plus, input_node_minus, output_node_plus, output_node_minus, + input_node_plus, input_node_minus, # Fixme: inverted inputs *args, **kwargs) impedance = FloatKeyParameter('Z0', default=50)