计算脉冲在非线性耦合器中演化的Matlab 程序 95!xTf
M}5 C;E*
% This Matlab script file solves the coupled nonlinear Schrodinger equations of ,Xh4(Gn#b
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of _+;x4K;
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear _>`0!mG
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 ./g0T{&
GS{9MGl
%fid=fopen('e21.dat','w'); 9xKFX|*$
N = 128; % Number of Fourier modes (Time domain sampling points) cn\_;TYiJ
M1 =3000; % Total number of space steps g]ihwm~
J =100; % Steps between output of space e.jgV=dT-
T =10; % length of time windows:T*T0 uyA9`~p=#
T0=0.1; % input pulse width NFSPw`f
MN1=0; % initial value for the space output location TRq~n7Y7C
dt = T/N; % time step 8EE7mEmLH
n = [-N/2:1:N/2-1]'; % Index Ci*5E$+\
t = n.*dt; x9ws@=[:
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 & aLR'*]6
u20=u10.*0.0; % input to waveguide 2 T5Fah#-4
u1=u10; u2=u20; xxiLi46/
U1 = u1; Ml3F\ fAW
U2 = u2; % Compute initial condition; save it in U ld?M,Qd
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. OS9v.pz
w=2*pi*n./T; r"Bf@va
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T 14&EdTG.
L=4; % length of evoluation to compare with S. Trillo's paper 08`
@u4
dz=L/M1; % space step, make sure nonlinear<0.05 lR(&Wc\j
for m1 = 1:1:M1 % Start space evolution drZw#b
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS )5t_tPv
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; L9kP8&&KK
ca1 = fftshift(fft(u1)); % Take Fourier transform W#wM PsB
ca2 = fftshift(fft(u2)); + mcN6/
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation uJO*aA{K
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift i!HGM=f
u2 = ifft(fftshift(c2)); % Return to physical space gky_]7Av
u1 = ifft(fftshift(c1)); fr?eOigbl
if rem(m1,J) == 0 % Save output every J steps. qb<gh D=j
U1 = [U1 u1]; % put solutions in U array O>Sbb2q?"
U2=[U2 u2]; ` WB|h)Y
MN1=[MN1 m1]; Gs6#aL}]R
z1=dz*MN1'; % output location pE<' '`
end h>/ViB@"W|
end l}^#kHSyd
hg=abs(U1').*abs(U1'); % for data write to excel |l|]Tw
ha=[z1 hg]; % for data write to excel G](K2=
t1=[0 t']; ;H=6u
hh=[t1' ha']; % for data write to excel file xr/k.Fz
%dlmwrite('aa',hh,'\t'); % save data in the excel format _"bx#B*
figure(1) s7e'9Bx
waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn }:mI6zsNj
figure(2) ^\?9W
waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn }B-A*TI<h
}rE|\p>
非线性超快脉冲耦合的数值方法的Matlab程序 H6O\U2+
Y'5ck(
在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。 i/~J0qQ
Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 GN<I|mGLJK
0o]K6b
#dft-23
rA`\we)
% This Matlab script file solves the nonlinear Schrodinger equations {5udol5?
% for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of ~c^-DAgB
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear agYKaM1N
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 z!+<m<
yjq
)}y,tF
C=1; 9zyN8v2
M1=120, % integer for amplitude s]iOC6v
M3=5000; % integer for length of coupler XbC8t &Q],
N = 512; % Number of Fourier modes (Time domain sampling points) M9K).P=
dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05. DX";v
J
T =40; % length of time:T*T0. IT(c'}
dt = T/N; % time step h 3&:"*A2
n = [-N/2:1:N/2-1]'; % Index
%\cC]<>
t = n.*dt; z aF0nov
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. mSfhl(<L
w=2*pi*n./T; Lvq]SzOw
g1=-i*ww./2; A 5 X+Z
g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0; )ta5y7np
g3=-i*ww./2; zmFFBf"<
P1=0; |pqpF?h5|
P2=0; cPcV[6)5K9
P3=1; -G;1U
P=0; 9pcf jx..
for m1=1:M1 ".%LBs~$
p=0.032*m1; %input amplitude =]a@)6y
s10=p.*sech(p.*t); %input soliton pulse in waveguide 1 fn OkH
s1=s10; =!^iiHF
s20=0.*s10; %input in waveguide 2 /wE_eK.
s30=0.*s10; %input in waveguide 3 s%oAsQ_y
s2=s20; \z9?rvT:
s3=s30; R3n&o%$*
p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1)))); >U<nEnB$?
%energy in waveguide 1 4C%>/*%8>
p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1)))); k~f+L O
%energy in waveguide 2 #sU~fq
p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1)))); h50StZ8Yr
%energy in waveguide 3 8>Z$/1Mh
for m3 = 1:1:M3 % Start space evolution aT#{t{gkA
s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS Vb^s 'k
s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2; $ud>Z;X=P
s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3; 41o!2(e$
sca1 = fftshift(fft(s1)); % Take Fourier transform >iH).:j
sca2 = fftshift(fft(s2)); w3qf7{b
sca3 = fftshift(fft(s3)); t`T\d\
sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift jF{gDK
sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz); V6MT> T
sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz); yH%+cmp7
s3 = ifft(fftshift(sc3)); 9K46>_TyH
s2 = ifft(fftshift(sc2)); % Return to physical space C;q}3c*L
s1 = ifft(fftshift(sc1)); SU
O;
end &OR