计算脉冲在非线性耦合器中演化的Matlab 程序 yA}nPXrd
gV`S%
% This Matlab script file solves the coupled nonlinear Schrodinger equations of #M:B3C!ouY
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of RAOKZ~`
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear iiN?\OO^~
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 gvr]]}h:O
Hdna{@~
%fid=fopen('e21.dat','w'); .f%vDBJS
N = 128; % Number of Fourier modes (Time domain sampling points) \E&th p
M1 =3000; % Total number of space steps s((b"{fFb
J =100; % Steps between output of space gix>DHq$k
T =10; % length of time windows:T*T0 @Yarz1
T0=0.1; % input pulse width J[o${^
MN1=0; % initial value for the space output location &<t79d%{
dt = T/N; % time step =W|vOfy
n = [-N/2:1:N/2-1]'; % Index "i(U
t = n.*dt; un&>
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 pLo;#e8'f
u20=u10.*0.0; % input to waveguide 2 ec1Fg0Fa
u1=u10; u2=u20; `.`FgaJ
|
U1 = u1; wOM<XhZ
U2 = u2; % Compute initial condition; save it in U fv/v|
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. ~D_rZ&
w=2*pi*n./T; ULck
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T x3_,nl
L=4; % length of evoluation to compare with S. Trillo's paper *V<)p%l.
dz=L/M1; % space step, make sure nonlinear<0.05 *Ji9%IA
for m1 = 1:1:M1 % Start space evolution 2X^iV09
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS /t5g"n3
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; YpiRF+G
ca1 = fftshift(fft(u1)); % Take Fourier transform Uv'uqt
ca2 = fftshift(fft(u2)); wvX"D0eVn
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation ec#_olG%
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift 63SVIc~wT
u2 = ifft(fftshift(c2)); % Return to physical space 4a1BGNI%SW
u1 = ifft(fftshift(c1)); |&(H^<+Xp
if rem(m1,J) == 0 % Save output every J steps. k=FcPF"
U1 = [U1 u1]; % put solutions in U array QdirE4W
U2=[U2 u2]; (w}r7`n
MN1=[MN1 m1]; R'r|E_
z1=dz*MN1'; % output location a0)vvo=bz
end _3I3AG0e
end EO"=\C,
hg=abs(U1').*abs(U1'); % for data write to excel :nt}7Dn'
ha=[z1 hg]; % for data write to excel EI<"DB
t1=[0 t']; svF*@(-P#
hh=[t1' ha']; % for data write to excel file Qk|( EFQ9
%dlmwrite('aa',hh,'\t'); % save data in the excel format Fr<Pe&d