计算脉冲在非线性耦合器中演化的Matlab 程序 -I~\
JE;!~=
% This Matlab script file solves the coupled nonlinear Schrodinger equations of Qn@[{%),4
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of ~;oaW<"
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear +,eF(VS!
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 O/oLQoH
r$,Xv+}
%fid=fopen('e21.dat','w'); Pe@*')o*
N = 128; % Number of Fourier modes (Time domain sampling points) ^,Ft7 JAn
M1 =3000; % Total number of space steps &InFC5A
J =100; % Steps between output of space H$6;{IUz~
T =10; % length of time windows:T*T0 D#d/?\2
T0=0.1; % input pulse width E/ ^N
MN1=0; % initial value for the space output location ,oJ$m$(Lj
dt = T/N; % time step !"
@<!
n = [-N/2:1:N/2-1]'; % Index *tl; 0<n
t = n.*dt; {7EpljH@
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 Wyb+K)Tg
u20=u10.*0.0; % input to waveguide 2 D+Z2y1
u1=u10; u2=u20; @$;I%
U1 = u1; .Z@ i z5
U2 = u2; % Compute initial condition; save it in U #eKH'fE
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. |[$TT$Fb
w=2*pi*n./T; R^yh,
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T ZUl-&P_X
L=4; % length of evoluation to compare with S. Trillo's paper n -xCaq
dz=L/M1; % space step, make sure nonlinear<0.05 L!Gpk)}[i
for m1 = 1:1:M1 % Start space evolution <4-g2.\
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS `F_R J.g*p
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; 5GURfG3{
ca1 = fftshift(fft(u1)); % Take Fourier transform ~b6c:db3
ca2 = fftshift(fft(u2)); W A#y&
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation w$jSlgUHy)
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift q( %)^C
u2 = ifft(fftshift(c2)); % Return to physical space 4UMOC_
u1 = ifft(fftshift(c1)); $Q= S`z=
if rem(m1,J) == 0 % Save output every J steps. Y,-!QFS#
U1 = [U1 u1]; % put solutions in U array Xj<xen(
U2=[U2 u2]; <ti,Wn.
MN1=[MN1 m1];
4G j
z1=dz*MN1'; % output location :,.HJ[Vg&
end FMT_X
end yL23Nqe
hg=abs(U1').*abs(U1'); % for data write to excel Ys<z%
ha=[z1 hg]; % for data write to excel X#ud_+6x
t1=[0 t']; D@m3bsMwe
hh=[t1' ha']; % for data write to excel file UTO$L|K
%dlmwrite('aa',hh,'\t'); % save data in the excel format UW{C`^?=B
figure(1) 5
axt\
waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn }wC=p>zA
figure(2) ~NIqO4 D
waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn af&P;#U
D&D-