Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
toaster-code wants to merge1 commit intopython-control:main
base:main
Choose a base branch
Loading
fromtoaster-code:added_xperm_function

Conversation

toaster-code
Copy link

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.

Copy link
Member

@slivingstonslivingston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please add tests.

toaster-code reacted with thumbs up emoji
D_perm = sys.D # D remains unchanged

return ss(A_perm, B_perm, C_perm, D_perm)
"""
Copy link
Member

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
Copy link
Member

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
Copy link

Coverage Status

coverage: 94.421% (-0.3%) from 94.694%
when pullingc102929 on toaster-code:added_xperm_function
into373ff11 on python-control:main.

@toaster-code
Copy link
Author

@slivingston Thanks for the feedback.
Sure. I shall try to write some examples to the folder "examples" and write some docstrings.
This is my first time contributing to a substantial project, so sorry if the contribution is still raw or incomplete.
All tips and advises are welcome.

I shall improve it locally before re-submitting a Pull request.

Thanks.

@slivingstonslivingston self-assigned thisAug 13, 2024
@slivingston
Copy link
Member

Sure. I shall try to write some examples to the folder "examples" and write some docstrings. This is my first time contributing to a substantial project, so sorry if the contribution is still raw or incomplete. All tips and advises are welcome.

I shall improve it locally before re-submitting a Pull request.

Thanks for contributing! No worries, and I am happy to provide feedback. We can iterate on this PR as much as needed.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@slivingstonslivingstonslivingston requested changes

Assignees

@slivingstonslivingston

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@toaster-code@coveralls@slivingston

[8]ページ先頭

©2009-2025 Movatter.jp