I help you build some complex B-source expressions. Used by MOSFET_Model.

Method __init__ Undocumented
Method ap Appends a part to my list of expression parts eParts. Call with a string, or a string prototype and args, to add an expression part.
Method ep Build the expression from my list of parts eParts, clears the list for another build, and returns the built expression.
Method ifelse Returns an expression for selecting expr_yes if Ngspice evaluates expr_test as True, else expr_no.
Method lowerLimit Returns an expression for an expression that is numerically robust and implements a soft lower limit, at expr_limit if specified, otherwise zero.
Method zeroLimit Returns an expression for a numerically robust expression that implements a soft lower limit at zero.
def __init__(self):
Undocumented
def ap(self, *args, **kw):

Appends a part to my list of expression parts eParts. Call with a string, or a string prototype and args, to add an expression part.

If joinWith is specified, then the expression from my current list of parts (including the one from this method call) is built and returned, and the list is cleared. You can include the other keywords accepted by ep.

def ep(self, joinWith='', suffix=None, new=False, paren=None):

Build the expression from my list of parts eParts, clears the list for another build, and returns the built expression.

If new is set True, puts the new expression back into myself as the first part of a new list of expression parts. (It is still returned.)

If paren is set True, the expression is wrapped inside parentheses. If paren is set to a non-blank string, that string precedes the parentheses with no space.

def ifelse(self, expr_yes, expr_no, proto_test, *args):

Returns an expression for selecting expr_yes if Ngspice evaluates expr_test as True, else expr_no.

def lowerLimit(self, A, expr_x, expr_limit=None, expr_test=None):

Returns an expression for an expression that is numerically robust and implements a soft lower limit, at expr_limit if specified, otherwise zero.

You must surround expr_x with parentheses if it is a sum or difference.

The limiter output is log(2)/A when the value of expr_x equals that of expr_limit.

Uses different limiter expression depending on whether expr_test is positive or negative. If expr_test is not specified, expr_x - expr_limit is used.

See AlsoT&M (10.4.6) p. 612.
def zeroLimit(self, A, expr_x, expr_test=None):

Returns an expression for a numerically robust expression that implements a soft lower limit at zero.

The limiter output is log(2)/A when expr_x is zero.

See AlsoT&M (10.4.6) p. 612.
API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.