Warning: The data cannot be plotted because it is incompatible with the size

5 views (last 30 days)
I copied an example and a "Long" error massage come up, I am new in Matlab. I hope someone can help me:
The code:
pos = input('Type%OS: ' ) ;
Tp=input ('Type peaktime: ' ) ;
Kv=input ('Type value of Kv: ')
numg=[100];
deng=poly ([0 -36 -100] ) ;
G = tf( numg , deng ) ;
s = tf ([10],1);
sG=s*G;
sG=minreal (sG) ;
K = dcgain( Kv / sG ) ;
'G(s)'
G=zpk(K*G);
z=(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2));
Pm=atan(2*z/sqrt(-2*z^2+sqrt(1+4*z^4)))*(180/pi);
wn=pi/(Tp*sqrt(1-z^2));
w=0.01:0.5:1000;
[M,P]=bode(G,w);
[Gm,Pm,Wcg,Wcp]=margin(G);
Pmreq=atan(2*z/sqrt(-2*z^2+sqrt(1+4*z^4)))*(180/pi);
Pmreqc=Pmreq+10;
Pc=Pmreqc-Pm;
%Design leadCompensator;
beta=(1-sin(Pc*pi/180))/(1+sin(Pc*pi/180));
magpc=1/sqrt(beta);
for k=1:1:length(M);
if M(k)-(1/magpc)<=0;
w=max(k);
break
end
end
%Calc lead compensator zero,pole and gain
zc=w*sqrt(beta);
pc=zc/beta;
Kc=1/beta;
'Gc(s)'
Gc=tf(Kc*[1 zc],[1 pc]);
Gc=zpk(Gc);
'Ge(s)=G(s)Gc(s)'
Ge=G*Gc
sGe=s*Ge;
sGe=minreal(sGe);
Kv=dcgain(sGe);
T=feedback(Ge,1);
step(T)
title('Lead-Compensated Step Response')
pause
The error massage:
Warning: The closed-loop model may be improper because of singular algebraic loops. > In InputOutputModel.feedback at 134 In Example_11_3 at 47 Warning: The data cannot be plotted because it is incompatible with the size of the plot or is missing. > In warning at 25 In wavepack.waveform.draw at 63 In wrfc.plot.draw at 17 In wrfc.plot.init_listeners>LocalRefreshPlot at 122 In DynamicSystem.stepplot at 131 In DynamicSystem.step at 92 In Example_11_3 at 48
  2 Comments
Christiaan
Christiaan on 23 Mar 2015
Dear Hendrik,
Could you tell us, what the perpose of your MATLAB code is, that we could find a possbible workaround? When I looked at your code, the transfer function Kv / sG is more zeros then poles. Therefore this is not a physical system. Therefore the dcgain could not be calculated (0=). Then also no Ge can be calculated. The result is that no feedback look can be constructed, since the transfer function is not defined properly.
Kind regards, Christiaan

Sign in to comment.

Answers (0)

Categories

Find more on Dynamic System Models in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!