17
>> G1=tf([1],[1 0]) G1 = 1 - s Continuous-time transfer function. >> G2=tf([1],[1 1]) G2 = 1 ----- s + 1 Continuous-time transfer function. >> G3=tf([1],[0 1]) G3 =

Parte 1 Practica Control

Embed Size (px)

DESCRIPTION

practica control

Citation preview

>> G1=tf([1],[1 0])

G1 = 1 - s Continuous-time transfer function.

>> G2=tf([1],[1 1])

G2 = 1 ----- s + 1 Continuous-time transfer function.

>> G3=tf([1],[0 1])

G3 = 1 Static gain.

>> G=G1*G2/(1+G1*G2*G3)

G = s^2 + s ----------------------- s^4 + 2 s^3 + 2 s^2 + s Continuous-time transfer function.

>> impulse(G);

>> Shg

Shg

Step(G)

>> [x,y]=ginput

x =

3.5972

y =

1.1674

>> Mp=max(y)

Mp =

1.1674

PROGRAMA 1

g1=tf([1],[1 0]);g2=tf([1],[1 1]);r=1;h=4;for c=1:h d=2*c,a=d-1; g3=tf([r],[0 1]); g=g1*g2/(1+g1*g2*g3); [y,t]=impulse(g); subplot(h,2,a),plot(t,y) ylabel('impulse'); [y1,t]=step(g); subplot(h,2,d), plot(t,y1) ylabel('escalon'); shg r=r-0.32end

Bode(G)

Nyquist(G)

>> pol=G.den{1}

pol =

1 2 2 1 0

>> roots(pol)

ans =

0 -1.0000 -0.5000 + 0.8660i -0.5000 - 0.8660i

Pzmap(G)

Shg>> shg

Rlocus

Shg

Rlocfind(G)>> rlocfind(G)Select a point in the graphics window

selected_point =

-0.4983 - 0.8509i

ans =

0.0261

selected_point =

-0.9960 - 0.0062i

k =

0.9960

raices =

0 -0.5000 + 1.3214i -0.5000 - 1.3214i -1.0000

PROGRAMA 2

g1=tf([1],[2 0]);g2=tf([1],[1 1]);r=1;h=4;for c=1:h d=4*c,a=d-2,b=d-1,e=d-3; g3=tf([r],[0 1]); g=g1*g2/(1+g1*g2*g3); [y,t]=step(g); subplot(h,4,e),plot(t,y); subplot(h,4,a), pol=den{1}; roots(pol); pzmap(g); rlocus(g); subplot(h,4,b),bode(g); subplot(h,4,d),nyquist(g); shg r=r-0.32end