dkpy.DScaleFitSlicot

class dkpy.DScaleFitSlicot

Bases: DScaleFit

Fit D-scale magnitudes with SLICOT.

Examples

Compute mu and D at each frequency and fit a transfer matrix to 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, D_inv = dkpy.DScaleFitSlicot().fit(omega, D_l_omega, D_r_omega, 2, block_structure)
__init__()

Methods

__init__()

fit(omega, D_l_omega, D_r_omega[, order, ...])

Fit D-scale magnitudes.

fit(omega, D_l_omega, D_r_omega, order=0, block_structure=None)

Fit D-scale magnitudes.

Parameters:
  • omega (np.ndarray) – Angular frequencies (rad/s).

  • D_l_omega (np.ndarray) – Transfer matrix evaluated at each frequency, with frequency as last dimension.

  • D_r_omega (np.ndarray,) – Transfer matrix evaluated at each frequency, with frequency as last dimension.

  • order (Union[int, np.ndarray]) – Transfer function order to fit. Can be specified per-entry.

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

Returns:

Fit state-space system and its inverse.

Return type:

Tuple[control.StateSpace, control.StateSpace]

Raises:

ValueError – If order is an array but its dimensions are inconsistent with uncertainty_structure.

References