function [T] = plots_nlinear_lat(T, Z, Y, Uinp, params, par_std, iter); % Time history plots of measured and estimated responses and parameter convergence % test_case = 4 -- Longitudinal motion: HFB-320 Aircraft % Nonlinear model in terms of non-dimensional derivatives as function of % variables in the stability axes (V, alfa) % states - beta, p, r, phi, psi % outputs - beta, p, r, phi, psi, ay % inputs - da, dr % parameters - Yb, Yp, Yr, Ydr, Lb, Lp, Lr, Lda, Ldr, Nb, Np, Nr, Nda, Ndr % f11, f22, f33, f44, f55 (diagonal elements of process noise matrix) % Conversion factor radians to degrees r2d = 180/pi; %Plot time histories of measured and estimated observation variables figure(1) subplot(811),plot(T,Z(:,1)*r2d, T,Y(:,1)*r2d,'r'); grid; ylabel('\beta (deg)'); title('Time histories of output variables (measured and estimated); input variables') subplot(812),plot(T,Z(:,2)*r2d, T,Y(:,2)*r2d,'r'); grid; ylabel('p (deg/s)'); subplot(813),plot(T,Z(:,3)*r2d, T,Y(:,3)*r2d,'r'); grid; ylabel('r (deg/s)'); subplot(814),plot(T,Z(:,4)*r2d, T,Y(:,4)*r2d,'r'); grid; ylabel('\phi (deg)'); subplot(815),plot(T,Z(:,5)*r2d, T,Y(:,5)*r2d,'r'); grid; ylabel('\psi (deg)'); subplot(816),plot(T,Z(:,6), T,Y(:,6),'r'); grid; ylabel('ay (m/s2)'); subplot(817),plot(T,Uinp(:,1)*r2d); grid; ylabel('{\delta_a} (deg)'); subplot(818),plot(T,Uinp(:,2)*r2d); grid; ylabel('{\delta_r} (deg)'); xlabel('Time in sec'); % Convergence plot: estimated parameter +- standard deviations versus iteration count if iter > 0, iterations = [0:iter]; figure(2); zoom; subplot(5,3, 1);errorbar(iterations, params(1,:),par_std(1,:));ylabel('Y{\beta}'); xlabel('iteration #');grid title('Convergence of parameter estimates with error bounds') subplot(5,3, 4);errorbar(iterations, params(2,:),par_std(2,:));ylabel('Yp'); xlabel('iteration #');grid subplot(5,3,7);errorbar(iterations, params(3,:),par_std(3,:));ylabel('Yr'); xlabel('iteration #');grid subplot(5,3,13);errorbar(iterations, params(3,:),par_std(3,:));ylabel('Y{\delta}r'); xlabel('iteration #');grid subplot(5,3, 2);errorbar(iterations, params(4,:),par_std(4,:));ylabel('L{\beta}'); xlabel('iteration #');grid subplot(5,3, 5);errorbar(iterations, params(5,:),par_std(5,:));ylabel('Lp'); xlabel('iteration #');grid subplot(5,3, 8);errorbar(iterations, params(6,:),par_std(6,:));ylabel('Lr'); xlabel('iteration #');grid subplot(5,3,11);errorbar(iterations, params(7,:),par_std(7,:));ylabel('L{\delta}a'); xlabel('iteration #');grid subplot(5,3,14);errorbar(iterations, params(8,:),par_std(8,:));ylabel('L{\delta}r'); xlabel('iteration #');grid subplot(5,3, 3);errorbar(iterations, params( 9,:),par_std( 9,:));ylabel('N{\beta}'); xlabel('iteration #');grid subplot(5,3, 6);errorbar(iterations, params(10,:),par_std(10,:));ylabel('Np'); xlabel('iteration #');grid subplot(5,3, 9);errorbar(iterations, params(11,:),par_std(11,:));ylabel('Nr'); xlabel('iteration #');grid subplot(5,3,12);errorbar(iterations, params(12,:),par_std(12,:));ylabel('N{\delta}a'); xlabel('iteration #');grid subplot(5,3,15);errorbar(iterations, params(13,:),par_std(13,:));ylabel('N{\delta}r'); xlabel('iteration #');grid end