Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ authors:
orcid: "https://orcid.org/0000-0002-1987-9268"
affiliation: "McGill University"
title: "decargroup/dkpy"
version: v0.1.10
version: v0.1.11
url: "https://github.com/decargroup/dkpy"
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ If you use this software in your research, please cite it as below or see
url={https://github.com/decargroup/dkpy},
publisher={Zenodo},
author={Steven Dahdah and Timothy Everett Adams and James Richard Forbes},
version = {{v0.1.10}},
version = {{v0.1.11}},
year={2025},
}
Binary file added doc/_static/example_6/actuator_response.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/example_6/plot_inputs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/example_6/plot_mu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/example_6/plot_states.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/example_6/state_response.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
project = "dkpy"
copyright = "2024, Steven Dahdah, Timothy Everett Adams and James Richard Forbes"
author = "Steven Dahdah, Timothy Everett Adams and James Richard Forbes"
version = "0.1.10"
release = "0.1.10"
version = "0.1.11"
release = "0.1.11"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
31 changes: 31 additions & 0 deletions doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,34 @@ Output::

.. image:: _static/plot_mu.png
.. image:: _static/plot_D.png


D-K iteration with list of fit orders and simulation of perturbed systems
-------------------------------------------------------------------------

In this example, the orders are specified in a list. Once the robust controller
is synthesized, it is tested on a set of perturbed systems by generating a set
of perturbations `Δ` that have H-infinity norm less than or equal to 1.

In this example, a controller is designed for the linearized lateral dynamics
of an aircraft from an example given in Section 14.1 of [M04]_.

.. literalinclude:: ../examples/6_dk_iteration_airframe.py
:language: python

Output::

mu: 0.9824275970458984

.. image:: _static/example_6/plot_mu.png

After the controller is synthesized, a set of off-nominal models are generated
by interconnecting various admissible perturbations `Δ` with the nominal model.
Then, the closed-loop systems are formed for each perturbed system. The time
domain response of the systems can be obtained for a step response in the roll
angle reference signal, no external disturbances, and moderate sensor noise. In
particular, the response of the system states and actuator inputs are shown.

.. image:: _static/example_6/plot_states.png

.. image:: _static/example_6/plot_inputs.png
4 changes: 4 additions & 0 deletions doc/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ References
.. [SP06] S. Skogestad and I. Postlethwaite, Multivariable Feedback Control:
Analysis and Design. West Sussex, England: Wiley, 2006.
ISBN 978-0-47-001168-3.
.. [M04] U. Mackenroth, Robust Control Systems: Theory and Case Studies.
Berlin, Heidelberg: Springer, 2004. ISBN 978-3-642-05891-2.


14 changes: 6 additions & 8 deletions examples/1_example_dk_iter_fixed_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ def example_dk_iter_fixed_order():
)

omega = np.logspace(-3, 3, 61)
# Alternative MATLAB descr.
# Alternative MATLAB block structure description
# uncertainty_structure = dkpy.UncertaintyBlockStructure(
# [[1, 1], [1, 1], [2, 2]]
# )
uncertainty_structure = dkpy.UncertaintyBlockStructure(
[
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
)
uncertainty_structure = [
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
K, N, mu, iter_results, info = dk_iter.synthesize(
eg["P"],
eg["n_y"],
Expand Down
20 changes: 9 additions & 11 deletions examples/2_example_dk_iter_list_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,22 @@ def example_dk_iter_list_order():
d_scale_fit=dkpy.DScaleFitSlicot(),
# fit_orders=[4, 4, 4], # <- an alternative
fit_orders=[
np.diag([4, 4, 0, 0]),
np.diag([4, 4, 0, 0]),
np.diag([4, 4, 0, 0]),
[4, 4, 0],
[4, 4, 0],
[4, 4, 0],
],
)

omega = np.logspace(-3, 3, 61)
# Alternative MATLAB descr.
# Alternative MATLAB block structure description
# uncertainty_structure = dkpy.UncertaintyBlockStructure(
# [[1, 1], [1, 1], [2, 2]]
# )
uncertainty_structure = dkpy.UncertaintyBlockStructure(
[
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
)
uncertainty_structure = [
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
K, N, mu, iter_results, info = dk_iter.synthesize(
eg["P"],
eg["n_y"],
Expand Down
14 changes: 6 additions & 8 deletions examples/3_example_dk_iter_auto_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,15 @@ def example_dk_iter_auto_order():
)

omega = np.logspace(-3, 3, 61)
# Alternative MATLAB descr.
# Alternative MATLAB block structure description
# uncertainty_structure = dkpy.UncertaintyBlockStructure(
# [[1, 1], [1, 1], [2, 2]]
# )
uncertainty_structure = dkpy.UncertaintyBlockStructure(
[
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
)
uncertainty_structure = [
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
K, N, mu, iter_results, info = dk_iter.synthesize(
eg["P"],
eg["n_y"],
Expand Down
14 changes: 6 additions & 8 deletions examples/4_example_dk_iter_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ def example_dk_iter_interactive():
)

omega = np.logspace(-3, 3, 61)
# Alternative MATLAB descr.
# Alternative MATLAB block structure description
# uncertainty_structure = dkpy.UncertaintyBlockStructure(
# [[1, 1], [1, 1], [2, 2]]
# )
uncertainty_structure = dkpy.UncertaintyBlockStructure(
[
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
)
uncertainty_structure = [
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
K, N, mu, iter_results, info = dk_iter.synthesize(
eg["P"],
eg["n_y"],
Expand Down
19 changes: 9 additions & 10 deletions examples/5_example_dk_iteration_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def _get_fit_order(
iteration,
omega,
mu_omega,
D_omega,
D_l_omega,
D_r_omega,
P,
K,
uncertainty_structure,
block_structure,
):
print(f"Iteration {self.my_iter_count} with mu of {np.max(mu_omega)}")
if self.my_iter_count < 3:
Expand Down Expand Up @@ -70,17 +71,15 @@ def example_dk_iter_custom():
)

omega = np.logspace(-3, 3, 61)
# Alternative MATLAB descr.
# Alternative MATLAB block structure description
# uncertainty_structure = dkpy.UncertaintyBlockStructure(
# [[1, 1], [1, 1], [2, 2]]
# )
uncertainty_structure = dkpy.UncertaintyBlockStructure(
[
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
)
uncertainty_structure = [
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
K, N, mu, iter_results, info = dk_iter.synthesize(
eg["P"],
eg["n_y"],
Expand Down
Loading
Loading