skrf.vectorFitting.VectorFitting.passivity_enforce

VectorFitting.passivity_enforce(n_samples=200, f_max=None, parameter_type='s', preserve_dc=True)[source]

Enforces the passivity of the vector fitted model, if required. This is an implementation of the methods presented in [1] and [2] using singular value perturbation. To preserve the dc point in the model during passivity enforcement, only the residues are perturbed, not the constant term.

Parameters:
  • n_samples (int, optional) – Number of linearly spaced frequency samples at which passivity will be evaluated and enforced. (Default: 200). If there are very narrow frequency bands of passivity violations, a sufficiently large number of frequency samples is required.

  • f_max (float or None, optional) – Highest frequency of interest for the passivity enforcement (in Hz, not rad/s). This limit usually equals the highest sample frequency of the fitted Network. If None, the highest frequency in self.network is used, which must not be None is this case. If f_max is not None, it overrides the highest frequency in self.network.

  • parameter_type (str, optional) – Representation type of the fitted frequency responses. Either scattering (s or S), impedance (z or Z) or admittance (y or Y). Currently, only scattering parameters are supported for passivity evaluation.

  • preserve_dc (bool, optional) – Enables dc point preservation during passivity enforcement. This only works if the fitted model is already passive at the dc point, which is not always the case. If it is not passive, dc point preservation is disabled and passivity is also enforced on the dc point.

Return type:

None

Raises:
  • NotImplementedError – If the function is called for parameter_type different than S (scattering).

  • ValueError – If the function is used with a model containing nonzero proportional coefficients. Or if both f_max and self.network are None.

See also

is_passive

Returns the passivity status of the model as a boolean value.

passivity_test

Verbose passivity evaluation routine.

plot_passivation

Convergence plot for passivity enforcement iterations.

Examples

Load and fit the Network, then enforce the passivity of the model:

>>> nw_3port = skrf.Network('my3port.s3p')
>>> vf = skrf.VectorFitting(nw_3port)
>>> vf.vector_fit(n_poles_real=1, n_poles_cmplx=4)
>>> vf.passivity_enforce()  # won't do anything if model is already passive

References