-
Notifications
You must be signed in to change notification settings - Fork 438
StateSpace.zero() now supports MIMO systems #205
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
Conversation
3 similar comments
Calculating the zeros directly as a generalized eigenvalue problem only works if the system is square. The paper you linked talks about the non-square case on page 9. Since square systems are common, I think this is a worthwhile pull request, but I do think the limitation should be noted in the doc string. I suppose a non-square system will cause scipy.linalg.eigvals() to throw its own error, but I think it would be better to catch it here, since we can provide a more enlightening error message. |
|
Alternatively (if available) @calcmogul The squareness is about the system shape, 3 inputs and 2 outputs system cannot be used with the generalized eigenvalue method. |
scipy.linalg.eigvals() is used to solve the generalized eigenvalue problem. The zero locations used in the unit test were obtained via the zero() function in MATLAB R2017b with two more digits of precision added based on the results of StateSpace.zero().
Oh, that makes a lot more sense. The latest patch uses AB08ND if available to produce square matrices scipy.linalg.eigvals() can use. I'd like the non-Slycot version to have feature parity though, so I'm going to keep working on that. The paper's suggestion of augmenting the non-square matrices with pseudo-random numbers isn't returning sensible eigenvalues for the test case (it always returns all 1's), but the input matrices to eigvals() look like what the paper specifies. I didn't like the idea of random numbers anyway. I'm going to look into translating AB08ND's algorithm into Python instead. The logic and Fortran syntax hasn't been hard to follow so far. |
scipy.linalg.eigvals() is used to solve the generalized eigenvalue
problem. The zero locations used in the unit test were obtained via the
zero() function in MATLAB R2017b with two more digits of precision added
based on the results of StateSpace.zero().