%
% Filename: example6.m
%
% Description: Example using matlab to check state feedback design for
% system regulation.
%
clear; clf;
x0 = [pi/2; 0.3]; % ICs: theta=pi/2 rad, thetadot=0.3rad/sec
A = [0 1;0 0]; % system matrices
B = [0; 0.2];
C = [1 0];
K = [205 40]; % state feedback controller gains
Pc = ctrb(A,B); % construct controllability matrix
if(abs(det(Pc)) > eps) % test for controllability
disp('System Is Controllable');
else
disp('System Is NOT Controllable');
end;
Q = obsv(A,C); % construct observability matrix
if(abs(det(Q)) > eps) % test for controllability
disp('System Is Observable');
else
disp('System Is NOT Observable');
end;
initial((A-B*K),[0;0],C,[0],x0); % compute and plot response
title('Regulation Response of Satellite Orientation Angle');
MATLAB Plot Generated: