Finder for semiconductor packages, using a Cauer RC network to model thermal impedance:

                                    :
   tj ----+-- R1 ---+--- R2 ---+--- : ----+--- Rn ----+
          |         |          |    :     |           |
       +----+    +----+     +----+  :  +----+         |
       | C1 |    | C2 |     | C2 |  :  | Cn |         |
       +----+    +----+     +----+  :  +----+         |
          |         |          |    :     |           |
   tc ----+---------+----------+----:-----+------+----+-------+
                                    :            |            |
                                    :        +-------+    +--------+
   tca0 ------------------------------------x| cth_c |    | rth_ca |
                                    :        +-------+    +--------+
            #==========+            :            |            |
            # timeWarp #            :            +------------+----- ta
            # fiti     #
            # ts       #
            #==========#

The Cauer RC network terminates in a first-order parallel RC for case-to-ambient heat dissipation with an R of rth_ca and a C of cth_c. If you have a heatsink, you can replace the package's defaults with its rth_ca and cth_c. In the unlikely event you connect another thermal network to the 'tc' node, set rth_ca to something huge and cth_c to zero.

Implements the pingspice-only simulation option fiti: Initial time allocated for fast initial temperature increase, for irregular but simulation-friendly initial warm-up. None for no irregular warm-up. If set True or to a value less than 100x ts, will be forced to 100x ts. Note: timeWarp, if any, still applies.

You can set an initial case-ambient temperature differential with the input node 'tca0'.

Pingspice-only simulation options used: ts, timeWarp, and fiti.

The time you should set aside for my initial and/or fast "charging" to desired case-ambient differential at the beginning of your TRAN simulation appears as the 'ti' entry of my setupResults.

Heatsinking

At the end of my setup method, I check my heatsink attribute to see if it was set to a callable. If so, it must return a 2-sequence with values for rth_ca and cth_c that override the class-wide defaults. If not, and it is a 2-sequence, I will use that directly. If heatsink is None (the default), no heatsink is assumed to be attached.

Set this with a Subcircuit constructor keyword to "attach" a heatsink to a particular device and replace the package's rth_ca and cth_c with a heatsink's rth_ca that is much lower and a cth_c that is much higher.

Remember, though: You don't set Python-instance attributes with keywords when calling the instance; those keywords are only for subcircuit parameters, which only Ngspice references. You'll need a separate Python instance for each device with a different heatsink configuration, even if the devices use the same Subcircuit subclass.

Construct an instance of Heatsink or a subclass of it for a callable object suitable for this.

Note: I have no class-wide defaults defined for instance variables heatsink, rth_ca, cth_c, and tca0 because my custom ParameterFinder.__getattr__ needs to not find one or it won't go look for it in a package subcircuit. The default values for non-heatsinked packages are defined in each package's .specs file, e.g., lib/TO247.specs.

Instance Variable heatsink A 2-sequence (or callable that returns a 2-sequence) containing values for rth_ca and cth_c.
Instance Variable rth_ca Thermal resistance, case (package) to ambient. Should only be defined if heatsink is not.
Instance Variable cth_c Thermal capacitance of case (package). Should only be defined if heatsink is not.
Instance Variable tca0 Set to an initial case-ambient temperature difference to have me use XSPICE capacitance model with that as the initial voltage for my case/heatsink's thermal capacitance instead of constructing an internal 'tca0' node with a fast-charge initial voltage. Simpler, but may cause convergence problems.
Method setup RC pairs of Cauer network, with time constants roughly a decade apart starting at around 0.1-10 microseconds.
Method setupTestCircuit You must override this to define test circuitry for one or more setups.

Inherited from ParameterFinder:

Class Variable Setups A subclass of Setups that you define to specify parameter names, analyzers, independent vectors, goal points, etc.
Instance Variable s An instance that I construct of the Setups subclass referenced in your subclass of me.
Method __init__

There are two different call patterns. One is for using Differential Evolution to find parameter values:

Method __getattr__ Looks to my subcircuit "parent" and then my Setups object s for attributes that I lack.
Method tableSources Called by analyzerPrep for each setup ID to possibly generate one or more TABLE sources.
Method analyzerPrep Call this with a setup ID to provide what the Analyzer for that setup will need when it is activated.
Method __call__ Call this to find best-fit alterable values for the circuit you've defined with your setup override method.
Class _EmptySetups Undocumented
Method __init_pf My constructor calls this to do the full initialization in paramfinding mode, when no parameters are supplied.
heatsink =
A 2-sequence (or callable that returns a 2-sequence) containing values for rth_ca and cth_c.
rth_ca =
Thermal resistance, case (package) to ambient. Should only be defined if heatsink is not.
cth_c =
Thermal capacitance of case (package). Should only be defined if heatsink is not.
tca0 =
Set to an initial case-ambient temperature difference to have me use XSPICE capacitance model with that as the initial voltage for my case/heatsink's thermal capacitance instead of constructing an internal 'tca0' node with a fast-charge initial voltage. Simpler, but may cause convergence problems.
def setup(self, f):

RC pairs of Cauer network, with time constants roughly a decade apart starting at around 0.1-10 microseconds.

def setupTestCircuit(self, f, ID):

You must override this to define test circuitry for one or more setups.

API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.