function sm = StabMode(F,TAS,LLD,LON,SBA,DIM) % Stability and Modes of Motion % ============================= % December 5, 2016 sm = 1; [Eigenvectors,EigenvalueMatrix] = eig(F); disp('Eigenvalues along Diagonal') EigenvalueMatrix disp('Eigenvectors in Same Order as Eigenvalues') Eigenvectors kv = length(F); disp('Eigenvector Amplitudes') EVA = []; for k = 1:kv % Eigenvector Amplitudes a = Eigenvectors(:,k); Magnitude = real(sqrt(ctranspose(a) * a)); EvectorAmplitude = sqrt(a .* conj(a)) / Magnitude; EVA = [EVA, EvectorAmplitude]; end EVA disp('Velocity-Weighted Eigenvector Amplitudes') EVAW = []; for k = 1:kv % Velocity-Weighted Eigenvector Amplitudes a = Eigenvectors(:,k); if LLD >= 1 if LON >= 1 % Reduced-Order Model if SBA >= 1 % Longitudinal Model if DIM >= 6 % Stability/Hybrid Axes a = [a(1)/TAS;a(2:4);a(5:6)/TAS]; % 6th-Order else a = [a(1)/TAS;a(2:4)]; % 4th-Order end else if DIM >= 6 % Body Axes a = [a(1:2)/TAS;a(3:4);a(5:6)/TAS]; % 6th-Order else a = [a(1:2)/TAS;a(3:4)]; % 4th-Order end end else if SBA >= 1 % Lateral-Directional Model if DIM >= 6 % Stability/Hybrid Axes a = [a(1:5);a(6)/TAS]; % 6th-Order else a = a; % 4th-Order end else if DIM >= 6 % Body Axes a = [a(1)/TAS;a(2:5);a(6)/TAS]; % 6th-Order else a = [a(1)/TAS;a(2:4)] % 4th-Order end end end else a = [a(1:6)/TAS;a(7:12)]; % Original Model end Magnitude = real(sqrt(ctranspose(a) * a)); EvectorAmplitude = sqrt(a .* conj(a)) / Magnitude; EVAW = [EVAW, EvectorAmplitude]; end EVAW