   

% This script plots the a-priori model over the actual flight test data.


    g =32.2;

   sf =Vt/g;

 
% C = [57.3 -57.3*1.50/Vt; 0 57.3; -sf*A(1,1)-.122/g*A(2,1) ...
%  -sf*(A(1,2)-1)-.122/g*A(2,2)];


%C = [57.3 -57.3*1.667/Vt; 0 57.3; -sf*A(1,1) ...
%  -sf*(A(1,2)-1)];

%  D = [0 5.0;0  0; -B(1,1)*sf-.122*B(2,1)/g 1.0];




   dde = (de+5)/57.3; 
   
   u =[dde';ones(size(dde))']';

   data = lsim(A,B,C,D,u,time);

    Nz = data(:,3);

   hold on


     figure(1)
     
   hold on
   subplot(5,1,2),plot(time,alpha,time,data(:,1))
   ylabel('alpha (deg)')
   grid
   subplot(5,1,3),plot(time,az,time,Nz)
   ylabel('az (g)')
   grid
   subplot(5,1,4),plot(time,qq,time,data(:,2))
   ylabel('q (deg/sec)')
   grid on
    

 %  data(:,1) is alpha
 %  Nz is normal acceleration
 %  data(:,2) is pitch rate 



