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 — fix rlocus timeout due to inefficient _default_wn calculation by murrayrm · Pull Request #527 · python-control/python-control

Conversation

@murrayrm

@murrayrm murrayrm commented Jan 30, 2021

Copy link
Copy Markdown
Member

This PR fixes an obscure bug that got pointed out to me a year ago in e-mail from a colleague in Costa Rica:

I have a piece of code that I run for my students. I downloaded the latest control module and it does not print the root locus any more. I think it gets stuck in an iterative process. Nothing changed in the code. I suppose something in the updated version is causing the problem. Has anybody else made a complaint about the root locus?

Turns out that the problem was that he had a very unusual pole/zero pattern in which the algorithm for computing the default natural frequencies to use in plotting the grid was introduced in PR #138. The code essentially used the x-axis major ticks as the starting point for the natural frequencies and then added additional ticks to "complete" the frequencies on the y axis. The problem was that if the x-axis had tick marks that were orders of magnitude different that the y-axis, this could generate a lot of additional natural frequencies (which were subsequently removed a later point in the code).

I didn't want to spend a lot of time on this fix, so I basically put in a check to see when you might end up generating an excessive number of ticks based on this heuristic and switched things so that if that happens, you use the y-axis ticks as the starting point. There's a unit test to make sure it is working right (that also covers the new code).

Sorry, something went wrong.

Uh oh!

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

All reactions
@murrayrm
fix rlocus timeout due to inefficient _default_wn calculation
4ef4906
@coveralls

coveralls commented Jan 30, 2021

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 87.78% when pulling 4ef4906 on murrayrm:fix_rlocus_timeout into 343d5d6 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

sawyerbfuller
sawyerbfuller approved these changes Feb 5, 2021
View reviewed changes
@bnavigator
bnavigator merged commit ff7d827 into python-control:master Feb 5, 2021
@murrayrm
murrayrm deleted the fix_rlocus_timeout branch February 11, 2021 06:15
@murrayrm murrayrm added this to the 0.9.0 milestone Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sawyerbfuller sawyerbfuller sawyerbfuller approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

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

@murrayrm @coveralls @sawyerbfuller @bnavigator
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 01402503 — 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.