dkpy.IterResult

class dkpy.IterResult(omega, mu_omega, D_l_omega, D_r_inv_omega, mu_fit_omega, D_l_fit_omega, D_r_inv_fit_omega, D_l_fit, D_r_inv_fit, block_structure)

Bases: object

Information about the current iteration of the D-K iteration process.

All DkIteration objects return a list of IterResult objects (one for each iteration).

This class is used mainly to assess the accuracy of the D-scale fit. Can be plotted using plot_mu() and plot_D().

Parameters:
__init__(omega, mu_omega, D_l_omega, D_r_inv_omega, mu_fit_omega, D_l_fit_omega, D_r_inv_fit_omega, D_l_fit, D_r_inv_fit, block_structure)

Instantiate IterResult.

Parameters:
  • omega (np.ndarray) – Angular frequencies to evaluate D-scales (rad/s).

  • mu_omega (np.ndarray) – Numerically computed structured singular value at each frequency.

  • D_l_omega (np.ndarray) – Numerically computed left D-scale magnitude at each frequency.

  • D_r_inv_omega (np.ndarray) – Numerically computed inverse right D-scale magnitude at each frequency.

  • mu_fit_omega (np.ndarray) – Fit structured singular value at each frequency.

  • D_l_fit_omega (np.ndarray) – Fit left D-scale magnitude at each frequency.

  • D_r_inv_fit_omega (np.ndarray) – Fit D-scale magnitude at each frequency.

  • D_l_fit_omega – Fit left D-scale magnitude at each frequency.

  • D_r_inv_fit (control.StateSpace) – Fit right D-scale state-space representation.

  • uncertainty_structure (Union[List[uncertainty_structure.UncertaintyBlock], List[List[int]], np.ndarray]) – Uncertainty block structure representation.

  • D_l_fit (StateSpace)

  • block_structure (List[UncertaintyBlock] | List[List[int]] | ndarray)

Methods

__init__(omega, mu_omega, D_l_omega, ...)

Instantiate IterResult.

create_from_fit(omega, mu_omega, D_l_omega, ...)

Instantiate IterResult from fit D-scales.

classmethod create_from_fit(omega, mu_omega, D_l_omega, D_r_omega, P, K, D_l_fit, D_r_inv_fit, block_structure)

Instantiate IterResult from fit D-scales.

Parameters:
  • omega (np.ndarray) – Angular frequencies to evaluate D-scales (rad/s).

  • mu_omega (np.ndarray) – Numerically computed structured singular value at each frequency.

  • D_l_omega (np.ndarray) – Numerically computed left D-scale magnitude at each frequency.

  • D_r_omega (np.ndarray) – Numerically computed right D-scale magnitude at each frequency.

  • P (control.StateSpace) – Generalized plant.

  • K (control.StateSpace) – Controller.

  • D_l_fit (control.StateSpace) – Fit left D-scale magnitude at each frequency.

  • D_r_inv_fit (control.StateSpace) – Fit inverse right D-scale magnitude at each frequency.

  • block_structure (Union[List[uncertainty_structure.UncertaintyBlock], List[List[int]], np.ndarray]) – Uncertainty block structure representation.

Returns:

Instance of IterResult

Return type:

IterResult

Examples

Create a IterResult object from fit data

>>> P, n_y, n_u, K = example_skogestad2006_p325
>>> block_structure = [
...     dkpy.ComplexFullBlock(1, 1),
...     dkpy.ComplexFullBlock(1, 1),
...     dkpy.ComplexFullBlock(2, 2),
... ]
>>> omega = np.logspace(-3, 3, 61)
>>> N = P.lft(K)
>>> N_omega = N(1j * omega)
>>> mu_omega, D_l_omega, D_r_omega, info = dkpy.SsvLmiBisection().compute_ssv(
...     N_omega,
...     block_structure,
... )
>>> D_l, D_r_inv = dkpy.DScaleFitSlicot().fit(omega, D_l_omega, D_r_omega, 2, block_structure)
>>> d_scale_fit_info = IterResult.create_from_fit(
...     omega,
...     mu_omega,
...     D_l_omega,
...     D_r_omega,
...     P,
...     K,
...     D_l,
...     D_r_inv,
...     block_structure,
... )