-
Notifications
You must be signed in to change notification settings - Fork 438
add unsupervised calculation on gains for root locus plot. #138
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
add unsupervised calculation on gains for root locus plot. #138
Conversation
fix bug plotting zeros when only zeros in zero exist
fix bug plotting zeros when only zeros in zero exist
…o unsup_rlocus_gain_selection
…and wn constant lines. grids ok in most of the examples.
@gonmolina can you add a citation in the docstring to the book that you used? |
I am sorry for my delay; I lost track of my GitHub notifications feed. I anticipate finishing reviewing this within 2 days. |
…r of poles and zeros
better selection of sgrid zetas and omega
fix a minor bug.
I added a book as a reference. @slivingston I wait for your review. |
@gonmolina thanks working on it now. |
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.
Besides using and
instead of &
, I made several minor requests about style. Otherwise, this is ready.
You do not need to do it now for this PR, but for the future, commits like 6e4d14f that accomplish more than one distinct task should be split into multiple commits. One reason to do so is simple reverting of changes later if we need to.
control/rlocus.py
Outdated
open_loop_poles = den.roots | ||
open_loop_zeros = num.roots | ||
|
||
if (open_loop_zeros.size != 0) & (open_loop_zeros.size < open_loop_poles.size): |
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.
and
should be used instead of &
. The same request applies to lines 198 and 369.
control/rlocus.py
Outdated
|
||
|
||
def _k_max(num, den, real_break_points, k_break_points): | ||
"""" Calculation the maximum gain for the root locus shown in tne figure""" |
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.
misprint: "tne" should be "the". Also, the first word should some verb. E.g., "Calculate"
control/rlocus.py
Outdated
roots = [] | ||
for k in kvect: | ||
curpoly = denp + k * nump | ||
curroots = curpoly.r | ||
if len(curroots) < denp.order: | ||
curroots = np.insert(curroots, len(curroots), np.inf) # if i have less poles than open loop is because i |
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.
The comment here overflows into the next line. For ease of reading, it should be moved to the line before. This style for block comments is given in PEP 8. E.g., after I edit the comment text a little,
if len(curroots) < denp.order:
# If I have fewer poles than open loop, it is because I
# have one at infinity.
curroots = np.insert(curroots, len(curroots), np.inf)
@gonmolina thanks. The changes are good. |
Actually considering the failures on CI testing, there may have been a regression. I am trying to reproduce locally. |
Is there any way to do the test locally in my machine without doing a push? |
There are several new changes outside the scope of the previous review, so I will review these when you tell me that they are ready. Several of the commit messages mention fixing of bugs. If these existed before this PR, can you add regression tests for them, i.e., tests that demonstrate the bugs? |
I made 2 changes:
A regression test for the first problem is: import control as ctrl |
@gonmolina it looks like you are permitting me to push changes to the branch associated with this pull request. Can I do so, to add the regression test that you suggest above? |
yes, you can do it. |
@slivingston I'm trying to clean up some of the PRs over the holiday break. Let me know if you are still working on this one. |
I've run Travis CI on a local branch and all tests are OK: results. @gonmolina, @slivingston Are we ready to merge or is more testing required? Seems like this has to be better than what was there before (placeholder). |
Add gains up to a tolerance is achived.
@slivingston I wait for reviews. I have a file with some examples that are an exersice taken from Franklyn book. Let me know if you need it to test the algorithm. Do I have to put in a particular place? Where? Thanks in advance.