Transcript
Page 1: Terminado Lab de Control

2)

A=[ -1 0.5 0.5 -0.5];B=[ 0 2];C=[ 1 1 1 0 0 1];D=[ 0 0 0];%solucion espacio estadoI=[ 1 0 0 1];X0=[ 0 0];syms sx1=inv(s*I-A);%Entrada u=5u=5/s;x2=(B*u+X0);x=x1*x2;x1=ilaplace(x(1));x2=ilaplace(x(2));figure(1)ezplot(x(1))

-6 -4 -2 0 2 4 6

0

500

1000

1500

2000

2500

3000

t

20 - 20 exp(-(3 t)/4) (cosh((51/2 t)/4) + (3 51/2 sinh((51/2 t)/4))/5)

Page 2: Terminado Lab de Control

figure(2)ezplot(x(2))

-6 -4 -2 0 2 4 6

-2000

-1500

-1000

-500

0

t

40 - 40 exp(-(3 t)/4) (cosh((51/2 t)/4) + (2 51/2 sinh((51/2 t)/4))/5)

3)

A=[ -1 0.5

0.5 -0.5];

B=[ 0

2];

C=[ 1 1

1 0

0 1];

D=[ 0

0

0];

Continuous-time state-space model.

>>sys=ss(A,B,C,D)%Entrada f=5N>>t=0:0.025:100;>>u=5*ones(size(t));>>[y t x]=lsim(sys,u,t)

Page 3: Terminado Lab de Control

>> figure(1)>> plot(t,x(:,1),'r')%Variable de estado X1

0 10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

16

18

20

Page 4: Terminado Lab de Control

>> figure(2)>> plot(t,x(:,2),'b')%Variable de estado X2

0 10 20 30 40 50 60 70 80 90 1000

5

10

15

20

25

30

35

40

>> figure(3)>> plot(t,y(:,1),'g')%salida Y1

0 10 20 30 40 50 60 70 80 90 1000

10

20

30

40

50

60

Page 5: Terminado Lab de Control

>> figure(4)>> plot(t,y(:,2),'y')%salida Y2

0 10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

16

18

20

>> figure(5)>> plot(t,y(:,3),'c')%salida Y3

0 10 20 30 40 50 60 70 80 90 1000

5

10

15

20

25

30

35

40


Top Related