I wrote this 'code' for MATLAB:
close all; clear all;
G=zpk([],[-0.1 -1 -1],[1])
nyquist(G)
hold on;
H=zpk([],[-0.1 -1 -1],[2])
nyquist(H)
J=zpk([],[-0.1 -1 -1],[4])
nyquist(J)
And I would like to have a specific look at the crossings of the Real axis for negative values, specifically surrounding the point, -1 0j.
But I am not satisfied with the precision of the plot, especially around -1. Is there a way to tell MATLAB to calculate longer and get more data points? Ideally not even for the whole plot but maybe just for values with a negative real value, so I don't have a lot of unnecessary computational work?
I use Windows 10 on a Dell-XPS-13-2-in-1 with MATLAB R2021a, in case that is important.
CodePudding user response:
You can specify the frequency vector w
on which the plot points are defined. If you have no idea what that vector should look like, let MATLAB compute it for you and use the same computed vector but after increasing the number of points.
Here, I chose 1000 points for the vector, w = logspace(-20,20,1000);
. How do I specify this? The answer is to use this format [re,im,wout] = nyquist(G);
to get wout
. Now get the min
and max
of log10(wout)
excluding -inf
. This will give you -20
and 20
, respectively. Use these to create the new w
vector with the number of points that you want.
close, clear
G = zpk([], [-0.1 -1 -1], 1)
w = logspace(-20,20,1000);
nyquist(G, w)
hold on;
H = zpk([], [-0.1 -1 -1], 2)
nyquist(H, w)
J = zpk([], [-0.1 -1 -1], 4)
nyquist(J, w)