An error is reported when plotting the Nyquist curve with matlab. Please help me to see the problem and how to modify it?

1 次查看(过去 30 天)
The code show as below:
clc;clear;
%The relevant parameters of series part
H=6.4;
Dp=1140;
K=5;
Dq=150;
wn=2*pi*50;
T1=1.59e-5;
T2=1.59e-6;
P=10e3;
Q=0;
Id=2/3*10e3/220;
Iq=0;
Ud=220;
Uq=0;
Ug=220;
L=4.5e-3;
w0=2*pi*50;
X=w0*L;
syms y;
y=vpasolve(220*220*y*cos(y)==90*pi);
delta=0.0058419042066544734259150800059222;
Em=Ug*cos(delta);
%The relevant transfer function of series part
Fpq=[tf(1,[H Dp 0]),tf(0,1);tf(0,1),tf(1,[K Dq])];
Fpq_u=[tf(1.5*Id,1),tf(1.5*Iq,1);tf(-1.5*Iq,1),tf(1.5*Id,1)];
Fpq_i=[tf(1.5*Ud,1),tf(1.5*Uq,1);tf(1.5*Uq,1),tf(-1.5*Ud,1)];
K=[tf(1,[T1*T2 T1+T2 1]),tf(0,1);tf(0,1),tf(1,[T1*T2 T1+T2 1])];
F1=[tf(-Em*sin(delta),1),tf(cos(delta),1);tf(Em*cos(delta),1),tf(sin(delta),1)];
F2=[tf(0,1),tf(Em/Ug*sin(delta),1);tf(0,1),tf(-Em/Ug*cos(delta),1)];
FL=[tf([L 0],[L*L 0 L*L*w0*w0]),tf(L*w0,[L*L 0 L*L*w0*w0]);tf(-L*w0,[L*L 0 L*L*w0*w0]),tf([L 0],[L*L 0 L*L*w0*w0])];
E=[tf(1,1),tf(0,1);tf(0,1),tf(1,1)];
A= FL * F1 * Fpq * Fpq_i * K + E;
B= FL * (F2 - F1 * Fpq * Fpq_u * K - E);
C= inv(B);
%The output impedance of series part
Zout = - C * A;
%The output impedance of shunt part
Lg=2.3e-3;
Zg = [tf([Lg 0],1),tf(-w0*Lg,1);tf(w0*Lg,1),tf([Lg 0],1)];
L=Zg/Zout;
[V,D]=eig(L);
D
nyquist(D)
The error message is as follows:
Error using DynamicSystem/eig
Too many output arguments.Too many output arguments.
Error in test2 (line 53)
[V,D]=eig(L);

回答(1 个)

Walter Roberson
Walter Roberson 2020-1-15
Your Zg is a transfer function. Your Zout is a symbolic array. You cannot do operations between a transfer function and a symbolic array.
The 's' of the transfer function is not the same as the symbolic variable s in your Zout array.
You can use sym2tf from https://www.mathworks.com/matlabcentral/fileexchange/10816-ovivero-mimotoolbox to convert Zout into a tf .
[V,D]=eig(L);
That will not work on the transfer function L: the eig() function that applies to transfer functions does not support multiple outputs. You can use
P = eig(L); %poles
but the result will not be a transfer function and so you will not be able to nyquist(P)
On the other hand you can directly
nyquist(L)
  2 个评论
Shuai Wang
Shuai Wang 2020-1-15
But I need to sovle the eigenvalue of the transfer function matric L, and draw a nyquist diagram for the eigenvalue function.
Walter Roberson
Walter Roberson 2020-1-15
Well, the eig() function that is available for transfer functions is really just a call to pole()
If you need something else, then you are probably going to need to convert the transfer function into a symbolic system and try to find the eigenvaues . After that you would have the task of figuring out how to create a nyquist diagram out of the eigenvalues.
It seems odd to me that you cannot simply ask to nyquist(L) which will draw the nyquist diagram directly.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Stability Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by