Simulating Lossy or Custom Transmission Lines, using NG-Spice.

One of the fun things that can be done using the Open-Source circuit-simulator ‘NG-Spice’ is, that transmission lines can be simulated, with the parameters ‘Z0′ and ‘TD’, which stand for the characteristic impedance, and the delay down the length of the transmission line. However, what some people have noticed, and recorded as a bug, elsewhere on the Web, is, that such transmission lines will appear to have ideal behaviour right down to ‘DC frequencies’.

Rather than to think of this as a bug, I’d categorize this as the behaviour, that if the ‘RefDes’ of the transmission line begins with the letter ‘T’, NG-Spice will always simulate a lossless transmission line.

What some people might prefer is, to simulate a lossy transmission line. And When using NG-Spice, this capability is available, but hidden. Basically, NG-Spice uses the same simulation engine, to simulate the Netlists, that other versions of Spice will use. But, the Open-Source version will be lacking in GUI support, as well as in the available libraries of components.

The key to understanding, how to simulate a lossy transmission line, is, that NG-Spice will only process them as being a different type of component, if their reference descriptor begins with the letter ‘O’. This is similar to how NG-Spice will require that the ‘RefDes’ begin with the letter ‘X’, if what is to be simulated, is some sort of sub-circuit. But, because this will stem from a modelcard, the model of the transmission line will actually need to be specified within the Schematic Editor, as the Value of the component, for which there also needs to be a Model entry in the schematic, that points to the file, which will define the model. This Model entry will have a reference descriptor, beginning with the letter ‘A’…

(Updated 6/07/2021, 2h25… )

(As of 6/03/2021: )

Hence, to start the process, the first thing that would need to be done is, that a Custom Symbol would need to be defined, which can be begun, by copying the symbol ‘tline.sym’ from the System-Side Library, to whichever folder we store our custom symbols in. The system-wide library location under a Linux installation from the package manager, will be:


Once it is in our folder for custom symbols, it will need to be edited using the same schematic editor, which is called ‘gschem’. The Value Attribute will need to be changed, and the RefDes Attribute will need to be changed from ‘T?’ to ‘O?’, or to ‘O1′, just so that these attributes will be inherited by component instances, and promoted to whatever the user wants.




The properties will be defined in the modelcard.

Thus, I was able to use this symbol, next, and simulate the following schematic with it:




And, this was the Netlist of what I simulated:

While this was the modelcard for the transmission line:

The following was the frequency-response, of the intentionally mismatched circuit, which followed:




This question can be taken further, to ask whether these transmission lines can also be simulated, for the scenario that they are to be wound on a core And the short answer is, that I cannot be sure. What one can do first is, to compute what the inductance of an arbitrary wire would be, if it were to be wound on the core. This value can be divided by how many units of length our modelcard assumed, the transmission line would have, to arrive at a new, higher amount of inductance, per unit length, which in turn can be edited into our modelcard. This is how I would go about, trying to simulate Transmission Line Transformers, aka TLTs. But the idea which I’m not clear on is, whether the characteristic line impedance of such a transmission line, would indeed increase, with the square root of the linear inductance which has been recomputed in this way, in the real situation. Alternatively, it could happen when real transmission lines are choked, that their internal characteristic impedance is not altered. If that is their real behaviour, then the method I just suggested will be flawed.

With TLTs in general, having a characteristic line impedance which is ‘too high’, is better than having a value which is ‘too low’.


I think that this (simulated) multiplied linear inductance would behave, as if it was being applied in a negative polarity, between the two terminals, while, what choking a transmission line should do (in reality), is to apply it with the same polarity. Therefore, while it’s good that lossy or non-ideal transmission lines can be simulated, I think it’s Not the way to simulate TLTs.


An interesting observation to note would be, that the ‘RG174′, 50Ω subminiature coax cable I modelled my transmission line on, is only rated to work well, up to a frequency of ~1GHz. This differs from how full coax cables behave, well, up to frequencies such as ~10GHz. The simulation cannot take this into account, because the simulation is unaware, of the behaviours of the inner and outer conductors actually used.


(Update 6/07/2021, 2h25: )

(Note – As of 6/07/2021, 3h45, most Web-browsers will need to have JavaScript enabled, both from this site, and from ‘’, to view the following work-sheet…)





Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>