# ahkab.pz¶

This module offers the functions needed to perform a numeric pole-zero extraction.

Currently, this module implements the MD algorithm, more may be added in the future.

A description of the algorithm is found in the following references:

Haley, S.B., “The generalized eigenproblem: pole-zero computation,” Proceedings of the IEEE, vol.76, no.2, pp.103,120, Feb 1988

and:

Raghuram, R.; Divekar, D.; Wang, P., “Implementation of pole-zero analysis in SPICE based on the MD method,” Circuits and Systems, 1991., Proceedings of the 34th Midwest Symposium on, pp.380, 383 vol.1, 14-17 May 1991

Frequency sweeping – or shifting – is performed with a random frequency kick, currently, hoping not to kick so hard that we end up on the negative side. A bisection method would be better and hopefully will be implemented soon.

## Overview¶

Two main methods are available in this module:

Currently this module uses dense matrices.

## Reference¶

calculate_poles(mc, MNA=None, x0=None, outfile=None, verbose=0)[source]

Calculate the circuit poles.

Parameters:

mc : circuit instance
The circuit to be analyzed.
MNA : ndarray, optional
The Modified Nodal Analysis matrix, if available. In case the circuit is non-linear, MNA should include the contributes of the non-linear elements (ie the Jacobian $$J$$).
x0 : ndarray or op_solution, optional
The linearization point. Only needed for non-linear circuits.
outfile : str or None, optional
The data filename.
verbose : int, optional
Verbosity level, from 0 (silent, default) to 6 (debug).

Returns:

pz_sol : pz_solution instance
The PZ solution, with no zeros.
calculate_singularities(mc, input_source=None, output_port=None, MNA=None, x0=None, shift=0, outfile=None, verbose=0)[source]

Calculate poles and zeros.

By default, only poles are calculated, as they need no information other than the circuit description.

To activate zeros calculation, it is necessary:

• to specify an input source (input_source),
• to specify an output port (output_port).

Parameters:

mc : circuit instance
The circuit to be analyzed.
input_source : string or element, optional
If zeros are to be calculated, set this to the input surce.
output_port : external node (ref. to gnd) or tuple of external nodes, opt
If zeros are to be calculated, set this to the output nodes.
MNA : ndarray, optional
The Modified Nodal Analysis matrix, if available. In case the circuit is non-linear, MNA should include the contributes of the non-linear elements (ie the Jacobian $$J$$).
x0 : ndarray or op_solution, optional
The linearization point. Only needed for non-linear circuits.
shift : float, optional
Shift frequency at which the algorithm should be run.
outfile : str or None, optional
The data filename.
verbose : int, optional
Verbosity level, from 0 (silent, default) to 6 (debug).

Returns:

pz_sol : pz_solution instance
The PZ solution