Solving Eigenvalue problem (2nd order ODE)
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to solve the following eigenvalue problem:
Amatrix = zeros(nz-1,nz-1);
Coeff = zeros(nz,1);
for iR = 1 : nz
Coeff(iR) = 1/N2(iR);
if isnan(Coeff(iR))
Coeff(iR)=Coeff(iR-1);
end
end
for iA = 2 : (nz-2)
Amatrix(iA,iA) = -2/(DZ(iA)*DZ(iA))*Coeff(iA);
Amatrix(iA,iA-1) = 1/(DZ(iA)*DZ(iA))*Coeff(iA);
Amatrix(iA,iA+1) = 1/(DZ(iA)*DZ(iA))*Coeff(iA);
end
Amatrix(1,1) = -2/(DZ(1)*DZ(1))*Coeff(1);
Amatrix(1,2) = 1/(DZ(1)*DZ(1))*Coeff(1);
Amatrix(nz-1,nz-1) = -2/(DZ(nz-1)*DZ(nz-1))*Coeff(nz-1);
Amatrix(nz-1,nz-2) = 1/(DZ(nz-1)*DZ(nz-1))*Coeff(nz-1);
[V,DD] = eig(full(Amatrix));
PHI = zeros(100,1);
for iz = 1 : 99
PHI(iz,1)=V(iz,1); %Selecting tthe first mode?
end
C = DD.^{-0.5}
When I execute this code, however,
does not match the theory; specifically the mode-1 (
) structure is not present (
should only have one extrema between
and
). I have included the plot below of normalized
and
for clarity.

Any advice with where I'm going wrong would be greatly appreciated. Thanks in advance for your help!
0 Commenti
Risposte (1)
Alan Stevens
il 12 Feb 2021
Your mathematical equation has the inverse of the eigenvalue squared, but your code calcukates the inverse of the square root of the eigenvalue. No idea if this solves your problem as you don't specify N2 or DZ, so can't run your coding.
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!