Is it possible to make a manual Nyquist plot using polar(theta,rho)

12 次查看(过去 30 天)
Hello,
I am trying to create a manual Nyquist plot in MATLAB. I am aware of the nyquist() function but I want to create my own plot. I have a control system whose magnitude and phase angle are defined as:
I know there is a polar(theta, rho) function so I'm trying to use that. When I type the following in for rho (the magnitude), I get an error.
rho=2500/(sqrt(w^6+2525*w^4+62500*w^2))
Inputs must be a scalar and a square matrix.
So then I tried:
rho=2500/(sqrt(w.^6+2525*w.^4+62500*w.^2))
Matrix dimensions must agree.
Basically, what I want to do is use polar(theta,rho) to plot the points of L(jw) from w = 0 to w = infinity (or a large number) in steps of 0.01.
Is there an easier way to do this?

回答(2 个)

Craig Cowled
Craig Cowled 2013-6-15
Jeffrey, I usually keep my data in one complex vector rather than having two vectors (i.e., mag & phase). Then it's a simple thing to plot ...
plot(real(y), imag(y))
It should be fairly straightforward to convert your mag and phase vectors into one complex vector.
Never have used the polar plot function, but I think you should have a look at the length of your mag and phase vectors. Your error message looks like it is telling you that they have different lengths.
  1 个评论
Xiaochen
Xiaochen 2013-12-17
编辑:Xiaochen 2013-12-17
Craig,I have done the plot just like you have said,then the nyquist curve: it is not smooth because this plot uses a discrete FRF vector, my question is, how to do the curve fitting to obtain a smooth nyquist plot?

请先登录,再进行评论。


Jeffrey
Jeffrey 2013-6-15
Thanks for your reply Craig. I have made some progress. I now have two arrays storing my coordinates. When I perform the plot in the last line of code below, I get a weird-looking spiral that does not look anything like the Nyquist plot for this function should look like. I'll keep trying.
polar=[];
complex=[];
K=[0:0.1:100];
for i=1:length(K)
mag = 2500/(sqrt(K(i).^6+2525*K(i).^4+62500*K(i).^2));
phase = atand((250-K(i).^3)/(55*K(i).^2));
z=mag.*exp(phase*sqrt(-1));
polar=[polar; mag phase];
complex=[complex; z];
end
fprintf('magnitude phase\n--------------------\n')
disp(polar)
fprintf('complex\n--------------------\n')
disp(complex)
plot(complex)
  1 个评论
Craig Cowled
Craig Cowled 2013-6-17
Jeffrey, that plot actually does look like a Nyquist plot to me. Perhaps you need to look at a narrower frequency band rather than plotting the entire length of your vector. Just focus on the frequency range of interest.

请先登录,再进行评论。

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by