# matlab数组判断零点,请教一个matlab 求函数零点的问题

function beta_3

c=3*10^8;

lambda=1.55;

rho(1)=1;nc=1;n1=3;l1=0.13;n2=1.5;l2=0.265;

omega=2*pi*c/lambda;

x=fsolve(@(x) myfun(x,omega,l1,l2,n1,n2,nc,c),[0.5,4.0227,12.1507,6.0599,-1.2508-i*0.0461,0.7453-0.1052*i,3.1416-0.6942*i]')

function F=myfun(x,omega,l1,l2,n1,n2,nc,c)

beta=x(1);

kc=x(2);

k1=x(3);

k2=x(4);

kte=x(5);

Ate=x(6);

Bte=x(7);

F(1)=-besselj(kc*1,1)/(besselj(kc*1,0))+i*kc/k1*(exp(i*kte)-Ate-Bte)/(exp(i*kte)-Ate+Bte);

F(2)=kc-sqrt(nc^2*(omega/c)^2-beta^2);

F(3)=k1-sqrt(n1^2*(omega/c)^2-beta^2);

F(4)=k2-sqrt(n2^2*(omega/c)^2-beta^2);

F(5)=Ate-exp(i*k1*l1)*(i*(k1^2+k2^2)/(2*k1*k2)*sin(k2*l2)+cos(k2*l2));

F(6)=Bte-i*exp(-i*k1*11)*(k1^2-k2^2)/(2*k1*k2)*sin(k2*l2);

F(7)=kte+i*log(real(Ate)-sqrt(real(Ate)^2-1));

kc=sqrt(nc^2*(omega/c)^2-beta^2);

k1=sqrt(n1^2*(omega/c)^2-beta^2);

k2=sqrt(n2^2*(omega/c)^2-beta^2);

Ate=exp(i*k1*l1)*(i*(k1^2+k2^2)/(2*k1*k2)*sin(k2*l2)+cos(k2*l2));

Bte=i*exp(-i*k1*11)*(k1^2-k2^2)/(2*k1*k2)*sin(k2*l2);

kte=-i*log(real(Ate)-sqrt(real(Ate)^2-1));

-besselj(kc*1,1)/(besselj(kc*1,0))+i*kc/k1*(exp(i*kte)-Ate-Bte)/(exp(i*kte)-Ate+Bte)=0；

• 0
点赞
• 0
收藏
• 0
评论
12-22
03-06 3万+
03-16 1714
12-04 3857
07-29 3万+
12-03 4348

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助