dkpy.plot_D

dkpy.plot_D(d_scale_info, ax=None, plot_kw=None, hide=None, plot_inverse=False)

Plot D.

Parameters:
  • d_scale_fit_info (dkpy.IterResult) – Object containing information about the D-scale fit.

  • ax (Optional[np.ndarray]) – Array of Matplotlib axes to use.

  • plot_kw (Optional[Dict[str, Any]]) – Keyword arguments for plt.Axes.semilogx().

  • hide (Optional[str]) – Set to 'D_omega' or 'D_fit_omega' to hide either one of those lines.

  • plot_inverse (Optional[bool]) – Plot the inverse right D-scale.

  • d_scale_info (IterResult)

Returns:

Matplotlib plt.Figure object and two-dimensional array of plt.Axes objects.

Return type:

Tuple[plt.Figure, np.ndarray]

Examples

Create a IterResult object from fit data and plot D

>>> 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,
... )
>>> fig, ax = dkpy.plot_D(d_scale_fit_info)