计算脉冲在非线性耦合器中演化的Matlab 程序
6H'HxB4
/tUy3myJ
% This Matlab script file solves the coupled nonlinear Schrodinger equations of IKi5 v~bE
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of -=(!g&0
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear Kw#i),M
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 %*\es7m}
z@w Mc
EH
%fid=fopen('e21.dat','w'); mQY_`&Jq
N = 128; % Number of Fourier modes (Time domain sampling points) $jg*pmR-
M1 =3000; % Total number of space steps f"St&q>[s
J =100; % Steps between output of space n/h,Lr)Z
T =10; % length of time windows:T*T0 SCz(5[MZJ
T0=0.1; % input pulse width ca>Z7qT!
MN1=0; % initial value for the space output location &\Amn?Iq
dt = T/N; % time step z(H^..<!5
n = [-N/2:1:N/2-1]'; % Index ~{Mn{
t = n.*dt; N&M~0iw
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 ?2oHZ%G
u20=u10.*0.0; % input to waveguide 2 .B\ 5OI,]
u1=u10; u2=u20; $H-!j%hV
U1 = u1; [/X4"D-uOK
U2 = u2; % Compute initial condition; save it in U SXy=<%ed
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. AW,53\ 0
w=2*pi*n./T; 6qaulwV4t
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T 3JVK
L=4; % length of evoluation to compare with S. Trillo's paper >ss/D^YS
dz=L/M1; % space step, make sure nonlinear<0.05 :duo#w"K
for m1 = 1:1:M1 % Start space evolution R%'^ gFk8
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS HB7;0yt`:
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; ]Oif|k`{
ca1 = fftshift(fft(u1)); % Take Fourier transform }oNhl^JC
ca2 = fftshift(fft(u2)); 2/0v B>
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation L>YU,I\o
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift 3Oi
nK['
u2 = ifft(fftshift(c2)); % Return to physical space qv@$ZLR
u1 = ifft(fftshift(c1)); m o:D9
if rem(m1,J) == 0 % Save output every J steps. lgb?)=
U1 = [U1 u1]; % put solutions in U array Rb{U+/gq
U2=[U2 u2]; Q*b]_0Rb
MN1=[MN1 m1]; M6}3wM*4
z1=dz*MN1'; % output location 'CN|'W)g7
end WASU0
end Oj^,m.R
hg=abs(U1').*abs(U1'); % for data write to excel ^6_Cc
ha=[z1 hg]; % for data write to excel 7bV{Q355P
t1=[0 t']; M-giR:,
hh=[t1' ha']; % for data write to excel file 67VT\f
%dlmwrite('aa',hh,'\t'); % save data in the excel format iURk=*Z=
figure(1) fF V!)Zj
waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn )lZp9O
figure(2) Lg+G; W
waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn <NuUW9+
oDU ;E
非线性超快脉冲耦合的数值方法的Matlab程序 B}&x