D-K iteration in Python
Project description
dkpy
dkpy is a D-K iteration library written in Python, aiming to build upon python-control.
The package is currently a work-in-progress, and no API stability guarantees will be made until version 1.0.0.
D-K iteration
The standard robust control problem has the form:
┌─────────┐
│ │
w2 ┌────┤ Δ │◄───┐ z2
│ │ │ │
│ └─────────┘ │
│ ┌─────────┐ │
└───►│ ├────┘
w1 ──────►│ P ├──────► z1
┌───►│ ├────┐
│ └─────────┘ │
│ ┌─────────┐ │
│ │ │ │
u └────┤ K │◄───┘ y
│ │
└─────────┘
where P is the generalized plant, K is the controller, and Δ is an uncertain LTI system whose H-infinity norm is less than or equal to 1.
Synthesizing a controller that makes the transfer matrix from w1 to z1 have an H-infinity norm less than 1 guarantees robust stability by the small gain theorem.
When Δ has structure (e.g., Δ = diag(Δ1, Δ2)), this approach is too conservative. Robust stability can instead be achieved by synthesizing a controller whose structured singular value, µ, is less than 1. Robust performance problems can also be viewed as robust stability problems with structured uncertainty.
Minimizing µ is much more challenging than minimizing the H-infinity norm. D-K iteration is one method to do so. It relies on the fact that an upper bound for µ is:
µ(M) ≤ min σ̅(DMD⁻¹)
D
where D is a complex matrix whose structure commutes with Δ. More specifically, for each full block in Δ, the corresponding entry of D is d I, where d is a scalar and I is the identity matrix. If Δ has any entries of the form δ I, then D has a full block in the corresponding entry.
D-K iteration has the following steps, where D is initially identity.
Augment P with D and D⁻¹, then synthesize an H-infinity controller.
Compute µ and D for the closed-loop system without the D-scalings over a range of discrete frequencies.
Fit a transfer matrix to D and repeat. Stop when µ < 1.
The D-K iteration process is represented by dkpy.DkIteration. The
steps of the process are represented by
dkpy.ControllerSynthesis,dkpy.StructuredSingularValue, anddkpy.DScaleFit.
Example
import dkpy
import numpy as np
# Load an example
eg = dkpy.example_skogestad2006_p325()
# Set up the D-K iteration method
dk_iter = dkpy.DkIterListOrder(
controller_synthesis=dkpy.HinfSynSlicot(),
structured_singular_value=dkpy.SsvLmiBisection(),
d_scale_fit=dkpy.DScaleFitSlicot(),
fit_orders=[4, 4, 4],
)
# Synthesize a controller
omega = np.logspace(-3, 3, 61)
block_structure = [
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(1, 1),
dkpy.ComplexFullBlock(2, 2),
]
K, N, mu, d_scale_fit_info, info = dk_iter.synthesize(
eg["P"],
eg["n_y"],
eg["n_u"],
omega,
block_structure,
)
Contributing
To install the pre-commit hook, run
$ pip install -r requirements.txt
$ pre-commit install
in the repository root.
Citation
If you use this software in your research, please cite it as below or see CITATION.cff.
@software{dahdah_dkpy_2025,
title={{decargroup/dkpy}},
doi={10.5281/zenodo.14511244},
url={https://github.com/decargroup/dkpy},
publisher={Zenodo},
author={Steven Dahdah and Timothy Everett Adams and James Richard Forbes},
version = {{v0.1.9}},
year={2025},
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dkpy-0.1.9.tar.gz.
File metadata
- Download URL: dkpy-0.1.9.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
841e87c1a15e1e967326c24386e45daba8142b15250723fe9a111d0e3b0348b4
|
|
| MD5 |
8bf81b34b958319662cdd9073536cb7f
|
|
| BLAKE2b-256 |
4770e686f91bc1c839d29b734837fea9ff65b0f68f1b950d87a1b740f766f58b
|
Provenance
The following attestation bundles were made for dkpy-0.1.9.tar.gz:
Publisher:
release-package.yml on decargroup/dkpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dkpy-0.1.9.tar.gz -
Subject digest:
841e87c1a15e1e967326c24386e45daba8142b15250723fe9a111d0e3b0348b4 - Sigstore transparency entry: 657189094
- Sigstore integration time:
-
Permalink:
decargroup/dkpy@0b8bfda38d81f6c69e6256d6624e9e41100ddd92 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/decargroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-package.yml@0b8bfda38d81f6c69e6256d6624e9e41100ddd92 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dkpy-0.1.9-py3-none-any.whl.
File metadata
- Download URL: dkpy-0.1.9-py3-none-any.whl
- Upload date:
- Size: 40.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71765e9243a75fb9982cee191fde888419c40a43f1fb03af6cb4ba531de6a01a
|
|
| MD5 |
a052f8bd9c1791c17925287d7d8f3f75
|
|
| BLAKE2b-256 |
e91b8d8ed72b3e58226bc64e0fb415d68c5ba6a0041a4827391c4da60b758911
|
Provenance
The following attestation bundles were made for dkpy-0.1.9-py3-none-any.whl:
Publisher:
release-package.yml on decargroup/dkpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dkpy-0.1.9-py3-none-any.whl -
Subject digest:
71765e9243a75fb9982cee191fde888419c40a43f1fb03af6cb4ba531de6a01a - Sigstore transparency entry: 657189114
- Sigstore integration time:
-
Permalink:
decargroup/dkpy@0b8bfda38d81f6c69e6256d6624e9e41100ddd92 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/decargroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-package.yml@0b8bfda38d81f6c69e6256d6624e9e41100ddd92 -
Trigger Event:
release
-
Statement type: