clear all; clc;
n1=1.50; % core refractive index
n2=1.48; % clading refractive index
a1=4.15; % core radius=4.15microm
a2=62.5; % cladding radius=62.5microm
nama=1.55; % imput wavelength=1.55microm
pfcri=sqrt(n1^2-n2^2);
V1=2*pi/nama;
V=V1*a1*pfcri;
ncoeff=(n2:0.001:n1)';
b=(ncoeff.^2-n2^2)./(pfcri^2);
x=V.*sqrt(1-b);
x1=V.*sqrt(b);
y_0=besselj(0,x); %零阶
y_1=besselj(1,x); %一阶
y_01=besselk(0,x1); %零阶
y_11=besselk(1,x1); %一阶
yl=x.*y_0./y_1;
yr=x1.*y_01./y_11;
axis([n2,n1,-50,50]);
plot(ncoeff,yl,'r',ncoeff,yr,'b');grid on;
xlabel('core effective refractive index');
% 寻找数值上的交点
data0=abs(yl-yr);
[~,ind]=min(data0)
x=ind
y=yl(x)
è¿ä¸ªå¯ä»¥è°ç¨æçå½æ°[x,y]=crosspt(x1,y1,x2,y2)
è¿éx1,y1,x2,y2åå«æ¯ä¸¤æ¡æ²çº¿ç横纵åæ å¼ãå¾å°çxï¼yåå«æ¯äº¤ç¹åæ ã
ä½ çä¾åï¼
clear; clc;æåå¾å°çç»æï¼
å½ç¶ä¹å¯ä»¥æ±åºå¤ä¸ªäº¤ç¹ï¼ä¸é¢ç»åºæçä¾åï¼
clcäºä¸ªç¹é½æ±åºæ¥äºã
è®°ä½ææçcrosspt.pæ件æ¾å¨ä½ çå½åæ件夹éé¢