dkpy.DkIterAutoOrder

class dkpy.DkIterAutoOrder(controller_synthesis, structured_singular_value, d_scale_fit, max_mu=1, max_mu_fit_error=0.01, max_iterations=None, max_fit_order=None)

Bases: DkIteration

D-K iteration with automatically selected fit orders.

Parameters:
__init__(controller_synthesis, structured_singular_value, d_scale_fit, max_mu=1, max_mu_fit_error=0.01, max_iterations=None, max_fit_order=None)

Instantiate DkIterListOrder.

Parameters:
  • controller_synthesis (dkpy.ControllerSynthesis) – A controller synthesis object.

  • structured_singular_value (dkpy.StructuredSingularValue) – A structured singular value computation object.

  • d_scale_fit (dkpy.DScaleFit) – A D-scale fit object.

  • max_mu (float) – Maximum acceptable structured singular value.

  • max_mu_fit_error (float) – Maximum relative fit error for structured singular value.

  • max_iterations (Optional[int]) – Maximum number of iterations. If None, there is no upper limit.

  • max_fit_order (Optional[int]) – Maximum fit order. If None, there is no upper limit.

Examples

>>> eg = dkpy.example_skogestad2006_p325()
>>> dk_iter = dkpy.DkIterAutoOrder(
...     controller_synthesis=dkpy.HinfSynSlicot(),
...     structured_singular_value=dkpy.SsvLmiBisection(),
...     d_scale_fit=dkpy.DScaleFitSlicot(),
...     max_mu=1,
...     max_mu_fit_error=1e-2,
...     max_iterations=3,
...     max_fit_order=4,
... )
>>> omega = np.logspace(-3, 3, 61)
>>> block_structure = [
...     dkpy.ComplexFullBlock(1, 1),
...     dkpy.ComplexFullBlock(1, 1),
...     dkpy.ComplexFullBlock(2, 2),
... ]
>>> K, N, mu, d_scale_fit_info, info = dk_iter.synthesize(
...     eg["P"],
...     eg["n_y"],
...     eg["n_u"],
...     omega,
...     block_structure,
... )
>>> mu
1.03

Methods

__init__(controller_synthesis, ...[, ...])

Instantiate DkIterListOrder.

synthesize(P, n_y, n_u, omega, block_structure)

Synthesize controller using D-K iteration.

synthesize(P, n_y, n_u, omega, block_structure)

Synthesize controller using D-K iteration.

The IterResult objects returned by this function can be plotted using plot_mu() and plot_D().

Parameters:
  • P (control.StateSpace) – Generalized plant, with y and u as last outputs and inputs respectively.

  • n_y (int) – Number of measurements (controller inputs).

  • n_u (int) – Number of controller outputs.

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

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

Returns:

Controller, closed-loop system, structured singular value, intermediate results for each iteration, and solution information. If a controller cannot by synthesized, the first three elements of the tuple are None, but fit and solution information are still returned.

Return type:

Tuple[control.StateSpace, control.StateSpace, float, List[IterResult], Dict[str, Any]]

See also

IterResult

Intermediate results for each iteration.

plot_mu()

Plot structured singular value fit from an IterResult object.

plot_D()

Plot D-scale fit from an IterResult object.