Base class for Diode_Helper and MOSFET_Helper.

Construct me with an instance of analysis.param.Specs that's been populated with attributes defining device-specific variables, the device's parameter-finding goals, and any known parameters.

Class Variable w Dict with emphases for each evaluation setup, each entry keyed by setup ID and scaling its target's weight by the square of its value.
Class Variable weightN Weight of number of steps column vs excess range column in prettyStep.
Method __init__ MOSFET_Helper(specs)
Method timeSetup Override this in your subclass.
Method timeSetupCommon Call this from your subclass's override of timeSetup to get common stuff done.
Method get_rrParams Call this to get a 4-tuple with parameters V, I, dI, and dt for reverse recovery.
Method TRAN Adds an analysis.sim.TRAN analyzer to the supplied analyzerDict for the specified setup ID, with (name, value) tuples for any keywords supplied.
Method gcd_seq Returns the greatest common denominator of values in sequence X, or None if there is no GCD.
Method sss Returns a 3-list with the start, stop, and step values for doing a DC sweep of values in sequence X that lands exactly on all its values, or None if no such sweep is possible.
Method Tj_sa Returns the additional arguments for a secondary DC sweep of the junction temperature that best fits the 'tj' values for goals of the specified setup ID.
Static Method decimal Undocumented
Method prettyStep Finds a "pretty" step size to go from Zmin (or slightly below) to Zmax (or slightly above) in as close as possible (but not more than) Nmax steps with limited precision.
Static Method includesZero Undocumented
Method prettyRange Undocumented
Method mms Returns a suitable min, max, and step for a DC sweep of a vector.
Method warp Warps the values of x that are close to x0.
Method emphasis Returns the square of the emphasis for the specified setup ID, multiplied by the product of any arguments.
Method transform_bias Undocumented
Method transform_capacitance Undocumented
Method weight_capacitance Weighting of 'cap' tranformed value for setups 4xx.
Method _bc_fix Called by transform_bias and transform_capacitance to obtain a cleaned-up version of bias1 and cap1.
w =
Dict with emphases for each evaluation setup, each entry keyed by setup ID and scaling its target's weight by the square of its value.
weightN =
Weight of number of steps column vs excess range column in prettyStep.
def __init__(self, specs):
def timeSetupCommon(self, s):

Call this from your subclass's override of timeSetup to get common stuff done.

Returns a reference to my timing setup dict tsu, with entries for partial (common) setup. There may be entries that won't ever be used for your particular type of device, and that's OK.

def get_rrParams(self):

Call this to get a 4-tuple with parameters V, I, dI, and dt for reverse recovery.

def TRAN(self, analyzerDict, ID, **kw):

Adds an analysis.sim.TRAN analyzer to the supplied analyzerDict for the specified setup ID, with (name, value) tuples for any keywords supplied.

def gcd_seq(self, X):

Returns the greatest common denominator of values in sequence X, or None if there is no GCD.

The result will be None if the values are not all equal to integers.

def sss(self, X, N_max, M=1, maxStep=None, minStep=None):

Returns a 3-list with the start, stop, and step values for doing a DC sweep of values in sequence X that lands exactly on all its values, or None if no such sweep is possible.

ParametersMMultiplier of the number of steps. Sometimes M > 1 helps Ngspice convergence.
def Tj_sa(self, ID, N=50, maxStep=None, minStep=None):

Returns the additional arguments for a secondary DC sweep of the junction temperature that best fits the 'tj' values for goals of the specified setup ID.

@staticmethod
def decimal(value, mult, ceil=False):
Undocumented
def prettyStep(self, Zmin, Zmax, Nmax, mult=0.01, notStep=None):

Finds a "pretty" step size to go from Zmin (or slightly below) to Zmax (or slightly above) in as close as possible (but not more than) Nmax steps with limited precision.

Returns the step size and number of steps.

ParametersmultSet to the precision of the step size (e.g., 0.1 for one digit, 0.01 for two digits).
@staticmethod
def includesZero(Zmin, Zmax, step):
Undocumented
def prettyRange(self, Zmin, Zmax, Nmax, mult, notZero=False, notStep=None):
Undocumented
def mms(self, *args, **kw):

Returns a suitable min, max, and step for a DC sweep of a vector.

Call patterns with 1, 2, or 3 arguments:

  • Sequence Z: 1-D Numpy array with unique values.
  • Setup ID and vector name: Uses the unique values of the goal points of that vector.
  • Zmin, Zmax, and N: Lower and upper bounds to be covered and a maximum number of steps acceptable for the sweep.

For some stupid reason, it sometimes does seem to help Ngspice convergence to keep the step size "pretty", e.g., 0.1 to go from 3.0 to 10.1 in 72 steps instead of 0.071 in 100 steps. But it's not consistent.

ParametersNThe maximum number of steps acceptable for the sweep. (Disregarded with 3 args.)
MMultiplier of the number of steps. Sometimes M > 1 helps Ngspice convergence. (Disregarded with 3 args.)
N_digitsThe number of digits after the decimal point allowable in the step size.
maxStepThe maximum step to use if an exact match is found. (Disregarded with 3 args.)
notZeroSet True to prevent the sweep from including exactly zero.
def warp(self, x, x0, power=0.3):

Warps the values of x that are close to x0.

Called by weight_Ids and weight_drain to put increased emphasis at goal points near certain drain currents and voltage.

def emphasis(self, ID, *args):

Returns the square of the emphasis for the specified setup ID, multiplied by the product of any arguments.

Nominal emphasis is 0.5, so compensates for that by multiplying its square by 4.0.

def _bc_fix(self, ID, bias1, cap1):

Called by transform_bias and transform_capacitance to obtain a cleaned-up version of bias1 and cap1.

The clean up consists of (1) flipping each vector so that bias is in ascending order of voltage, and (2) in the flipped version, clipping bias just past the maximum goal value and setting capacitance to the value at the clipped bias value.

All transformed vectors must have the exact same number of elements as the input vectors, and this method honors that requirement.

The first time called with a given pair of bias and cap vectors, stores the cleaned-up pair in my bc_cache dict. The second time, pops the stored pair and returns that instead of re-computing. A given pair is never retrieved from the cache more than once.

def transform_bias(self, ID, bias1, cap1):
Undocumented
def transform_capacitance(self, ID, bias1, cap1):
Undocumented
def weight_capacitance(self, ID, x):

Weighting of 'cap' tranformed value for setups 4xx.

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