Page 163 - MATLAB an introduction with applications
P. 163
148 ——— MATLAB: An Introduction with Applications
Solution:
>> %MATLAB Program
>> K= [0:0.2:200];
>> for i =1: length (K);
>> deng=poly ([0 –1 –5 –6]);
>> dent=deng+ [0 0 0 K (i) K (i)];
>> R=roots (dent);
>> A=real(R);
>> B=max (A);
>> if B>0
>> R
>> K=K (i)
>> break
>> end
>> end
Computer response:
R =
–10.0000
–0.5000 + 4.4441i
–0.5000 – 4.4441i
–1.0000
A =
–10.0000
–0.5000
–0.5000
–1.0000
B =
–0.5000
Example E3.9: Write a program in MATLAB to obtain the Nyquist and Nichols plots for the following
transfer function for k=30.
( k s + 1)(s + + 3 7 ) i
3 7 )( i s + −
() =
Gs
(s + 1)(s + 3)(s + 5)(s + + 3 7 ) i
3 7 )( i s + −
Solution:
>> %MATLAB Program
>> %Simple Nyquist and Nichols plots
>> clf
>> z= [–1 –3+7*i –3–7*i];
>> p= [–1 –3 –5 –3+7*i –3–7*i];
>> k=30;
>> [num, den] =zp2tf (z’, p’, k);
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09