GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add unsupervised calculation on gains for root locus plot. by gonmolina · Pull Request #138 · python-control/python-control

Conversation

@gonmolina

@gonmolina gonmolina commented Mar 21, 2017

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gonmolina added 4 commits March 20, 2017 22:22
@gonmolina
add unsupervised calculation on gains for root locus plot.
ffc3041
@gonmolina
fix bug concatenating zero dimensional array
2aada8b
@gonmolina
fix bug concatenating zero dimensional when test in matlab_test.py
7130434
@gonmolina
fix bug with array==0! problem test in matlab_test.py
8b829cc
@coveralls

coveralls commented Mar 21, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 77.778% when pulling 8b829cc on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gonmolina added 2 commits March 22, 2017 22:14
@gonmolina
fix bug with axis limits with no asymptotes
d4cbc95
fix bug plotting zeros when only zeros in zero exist
@gonmolina
fix bug calculating kmax
6d55d57
@coveralls

coveralls commented Mar 23, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 77.778% when pulling 6d55d57 on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gonmolina added 5 commits March 26, 2017 15:36
@gonmolina
add unsupervised calculation on gains for root locus plot.
01e33ea
@gonmolina
fix bug with axis limits with no asymptotes
95d6908
fix bug plotting zeros when only zeros in zero exist
@gonmolina
add sgrid to rlocus plot, to the last version of unsupervised gains.
1b20bd4
@gonmolina
add origin to rlocus plot and x=0 line (zeta =0 grid line).
5e47d1f
@gonmolina
add grid arguments in docstring.
ebd3904
@coveralls

coveralls commented Mar 31, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.4%) to 76.955% when pulling ebd3904 on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston slivingston self-assigned this Mar 31, 2017
gonmolina added 3 commits March 31, 2017 18:00
@gonmolina
Merge remote-tracking branch 'origin/unsup_rlocus_gain_selection' int…
3fb2c86
…o unsup_rlocus_gain_selection
@gonmolina
reorder code that calculate defaults damp coefficents constant lines …
de87bb0
…and wn constant lines.

grids ok in most of the examples.
@gonmolina
formatting code to make easier sgrid() function in future.
5438746
@coveralls

coveralls commented Apr 2, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 76.822% when pulling 5438746 on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston

slivingston commented May 28, 2017

Copy link
Copy Markdown
Member

@gonmolina can you add a citation in the docstring to the book that you used?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston

slivingston commented May 28, 2017

Copy link
Copy Markdown
Member

I am sorry for my delay; I lost track of my GitHub notifications feed. I anticipate finishing reviewing this within 2 days.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gonmolina added 2 commits June 8, 2017 18:11
@gonmolina
trying that algorithm work with 0 degrees root locus with equal numbe…
1e356b8
…r of poles and zeros
@gonmolina
adding some support for 0 degrees root locus.
6c813ce
better selection of sgrid zetas and omega
@coveralls

coveralls commented Jun 13, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage decreased (-0.6%) to 76.68% when pulling 6c813ce on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gonmolina
add book reference of root locus calculation.
6e4d14f
fix a minor bug.
@coveralls

coveralls commented Jun 13, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage decreased (-0.9%) to 76.428% when pulling 6e4d14f on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gonmolina

gonmolina commented Jun 13, 2017

Copy link
Copy Markdown
Contributor Author

I added a book as a reference.
I added possibility to draw a grid on s-plane similar to matlab (argument grid = True).
I have tested a lot this function and works fine.
I have wrote a script with several tests with a lot of cases and root locus figures seem to be fine. If you think this script can help you to test the algorithm I can add it to the repository (please tell me where is the right place to add it).
I have added support of 0 degrees root locus (positive feedback or k<0) in the algorithm. This works fine in all cases that I have tested, but I couldn't solve when the num.order=den.order. To solve this problem a complete new solution have to be written, mainly when lines are plotted and when roots are sorted. I raise an error when a root locus of this kind is demanded.

@slivingston I wait for your review.
Thanks in advance.
Gonzalo

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gonmolina added 2 commits June 14, 2017 10:07
@gonmolina
fix minor bug when fartest point is zero.
a680c6a
@gonmolina
fix minor bugs when that solves problems in paricular cases
81b73a6
@slivingston

slivingston commented Jun 25, 2017

Copy link
Copy Markdown
Member

@gonmolina thanks working on it now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston slivingston mentioned this pull request Jun 25, 2017
Add smart selection of gains for root locus plot. Calculation of break… #132
Closed
slivingston
slivingston previously requested changes Jun 25, 2017
View reviewed changes

@slivingston slivingston left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 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):

@slivingston slivingston Jun 25, 2017

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 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"""

@slivingston slivingston Jun 25, 2017

Copy link
Copy Markdown
Member

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"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread control/rlocus.py Outdated
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

@slivingston slivingston Jun 25, 2017

Copy link
Copy Markdown
Member

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gonmolina
Fixed requested issues.
62ed2aa
@slivingston

slivingston commented Jul 1, 2017

Copy link
Copy Markdown
Member

@gonmolina thanks. The changes are good.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston

slivingston commented Jul 1, 2017

Copy link
Copy Markdown
Member

Actually considering the failures on CI testing, there may have been a regression. I am trying to reproduce locally.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gonmolina

gonmolina commented Jul 1, 2017

Copy link
Copy Markdown
Contributor Author

Is there any way to do the test locally in my machine without doing a push?
I think I can fix it....

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston

slivingston commented Jul 1, 2017

Copy link
Copy Markdown
Member

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gonmolina

gonmolina commented Jul 1, 2017

Copy link
Copy Markdown
Contributor Author

I made 2 changes:

  • I added line 268 to ensure kmax> 0 when all the singular points are in 0. Problems getting kvect when deal with systems of the form 1/s^n. I do not think this is the problem while building.
  • I greatly increased the gain after the kmax in line 209 so that the lines of the roots locus reach the zeros (in the figure) for all cases. I think this can be the problem since several groups of equal roots turn out to be about the same for too large gains. Solution: fewer points after kmax, smaller maximum gain, and separate them logarithmically. This problem was clear when I was trying to solve 0 degrees root locus with for systems with equal number of zeros and poles.

A regression test for the first problem is:

import control as ctrl
sys1=ctrl.tf([1],[1,0,0])
r,k = ctrl.rlocus(sys1, grid=True)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gonmolina
fix build problem (numerical problem)
4eedde4
@coveralls

coveralls commented Jul 1, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.6%) to 76.741% when pulling 4eedde4 on gonmolina:unsup_rlocus_gain_selection into 6ada795 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slivingston

slivingston commented Sep 17, 2017

Copy link
Copy Markdown
Member

@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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gonmolina

gonmolina commented Sep 18, 2017

Copy link
Copy Markdown
Contributor Author

yes, you can do it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm

murrayrm commented Dec 27, 2017

Copy link
Copy Markdown
Member

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm murrayrm added this to the 0.8.0 milestone Dec 27, 2017
@murrayrm

murrayrm commented Jan 3, 2018

Copy link
Copy Markdown
Member

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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm
murrayrm dismissed slivingston’s stale review January 5, 2018 05:31

Changes have been implemented.

@murrayrm
murrayrm merged commit 92ccf2d into python-control:master Jan 5, 2018
@murrayrm murrayrm mentioned this pull request Jan 30, 2021
fix rlocus timeout due to inefficient _default_wn calculation #527
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slivingston slivingston slivingston left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@slivingston slivingston

Labels

None yet

Projects

None yet

Milestone

0.8.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@gonmolina @coveralls @slivingston @murrayrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.