At throat: pressure node = = 0 p1 p(x1) pressure antinode = = = p1 p(x1) p(x2) p2 Example for the second derivative matrix with = 9 and = 7 N N-2 Element (1,1) = -2 for pressure node at throat and element (1,1) = -1 for pressure antinode. % Make Second Derivative Matrix off = ones(N-3,1); SD_matrix = (2*eye(N-2) - diag(off,1) - diag(off,-1)); if flagBC == 1; SD_matrix(1,1) = 1; end SD_matrix = SD_matrix ./dx2; Matrix = SD_matrix - AP_matrix ; where -Matrix To find the eigenvalues and eigenvectors of the matrix [M] given by equation (9) we can use the Matlab command eigs. You use the command eig because it often produces an can’t aliasing effect for the eigenvectors. To find the first eigenvalues: Neig SIGMA = 'sm'; [e_funct e_values] = eigs(Matrix,Neig,SIGMA); The eigs command eigs(Matrix,Neig,SIGMA) finds the eigenvalues smallest [‘sm’] Neig and eigenvectors of Matrix . To extract the eigenvalues = K k2: % All Eigenvalues 1, 2 , ... N-2 wave number k k2 = zeros(1,Neig); for cc = 1 : Neig k2(cc) = e_values(cc,cc);
At throat: pressure node p1 = p(x1) = 0 pressure antinode p1 = p(x1) = p(x2) = p2 Example for the second derivative matrix with N = 9 and N-2 = 7 Element (1,1) = -2 for pressure node at throat and element (1,1) = -1 for pressure antinode. % Make Second Derivative Matrix off = ones(N-3,1); SD_matrix = (2*eye(N-2) - diag(off,1) - diag(off,-1)); if flagBC == 1; SD_matrix(1,1) = 1; end SD_matrix = SD_matrix ./dx2; Matrix = SD_matrix - AP_matrix ; where -Matrix To find the eigenvalues and eigenvectors of the matrix [M] given by equation (9) we can use the Matlab command eigs. You can’t use the command eig because it often produces an aliasing effect for the eigenvectors. To find the first Neig eigenvalues: SIGMA = 'sm'; [e_funct e_values] = eigs(Matrix,Neig,SIGMA); The eigs command eigs(Matrix,Neig,SIGMA) finds the smallest [‘sm’] Neig eigenvalues and eigenvectors of Matrix . To extract the eigenvalues K = k2: % All Eigenvalues 1, 2 , ... N-2 wave number k k2 = zeros(1,Neig); for cc = 1 : Neig k2(cc) = e_values(cc,cc);
wav_air_columns.docx