eigen value is not showing

k0=2*pi/l;
nc=1.33;
ec=nc^2;
na=1.43;
ea=na^2;
nf=1.59;
ef=nf^2;
nm=0.064+1i*4;
em=nm^2;
ns=1.495;
es=ns^2;
df=0.5e-6;
dm=0.03e-6;
da=0.06e-6;
kc=sqrt(kx.^2-ec*k0^2);
ka=sqrt(ea*k0^2-kx.^2);
kf=sqrt(ef*k0^2-kx.^2);
km=sqrt(em*k0^2-kx.^2);
ks=sqrt(kx.^2-es*k0^2);
a11=exp(-ks*dm);
a12=-exp(-km*dm);
a13=exp(km*dm);
a14=0;a15=0;a16=0;a17=0;a18=0;
a21= ks.*exp(-ks*dm);
a22=1i*km.*exp(-1i*km*dm);
a23= -1i*km.*exp(1i*km*dm);
a24=0;
a25=0;a26=0;a27=0;a28=0;
a31=0;a32=1;a33=1;a34=-1;a35=-1;a36=0;a37=0;a38=0;
a42=1i*km;a41=0;a43=-1i*km;a44=-1i*kf;a45=1i*kf;a46=0;a47=0;a48=0;
a51=0;a52=0;a53=0;a54=exp(1i*kf*df); a55=exp(-1i*kf*df);a56=-exp(1i*ka*df);a57=-exp(-1i*ka*df);
a58=0;a61=0;a62=0;a63=0;a64=1i*kf.*exp(1i*kf*df);a65=-1i*kf.*exp(-1i*kf*df);
a66=-1i*ka.*exp(1i*ka*df);a67=1i*ka.*exp(-1i*ka*df);a68=0;
a71=0;a72=0;a73=0;a74=0;a75=0;a76=exp(1i*ka*(da+df));
a77=- exp(-1i*ka*(da+df));a78= exp(-1i*kc*(da+df));
a81=0;a82=0;a83=0;a84=0;a85=0;a86=1i*ka.* exp(1i*ka*(da+df));a87=-1i*ka.*exp(-1i*ka*(da+df));
a88=kc.*exp(1i*kc*(da+df));
Phi=[a11 a12 a13 a14 a15 a16 a17 a18; a21 a22 a23 a24 a25 a26 a27 a28; a31 a32 a33 a34 a35 a36 a37 a38; a41 a42 a43 a44 a45 a46 a47 a48; a51 a52 a53 a54 a55 a56 a57 a58; a61 a62 a63 a64 a65 a66 a67 a68; a71 a72 a73 a74 a75 a76 a77 a78; a81 a82 a83 a84 a85 a86 a87 a88];
eig(Phi)

13 commentaires

shiv gaur
shiv gaur le 7 Jan 2022
l=0.6328*10^-10 value of eigen value
KSSV
KSSV le 7 Jan 2022
Is the code working in the first place?
shiv gaur
shiv gaur le 7 Jan 2022
not working till now
KSSV
KSSV le 7 Jan 2022
Then specify the error you have and the problem you are facing with the code. The ocde given lot of variables are not defined.
Steven Lord
Steven Lord le 7 Jan 2022
What does "not working" mean in this context?
  • Do you receive warning and/or error messages? If so the full and exact text of those messages (all the text displayed in orange and/or red in the Command Window) may be useful in determining what's going on and how to avoid the warning and/or error.
  • Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
  • Did MATLAB crash? If so please send the crash log file (with a description of what you were running or doing in MATLAB when the crash occured) to Technical Support using the Contact Support link on the Support section of the MathWorks website so we can investigate.
shiv gaur
shiv gaur le 7 Jan 2022
only kx variable is to be root of the equation all the parameter as mention
The very first line:
k0=2*pi/l;
Unrecognized function or variable 'l'.
shiv gaur
shiv gaur le 7 Jan 2022
l=0.6328*10^-10;
VIGNESH B S
VIGNESH B S le 7 Jan 2022
What is this code for ?
shiv gaur
shiv gaur le 7 Jan 2022
to calculate the value of eigen value
k0=2*pi/l;
Your variable l is undefined. There may be other problems with your code of course. But we can go no further than that.
shiv gaur
shiv gaur le 7 Jan 2022
the l value is 0.6328*10^-10
John D'Errico
John D'Errico le 7 Jan 2022
Modifié(e) : John D'Errico le 7 Jan 2022
It is a REALLY, REALLY, REALLY bad idea to define a variable named lower case L, so l. That is because l and the number 1 look almost indistinguishable in some fonts. O and 0 are another case that you really need to avoid.
Next, learn to use scientific notation.
l = 0.6328e-10
Next, when I try to execute your code, I see this error:
'kx' requires Datafeed Toolbox.
That is because you never defined the variable kx, but then you have these lines:
kc=sqrt(kx.^2-ec*k0^2);
ka=sqrt(ea*k0^2-kx.^2);
kf=sqrt(ef*k0^2-kx.^2);
km=sqrt(em*k0^2-kx.^2);
ks=sqrt(kx.^2-es*k0^2);
I still cannot get to the end of your code to know what is happening. As I read through all of your comments, it appears that you want kx to be an unknown?
If so, then eig CANNOT work, because the result will be a symbolic matrix with an unknown variable in it. And that must fail, because the matrix is of size 8. I you remember that the eigenvalues of a matrix can be considered as the roots of a characteristic polynomial of that matrix. Since the polynomial will be of degree at least 8, tthen eig will fail.

Connectez-vous pour commenter.

Réponses (0)

Catégories

Produits

Version

R2021b

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by