function t = plots_TC03_lat_5RPE(t, parOEM, Z, U, syekf, sxekf, sxekfstd,... syukf, sxukf, sxukfstd,... syukfAug, sxukfAug, sxukfAugstd,... syrls, sxrls, sxrlsstd,... tFTR, sxdft, sxdftstd, method); % Time history plots of measured and estimated responses and parameter convergence % test_case = 3: Lateral-directional motion, nx=2, ny=2, nu=3, test aircraft ATTAS % states - p, r % outputs - p, r % inputs - aileron, rudder, beta % Parameters - Lp, Lr, Lda, Ldr, Lbeta, L0, Np, Nr, Nda, Ndr, Nbeta, N0 % Augmented states - p, r, Lp, Lr, Lda, Ldr, Lbeta, L0, Np, Nr, Nda, Ndr, Nbeta, N0 % Conversion factor radians to degrees r2d = 180/pi; XL = t(end) + 5; % EKF: Plot time histories of measured and estimated observation variables and inputs figure(1) subplot(511),plot(t,Z(:,1)*r2d, t,syekf(:,1)*r2d,'r');grid;ylabel('p (°/s)'); title('EKF: Time histories of output variables (measured and estimated); input variables') subplot(512),plot(t,Z(:,2)*r2d, t,syekf(:,2)*r2d,'r');grid;ylabel('r (°/s)'); subplot(513),plot(t,U(:,1)*r2d);grid;ylabel('{\delta_a} (°)'); subplot(514),plot(t,U(:,2)*r2d);grid;ylabel('{\delta_r} (°)'); subplot(515),plot(t,U(:,3)*r2d);grid;ylabel('{\beta} (°)'); xlabel('Time in sec'); % UKF: Plot time histories of measured and estimated observation variables and inputs figure(2) subplot(511),plot(t,Z(:,1)*r2d, t,syukf(:,1)*r2d,'r');grid;ylabel('p (°/s)'); title('UKF: Time histories of output variables (measured and estimated); input variables') subplot(512),plot(t,Z(:,2)*r2d, t,syukf(:,2)*r2d,'r');grid;ylabel('r (°/s)'); subplot(513),plot(t,U(:,1)*r2d);grid;ylabel('{\delta_a} (°)'); subplot(514),plot(t,U(:,2)*r2d);grid;ylabel('{\delta_r} (°)'); subplot(515),plot(t,U(:,3)*r2d);grid;ylabel('{\beta} (°)'); xlabel('Time in sec'); % UKF Augmented: Plot time histories of measured and estimated observation variables and inputs figure(3) subplot(511),plot(t,Z(:,1)*r2d, t,syukfAug(:,1)*r2d,'r');grid;ylabel('p (°/s)'); title('UKF Augmented: Time histories of output variables (measured and estimated); input variables') subplot(512),plot(t,Z(:,2)*r2d, t,syukfAug(:,2)*r2d,'r');grid;ylabel('r (°/s)'); subplot(513),plot(t,U(:,1)*r2d);grid;ylabel('{\delta_a} (°)'); subplot(514),plot(t,U(:,2)*r2d);grid;ylabel('{\delta_r} (°)'); subplot(515),plot(t,U(:,3)*r2d);grid;ylabel('{\beta} (°)'); xlabel('Time in sec'); % EFRLS: Plot time histories of measured and estimated observation variables and inputs figure(4) subplot(511),plot(t,Z(:,1)*r2d, t,syrls(:,1)*r2d,'r');grid;ylabel('p (°/s)'); title('EFRLS: Time histories of output variables (measured and estimated); input variables') subplot(512),plot(t,Z(:,2)*r2d, t,syrls(:,2)*r2d,'r');grid;ylabel('r (°/s)'); subplot(513),plot(t,U(:,1)*r2d);grid;ylabel('{\delta_a} (°)'); subplot(514),plot(t,U(:,2)*r2d);grid;ylabel('{\delta_r} (°)'); subplot(515),plot(t,U(:,3)*r2d);grid;ylabel('{\beta} (°)'); xlabel('Time in sec'); % EKF: Plot time histories of estimated parameters figure(5) subplot(611),plot(t,sxekf(:,3),'k', t,sxekf(:,3)+sxekfstd(:,3),'r',... t,sxekf(:,3)-sxekfstd(:,3),'r',... [0 XL],[parOEM(1,1) parOEM(1,1)]);grid;ylabel('L_p'); legend('x','x+\sigma','x-\sigma','OEM',1) title('EKF: Convergence of parameter estimates with error bounds') subplot(612),plot(t,sxekf(:,4),'k', t,sxekf(:,4)+sxekfstd(:,4),'r',... t,sxekf(:,4)-sxekfstd(:,4),'r',... [0 XL],[parOEM(1,2) parOEM(1,2)]);grid;ylabel('L_r'); subplot(613),plot(t,sxekf(:,5),'k', t,sxekf(:,5)+sxekfstd(:,5),'r',... t,sxekf(:,5)-sxekfstd(:,5),'r',... [0 XL],[parOEM(1,3) parOEM(1,3)]);grid;ylabel('L_{\deltaa}'); subplot(614),plot(t,sxekf(:,6),'k', t,sxekf(:,6)+sxekfstd(:,6),'r',... t,sxekf(:,6)-sxekfstd(:,6),'r',... [0 XL],[parOEM(1,4) parOEM(1,4)]);grid;ylabel('L_{\deltar}'); subplot(615),plot(t,sxekf(:,7),'k', t,sxekf(:,7)+sxekfstd(:,7),'r',... t,sxekf(:,7)-sxekfstd(:,7),'r',... [0 XL],[parOEM(1,5) parOEM(1,5)]);grid;ylabel('L_{\beta}'); subplot(616),plot(t,sxekf(:,8),'k', t,sxekf(:,8)+sxekfstd(:,8),'r',... t,sxekf(:,8)-sxekfstd(:,8),'r',... [0 XL],[parOEM(1,6) parOEM(1,6)]);grid;ylabel('L_0');... xlabel('Time in sec'); % UKF: Plot time histories of estimated parameters figure(6) subplot(611),plot(t,sxukf(:,3),'k', t,sxukf(:,3)+sxukfstd(:,3),'r',... t,sxukf(:,3)-sxukfstd(:,3),'r',... [0 XL],[parOEM(1,1) parOEM(1,1)]);grid;ylabel('L_p'); legend('x','x+\sigma','x-\sigma','OEM',1) title('UKF: Convergence of parameter estimates with error bounds') subplot(612),plot(t,sxukf(:,4),'k', t,sxukf(:,4)+sxukfstd(:,4),'r',... t,sxukf(:,4)-sxukfstd(:,4),'r',... [0 XL],[parOEM(1,2) parOEM(1,2)]);grid;ylabel('L_r'); subplot(613),plot(t,sxukf(:,5),'k', t,sxukf(:,5)+sxukfstd(:,5),'r',... t,sxukf(:,5)-sxukfstd(:,5),'r',... [0 XL],[parOEM(1,3) parOEM(1,3)]);grid;ylabel('L_{\deltaa}'); subplot(614),plot(t,sxukf(:,6),'k', t,sxukf(:,6)+sxukfstd(:,6),'r',... t,sxukf(:,6)-sxukfstd(:,6),'r',... [0 XL],[parOEM(1,4) parOEM(1,4)]);grid;ylabel('L_{\deltar}'); subplot(615),plot(t,sxukf(:,7),'k', t,sxukf(:,7)+sxukfstd(:,7),'r',... t,sxukf(:,7)-sxukfstd(:,7),'r',... [0 XL],[parOEM(1,5) parOEM(1,5)]);grid;ylabel('L_{\beta}'); subplot(616),plot(t,sxukf(:,8),'k', t,sxukf(:,8)+sxukfstd(:,8),'r',... t,sxukf(:,8)-sxukfstd(:,8),'r',... [0 XL],[parOEM(1,6) parOEM(1,6)]);grid;ylabel('L_0');... xlabel('Time in sec'); % UKF Augmented: Plot time histories of estimated parameters figure(7) subplot(611),plot(t,sxukfAug(:,3),'k', t,sxukfAug(:,3)+sxukfAugstd(:,3),'r',... t,sxukfAug(:,3)-sxukfAugstd(:,3),'r',... [0 XL],[parOEM(1,1) parOEM(1,1)]);grid;ylabel('L_p'); legend('x','x+\sigma','x-\sigma','OEM',1) title('UKF Augmented: Convergence of parameter estimates with error bounds') subplot(612),plot(t,sxukfAug(:,4),'k', t,sxukfAug(:,4)+sxukfAugstd(:,4),'r',... t,sxukfAug(:,4)-sxukfAugstd(:,4),'r',... [0 XL],[parOEM(1,2) parOEM(1,2)]);grid;ylabel('L_r'); subplot(613),plot(t,sxukfAug(:,5),'k', t,sxukfAug(:,5)+sxukfAugstd(:,5),'r',... t,sxukfAug(:,5)-sxukfAugstd(:,5),'r',... [0 XL],[parOEM(1,3) parOEM(1,3)]);grid;ylabel('L_{\deltaa}'); subplot(614),plot(t,sxukfAug(:,6),'k', t,sxukfAug(:,6)+sxukfAugstd(:,6),'r',... t,sxukfAug(:,6)-sxukfAugstd(:,6),'r',... [0 XL],[parOEM(1,4) parOEM(1,4)]);grid;ylabel('L_{\deltar}'); subplot(615),plot(t,sxukfAug(:,7),'k', t,sxukfAug(:,7)+sxukfAugstd(:,7),'r',... t,sxukfAug(:,7)-sxukfAugstd(:,7),'r',... [0 XL],[parOEM(1,5) parOEM(1,5)]);grid;ylabel('L_{\beta}'); subplot(616),plot(t,sxukfAug(:,8),'k', t,sxukfAug(:,8)+sxukfAugstd(:,8),'r',... t,sxukfAug(:,8)-sxukfAugstd(:,8),'r',... [0 XL],[parOEM(1,6) parOEM(1,6)]);grid;ylabel('L_0');... xlabel('Time in sec'); % Plot time histories of estimated parameters (EKF, UKF, UKFaug, EFRLA, FTR) figure(8) subplot(321),plot(t,sxekf(:,7),'b', t,sxukf(:,7),'r', t,sxukfAug(:,7),'c',... tFTR,sxdft(:,5),'m', t,sxrls(:,7),'k',... [0 XL],[parOEM(1,5) parOEM(1,5)]);... axis([0 XL,-6 2]);grid;... legend('L_{\beta} EKF',' UKF',' UKFaug',' FTR',' EFRLS',' OEM',1); title('EKF, UKF, UKFaug, FTR, EFRLS: Convergence of parameter estimates') subplot(323),plot(t,sxekf(:,3),'b', t,sxukf(:,3),'r', t,sxukfAug(:,3),'c',... tFTR,sxdft(:,1),'m', t,sxrls(:,3),'k',... [0 XL],[parOEM(1,1) parOEM(1,1)]);... axis([0 XL,-4 2]);grid;... legend('L_p EKF',' UKF',' UKFaug',' FTR',' EFRLS',' OEM',1); subplot(325),plot(t,sxekf(:,5),'b', t,sxukf(:,5),'r', t,sxukfAug(:,5),'c',... tFTR,sxdft(:,3),'m', t,sxrls(:,5),'k',... [0 XL],[parOEM(1,3) parOEM(1,3)]);... axis([0 XL,-10 2]);grid;... legend('L_{\deltaa} EKF',' UKF',' UKFaug',' FTR',' EFRLS',' OEM',1);... xlabel('Time in sec') subplot(322),plot(t,sxekf(:,13),'b', t,sxukf(:,13),'r', t,sxukfAug(:,13),'c',... tFTR,sxdft(:,10),'m', t,sxrls(:,13),'k',... [0 XL],[parOEM(1,11) parOEM(1,11)]);... axis([0 XL,1 6]);grid;... legend('N_{\beta} EKF',' UKF',' UKFaug',' FTR',' EFRLS',' OEM',1); subplot(324),plot(t,sxekf(:,10),'b', t,sxukf(:,10),'r', t,sxukfAug(:,10),'c',... tFTR,sxdft(:,7),'m', t,sxrls(:,10),'k',... [0 XL],[parOEM(1,8) parOEM(1,8)]); axis([0 XL,-2 1]);grid;... legend('N_r EKF',' UKF',' UKFaug',' FTR',' EFRLS',' OEM',1); subplot(326),plot(t,sxekf(:,12),'b', t,sxukf(:,12),'r', t,sxukfAug(:,12),'c',... tFTR,sxdft(:,9),'m', t,sxrls(:,12),'k',... [0 XL],[parOEM(1,10) parOEM(1,10)]);... axis([0 XL,-4 2]);grid;... legend('N_{\deltar} EKF',' UKF',' UKFaug',' FTR',' EFRLS',' OEM',1);... xlabel('Time in sec')