You are on page 1of 6

Nombre: Juan Ernesto Aldana Monterroso

Carne: 091-09-278
Ing Luis Ola

Pre-final
Problema 2
Codigo de matlab:
>> A=[-1 -1;0.5 0];
>> B=[1 1;1 0];
>> C=[1 0;0 1];
>> D=[0 0;0 0];
>> [num,den]=ss2tf(A,B,C,D,1)
num =

0 1.0000 -1.0000
0 1.0000 1.5000

den =

1.0000 1.0000 0.5000

>> num1=num(1,:)
num1 =

0 1.0000 -1.0000

>> num2=num(2,:)

num2 =

0 1.0000 1.5000
>> [num,den]=ss2tf(A,B,C,D,2)

num =

Nombre: Juan Ernesto Aldana Monterroso


Carne: 091-09-278
Ing Luis Ola
0 1.0000 0.0000
0 0.0000 0.5000

den =

1.0000 1.0000 0.5000

>> num3=num(1,:)

num3 =

0 1.0000 0.0000

>> num4=num(2,:)

num4 =

0 0.0000 0.5000

>> step(num1,den)
>> hold on
>> step(num2,den)
>> hold on
>> step(num3,den)
>> hold on
>> step(num4,den)
>> discreta=ss(A,B,C,D)

a=

Nombre: Juan Ernesto Aldana Monterroso


Carne: 091-09-278
Ing Luis Ola
x1 x2
x1 -1 -1
x2 0.5 0

b=
u1 u2
x1 1 1
x2 1 0

c=
x1 x2
y1 1 0
y2 0 1

d=
u1 u2
y1 0 0
y2 0 0

Continuous-time model.
>> discreta_t=c2d(discreta,0.2)

a=
x1
x1

x2

0.81 -0.1807

x2 0.09033 0.9907

b=
u1

u2

x1 0.162 0.1807
x2 0.2087 0.00935

Nombre: Juan Ernesto Aldana Monterroso


Carne: 091-09-278
Ing Luis Ola
c=
x1 x2
y1 1 0
y2 0 1

d=
u1 u2
y1 0 0
y2 0 0

Sampling time: 0.2


Discrete-time model.
>> AA=discreta_t(1,:)

a=
x1
x1

x2

0.81 -0.1807

x2 0.09033 0.9907

b=
u1

u2

x1 0.162 0.1807
x2 0.2087 0.00935

c=
x1 x2
y1 1 0

d=
u1 u2

Nombre: Juan Ernesto Aldana Monterroso


Carne: 091-09-278
Ing Luis Ola
y1 0 0

Sampling time: 0.2


Discrete-time model.
>> a = [0.81 -0.1807;0.09033 0.9907];
>> b =[0.162 0.1807;0.2087 0.00935];
>> c = [1 0];
>> d = [0 0];
>> [NUM,DEN]=ss2tf(a,b,c,d,1)

NUM =

0 0.1620 -0.1982

DEN =

1.0000 -1.8007 0.8188

>> [NUM2,DEN2]=ss2tf(a,b,c,d,2)

NUM2 =

0 0.1807 -0.1807
DEN2 =
1.0000 -1.8007 0.8188
>> hold on
>> dstep(NUM,DEN)
>> hold on
>> dstep(NUM2,DEN2)

Nombre: Juan Ernesto Aldana Monterroso


Carne: 091-09-278
Ing Luis Ola

GRAFICA DEL PROBLEMA

You might also like