www.pudn.com > EDFA-980nm.zip > VUA11.m, change:2014-09-23,size:767b


function [v,U,A]= VUA11(a,b,NA) 
% a光纤半径,单位m 
% b波长,单位m 
% NA 归一化频率 
% v值的范围最好在1-10之间 
v = 2*pi*a.*NA./b; 
nn=10000;%%%分成的份数 
uu=linspace(0,v,nn); 
ww=sqrt(v^2-uu.^2); 
df=uu.*besselj(2,uu)./besselj(1,uu)-ww.*besselk(2,ww)./besselk(1,ww); 
j=0;t=zeros();g=zeros(); 
for i=1:nn-1 
    if df(i)*df(i+1)<=0 
        j=j+1; 
        if abs(df(i))<=abs(df(i+1)) 
           t(j)=uu(i); 
           g(j)=ww(i); 
        else 
           t(j)=uu(i+1); 
           g(j)=ww(i+1); 
        end 
    end 
end 
U=t(1); 
W=g(1); 
m=1; 
f=@(r)(r.*(((besselj(m,U*r/a)/besselj(m,U)).^2).*(r<=a)+((besselk(m,W*r/a)/besselk(m,W)).^2).*(r>a))); 
d=2*pi*quad(f,0,a); 
tt=((1-(U/v)^2)*(1-besselj(1,U)^2/(besselj(2,U)*besselj(0,U)))).^-1; 
p=d.*tt; 
A=p.^-1;