pingspice.lib.passive.Wire(Subcircuit)
class documentation
Part of pingspice.lib.passive
(View In Hierarchy)
Known subclasses: pingspice.lib.passive.WirePair
A wire with a particular awg gauge and length, in meters
unless inches is set True
.
Various class methods support both an individual Wire
and a WirePair
.
Inductors often cause convergence errors in SPICE because they create
ringing that needs to be tracked by the stepwise simulation, often at much
higher frequencies than you're really interested in. To ignore the
inductance (and capacitance, in a WirePair
), set
R_only True
.
Class Method | mmArea | Returns the copper cross-sectional area (mm2) of a wire given the American Wire Gauge (an integer). An awg of 0 will select 4/0 battery cable. |
Class Method | mmDia | Returns the overall conductor or THHN insulated diameter (mm) of a wire given the American Wire Gauge (an integer). An awg of 0 will select 4/0 battery cable. |
Method | meters | Undocumented |
Method | skinDepth | Returns the skin depth in meters of an awg gauge conductor for a signal of f Hertz (default: 120 Hz). |
Method | L_internal | Returns the internal inductance (Henries) per meter of a wire of the specified radius r in mm. |
Method | L | Returns inductance (Henries) of my length of a single wire of my gauge awg. |
Method | R | Returns the room-temperature resistance (Ohms) of my length of copper wire of the specified gauge awg. |
Method | setup | Subcircuit definition. |
Inherited from NodeStuff (via Subcircuit):
Instance Variable | shunts | A dict of current sensing V elements with the pairs of nodes they connect. |
Class Variable | debug | A Bag that gets set
True for all instances to log info about each setup
call. |
Class Method | autoName | Undocumented |
Method | setupResults | Undocumented |
Method | fill | Undocumented |
Method | nodeCheck | Call with the circuit building tool f and a sequence of
nodes provided to this Include or
Subcircuit . |
Method | rawNetlist | Get lines of a raw netlist from a search hierarchy of possible sources. |
Method | shunt | Call to insert a current-measuring shunt and add an entry to my Elements
baton's dict of shunts. |
Method | raw | See Elements.raw . |
Method | iNode | See Elements.iNode . |
Method | ground | See Elements.ground . |
Method | sca | See Elements.sca . |
Method | sca6 | See Elements.sca6 . |
Class Method | _libDir | Undocumented |
Method | _strippedLines | Undocumented |
Method | _call_setup | Calls my setup
method (almost always your override of that method, actually) and processes
any return value. |
Inherited from NodeStuff (via Subcircuit):
Instance Variable | shunts | A dict of current sensing V elements with the pairs of nodes they connect. |
Class Variable | debug | A Bag that gets set
True for all instances to log info about each setup
call. |
Class Method | autoName | Undocumented |
Method | setupResults | Undocumented |
Method | fill | Undocumented |
Method | nodeCheck | Call with the circuit building tool f and a sequence of
nodes provided to this Include or
Subcircuit . |
Method | rawNetlist | Get lines of a raw netlist from a search hierarchy of possible sources. |
Method | shunt | Call to insert a current-measuring shunt and add an entry to my Elements
baton's dict of shunts. |
Method | raw | See Elements.raw . |
Method | iNode | See Elements.iNode . |
Method | ground | See Elements.ground . |
Method | sca | See Elements.sca . |
Method | sca6 | See Elements.sca6 . |
Class Method | _libDir | Undocumented |
Method | _strippedLines | Undocumented |
Method | _call_setup | Calls my setup
method (almost always your override of that method, actually) and processes
any return value. |
def mmArea(cls, awg):
Returns the copper cross-sectional area (mm2) of a wire given the American Wire Gauge (an integer). An awg of 0 will select 4/0 battery cable.
References: NEC 2017 Ch. 9, Tables 5A, 8.
def mmDia(cls, awg, insulation=False):
Returns the overall conductor or THHN insulated diameter (mm) of a wire given the American Wire Gauge (an integer). An awg of 0 will select 4/0 battery cable.
The conductor diameter includes voids between strands. Use mmArea
to
calculate wire resistance.
Set insulation to True
to include the
insulation.
References: NEC 2017 Ch. 9, Tables 5, 5A.
Returns the skin depth in meters of an awg gauge conductor for a signal of f Hertz (default: 120 Hz).
This is included for completeness but not used in resistance calculation because skin effect at 120 Hz only reduces cross-sectional area by about 1% on a 4/0 AWG wire.
Returns the internal inductance (Henries) per meter of a wire of the specified radius r in mm.
Included (and used) for completeness but not a realistic factor.
def L(self):
Returns inductance (Henries) of my length of a single wire of my gauge awg.
Returns the room-temperature resistance (Ohms) of my length of copper wire of the specified gauge awg.
Skin effect is negligible for DC and AC power frequencies and is not accounted for.
Subcircuit definition.
Why use f? Because it's short and a conveniently typed letter on the keyboard.
Override this if your subclass does not reference a param.ParameterFinder
subclass via the Finder class attribute. As with Include.setup
,
your override method can return a dict of attribute names and values to set
in my instance.