dkpy.SsvLmiBisection
- class dkpy.SsvLmiBisection(bisection_atol=1e-05, bisection_rtol=0.0001, max_iterations=100, initial_guess=10, lmi_strictness=None, solver_params=None, n_jobs=-1, objective='constant')
Bases:
StructuredSingularValueStructured singular value using an LMI approach with bisection.
Synthesis method based on Section 4.25 of [CF24].
Examples
Structured singular value computation from [SP06]
>>> 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(n_jobs=None).compute_ssv( ... N_omega, ... block_structure, ... ) >>> float(np.max(mu_omega)) 5.77
- Parameters:
- __init__(bisection_atol=1e-05, bisection_rtol=0.0001, max_iterations=100, initial_guess=10, lmi_strictness=None, solver_params=None, n_jobs=-1, objective='constant')
Instantiate
SsvLmiBisection.Solution accuracy depends strongly on the selected solver and tolerances. Setting the solver and its tolerances in
solver_paramsand settinglmi_strictnessmanually is recommended, rather than relying on the default settings.- Parameters:
bisection_atol (float) – Bisection absolute tolerance.
bisection_rtol (float) – Bisection relative tolerance.
max_iterations (int) – Maximum number of bisection iterations.
initial_guess (float) – Initial guess for bisection.
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].n_jobs (Optional[int]) – Number of processes to use to parallelize the bisection. Set to
Nonefor a single thread, or set to-1(default) to use all CPUs. See [2].objective (str) – Set to
'constant'to solve a feasibility problem at each bisection iteration. Set to'minimize'to minimize the trace of the slack variable instead, which may result in better numerical conditioning.
References
Methods
__init__([bisection_atol, bisection_rtol, ...])Instantiate
SsvLmiBisection.compute_ssv(N_omega[, block_structure])Compute structured singular value.
- compute_ssv(N_omega, block_structure=None)
Compute structured singular value.
- Parameters:
N_omega (np.ndarray) – Closed-loop transfer function evaluated at each frequency.
block_structure (Union[List[uncertainty_structure.UncertaintyBlock], List[List[int]], np.ndarray]) – Uncertainty block structure representation. Returns
- Returns:
Structured singular value at each frequency, D-scales at each frequency, and solution information. If the structured singular value cannot be computed, the first two elements of the tuple are
None, but solution information is still returned.- Return type:
Tuple[np.ndarray, np.ndarray, Dict[str, Any]]