You are on page 1of 6

>> clf

>> numgh=[1 -4 20];

>> dengh=poly([-2 -4]);

>> 'G(s)H(s)'

ans =

'G(s)H(s)'

>> GH=tf(numgh,dengh)

GH =

s^2 - 4 s + 20

--------------

s^2 + 6 s + 8

>> sgrid(Z,wn)

>> title('Root Locus')

>> pause

>> rlocus(GH)

>> axis([-3 1 -4 4])

>>

>> title('Close-up')

>> z=0.45;
>> wn=0;

>> sqrid(z,wn)

Continuous-time transfer function.

>> Z=0.2:0.05:0.5;

>> wn=0:1:10;

>> sgrid(z,wn)

>> for k=1:3

[K,p]=rlocfin
clear

clf

numg=[1 1.5]

deng=poly([0 -1 -10])

'G(s)'

G=tf(numgh,dengh)

G=

s^2 - 4 s + 20

--------------

s^2 + 6 s + 8

Continuous-time transfer function.

>> rlocus(G)

>> title('Smoothed Root Locus')

>> pos=input('Type %0S ');

Type %0S

>> z=-log(pos/100)/sqrt(pi^2+[log(pos/100)]^2)

z=

[]

sgrid(z,0)
>> title(['Root locus with ',num2str(pos),'%overshoot line'])

>> [K,p]=rlocfind(G)

Select a point in the graphics window

selected_point =

2.3649 - 0.0000i

K=

1.7221

p=

0.1632 + 3.9452i

0.1632 - 3.9452i

>> pause

'T(s)'

ans =

'T(s)'
>> T=feedback(K*G,1)

T=

1.722 s^2 - 6.888 s + 34.44

----------------------------

2.722 s^2 - 0.8883 s + 42.44

Continuous-time transfer function.

>> step(T)

>> title(['Steo Response for K=',num2str(K)])

>> pause

You might also like