Documente Academic
Documente Profesional
Documente Cultură
CONTROL 2
x&1 0 1 0 x1 0
x& = 0 0 1 x2 + 0 u
2
x&3 − 6 − 11 − 6 x3 1
x1
y = [1 1 1] x2
x3
Lo primero es digitar las matrices en Matlab
a=[0,1,0;0,0,1;-6,-11,-6]
a=
0 1 0
0 0 1
-6 -11 -6
b=[0;0;1]
b=
0
0
1
c=[1,1,1]
c=
1 1 1
2
d=[0]
d=
0
help eig
Overloaded methods
help sym/eig.m
help lti/eig.m
eig(a)
ans =
-1.0000
-2.0000
-3.0000
3
[m,ed]=eig(a)
m=
-0.5774 0.2182 -0.1048
0.5774 -0.4364 0.3145
-0.5774 0.8729 -0.9435
ed =
-1.0000 0 0
0 -2.0000 0
0 0 -3.0000
help ss
Creation:
SYS = SS(A,B,C,D) creates a continuous-time state-space (SS) model
SYS with matrices A,B,C,D. The output SYS is a SS object. You
can set D=0 to mean the zero matrix of appropriate dimensions.
Conversion:
SYS = SS(SYS) converts an arbitrary LTI model SYS to state space,
i.e., computes a state-space realization of SYS.
See also LTIMODELS, DSS, RSS, DRSS, SSDATA, LTIPROPS, TF, ZPK,
FRD.
sys=ss(a,b,c,d)
a=
x1 x2 x3
x1 0 1 0
x2 0 0 1
x3 -6 -11 -6
b=
u1
x1 0
x2 0
x3 1
c=
x1 x2 x3
y1 1 1 1
5
d=
u1
y1 0
Continuous-time model.
help canon
Overloaded methods
help ss/canon.m
help lti/canon.m
help frd/canon.m
csys=canon(sys)
6
a=
x1 x2 x3
x1 -1 0 0
x2 0 -2 0
x3 0 0 -3
b=
u1
x1 -0.86603
x2 -4.5826
x3 -4.7697
c=
x1 x2 x3
y1 -0.57735 0.65465 -0.7338
d=
u1
y1 0
Continuous-time model.
help ctrb
Overloaded methods
help lti/ctrb.m
co=ctrb(a,b)
co =
0 0 1
0 1 -6
1 -6 25
rank(co)
ans =
3
help obsv
Overloaded methods
help lti/obsv.m
ob=obsv(a,c)
ob =
1 1 1
-6 -10 -5
30 49 20
rank(ob)
ans =
3
step(a,b,c,d)
Step Response
From: U(1)
0.18
0.16
0.14
0.12
Amplitude
0.1
To: Y(1)
0.08
0.06
0.04
0.02
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec.)
9
[num,den]=ss2tf(a,b,c,d)
num =
0 1.0000 1.0000 1.0000
den =
1.0000 6.0000 11.0000 6.0000
step(num,den)
Step Response
From: U(1)
0.18
0.16
0.14
0.12
Amplitude
0.1
To: Y(1)
0.08
0.06
0.04
0.02
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec.)
sistema=tf(num,den)
Transfer function:
s^2 + s + 1
----------------------
s^3 + 6 s^2 + 11 s + 6
roots(den)
ans =
-3.0000
-2.0000
-1.0000
10
Simulink
simulink
1
K K
s
Step b Integrator c Scope
x' = Ax+Bu
y = Cx+Du
Step State-Space Scope