Modern Control Engineering

(Chris Devlin) #1
Section 10–8 / Quadratic Optimal Regulator Systems 805

MATLAB Program 10–23


% ---------- Unit-step response of designed system ----------


A = [0 1 0;0 0 1;0 -2 -3];


B = [0;0;1]


C = [1 0 0];


D = [0];


K = [100.0000 53.1200 11.6711];


k1 = K(1); k2 = K(2); k3 = K(3);


% ***** Define the state matrix, control matrix, output matrix,


% and direct transmission matrix of the designed systems as AA,


% BB, CC, and DD *****


AA = A - B*K;


BB = B*k1;


CC = C;


DD = D;


t = 0:0.01:8;


[y,x,t] = step (AA,BB,CC,DD,1,t);


plot(t,x)


grid


title('Response Curves x1, x2, x3, versus t')


xlabel('t Sec')


ylabel('x1,x2,x3')


text(2.6,1.35,'x1')


text(1.2,1.5,'x2')


text(0.6,3.5,'x3')


Response Curves x1,x2,x3 versus t

x1,

x2,

x^3

5


  • 2


1

4

2

0


  • 1


3

t Sec

051 2 3 486 7

x 3

x (^2) x 1
Figure 10–40
Response curves x 1
versust, x 2 versust,
andx 3 versust.

Free download pdf