pingspice.analysis.fixture.HelperBase(object)
class documentation
Part of pingspice.analysis.fixture
(View In Hierarchy)
Known subclasses: pingspice.analysis.diode.Diode_Helper, pingspice.analysis.mosfet.MOSFET_Helper, pingspice.test.analysis.test_fixture.TestableHelper
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. |
Override this in your subclass.
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.
Call this to get a 4-tuple with parameters V, I, dI, and dt for reverse recovery.
Adds an analysis.sim.TRAN
analyzer to the supplied analyzerDict for the specified setup
ID, with (name, value) tuples for any keywords supplied.
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.
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.
Parameters | M | Multiplier of the number of steps. Sometimes M > 1 helps Ngspice convergence. |
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.
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.
Parameters | mult | Set to the precision of the step size (e.g., 0.1 for one digit, 0.01 for two digits). |
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.
Parameters | N | The maximum number of steps acceptable for the sweep. (Disregarded with 3 args.) |
M | Multiplier of the number of steps. Sometimes M > 1 helps Ngspice convergence. (Disregarded with 3 args.) | |
N_digits | The number of digits after the decimal point allowable in the step size. | |
maxStep | The maximum step to use if an exact match is found. (Disregarded with 3 args.) | |
notZero | Set True to prevent the sweep from including exactly zero. |
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.
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.
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.