计算脉冲在非线性耦合器中演化的Matlab 程序 r2
o-/$
-4'yC_8t
% This Matlab script file solves the coupled nonlinear Schrodinger equations of ;&G8e*bM2
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of zq&,KZ
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear ~85Pgb<
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 p*Hbc|?{Q&
ZCS{D
%fid=fopen('e21.dat','w'); 5x; y{qT
N = 128; % Number of Fourier modes (Time domain sampling points) x?MSHOia`P
M1 =3000; % Total number of space steps *,d>(\&[f
J =100; % Steps between output of space VC@{cVT
T =10; % length of time windows:T*T0 . ;q4<_
T0=0.1; % input pulse width ?$LKn2C
MN1=0; % initial value for the space output location B?)=d,E
dt = T/N; % time step GwaU7[6
n = [-N/2:1:N/2-1]'; % Index F,-S&d
t = n.*dt; _o-D},f*e
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 V_"K
u20=u10.*0.0; % input to waveguide 2 |KxFiH
u1=u10; u2=u20; h_Cac@F0
U1 = u1; ^UAL5}CQt
U2 = u2; % Compute initial condition; save it in U =D2x@ank[
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. aPMqJ#fIr
w=2*pi*n./T; ZNvnVW<
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T $!_]mz6*
L=4; % length of evoluation to compare with S. Trillo's paper 30v 3C7o=
dz=L/M1; % space step, make sure nonlinear<0.05 ;f7;U=gl,
for m1 = 1:1:M1 % Start space evolution Z;#Ei.7p|
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS `Vqpo/
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; )m Uc
!TP
ca1 = fftshift(fft(u1)); % Take Fourier transform :5`BhFAd
ca2 = fftshift(fft(u2)); A+lP]Oy0S
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation -S"$S16D
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift @i[z4)"S
u2 = ifft(fftshift(c2)); % Return to physical space JS<4%@
u1 = ifft(fftshift(c1)); 1wpeYn7>W
if rem(m1,J) == 0 % Save output every J steps. $MEKt}S
U1 = [U1 u1]; % put solutions in U array zp2IpYQ,3
U2=[U2 u2]; "38ya2*
MN1=[MN1 m1]; wcT0XXh
z1=dz*MN1'; % output location D{aN_0mT
end 8U07]=Bt<
end D$RQD{*
hg=abs(U1').*abs(U1'); % for data write to excel G,8LF/sR
ha=[z1 hg]; % for data write to excel Ta38/v;S
t1=[0 t']; iraO/KhD*3
hh=[t1' ha']; % for data write to excel file IZ;%lV7t
%dlmwrite('aa',hh,'\t'); % save data in the excel format EQkv&k5X
figure(1) .`OdnLGy
waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn U.
1Vpfy
figure(2) /?jAG3"
waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn P!{
O<P
/2&