EE443: SIMULATED STEP RESPONSE FOR SATELLITE MODELED IN STATE VARIABLE FORM

Matlab m-file example7.m:
%
% Filename: example7.m
%
% Description: m-file to simulate satellite response to step input.
%

clear; clf;

A = [0 1;0 0];						% Define System Matrices
B = [0;0.2];
C = [1 0];
D = [0];
x0 = [0;0];							% Initial Conditions

p = [-4+j*5; -4-j*5]; 			% Desired Pole Location
K = acker(A,B,p);					% Compute Feedback Matrix K

t = 0:0.01:1.5;
yd = (pi/2)*ones(size(t));		% Reference input

[y,x] = lsim((A-B*K), K(1)*B, C, D, yd, t, x0);	% Simulate Response
plot(t,y);
xlabel('time ')
ylabel('y(t)');
title('Satellite Orientation');
hold on;
plot(t,yd,'--');
hold off;
MATLAB Plot Generated: