- Notifications
You must be signed in to change notification settings - Fork441
Allow static gain StateSpace objects to be straightforwardly created.#107
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ects.Allows StateSpace([],[],[],D), which failed previously. Static gainshave sizes enforced as follows: A 0-by-0, B 0-by-ninputs, Cnoutputs-by-0.Tests added for instantiation, and sum, product, feedback, and appending,of 1x1, 2x3, and 3x2 static gains StateSpace objects.
On Python 2.7, the special case "all states useless" in_remove_useless_states resulted in A=[[0]] (and similarly for B and C).The special case is no longer needed, since empty A, B, C matrices canbe handled. numpy.delete does the right thing w.r.t. matrixsizes (e.g., deleting all columns of a nxm matrix gives an nx0 matrix).Added test for this.
coveralls commentedAug 11, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
raise ValueError("D must have the same column size as B.") | ||
if self.outputs != D.shape[0]: | ||
raise ValueError("D must have the same row size as C.") | ||
raise ValueError("A and C C must have the same number of columns.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think it's oneC
too many here. 😸
D'oh! Thanks, will fix. |
coveralls commentedAug 12, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I like this syntax for creating static gain objects. This PR looks good to me. |
One case not covered by this PR is the "empty" system, Wanting 0-input, 0-output systems may seem like fussiness, but it turns out to be necessary (or useful, at least), in a prototype of |
Conflicts:control/tests/statesp_test.py
coveralls commentedDec 25, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Pull request#110 subsumes this one. |
Lets the (fairly?) obvious StateSpace([],[],[],D) work. One could previously create these by, e.g., converting a static gain TransferFunction to a StateSpace object.
In this case A will be 0-by-0, B 0-by-inputs, and C outputs-by-0. My intuition is that this is a generally correct approach (consider the simplification of _remove_useless_states, for example), but it may require some thought during review.