dkpy.HinfSynLmi

class dkpy.HinfSynLmi(lmi_strictness=None, solver_params=None)

Bases: ControllerSynthesis

H-infinity synthesis using a linear matrix inequality approach.

Synthesis method based on Section 5.3.3 of [CF24].

Examples

H-infinity controller synthesis with default settings

>>> P, n_y, n_u = example_scherer1997_p907
>>> K, N, gamma, info = dkpy.HinfSynLmi().synthesize(P, n_y, n_u)
>>> gamma
9.51

H-infinity controller synthesis with CLARABEL

>>> K, N, gamma, info = dkpy.HinfSynLmi(
...     lmi_strictness=1e-8,
...     solver_params={
...         "solver": "CLARABEL",
...         "tol_gap_abs": 1e-9,
...         "tol_gap_rel": 1e-9,
...         "tol_feas": 1e-9,
...         "tol_infeas_abs": 1e-9,
...         "tol_infeas_rel": 1e-9,
...     },
... ).synthesize(P, n_y, n_u)

H-infinity controller synthesis with SCS

>>> K, N, gamma, info = dkpy.HinfSynLmi(
...     lmi_strictness=1e-3,
...     solver_params={
...         "solver": "SCS",
...         "eps": 1e-4,
...     },
... ).synthesize(P, n_y, n_u)
>>> gamma
9.57

H-infinity controller synthesis with MOSEK (simple settings)

>>> K, N, gamma, info = dkpy.HinfSynLmi(
...     lmi_strictness=1e-8,
...     solver_params={
...         "solver": "MOSEK",
...         "eps": 1e-9,
...     },
... ).synthesize(P, n_y, n_u)

H-infinity controller synthesis with MOSEK (advanced settings)

>>> K, N, gamma, info = dkpy.HinfSynLmi(
...     lmi_strictness=1e-7,
...     solver_params={
...         "solver": "MOSEK",
...         "mosek_params": {
...             "MSK_DPAR_INTPNT_CO_TOL_DFEAS": 1e-8,
...             "MSK_DPAR_INTPNT_CO_TOL_INFEAS": 1e-12,
...             "MSK_DPAR_INTPNT_CO_TOL_MU_RED": 1e-8,
...             "MSK_DPAR_INTPNT_CO_TOL_PFEAS": 1e-8,
...             "MSK_DPAR_INTPNT_CO_TOL_REL_GAP": 1e-8,
...         },
...     },
... ).synthesize(P, n_y, n_u)
Parameters:
__init__(lmi_strictness=None, solver_params=None)

Instantiate HinfSynLmi.

Solution accuracy depends strongly on the selected solver and tolerances. Setting the solver and its tolerances in solver_params and setting lmi_strictness manually is recommended, rather than relying on the default settings.

Parameters:
  • lmi_strictness (Optional[float]) – Strictness for linear matrix inequality constraints. Should be larger than the solver tolerance. If None, then it is automatically set to 10x the solver’s largest absolute tolerance.

  • solver_params (Optional[Dict[str, Any]]) – Dictionary of keyword arguments for cvxpy.Problem.solve(). Notable keys are 'solver' and 'verbose'. Additional keys used to set solver tolerances are solver-dependent. A definitive list can be found at [1].

References

Methods

__init__([lmi_strictness, solver_params])

Instantiate HinfSynLmi.

synthesize(P, n_y, n_u)

Synthesize controller.

synthesize(P, n_y, n_u)

Synthesize controller.

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.

Returns:

Controller, closed-loop system, objective function value, solution information. If a controller cannot by synthesized, the first three elements of the tuple are None, but solution information is still returned.

Return type:

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

Raises:
  • ValueError – If the solver specified is not recognized by CVXPY.

  • ValueError – If the generalized plant is not continuous-time (i.e., if p.dt != 0).