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

fix gain handling in rlocus and sisotool#809

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

Merged
murrayrm merged 6 commits intopython-control:mainfromsawyerbfuller:kvect
Dec 16, 2022

Conversation

sawyerbfuller
Copy link
Contributor

@sawyerbfullersawyerbfuller commentedDec 7, 2022
edited
Loading

current problem is that if you want to pass an initial gain tosisotool to plot as starting point gain in the various plots, an error is raised if it is not an array. so you have to dosisotool(sys, kvect=(1.1, )) which is awkward. With this fix,you can dosisotool(sys, kvect=1.1) update: changed function call to look likesisotool(sys, initial_gain=1.1)

@coveralls
Copy link

coveralls commentedDec 7, 2022
edited
Loading

Coverage Status

Coverage decreased (-0.02%) to 94.785% when pulling15543ff on sawyerbfuller:kvect into9d65bf8 on python-control:main.

@sawyerbfuller
Copy link
ContributorAuthor

Added some more fixes to thekvect kwarg in rlocus and sisotool.kvect was intended to let the user specify their own array of gains, but it wasn't being used that way. Two primary changes aim to make it do what I believe was its intended purpose:

  1. I deprecatedkvect in sisotool, because you probably don't want to specify your own set of gains to plot in the rlocus plot in sisotool anyway. You probably want to use the ones that are computed automatically. Especially because sisotool/rlocus allows you to zoom in, and it re-computes gain points for the new zoomed root locus plot, to get a more precise click. Instead, there is now a new keyword,initial_gain that allows the user to specify the starting value of the closed-loop gain to plot in its four plots.kvect can be still given, and it reproduces the old behavior of sisotool usingkvect[0] as the initial gain, and ignoring everything else inkvect. And there is now a deprecation warning.

  2. For rlocus, you might actually want to specify your ownkvect if for example you only want to see where the roots go for a certain set of gains. But this wasn't what was happening: the rlocus plot ignores thekvect argument altogether and essentially always uses its own pre-computed gains. This is because any time the axis range is changed,kvect is automatically recomputed, which is basically every time the plot is created. I fixed it so that the new behavior is that ifkvect is supplied to rlocus, it is no longer recomputed automatically if the plot is zoomed.

  3. Other improvements:

  • docstring fixes
  • pep8 cleanups
  • changemymat toroot_array in rlocus to better describe its function

@sawyerbfullersawyerbfuller changed the titleallow sisotool to receive kvect as a singleton or an arrayfix gain handling in rlocus and sisotoolDec 9, 2022
Copy link
Member

@murrayrmmurrayrm left a comment

Choose a reason for hiding this comment

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

LGTM

@murrayrmmurrayrm linked an issueDec 14, 2022 that may beclosed by this pull request
@murrayrmmurrayrm merged commitb1d55a1 intopython-control:mainDec 16, 2022
@murrayrmmurrayrm added this to the0.9.3 milestoneDec 24, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@murrayrmmurrayrmmurrayrm left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
0.9.3
Development

Successfully merging this pull request may close these issues.

rlocus withkvect argument doesn't compute good limits
3 participants
@sawyerbfuller@coveralls@murrayrm

[8]ページ先頭

©2009-2025 Movatter.jp