Skip to content

Incorrect nyquist plot #830

Closed
Closed

Description

@Avitan01

I'm using the control package with python 3.10 in Pycharm and Jupiter lab.
I have stumbled upon a possible issue while trying to create a Nyquist plot for a simple system

import control as ct

s = ct.tf('s'))
plant_1 = 1/(s*(s + 5)*(s + 7)))
ct.nyquist_plot(plant_1)

The result I'm getting is this:

download

While in MATLAB I'm getting different results

clear all;
close all;
clc;


s = tf('s');
plant_1 = 1/(s*(s + 5)*(s + 7));
nyquistplot(plant_1)

image

Is there a limitation that might be causing this issue or am I missing something?

Activity

  1. bnavigator commented on Dec 31, 2022

    @bnavigator
    Contributor

    Look at the y-axis scale. The nyquist plot from control cuts off at max_curve_magnitude and scales the "infinity" loop for display within the plot boundaries.
    https://python-control.readthedocs.io/en/0.9.2/generated/control.nyquist_plot.html#control.nyquist_plot

  2. henklaak commented on Feb 2, 2023

    @henklaak
    Contributor

    Behaviour that will 'surprise' many, I guess. The documentation is not explicit about it and the default value of 20.

    How about not drawing the large magnitudes at all? Just clip the traces at the limit with a ≫to indicate direction?

  3. murrayrm commented on Feb 2, 2023

    @murrayrm
    Member

    If you clip the traces, then it is harder to see the number of net encirclements. Especially if there is more than one. For example

    sys = ct.tf([1], [1, 3, 2]) * ct.tf([1], [1, 0, 1])
    ct.nyquist_plot(sys)
    

    which generates:
    multi-encirclement

  4. murrayrm commented on Feb 2, 2023

    @murrayrm
    Member

    We should definitely make sure all of this is well-documented, though.

  5. henklaak commented on Feb 3, 2023

    @henklaak
    Contributor

    I'll take a stab at this (the documenting part), expect PR.

  6. added this to the 0.9.4 milestone on Mar 26, 2023
  7. self-assigned this
    on Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions