计算脉冲在非线性耦合器中演化的Matlab 程序 Wt(Kd5k0'2 s}jlS % This Matlab script file solves the coupled nonlinear Schrodinger equations of
?F1wh2oq % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
-=}b;Kf- % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
7O:"~L % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
+hpSxdAz4 ~+<<bzY %fid=fopen('e21.dat','w');
THJ
3-Ug N = 128; % Number of Fourier modes (Time domain sampling points)
9-b 8`|s M1 =3000; % Total number of space steps
C}9Kx }q J =100; % Steps between output of space
@2u#93Y T =10; % length of time windows:T*T0
}0Y`|H\v T0=0.1; % input pulse width
k'x#t( MN1=0; % initial value for the space output location
6Hda]y dt = T/N; % time step
:aH%bk n = [-N/2:1:N/2-1]'; % Index
cu<y8
:U< t = n.*dt;
0EyAMu u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
F% }7cm2 u20=u10.*0.0; % input to waveguide 2
Uh*@BmDA u1=u10; u2=u20;
NK~PcdGl U1 = u1;
mzu<C)9d, U2 = u2; % Compute initial condition; save it in U
w3d34*0$ ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
o,J^ e_ w=2*pi*n./T;
mdaYYD=c% g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
`T=1<Tw c L=4; % length of evoluation to compare with S. Trillo's paper
B.}cB'| dz=L/M1; % space step, make sure nonlinear<0.05
zLL)VFCJW for m1 = 1:1:M1 % Start space evolution
]Ym=+lgi u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
XwtAF3oz u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
5:$Xtq ca1 = fftshift(fft(u1)); % Take Fourier transform
+|9f%f6vp ca2 = fftshift(fft(u2));
6i| ~7md, c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
[$;,Ua-mt c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
OMvT;Vgg u2 = ifft(fftshift(c2)); % Return to physical space
]'tJ
S] u1 = ifft(fftshift(c1));
@*SA$9/l if rem(m1,J) == 0 % Save output every J steps.
l:)S 3 U1 = [U1 u1]; % put solutions in U array
YIO.yN"0 U2=[U2 u2];
~?CS_B * MN1=[MN1 m1];
"ct58Y@ z1=dz*MN1'; % output location
-n-Z/5~ X end
?T
<rt end
hox< vr4 hg=abs(U1').*abs(U1'); % for data write to excel
JDKLKHOMZ ha=[z1 hg]; % for data write to excel
eKyqU9 t1=[0 t'];
oJh"@6u6K hh=[t1' ha']; % for data write to excel file
%P;[fJ
`G %dlmwrite('aa',hh,'\t'); % save data in the excel format
:kt/$S^- figure(1)
:s]\k%" waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
jC4O` figure(2)
fq=:h\\G waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
{l@WCR jI A#!4 非线性超快脉冲耦合的数值方法的Matlab程序 2
ZK%)vq0 Mb1wYh 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
G%$}WA]| 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
Ok,HD7 ni<[G0#T pr/'J!{^ g8'~e{=( % This Matlab script file solves the nonlinear Schrodinger equations
2eHx"Ha % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
`H"vR:~{ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
p_r4^p\ % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
6<PW./rk: F)7j@h^ C=1;
+<{m45 M1=120, % integer for amplitude
h9jc,Xu5X M3=5000; % integer for length of coupler
p(?g- N = 512; % Number of Fourier modes (Time domain sampling points)
op.d;lO@ dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
.lr5!Stb T =40; % length of time:T*T0.
)P%4:P dt = T/N; % time step
\C7q4p?8 n = [-N/2:1:N/2-1]'; % Index
Qh8C,"a t = n.*dt;
R(`]n!V2 ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
\?dTH:v/E w=2*pi*n./T;
`,P
>mp)uU g1=-i*ww./2;
Wj tft% g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
,_bp)-O G g3=-i*ww./2;
.:N:p We P1=0;
r>O|L%xpv P2=0;
(kY@7)d'e P3=1;
ol }`Wwy P=0;
%I0}4$ for m1=1:M1
]'g:B p p=0.032*m1; %input amplitude
Fpf><Rn s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
o[^Q y(2~ s1=s10;
(0}j]p'w s20=0.*s10; %input in waveguide 2
zofx+g\(W s30=0.*s10; %input in waveguide 3
&(7$&Q s2=s20;
B!uxs s3=s30;
B:nK)"{ p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
Yt*vqm[WV %energy in waveguide 1
U!Mf]3
p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
s??czM2O %energy in waveguide 2
Y;eoTJ p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
,cD1{T\ %energy in waveguide 3
gyFr"9';c for m3 = 1:1:M3 % Start space evolution
0
u2Ny&6w s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
}*Zo6{B- s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
.1{l[[= W s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
K~3Ebr sca1 = fftshift(fft(s1)); % Take Fourier transform
Cm410 =b sca2 = fftshift(fft(s2));
C`EY5"N r sca3 = fftshift(fft(s3));
%qi%$ sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
yW`e |! sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
O5OXw] sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
(Vap7.6;_ s3 = ifft(fftshift(sc3));
3HKxYvc C s2 = ifft(fftshift(sc2)); % Return to physical space
C=[Ae, s1 = ifft(fftshift(sc1));
/ao<A\KR end
](nH{aY! p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
x?=B\8m p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
1daL y p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
Gk 6fO P1=[P1 p1/p10];
GMe0;StT P2=[P2 p2/p10];
7H#2WFQ7 P3=[P3 p3/p10];
H `5Ct P=[P p*p];
;j!UY.i end
bBG/gQ figure(1)
M}KZG'7 plot(P,P1, P,P2, P,P3);
1!1DuQ FJF3B)Va| 转自:
http://blog.163.com/opto_wang/