EE544 Matlab/Simulink Example 6: State-Space Control Law Design and Simulation

Matlab Commands (and Responses):

>> A = [-8 -17 -10; 1 0 0; 0 1 0];
>> B = [1; 0; 0];
>> C = [0 10 30];
>> D = 0;
>> K = acker(A, B, [-4, -1-j, -1+j])

K =

    -2    -7    -2

>> t = 0:0.001:10;
>> u = zeros(size(t));
>> x0 = [1; 1; 1];
>> clsys = ss(A-B*K, [0;0;0], C, D);
>> [y, t, x] = lsim(clsys, u, t, x0);
>> plot(t,x);
>> xlabel('time (sec)');
>> ylabel('x_i');
>> legend('x_1', 'x_2', 'x_3')
>> title('Example 6: CL Control System Response')

Matlab Plot Generated: