计算脉冲在非线性耦合器中演化的Matlab 程序 nC:T0OJv mQj# \<* % This Matlab script file solves the coupled nonlinear Schrodinger equations of
at>_EiS % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
;QZG< % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
,7nu;fOT[ % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
,~L*N*ML
/fQcrd7h %fid=fopen('e21.dat','w');
l,n_G/\ N = 128; % Number of Fourier modes (Time domain sampling points)
+:A `e+\ M1 =3000; % Total number of space steps
&0 QUObK J =100; % Steps between output of space
t%@iF
U;} T =10; % length of time windows:T*T0
|dIR v T0=0.1; % input pulse width
9FEhl~& MN1=0; % initial value for the space output location
SiNgV\('U dt = T/N; % time step
!&%KJS6p4 n = [-N/2:1:N/2-1]'; % Index
w+m7jn!$ t = n.*dt;
cGE{dWz u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
l4gH]!/@ u20=u10.*0.0; % input to waveguide 2
e`Yj}i*bx] u1=u10; u2=u20;
(~|)Gmq2 U1 = u1;
^;II@n
i U2 = u2; % Compute initial condition; save it in U
j,rc9 ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
~HY)$Yp; w=2*pi*n./T;
Dw=L]i
:0v g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
5|0}bv O L=4; % length of evoluation to compare with S. Trillo's paper
l@4pZkdq dz=L/M1; % space step, make sure nonlinear<0.05
DzC`yWstP for m1 = 1:1:M1 % Start space evolution
_d!sSyk` u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
U& GPede u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
8hV]t'/; ca1 = fftshift(fft(u1)); % Take Fourier transform
CfOyHhhKX ca2 = fftshift(fft(u2));
d 6Y9D=O
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
->#wDL!6 c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
2tU3p<[ u2 = ifft(fftshift(c2)); % Return to physical space
'q}Ud10c u1 = ifft(fftshift(c1));
mB2}(DbhE if rem(m1,J) == 0 % Save output every J steps.
&"u(0q U1 = [U1 u1]; % put solutions in U array
Eq@sU?j U2=[U2 u2];
~ESw* 6s9 MN1=[MN1 m1];
U["<f`z4\ z1=dz*MN1'; % output location
mq{Z
Q' end
d{TcjZ end
/5%'q~ hg=abs(U1').*abs(U1'); % for data write to excel
'4{@F~fu ha=[z1 hg]; % for data write to excel
/{({f?k<\/ t1=[0 t'];
oD%n} hh=[t1' ha']; % for data write to excel file
NO/$}vw %dlmwrite('aa',hh,'\t'); % save data in the excel format
fq1w <e figure(1)
%X\J%Fj waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
[voc_o7AI figure(2)
-0uGzd+m* waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
9X[378f+( '+_-r'2 非线性超快脉冲耦合的数值方法的Matlab程序 ,%Pn.E* r; &tkPZ*}#1 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
06NiH-0O Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
}?b\/l< !:d\A z:UkMn[ )~P<ruk>,C % This Matlab script file solves the nonlinear Schrodinger equations
Ym%#" % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
q2k}bb + % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
/&?ei*z % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
2C0j.Ib \>T1&JT C=1;
r<]^.]3zj M1=120, % integer for amplitude
i Q3wi M3=5000; % integer for length of coupler
"=s dn N = 512; % Number of Fourier modes (Time domain sampling points)
Uq=Rz8hLM dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
G>Bgw>#_ T =40; % length of time:T*T0.
7d{xXJ- dt = T/N; % time step
B8cg[;e81 n = [-N/2:1:N/2-1]'; % Index
h*4wi.- t = n.*dt;
.K940& Ui ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
p-C{$5&
O1 w=2*pi*n./T;
mGz'%?zj g1=-i*ww./2;
-vT$UP g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
lYS4Q`z$ g3=-i*ww./2;
bq7()ocA P1=0;
*~`oA~-Q P2=0;
AED
9vDE P3=1;
w6 Y+Y;,'f P=0;
fk#Ggp< for m1=1:M1
VQ~eg wJL p=0.032*m1; %input amplitude
xZAg s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
a$"Z\F:x s1=s10;
J_
h\tM s20=0.*s10; %input in waveguide 2
~9fTs4U s30=0.*s10; %input in waveguide 3
4yu=e;C wy s2=s20;
|bRi bB s3=s30;
qztL M?iV p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
d76C]R5L %energy in waveguide 1
"|
oW6@ p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
BZQJ@lk5 %energy in waveguide 2
B]D51R\}VE p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
?s 0")R& %energy in waveguide 3
"Q23s" for m3 = 1:1:M3 % Start space evolution
d[(%5pw~zL s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
wS2N,X/Y s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
+w?1<Z s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
L'BzefU;04 sca1 = fftshift(fft(s1)); % Take Fourier transform
BD ,3JDqT sca2 = fftshift(fft(s2));
P.|g4EdND sca3 = fftshift(fft(s3));
%D^j7`Z sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
_*(:6,8 sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
]o8~b- sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
87VXVI s3 = ifft(fftshift(sc3));
<>1*1%m s2 = ifft(fftshift(sc2)); % Return to physical space
!hPe*pPVV) s1 = ifft(fftshift(sc1));
g.EKdvY"%H end
T /7[hj p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
7"_gX p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
6dCqS p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
%8L5uMx P1=[P1 p1/p10];
64!V8&Ay P2=[P2 p2/p10];
Ks7kaX P3=[P3 p3/p10];
s@3<] P=[P p*p];
{'
|yb end
`=foB-(zt figure(1)
"_&HM4%! plot(P,P1, P,P2, P,P3);
Sytx9`G 5 j@s,5:;[ 转自:
http://blog.163.com/opto_wang/