bugGNU Octave - Bugs: bug #53164, [octave forge] (control) Use...

 
 

bug #53164: [octave forge] (control) Use clearer limits for nyquist() plot

Submitted by:  None
Submitted on:  Thu 15 Feb 2018 02:52:24 PM UTC  
 
Category:  Octave Forge Package Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Tomasz Sokolowski Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.2.1
Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Fri 23 Feb 2018 10:43:50 PM UTC, comment #20: 

this is fixed in control-3.1.0
this can be closed as fixed.

Doug Stewart <dastew>
Fri 16 Feb 2018 01:38:17 PM UTC, comment #19: 

I plan to push the 2 changes that have been suggested in this bug report.
Hopefully today.

Doug Stewart <dastew>
Fri 16 Feb 2018 04:53:22 AM UTC, comment #18: 

in file
 _frequency_vector_.m
at line 176
if I uncomment that line then the plot looks better. 
      dec_min -= 0.5;

this amount can be adjusted to give us more or less tail!

Doug Stewart <dastew>
Fri 16 Feb 2018 12:47:59 AM UTC, comment #17: 

Yes, I tried your suggestion and it looks good here.

We still should make the starting frequency be lower
when there is a pole at the origin (integrator)

Doug Stewart <dastew>
Thu 15 Feb 2018 10:54:20 PM UTC, comment #16: 

Does adding a marker to the critical point require anything other than changing

h = plot (pos_args{:}, neg_args{:});

to

h = plot (pos_args{:}, neg_args{:},-1,0,'r+');

?

Alexander Wilms <alexanderw>
Thu 15 Feb 2018 07:30:02 PM UTC, comment #15: 

Re-titling report, and shifting category to Octave Forge package as nyquist is not a core Octave function.  Making this a feature request and downgrading the severity to Minor.

Attaching the Matlab png to this bug report as the external links may break in the future.


Rik <rik5>
Project Administrator
Thu 15 Feb 2018 06:57:18 PM UTC, comment #14: 

Yes I like the fact that matlab marks -1 with a red + because this is the important point.

This could be re-titled and mark as a wish.

Doug Stewart <dastew>
Thu 15 Feb 2018 06:51:33 PM UTC, comment #13: 

Thanks for the additional information, and
thanks for your report.

Michael Godfrey <godfrey>
Project Member
Thu 15 Feb 2018 06:44:28 PM UTC, comment #12: 

I was comparing to Wolfram because I don't have MatLab on my laptop and wolfram was the handy thing showing the result as I wanted it to be.
However, as I wrote, I asked my collegue, who have got MatLab to check how it behaves on this example and the result was:
http://prntscr.com/if8pfo
(without negative frequencies)
He used the same code I posted in the first message.

Anonymous
Thu 15 Feb 2018 06:33:34 PM UTC, comment #11: 

Minor point: the person who reported this issue
was comparing the result to Wolfram, not Matlab.

Might try Matlab just for interest.

Michael Godfrey <godfrey>
Project Member
Thu 15 Feb 2018 06:17:26 PM UTC, comment #10: 

The solution you posted works perfect. Thank you for help.
I agree - not incorect, just different.

Anonymous
Thu 15 Feb 2018 06:12:12 PM UTC, comment #9: 

I think this can be closed. It is not incorrect
just different than Matlab.

Doug Stewart <dastew>
Thu 15 Feb 2018 06:10:46 PM UTC, comment #8: 

I see your point. here is one way to do it

s=tf('s')
 sys=.5/(s*(s+1)^2)
figure(1)
[ ~, ~, w]=nyquist(sys);
 nyquist(sys,w*.1)
 figure(2)
 bode(sys)

I will put it on my todo list and see why
octave's nyquist shows only part of what matlab's
nyquist shows.

Doug Stewart <dastew>
Thu 15 Feb 2018 06:03:47 PM UTC, comment #7: 

The tails can be useful - I'm working on describing function (control systems theory) where it's important whether the plot of the decribing function of the nonlinear part and the nyquist plot of the linear part intersect.
In this case (three-position regulator without hysteresis) - they can but in the part which isn't visible.

Reading the help I found the solution - giving the frequency range I was able to get desired plot.

I asked my collegue to draw this plot in MatLab and these parts of the plot were visible by default.
Generally speaking - that's not a bug but it can be misleading.
In this case it was easy to find out that something's wrong because the equation was simple. However, for something more complicated not seeing a part of the plot can be a problem.

Anonymous
Thu 15 Feb 2018 05:42:39 PM UTC, comment #6: 

ok, now we see the same.

Do these tails have any important information in them?
I think the Important parts are in relation to -1 on the real axis.
Therefore the tails are not very important.
 I am sure that if you read the help for nyquist you should be able to extent the tails.

Doug Stewart <dastew>
Thu 15 Feb 2018 05:34:52 PM UTC, comment #5: 

Yes, now I undestood what the difference is. The parts of the plot going to +/- infinity are missing.

Anonymous
Thu 15 Feb 2018 05:24:19 PM UTC, comment #4: 

Please explain what difference you are seeing.
Is it that octave does not have the long tails on the curve, after it crosses the x asis?

Doug Stewart <dastew>
Thu 15 Feb 2018 05:15:53 PM UTC, comment #3: 

The numerator doesn't change anything in my case.
I copied you code to Octave and I still get the Nyquist plot like in the attachment not like in wolfram.

Anonymous
Thu 15 Feb 2018 05:09:31 PM UTC, comment #2: 

you have different numerators.

I tried this and it looks the same a alpha

s=tf('s')
 sys=.5/(s*(s+1)^2)
figure(1)
 nyquist(sys)
 figure(2)
 bode(sys)

Doug Stewart <dastew>
Thu 15 Feb 2018 03:01:52 PM UTC, comment #1: 

Link to Wolphram Alpha is broken, here is correct one:
https://goo.gl/4pjBN1

Anonymous
Thu 15 Feb 2018 02:52:24 PM UTC, original submission:  

I tried to get Nyquist plot of a system descripted with equation:
0.5/(s*(1+s)^2)
I tried it on locally installed Octave and Octave online with same results.
The code I used is:

octave:1> s=tf('s')
octave:2> sys=1/(s*(s+1)^2)
octave:3> nyquist(sys)

I tried also "sys=tf([1],[1 2 1 0])" but with the same result.
In the attachment there is the result from Octave. Here is the correct result from wolfram alpha:
https://www.wolframalpha.com/input/?i=nyquist+(0.5%2F(s*(1%2Bs)%5E2))

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #43330:  matlab.nyquist.png added by rik5 (55KiB - image/png)
file #43328:  octave-online-line-5.png added by None (32KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by i7tiol (Updated the item)
  • -email is unavailable- added by alexanderw (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-24 i7tiol StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2018-02-15 mtmiller SummaryUse clearer limits for nyquist() plot => [octave forge] (control) Use clearer limits for nyquist() plot
    2018-02-15 rik5 Attached File- => Added matlab.nyquist.png, #43330
        CategoryPlotting => Octave Forge Package
        Severity3 - Normal => 2 - Minor
        Item GroupIncorrect Result => Feature Request
        StatusNone => Confirmed
        Operating SystemMicrosoft Windows => Any
        SummaryIncorrect Nyquist plot => Use clearer limits for nyquist() plot
    2018-02-15 None Attached File- => Added octave-online-line-5.png, #43328

    Back to the top


    Powered by Savane 3.5