计算脉冲在非线性耦合器中演化的Matlab 程序 U|7Qw|I7
D}/=\J/
% This Matlab script file solves the coupled nonlinear Schrodinger equations of {!1n5a3" 1
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of Ccr+SR2
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear Qf-k&d
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 a\69,%!:
:"P hkR
%fid=fopen('e21.dat','w'); //M4Sq(
N = 128; % Number of Fourier modes (Time domain sampling points) Gr"7w[|+
M1 =3000; % Total number of space steps NhoS7 y(
J =100; % Steps between output of space 3y=<w|4F
T =10; % length of time windows:T*T0 Q^Z<RA(C
T0=0.1; % input pulse width [du>ff
MN1=0; % initial value for the space output location >3`ctbe
dt = T/N; % time step |5IY`;+9
n = [-N/2:1:N/2-1]'; % Index gQh Ccv
t = n.*dt; sIRrEea
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 :.S41S
u20=u10.*0.0; % input to waveguide 2 H'0*CiHes
u1=u10; u2=u20; ]X:
rby$
U1 = u1; oiv2rOFu
U2 = u2; % Compute initial condition; save it in U %wjB)Mae
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. S`c]Fc
w=2*pi*n./T; ?gR\A8:8
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T 22/?JWL>
L=4; % length of evoluation to compare with S. Trillo's paper }1]!#yMfq
dz=L/M1; % space step, make sure nonlinear<0.05 `,-hG
for m1 = 1:1:M1 % Start space evolution UiK+c30FU
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS -hVv
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; c,+(FQ9
ca1 = fftshift(fft(u1)); % Take Fourier transform c_z/At;4
ca2 = fftshift(fft(u2)); KBr5bcm4u
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation Kcw1uLb
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift e.}3OK
u2 = ifft(fftshift(c2)); % Return to physical space R)d99j^"
u1 = ifft(fftshift(c1)); K_&c5(-(_
if rem(m1,J) == 0 % Save output every J steps. ^?6
W<
U1 = [U1 u1]; % put solutions in U array XW~ BEa
U2=[U2 u2]; zK>'tFU
MN1=[MN1 m1]; XJJ[F|k~
z1=dz*MN1'; % output location l<aqiZSY
end HhWwc#B
end 2-6.r_
hg=abs(U1').*abs(U1'); % for data write to excel XY!{ g(
ha=[z1 hg]; % for data write to excel #U$YZ#B
t1=[0 t']; /+4^.Q*
hh=[t1' ha']; % for data write to excel file %%as>}.
%dlmwrite('aa',hh,'\t'); % save data in the excel format 2%5^Fi
figure(1) KO-Zz&2f
waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn ^/%o%J&