skrf.mathFunctions.nudge_eig

skrf.mathFunctions.nudge_eig(mat, cond=None, min_eig=None)[source]

Nudge eigenvalues with absolute value smaller than max(cond * max(eigenvalue), min_eig) to that value. Can be used to avoid singularities in solving matrix equations.

Input should have dimension of similar to (nfreqs, nports, nports).

Parameters:
  • mat (np.ndarray) – Matrices to nudge

  • cond (float, optional) – Minimum eigenvalue ratio compared to the maximum eigenvalue. Default value is set by skrf.constants.EIG_COND.

  • min_eig (float, optional) – Minimum eigenvalue. Default value is set by skrf.constants.EIG_MIN.

Returns:

res – Nudged matrices

Return type:

np.ndarray