From f3588bea84d6498b59ba8788b4a2944b0eaea1e8 Mon Sep 17 00:00:00 2001 From: Steven Dahdah Date: Fri, 20 Dec 2024 15:03:13 -0500 Subject: [PATCH] Add references to mussv --- src/dkpy/d_scale_fit.py | 12 ++++++++++-- src/dkpy/dk_iteration.py | 24 ++++++++++++++++++++---- src/dkpy/structured_singular_value.py | 12 ++++++++++-- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/dkpy/d_scale_fit.py b/src/dkpy/d_scale_fit.py index 3628241..c3281c7 100644 --- a/src/dkpy/d_scale_fit.py +++ b/src/dkpy/d_scale_fit.py @@ -42,7 +42,7 @@ def fit( block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- @@ -54,6 +54,10 @@ def fit( ValueError If ``order`` is an array but its dimensions are inconsistent with ``block_structure``. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ raise NotImplementedError() @@ -162,13 +166,17 @@ def _mask_from_block_structure(block_structure: np.ndarray) -> np.ndarray: block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- np.ndarray Array of integers indicating zero, one, and unknown elements in the block structure. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ X_lst = [] for i in range(block_structure.shape[0]): diff --git a/src/dkpy/dk_iteration.py b/src/dkpy/dk_iteration.py index c7f3ace..d27e2be 100644 --- a/src/dkpy/dk_iteration.py +++ b/src/dkpy/dk_iteration.py @@ -60,7 +60,11 @@ def __init__( block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ self.omega = omega self.mu_omega = mu_omega @@ -103,7 +107,7 @@ def create_from_fit( block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- @@ -134,6 +138,10 @@ def create_from_fit( ... D_inv, ... block_structure, ... ) + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ # Compute ``mu(omega)`` based on fit D-scales N = P.lft(K) @@ -213,7 +221,7 @@ def synthesize( block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- @@ -223,6 +231,10 @@ def synthesize( controller cannot by synthesized, the first three elements of the tuple are ``None``, but fit and solution information are still returned. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ # Solution information info = {} @@ -330,12 +342,16 @@ def _get_fit_order( block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- Optional[Union[int, np.ndarray]] D-scale fit order. If ``None``, iteration ends. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ raise NotImplementedError() diff --git a/src/dkpy/structured_singular_value.py b/src/dkpy/structured_singular_value.py index 5c43dd5..06463a5 100644 --- a/src/dkpy/structured_singular_value.py +++ b/src/dkpy/structured_singular_value.py @@ -35,7 +35,7 @@ def compute_ssv( block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- @@ -44,6 +44,10 @@ def compute_ssv( 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. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ raise NotImplementedError() @@ -323,12 +327,16 @@ def _variable_from_block_structure(block_structure: np.ndarray) -> cvxpy.Variabl block_structure : np.ndarray 2D array with 2 columns and as many rows as uncertainty blocks in Delta. The columns represent the number of rows and columns in - each uncertainty block. + each uncertainty block. See [#mussv]_. Returns ------- cvxpy.Variable CVXPY variable with specified block structure. + + References + ---------- + .. [#mussv] https://www.mathworks.com/help/robust/ref/mussv.html """ X_lst = [] for i in range(block_structure.shape[0]):