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 — Refine automatic contour determination in Nyquist plot by bnavigator · Pull Request #620 · python-control/python-control

Conversation

@bnavigator

@bnavigator bnavigator commented May 1, 2021

Copy link
Copy Markdown
Contributor

Fix for #613

import control
import matplotlib.pyplot as plt

G =  control.tf([1], [1,1,0,0,0])

count, contour1 = control.nyquist_plot(G, label='indent_radius default (0.1)',
                     return_contour=True)

R = 0.11
count, contour2 = control.nyquist_plot(G, indent_radius=R,
                                      return_contour=True,
                                      label=f'indent_radius={R}')

ax = plt.gca()
ax.set_aspect(1)
ax.legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0.)

plt.figure()
cp = plt.plot(contour1.real, contour1.imag, '-',
              label='indent_radius default (0.1)')
c = cp[0].get_color()
plt.plot(contour1.real, -contour1.imag, '--', color=c)
cp = plt.plot(contour2.real, contour2.imag, '-',
              label=f'indent_radius={R}')
c = cp[0].get_color()
plt.plot(contour2.real, -contour2.imag, '--', color=c)
ax = plt.gca()
ax.legend()
ax.set_aspect(1)
ax.set_xlim([-0.2, 0.2])
ax.set_ylim([-0.2, 0.2])
ax.grid()
ax.set_title(r'Nyquist Contour $\Gamma$',)
plt.show()

Figure_1
Figure_2

Sorry, something went wrong.

Uh oh!

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

All reactions
bnavigator added 5 commits May 1, 2021 15:58
@bnavigator
remove duplicate code for omega determination
0a82909
@bnavigator
add some omegas for quarter circle around origin poles in nyquist con…
31cd4d0
…tour
@bnavigator
only evaluate interactive code when __main__
38d6909
@bnavigator
mplcleanup for all nyquist tests
4a4d088
@bnavigator
add test for quarter circle
5cf0358
@bnavigator
bnavigator force-pushed the freqplot-omega branch from abec61f to 5cf0358 Compare May 1, 2021 20:48
@coveralls

coveralls commented May 1, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 89.641% when pulling 5cf0358 on bnavigator:freqplot-omega into 9f27293 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

@josujugo

josujugo commented May 1, 2021

Copy link
Copy Markdown

Hi,

I am trying to replicate this code in the master version and I am getting different plots. What am I doing wrong?

download-3

download-2

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator

bnavigator commented May 1, 2021

Copy link
Copy Markdown
Contributor Author

The master branch does not have the changed code. You have to checkout the PR brach.

All reactions

Sorry, something went wrong.

Uh oh!

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

@josujugo

josujugo commented May 1, 2021

Copy link
Copy Markdown

Ok, thanks. I have misunderstood it.

All reactions

Sorry, something went wrong.

Uh oh!

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

@murrayrm murrayrm linked an issue Jun 5, 2021 that may be closed by this pull request
Nyquist plot with imaginary poles, semi-circles only working after 'trick' #613
Closed
@murrayrm
murrayrm merged commit 618ea45 into python-control:master Jun 16, 2021
@murrayrm murrayrm added this to the 0.9.1 milestone Dec 30, 2021
@bnavigator
bnavigator deleted the freqplot-omega branch February 18, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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

Development

Successfully merging this pull request may close these issues.

Nyquist plot with imaginary poles, semi-circles only working after 'trick'

Uh oh!

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

4 participants

@bnavigator @coveralls @josujugo @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 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.