{"id":22441440,"url":"https://github.com/decargroup/dkpy","last_synced_at":"2025-08-01T18:32:33.959Z","repository":{"id":262327960,"uuid":"859358035","full_name":"decargroup/dkpy","owner":"decargroup","description":"Robust control in Python using D-K iteration... and more!","archived":false,"fork":false,"pushed_at":"2024-11-29T20:59:35.000Z","size":93,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-29T21:30:12.817Z","etag":null,"topics":["control","h-infinity","mu-analysis","mu-synthesis","robust-control"],"latest_commit_sha":null,"homepage":"https://dkpy.readthedocs.io/en/stable/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decargroup.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-18T14:25:53.000Z","updated_at":"2024-11-28T17:25:09.000Z","dependencies_parsed_at":"2024-11-29T21:37:17.192Z","dependency_job_id":null,"html_url":"https://github.com/decargroup/dkpy","commit_stats":null,"previous_names":["decargroup/dkpy"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fdkpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fdkpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fdkpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fdkpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decargroup","download_url":"https://codeload.github.com/decargroup/dkpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228397819,"owners_count":17913540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["control","h-infinity","mu-analysis","mu-synthesis","robust-control"],"created_at":"2024-12-06T02:14:31.241Z","updated_at":"2025-08-01T18:32:33.945Z","avatar_url":"https://github.com/decargroup.png","language":"Python","readme":".. role:: class(code)\n\ndkpy\n====\n\n.. image:: https://github.com/decargroup/dkpy/actions/workflows/test-package.yml/badge.svg\n    :target: https://github.com/decargroup/dkpy/actions/workflows/test-package.yml\n    :alt: Test package\n.. image:: https://readthedocs.org/projects/dkpy/badge/?version=stable\n    :target: https://dkpy.readthedocs.io/en/stable/?badge=stable\n    :alt: Documentation status\n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.14511244.svg\n    :target: https://doi.org/10.5281/zenodo.14511244\n    :alt: DOI\n\n``dkpy`` is a `D-K iteration \u003chttps://doi.org/10.1109/ACC.1994.735077\u003e`_\nlibrary written in Python, aiming to build upon\n`python-control \u003chttps://github.com/python-control/python-control\u003e`_.\n\nThe package is currently a work-in-progress, and no API stability guarantees\nwill be made until version 1.0.0.\n\nD-K iteration\n=============\n\nThe standard robust control problem has the form::\n\n              ┌─────────┐          \n              │         │          \n      w2 ┌────┤    Δ    │◄───┐ z2  \n         │    │         │    │     \n         │    └─────────┘    │     \n         │    ┌─────────┐    │     \n         └───►│         ├────┘     \n    w1 ──────►│    P    ├──────► z1\n         ┌───►│         ├────┐     \n         │    └─────────┘    │     \n         │    ┌─────────┐    │     \n         │    │         │    │     \n       u └────┤    K    │◄───┘ y   \n              │         │          \n              └─────────┘          \n\nwhere ``P`` is the generalized plant, ``K`` is the controller, and ``Δ`` is an\nuncertain LTI system whose H-infinity norm is less than or equal to 1.\n\nSynthesizing a controller that makes the transfer matrix from ``w1`` to ``z1``\nhave an H-infinity norm less than 1 guarantees robust stability by the small\ngain theorem.\n\nWhen ``Δ`` has structure (*e.g.*, ``Δ = diag(Δ1, Δ2)``), this approach is too\nconservative. Robust stability can instead be achieved by synthesizing a\ncontroller whose **structured singular value**, ``µ``, is less than 1. Robust\nperformance problems can also be viewed as robust stability problems with\nstructured uncertainty.\n\nMinimizing ``µ`` is much more challenging than minimizing the H-infinity norm.\nD-K iteration is one method to do so. It relies on the fact that an upper bound\nfor ``µ`` is::\n\n    µ(M) ≤ min σ̅(DMD⁻¹)\n            D\n\nwhere ``D`` is a complex matrix whose structure commutes with ``Δ``. More\nspecifically, for each full block in ``Δ``, the corresponding entry of ``D`` is\n``d I``, where ``d`` is a scalar and ``I`` is the identity matrix. If ``Δ`` has\nany entries of the form ``δ I``, then ``D`` has a full block in the\ncorresponding entry.\n\nD-K iteration has the following steps, where ``D`` is initially identity.\n\n#. Augment ``P`` with ``D`` and ``D⁻¹``, then synthesize an H-infinity controller.\n#. Compute ``µ`` and ``D`` for the closed-loop system without the D-scalings\n   over a range of discrete frequencies.\n#. Fit a transfer matrix to ``D`` and repeat. Stop when ``µ \u003c 1``.\n\nThe D-K iteration process is represented by :class:`dkpy.DkIteration`. The\nsteps of the process are represented by\n\n#. :class:`dkpy.ControllerSynthesis`,\n#. :class:`dkpy.StructuredSingularValue`, and\n#. :class:`dkpy.DScaleFit`.\n\nExample\n=======\n\n.. code-block:: python\n\n    import dkpy\n    import numpy as np\n\n    # Load an example\n    eg = dkpy.example_skogestad2006_p325()\n\n    # Set up the D-K iteration method\n    dk_iter = dkpy.DkIterListOrder(\n        controller_synthesis=dkpy.HinfSynSlicot(),\n        structured_singular_value=dkpy.SsvLmiBisection(),\n        d_scale_fit=dkpy.DScaleFitSlicot(),\n        fit_orders=[4, 4, 4],\n    )\n\n    # Synthesize a controller\n    omega = np.logspace(-3, 3, 61)\n    block_structure = [\n        dkpy.ComplexFullBlock(1, 1),\n        dkpy.ComplexFullBlock(1, 1),\n        dkpy.ComplexFullBlock(2, 2),\n    ]\n    K, N, mu, d_scale_fit_info, info = dk_iter.synthesize(\n        eg[\"P\"],\n        eg[\"n_y\"],\n        eg[\"n_u\"],\n        omega,\n        block_structure,\n    )\n\nContributing\n============\n\nTo install the pre-commit hook, run\n\n.. code-block:: sh\n\n   $ pip install -r requirements.txt\n   $ pre-commit install\n\nin the repository root.\n\nCitation\n========\n\nIf you use this software in your research, please cite it as below or see\n``CITATION.cff``.\n\n.. code-block:: bibtex\n\n    @software{dahdah_dkpy_2025,\n        title={{decargroup/dkpy}},\n        doi={10.5281/zenodo.14511244},\n        url={https://github.com/decargroup/dkpy},\n        publisher={Zenodo},\n        author={Steven Dahdah and Timothy Everett Adams and James Richard Forbes},\n        version = {{v0.1.10}},\n        year={2025},\n    }\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecargroup%2Fdkpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecargroup%2Fdkpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecargroup%2Fdkpy/lists"}