Demonstrate full state feedback.

Steps to use this with ControlDesignGUI:

1. Run this demo. The plant 'DoubleIntegrator.mat' will be saved in CommonData.
2. Click the plant block in the ControlDesignGUI to select it and load the
   DoubleIntegrator model into the plant  (click 'Load Plant').
3. Enter into LQ pane: Select the Full State Feedback option
    Q:     w.q
    R:     w.r
4. Push Create
------------------------------------------------------------------------
See also statespace, LQC, Step., @statespace/statespace.m, FindDirectory
------------------------------------------------------------------------
%-------------------------------------------------------------------------------
%	 Copyright (c) 2001 Princeton Satellite Systems, Inc. All rights reserved.
%-------------------------------------------------------------------------------
clear w;

a         = [0 1;0 0];
b         = [0;1];
c         = eye(2);
d         = [0;0];

g         = statespace( a, b, c, d, 'Double Integrator',...
            {'position', 'velocity'}, 'force', {'position', 'velocity'} );

p = FindDirectory( 'CommonData' );
save( fullfile(p,'DoubleIntegrator'), 'g' );

q         = eye(2);
r         = 1;

w.q       = q;
w.r       = r;

gC        = LQC( g, w, 'lq' );
k         = get( gC, 'd' );

[a,b,c,d] = getabcd( g );
inputs    = get( g, 'inputs' );
inputs    = strvcat( inputs, 'pitch rate' );
g         = set( g, a - b*k*c, 'a' );
Step( g, 1, 0.1, 100 );


%--------------------------------------
% $Date$
% $Id: a64553f96a24afcba38830d311f77b2e27af26a9 $