计算脉冲在非线性耦合器中演化的Matlab 程序 8<o(z'&y
rVO+
vhih
% This Matlab script file solves the coupled nonlinear Schrodinger equations of AvwX 2?tc
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of P--#5W;^oB
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear ei"FN3 Rm
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 1,/oS&?E
p'R}z|d)
%fid=fopen('e21.dat','w'); ^o{O5&i]
N = 128; % Number of Fourier modes (Time domain sampling points) Axcm~!uf
M1 =3000; % Total number of space steps :xA'X+d/'
J =100; % Steps between output of space >Qi2;t~G
T =10; % length of time windows:T*T0 'Kq%tM26!
T0=0.1; % input pulse width {:"bX~<^
MN1=0; % initial value for the space output location LsmC/+7r$1
dt = T/N; % time step YlYTH_L>E
n = [-N/2:1:N/2-1]'; % Index phNv^R+
t = n.*dt; v3[
2!UXq
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 1ptP ey
u20=u10.*0.0; % input to waveguide 2 EBn7waBS
u1=u10; u2=u20; S4\T (
U1 = u1; [#.QDe
U2 = u2; % Compute initial condition; save it in U d6Z;\f7[
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. P!-9cd1C,
w=2*pi*n./T; N".
af)5
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T uh GL1{
L=4; % length of evoluation to compare with S. Trillo's paper | 0&~fY
dz=L/M1; % space step, make sure nonlinear<0.05 , n+dB2\
for m1 = 1:1:M1 % Start space evolution sqkPC_;A
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS toP7b
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; $V@IRBm
ca1 = fftshift(fft(u1)); % Take Fourier transform PB`94W
ca2 = fftshift(fft(u2)); X09&S4
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation gXF.e.uU
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift PsTwJLY
u2 = ifft(fftshift(c2)); % Return to physical space x&kF;UC
u1 = ifft(fftshift(c1)); p(
z.[
if rem(m1,J) == 0 % Save output every J steps. 0uj3kr?cv
U1 = [U1 u1]; % put solutions in U array C^uXJ~8
U2=[U2 u2]; yJ?4B?p(
MN1=[MN1 m1]; x=9drKIw>
z1=dz*MN1'; % output location -()CgtSR
end eE7+fMP{
end oo/#]a
hg=abs(U1').*abs(U1'); % for data write to excel _RAPXU~ 6-
ha=[z1 hg]; % for data write to excel )WD<Q x&