-
Notifications
You must be signed in to change notification settings - Fork 441
Disk margin calculations #1146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
murrayrm
merged 40 commits into
python-control:main
from
josiahdelange:jdelange/disk-margins
Jun 25, 2025
Merged
Disk margin calculations #1146
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
f6dada2
Initial version of disk margin calculation and example/test script
josiahdelange bdb82a5
Merge remote-tracking branch 'origin' into jdelange/disk-margins
josiahdelange e46f824
Comment updates: update margins.py header, clarify import exception h…
josiahdelange 1e3af88
More work in progress on disk margin calculation, adding new prototyp…
josiahdelange ba15789
Add disk_margin_plot to subroutine list in comment header in margins.py
josiahdelange e47ae02
Follow-on to ba157895fee83ecc15bd5c1bcd8f56f4e50778a5, add disk_margi…
josiahdelange 20686fe
Merge branch 'python-control:main' into jdelange/disk-margins
josiahdelange f84221d
More work in progress on disk_margin_plot. Corrected a typo/bug in the
josiahdelange edf8040
Merge branch 'jdelange/disk-margins' of github.com:josiahdelange/pyth…
josiahdelange 9d55419
Merge remote-tracking branch 'origin/main' into jdelange/disk-margins
josiahdelange 2cf1545
Further progress/debugging on disk margin calculation + plot utility
josiahdelange bbf37f0
Merge remote-tracking branch 'origin/main' into jdelange/disk-margins
josiahdelange c3efe75
Clean up docstring/code for disk_margin_plot
josiahdelange 63c8523
Clean up docstring/code for disk_margin_plot
josiahdelange cffc3e5
Remove debugging statements, update comments, add unit tests.
josiahdelange 91517f9
Minor change to fix logic to find minimum across DGM, DPM numpy vectors
josiahdelange 86329e0
Rename disk margin example, since unit tests are now written in contr…
josiahdelange d92fb20
Remove unneeded dependencies from margins.py, used for debugging
josiahdelange b2a2edc
Minor updates to docstrings
josiahdelange 1f0ee52
Undo d92fb2045a786581741ddb703819f7ae5865a323
josiahdelange ba41e8c
Minor tweaks to plots in example script for readability
josiahdelange 14eb315
Fix typo in disk_margin_plot.
josiahdelange 0bebc1d
Fix mag2db import hack/workaround and trim down disk_margin docstring.
josiahdelange 87714bd
Add input handling to disk_margin, clean up column width/comments
josiahdelange c17910f
Move disk_margin_plot out of the library into the example script
josiahdelange 5f34a7b
Recommended changes from the linter
josiahdelange f0e2d74
Follow-on to 5f34a7bea410715ee1389a36cd8de3e7001ebf34
josiahdelange a5fcb91
Add disk_margins to function list
josiahdelange 077d538
Whittle down the docstring from disk_margins
josiahdelange 8f0c037
Put more comments in the disk margin example, add example to document…
josiahdelange ce80819
Fixing docstrings
josiahdelange 397efab
Corrected expected values for 'no-slycot' condition in newly-added un…
josiahdelange cc02712
Attempt #2 at 397efabbe7ff9dcc11f2c4309ba73d63ed44d742, based on lint…
josiahdelange e8897f6
Address @murrayrm review comments.
josiahdelange 579f24b
Update formatting per PEP8/@murrayrm review comments. Add additional…
josiahdelange fe79760
Follow-on to e8897f6fb57d1c9f7b7409055383083cdb59ae68: remove now-unn…
josiahdelange b85147e
Update formatting per @murrayrm review comments
josiahdelange 7186406
Merge branch 'python-control:main' into jdelange/disk-margins
josiahdelange eb3af29
Remove temporarily-added string from docstring
josiahdelange bb06c9e
Minor tweak to docstring to fit the word 'function' back into the des…
josiahdelange File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Disk margin example | ||
------------------------------------------ | ||
|
||
This example demonstrates the use of the `disk_margins` routine | ||
to compute robust stability margins for a feedback system, i.e., | ||
variation in gain and phase one or more loops. The SISO examples | ||
are drawn from the published paper and the MIMO example is the | ||
"spinning satellite" example from the MathWorks documentation. | ||
|
||
Code | ||
.... | ||
.. literalinclude:: disk_margins.py | ||
:language: python | ||
:linenos: | ||
|
||
Notes | ||
..... | ||
1. The environment variable `PYCONTROL_TEST_EXAMPLES` is used for | ||
testing to turn off plotting of the outputs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ Frequency domain analysis: | |
|
||
bandwidth | ||
dcgain | ||
disk_margins | ||
linfnorm | ||
margin | ||
stability_margins | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.