eigen value is not showing

1 次查看(过去 30 天)
shiv gaur
shiv gaur 2022-1-7
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 个评论
shiv gaur
shiv gaur 2022-1-7
the l value is 0.6328*10^-10
John D'Errico
John D'Errico 2022-1-7
编辑:John D'Errico 2022-1-7
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by