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 — Improved speed of ctrb and obsv functions by Jpickard1 · Pull Request #941 · python-control/python-control Conversation
Contributor
Current implementation of ctrb and obsv functions utilize Additionally, I added an optional parameter This appears to pass all test cases.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…xponentiation following the MATLAB implimentation of obsv
|
There was an error while loading. Please reload this page.
|
coverage: 95.009% (+0.007%) from 95.002% |
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.
Thanks for the contribution!
A couple of 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.
Co-authored-by: Sawyer Fuller <[email protected]>
Co-authored-by: Sawyer Fuller <[email protected]>
|
Dear Prof. Fuller and others, Thank you for the prompt reply. Concerning: “Have you benchmarked this to confirm it's actually faster? Also, I am not aware of a use case where the obsv or ctrb matrix must be repeatedly evaluated - is there one?” I have benchmarked the speed of these two methods in this Google Colab notebook which is available here: https://colab.research.google.com/drive/1nDQgmJuQE-Q6H2OZfi4QUstJB44JikHN?usp=sharing. This appears to create a improvement in speed (see the plot below). The notebook creates two functions I agree that there are not many use cases where we need to repeatedly create the controllability or observability matrices, but I have lately been working on a problem of biological sensor selection where I find it beneficial to create many observability matrices. In particular, I am applying several sensor selection algorithms to design my output matrix Regarding: “can you add a unit test for obsv and ctrb for the t < n case?” I have added the test cases Concerning: “can you define n in the docstrings?” I have removed The addition of this parameter may seem unnecessary, but it is relevant to a method I am currently using. Since it doesn't break anything to add Please let me know what else! Thank you very much. Best, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is actually not only for performance but for accuracy reasons, the right way to go. Hence it is an improvement anyways. It is basically a Krylov space argument that leads to repeated powers of However, this test is fundamentally broken for production code; i) it is only a theoretical tool since the powers blow up regardless ii) rank decision is a very tricky thing to nail it down without false positives and false negatives iii) as if it is not enough, the answer is a binary yes or no. It does not give any indication of how close we are dancing to uncontrollability/unobservability. A typical and best bang for buck candidate is D. Boley's test if you are really looking for a better test which computes the cancellation distance in our context (but originally checks for the rank deficiency metric) Then you can put a limit on the distance and you can tie it to the matrix norms and so on. In my opinion a much better candidate instead of a lower semi-continuous function. I have the regular version here in case you want to check it out. The article is in the docstring. I hope academia emphasizes a bit more that the Kalman test is just a theoretical tool and we use it just on the homework problems. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dear Ilhan, Thank you. I agree there are several issues with utilizing the Kalman test for determining controllability or observability, and thank you for sharing the test by Boley. My particular motivation for this change is to use Gramians to determine observability. This is advantageous to me because in addition to providing a Yes/No test, the Gramian provides information on the principal directions of controllability/observability. Since discrete, finite horizon Gramians can be computed in terms of While there are these limitations that you have noted, it seems to me that we are in agreement this is a beneficial argument to add for the Thank you. Best, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dear all, It appears that this is failing with the below error related to Thank you. Best, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It's failing in parts of the code unaffected by your change, so don't worry about in this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I tried re-running the failing test once or twice but it kept failing. I agree that it has nothing to do with this PR, so I'll merge it. |
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.