Skip to content

Commit

Permalink
Add references to mussv
Browse files Browse the repository at this point in the history
  • Loading branch information
sdahdah committed Dec 20, 2024
1 parent 502669b commit f3588be
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
12 changes: 10 additions & 2 deletions src/dkpy/d_scale_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand All @@ -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()

Expand Down Expand Up @@ -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]):
Expand Down
24 changes: 20 additions & 4 deletions src/dkpy/dk_iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
-------
Expand All @@ -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 = {}
Expand Down Expand Up @@ -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()

Expand Down
12 changes: 10 additions & 2 deletions src/dkpy/structured_singular_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand All @@ -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()

Expand Down Expand Up @@ -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]):
Expand Down

0 comments on commit f3588be

Please sign in to comment.