GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — Add passivity module, ispassive function, and passivity_test. Introduces optional dependency cvxopt. by Mark-Yeatman · Pull Request #739 · python-control/python-control Conversation
Contributor
I made a discussion topic a couple of weeks ago about making a passivity module, @murrayrm suggested making a draft PR. Here it is!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Mark-Yeatman
marked this pull request as ready for review
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
The initial disussion is here: #732 Thanks for the initiative! As far as I understand, you introduce 3 new depenendies because you work with symbolic matrices:
Would it be possible to implement the matrix handling and solving with NumPy and SciPy functions only? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I'm about 60% sure cvxopt is necessary to solve the linear matrix inequality. Sympy and lmi_sdp can definitely be dropped. Cvxopt only requires BLAS/LAPACK, which it seems that slycot also requires. So this passivity package could be setup to be optional? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CVXOPT is available on conda-forge and as wheels with bundled libraries on PyPI. They link and bundle OpenBLAS. I am not sure how well that plays with "Generic" Netlib linked NumPy and Slycot packages. But we can worry about that when it comes up. It must be installed in the test suite, so we need to add it to the requirements. It can be set as optional similar to how we do it with Slycot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnavigator I've removed sympy and lmi-sdp from the function, and I attempted to setup cvxopt in the test suite. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some initial review comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Ben Greiner <[email protected]>
There was an error while loading. Please reload this page.
|
Coverage increased (+0.02%) to 94.549% when pulling c2255b0 on Mark-Yeatman:passivity-tools into d98ed29 on python-control:main. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
A few comments below. Also, it would be nice to add a unit test to make sure that if cvxopt is not installed that the proper exception is raised.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@bnavigator I believe I've resolved all the outstanding review comments? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One more review comment
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Ben Greiner <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Instead of writing things in the standard SDP notation, you might want to use CVXPY notation (which acts like YALMIP) so you don't have to use the tiresome basis matrices. Also note that strictly proper systems cannot be checked via positive real lemma via strict inequalities due zero D + D.T block forcing the optimization problem to infeasibilty. You either have to use extended version or nudge D block with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I would definitely be up for using cvxpy, but it looks like it has more dependencies than just using cvxopt (https://www.cvxpy.org/install/#install-from-source vs https://cvxopt.org/install/#building-and-installing-from-source)? That seems like an issue for a project maintainer. You're right about the D = 0 case, I will nudge it as you suggested. Thanks for catching that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CVXPY: I don't think it is necessary to employ a full domain specific language with all its dependencies for one hardcoded optimization problem. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
… rename is_passive to ispassive for naming convention consistency. Autoformat to pep8.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…led in an object oriented style as a LTI class member. Added unit tests for transfer function and oo style calls. Ran autopep8 on lti.py.
|
I took the liberty of fixing the missing skips. I hope you don't mind. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready for a merge. Any improvements welcome with subsequent PRs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.