- Notifications
You must be signed in to change notification settings - Fork441
added xperm function: reorder state variables in a ss model.#1039
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Please add tests.
D_perm = sys.D # D remains unchanged | ||
return ss(A_perm, B_perm, C_perm, D_perm) | ||
""" |
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.
This string block should be moved to somewhere accessible to users: the docstring, or a filein examples/.
""" | ||
# TODO: transfer the original sys parameters to the new output sys to preserve labels. | ||
# TODO: create docstrings for this function - WIP |
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.
This will not be merged without a substantial docstring.
coveralls commentedAug 10, 2024
@slivingston Thanks for the feedback. I shall improve it locally before re-submitting a Pull request. Thanks. |
Thanks for contributing! No worries, and I am happy to provide feedback. We can iterate on this PR as much as needed. |
This PR provide a new function xperm, which allows to reorder state variables in a ss model. It is still undocumented (WIP) and there are caveats (named arguments does not propagate to the new ss model created as output from this function).
This PR contains no changes in functionality of the rest of the code, just adds a function that exists in Matlab control system toolbox.
Use case: Obtain the exact set of matrices A,B,C,D from a ss model without recurring to manually reorder them to match a result (like a book exercise).
There are other users cases I think, but for me, I wanted to have xperm as MATLAB does to reorder my obtained matrices to match the book results exactly.