Perform analysis

../_images/colorCode.svg

SLiCAP has a number of predefined analysis types. However, since it built upon the powerful sympy CAS (Computer Algebra System), the user can easily extend SLiCAP’s capabilities and add other analysis types.

General Instruction format

The general instruction format is:

result = do<Instruction>(cir, transfer='gain', source='circuit', detector='circuit',
                         lgref='circuit', convtype=None, pardefs=None, numeric=False,
                         stepdict=None)

where <Instruction> describes the analysis to be performed.

The return value of all instructions is an allResults object. Execution of the instruction will set some attributes of this object. Detailed information for each instruction is given in de Reference section

The funstion arguments are:

  1. cir: circuit object use for the instruction

  2. transfer: None, ‘gain’, ‘asymptotic’, ‘loopgain’, ‘servo’, or ‘direct’; defaults to ‘gain’

    A transfer type is required for transfer related analysis types

    • None: no transfer type is specified; SLiCAP will calculate the detector voltage or curremt or perform analysis that do not require a source specification

    • ‘gain’: source to detector transfer

    • ‘asymptotic’: Gain of a circuit is which the loop gain reference is replaced with a nullor (the ‘asymptotic-gain’)

    • ‘direct’: Gain of a circuit in which the value of the loop gain reference is set to zero (the ‘direct transfer’)

    • ‘loopgain’: Gain enclosed in the loop involving the loop gain reference (the ‘loop gain’)

    • ‘servo’: \(\frac{-L}{1-L}\), where \(L\) is the loop gain as defined above (the ‘servo function’)

  3. source: None,’circuit’, <refDes>, defaults to : ‘circuit’

    • None: No source required or desired

    • ‘circuit’: SLiCAP uses the source specification from the netlist

    • <refDes>: Name of an independent voltage or current source that must be used as signal source

    Obtain list of independent sources in your circuit:

    import SLiCAP as sl
    sl.initProject("my Project")
    cir = sl.makeCircuit(<myCircuit>)
    # Obtain the list of independent sources in <myCircuit>
    print(cir.indepVars)
    
  4. detector: None,’circuit’, <refDes>, defaults to : ‘circuit’

    • None: No detector required or desired

    • ‘circuit’: SLiCAP uses the detector specification from the netlist

    • <refDes>: Name of an independent variable (nodal voltage or branch current through a current-controlled element) that must be used as signal detector

    Obtain list with names of dependent variables in your circuit:

    import SLiCAP as sl
    sl.initProject("my Project")
    cir = sl.makeCircuit(<myCircuit>)
    # Obtain the list names of dependent variables in <myCircuit>
    print(cir.depVars)
    
  5. lgref: None,’circuit’, <refDes>, defaults to : ‘circuit’

    • None: No loop gain reference required or desired

    • ‘circuit’: SLiCAP uses the loop gain reference specification from the netlist

    • <refDes>: Name of a dependent source (controlled source) that must be used as loop gain reference

    Obtain list with names of dependent variables in your circuit:

    import SLiCAP as sl
    sl.initProject("my Project")
    cir = sl.makeCircuit(<myCircuit>)
    # Obtain the list names of dependent sources in <myCircuit>
    print(cir.controlled)
    
  6. convtype: None, ‘all’, ‘dd’, ‘dc’, ‘cd’, or ‘cc’; defaults to None

    The conversion type is used to convert balanced circuits into differential-mode and common-mode equivalent circuits.

    • None: No matrix conversion will be applied

    • ‘all’: Dependent variables and independent variables will be grouped in differential-mode and common-mode variables.

      The circuit matrix dimension is not changed.

      Conversion type only be used with the doMatrix() instruction

    • ‘dd’: After grouping of the vaiables in differential-mode and common-mode variables, only the differential-mode variables of both dependent and independent variables are considered.

      The matrix equation describes the differential-mode behavior of the circuit.

    • ‘cc’: After grouping of the vaiables in differential-mode and common-mode variables, only the common-mode variables of both dependent and independent variables are considered.

      The matrix equation describes the common-mode behavior of the circuit.

    • ‘dc’: After grouping of the vaiables in differential-mode and common-mode variables, only the differential-mode dependent variables and the common-mode independent variables are considered.

      The matrix equation describes the common-mode to differential-mode conversion of the circuit.

    • ‘cd’: After grouping of the vaiables in differential-mode and common-mode variables, only the common-mode dependent variables and the differential-mode independent ariables are considered.

      The matrix equation describes the differential-mode to common-mode conversion of the circuit.

  7. pardefs: None, ‘circuit’, or dict; defaults to None

    • None: Analysis will be performed without substitution of parameters

    • ‘circuit’: Analysis will be performed with all parameters defined with the circuit (cir.parDefs) recursively substituted

    • dict: Analysis will be performed with all parameters defined in dict (key = parameter name, value = parameter value or expression)

    Obtain a dictionary with parameter the circuit parameter definitions and a list with undefined parameters:

    import SLiCAP as sl
    sl.initProject("my Project")
    cir = sl.makeCircuit(<myCircuit>)
    # Obtain the parameter definitions in <myCircuit>
    for key in cir.parDefs.keys():
      print(key, ':', cir.parDefs[key])
    # Print a list with undefined parameters:
    print(cir.params)
    
  8. numeric: True, False; defaults to False

    • False: Analysis will be performed with rational numbers and without numeric evaluation of constants (\(\pi\)) or functions. In some cases, however, pole-zero analysis and noise integration will switch to floating point calculation.

    • True: Analysis will be performed with all constants and functions numerically evaluated

  9. stepdict: None, dict

    • None: Analysis will be performed withoud parameter stepping

    • dict: Analysis will be repeated for a number of steps with a different (set of) parameter(s)

      The step dictionary dict can have the following key-value pairs:

      • dict[‘stepmethod’]: (str); ‘lin’, ‘log’, ‘list’, ‘array’

      • dict[‘params’]: (str, sympy.Symbol) for stepmethod: lin’, ‘log’, and ‘list’ (list of str or sympy.Symbol) for stepmethod: ‘array’

      • dict[‘start’]: ( float, int, str): start value for linear and log stepping

      • dict[‘stop’]: ( float, int, str): stop value for linear and log stepping

      • dict[‘num’]: (int), number of steps for lin and log stepping

      • dict[‘values’]: (list of int, float, or str) step values for stepmethod: ‘list’, (list of lists of int, float, or str) step values for stepmethod: ‘array’

Predefined Analysis Types

Below an overview of instructions that have been implemented in SLiCAP. Links are provided to the detailed description of the functions in the reference section.

  1. Network equations:

    • doMatrix: matrix equation of the circuit

  2. Complex frequency domain (Laplace) analysis:

    • doLaplace: transfer function or detector current/voltage (Laplace expression)

    • doNumer: numerator of a transfer function or detector current/voltage

    • doDenom : denominator of a transfer function or detector current/voltage

    • doSolve: Laplace Transform of the network solution or detector current/voltage

  3. Complex frequency domain analysis: Poles and zeros of transfer functions:

    • doPoles: poles of a transfer, including non-controllable and non-observable (complex frequency solutions of Denom)

    • doZeros: zeros of a transfer (complex frequency solutions of Numer)

    • doPZ: DC value, poles and zeros of a transfer (with pole-zero canceling)

  4. Noise analysis: spectral densities of detector and source-referred noise and the individual contributions of all independent noise sources

  5. Time domain analysis, based on the Inverse Laplace Transform:

    • doTime: detector voltage or current

    • doImpulse: unit-impulse response of a transfer

    • doStep: unit-step response of a transfer

    • doTimeSolve: Time-domain solution of a network

  6. DC (zero-frequency) analysis:

    • doDC: Zero-frequency value of a transfer or detector current/voltage

    • doDCsolve: DC network solution

    • doDCvar: detector-referred and source-referred DC variance

Detector, source, and loop gain reference

Some analysis types require definitions of a signal source, a signal detector, and/or a loop gain reference. Souce, detector and loop gain reference are specified with the circuit.

  • A detector specification is NOT required for the instructions:

    • doMatrix()

    • doDenom()

    • doPoles()

    • doSolve()

    • doDCsolve()

    • doTimeSolve()

    AND for transfer types:

    • loopgain

    • servo

    In all other cases a definition of a detector is required.

  • A source specification is required for transfers: ‘gain’, ‘direct’, and ‘asymptotic’.

    If a source definition is given, instructions ‘doNoise()’ and ‘doDCvar()’ also return the source-referred noise and source referred DC variance, respectively.

  • A loop gain reference specification is required for the transfers: ‘asymptotic’, direct’, ‘loopgain’, and ‘servo’.

../_images/colorCode.svg