Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/_static/example_7/7_uncertainty_weight.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,17 @@ by the variation in parameters.
Next, the uncertainty residual can be computed for each off-nominal system and
uncertainty model. `dkpy` implements six unstructured uncertainty models:

* Additive uncertainty ("A");
* Additive uncertainty ("A")
.. image:: _static/example_7/7_sval_residual_A.png
* Multiplicative input uncertainty ("I");
* Multiplicative input uncertainty ("I")
.. image:: _static/example_7/7_sval_residual_I.png
* Multiplicative output uncertainty ("O");
* Multiplicative output uncertainty ("O")
.. image:: _static/example_7/7_sval_residual_O.png
* Inverse additive uncertainty ("iA");
* Inverse additive uncertainty ("iA")
.. image:: _static/example_7/7_sval_residual_iA.png
* Inverse multiplicative input uncertainty ("iI");
* Inverse multiplicative input uncertainty ("iI")
.. image:: _static/example_7/7_sval_residual_iI.png
* Inverse multiplicative output uncertainty ("iO").
* Inverse multiplicative output uncertainty ("iO")
.. image:: _static/example_7/7_sval_residual_iO.png

See Chapter 8.2.3 of [SP06]_ for more information on these unstructured
Expand All @@ -239,7 +239,10 @@ stable and minimum phase linear time-invariant (LTI) system can be fit to the
frequency response of the weights to obtain a LTI description of the uncertainty
set. The optimal weight frequency responses and fitted weights are shown below.

.. image:: _static/example_7/7_uncertainty_weight.png
* Left:
.. image:: _static/example_7/7_sval_uncertainty_weight_left.png
* Right:
.. image:: _static/example_7/7_sval_uncertainty_weight_right.png

Multi-Model Uncertainty Characterization: Aircraft Actuator Model
-----------------------------------------------------------------
Expand Down Expand Up @@ -269,7 +272,7 @@ weight is constrained to the identity matrix. Given that the right uncertainty
weight is the identity matrix, a fit does not need to be performed for this weight
as it will be neglected in the generalized plant.

.. image:: _static/example_8/8_magnitude_uncertainty_weight.png
.. image:: _static/example_8/8_sval_uncertainty_weight_left.png



Expand Down
32 changes: 24 additions & 8 deletions examples/7_uncertainty_characterization.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,26 @@ def example_uncertainty_characterization():
)

# Compute uncertainty weight frequency response
response_weight_left, response_weight_right = (
complex_weight_left, complex_weight_right = (
dkpy.compute_uncertainty_weight_response(
response_residuals_dict["inverse_additive"], "diagonal", "diagonal"
)
)

# Fit overbounding stable and minimum-phase uncertainty weight system
weight_left = dkpy.fit_uncertainty_weight(response_weight_left, omega, [4, 5])
weight_right = dkpy.fit_uncertainty_weight(response_weight_right, omega, [3, 5])
weight_left = dkpy.fit_uncertainty_weight(
complex_weight_left, omega, [4, 5], "left", "diagonal"
)
weight_right = dkpy.fit_uncertainty_weight(
complex_weight_right, omega, [3, 5], "right", "diagonal"
)

measure = dkpy.compute_uncertainty_measure_response(
complex_nominal,
complex_weight_left,
complex_weight_right,
"multiplicative_input",
)

# Plot: Magnitude response of nominal and off-nominal systems
dkpy.plot_magnitude_response_uncertain_model_set(
Expand Down Expand Up @@ -72,15 +83,20 @@ def example_uncertainty_characterization():
response_residuals_dict, omega
)

# Plot: Magnitude response of uncertainty weight frequency response and overbounding
# fit
dkpy.plot_magnitude_response_uncertainty_weight(
response_weight_left,
response_weight_right,
# Plot: Singular value response of left uncertainty weight
dkpy.plot_singular_value_response_uncertainty_weight(
complex_weight_left,
omega,
weight_left,
)

# Plot: Singular value response of right uncertainty weight
dkpy.plot_singular_value_response_uncertainty_weight(
complex_weight_right,
omega,
weight_right,
)

plt.show()


Expand Down
18 changes: 9 additions & 9 deletions examples/8_aircraft_actuator_uncertainty_characterization.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def example_aircraft_uncertainty_characterization():
)

# Compute the optimal uncertainty weights with a given structure
response_weight_left, response_weight_right = (
complex_weight_left, complex_weight_right = (
dkpy.compute_uncertainty_weight_response(
response_residual["multiplicative_input"],
"scalar",
Expand All @@ -35,7 +35,9 @@ def example_aircraft_uncertainty_characterization():
)

# Fit an overbounding LTI system to the optimal uncertainty weight response
weight_left = dkpy.fit_uncertainty_weight(response_weight_left, omega, 1)
weight_left = dkpy.fit_uncertainty_weight(
complex_weight_left, omega, 1, "left", "scalar"
)

# Plot: Singular value response of nominal and off-nominal systems
dkpy.plot_singular_value_response_uncertain_model_set(
Expand All @@ -48,15 +50,13 @@ def example_aircraft_uncertainty_characterization():
response_residual, omega, hz=True
)

# Plot: Magnitude response of uncertainty weight frequency response and overbounding
# fit
dkpy.plot_magnitude_response_uncertainty_weight(
response_weight_left,
response_weight_right,
# Plot: Singular value response of left uncertainty weight
dkpy.plot_singular_value_response_uncertainty_weight(
complex_weight_left,
omega,
weight_left=weight_left,
hz=True,
weight_left,
)

plt.show()


Expand Down
1 change: 1 addition & 0 deletions src/dkpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .controller_synthesis import *
from .dk_iteration import *
from .d_scale_fit import *
from .lti_system_fit import *
from .structured_singular_value import *
from .uncertainty_structure import *
from .uncertainty_characterization import *
Expand Down
Loading
Loading