计算脉冲在非线性耦合器中演化的Matlab 程序 3IU$
T0*TTB&b
% This Matlab script file solves the coupled nonlinear Schrodinger equations of y :i[~ y
% soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of >n$EeJ
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear , IMT '*
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 _Ssv:xc,
hIzPy3
%fid=fopen('e21.dat','w'); .^9/ 0.g8t
N = 128; % Number of Fourier modes (Time domain sampling points) lk+=26>
M1 =3000; % Total number of space steps /\3XARt
J =100; % Steps between output of space BZ\EqB
T =10; % length of time windows:T*T0 AT8B!m
T0=0.1; % input pulse width Ybn=Gy
MN1=0; % initial value for the space output location {R1Cxt}
dt = T/N; % time step +X%fcoc
n = [-N/2:1:N/2-1]'; % Index ?VOs:sln
t = n.*dt; $E4O^0%/p
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 ',J%Mv>Yf
u20=u10.*0.0; % input to waveguide 2 0+2Matk>.
u1=u10; u2=u20; =B o4yN
U1 = u1; &t.>^7ELF
U2 = u2; % Compute initial condition; save it in U 3*2&Fw!B
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. 2\z`G
w=2*pi*n./T; HhQPgjZ/
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T A\PV@w%Ai
L=4; % length of evoluation to compare with S. Trillo's paper vU\w3
dz=L/M1; % space step, make sure nonlinear<0.05 !Lg}q!*%>V
for m1 = 1:1:M1 % Start space evolution g*w-"%"O
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS ~qLhZR\g^
u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; y?R <g^A
ca1 = fftshift(fft(u1)); % Take Fourier transform HZr/0I?
ca2 = fftshift(fft(u2)); {C0OrO2:
c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation P`IMvOs&
c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift t#D\*:Xi
u2 = ifft(fftshift(c2)); % Return to physical space k+m_L{#m5
u1 = ifft(fftshift(c1)); p-(ADQS
if rem(m1,J) == 0 % Save output every J steps. c J"]yG)=
U1 = [U1 u1]; % put solutions in U array On96N|
U2=[U2 u2]; ?w5nKpG#RI
MN1=[MN1 m1]; =|{,5="
z1=dz*MN1'; % output location =VX<eV
end lA^Kh
end HU'`kimWb
hg=abs(U1').*abs(U1'); % for data write to excel 1Sc~Vb|>
ha=[z1 hg]; % for data write to excel ]BS{,sI
t1=[0 t']; #35S7G^ @`
hh=[t1' ha']; % for data write to excel file L&gEQDPgq|
%dlmwrite('aa',hh,'\t'); % save data in the excel format &_%+r5
figure(1) O,xAu}6f+
waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn E6^S2J2
figure(2) #V9hG9%8
waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn hk$nlc|$
zC>(!fJqq
非线性超快脉冲耦合的数值方法的Matlab程序 t+)GB=C
@Qsg.9N3K
在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。 ofrlTw&o
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 U-]PWt?C{
YDzF( ']o:
F0ivL`
uF.\dY\xv
% This Matlab script file solves the nonlinear Schrodinger equations pvwnza1
% for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of PA-0FlV|
% Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear 1.d9{LO [-
% pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 X9`C2fyVd
:~A1Ud4c
C=1; +uGP(ONY
M1=120, % integer for amplitude #y9K-}u
M3=5000; % integer for length of coupler zl8\jP
N = 512; % Number of Fourier modes (Time domain sampling points) Y X{
dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05. .L TFa.jxA
T =40; % length of time:T*T0. ZT-45_
dt = T/N; % time step +&zuI
n = [-N/2:1:N/2-1]'; % Index 2mp>Mn~K^
t = n.*dt; NwuBe:"@
ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. jvKaxB;e
w=2*pi*n./T; 7u3b aM
g1=-i*ww./2; Q@.9wEAJ
g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0; {8p?we3l1
g3=-i*ww./2; m=l3O:~J
P1=0;
! +VN
P2=0; X1z0'gvh
P3=1; 9M~$W-5
P=0; jxOVH+?l%
for m1=1:M1 ?}Ptb&Vk(
p=0.032*m1; %input amplitude 8JO\%DFJ
s10=p.*sech(p.*t); %input soliton pulse in waveguide 1 1#_j6Q2
s1=s10; OuIW|gIu0
s20=0.*s10; %input in waveguide 2 mt]YY<l
s30=0.*s10; %input in waveguide 3 EsxTBg
s2=s20; [Ik
B/Xbw|
s3=s30; 9oN'.H^
p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1)))); (']z\4o
%energy in waveguide 1 9d(v^T
p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1)))); p~;z"Z
%energy in waveguide 2 pC.P
p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1)))); 2<. /HH*f
%energy in waveguide 3 /@}# KP=
for m3 = 1:1:M3 % Start space evolution Us~wv"L=UX
s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS zyn =Xv@p
s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2; b020U>)v
s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3; (S 3kP5:F
sca1 = fftshift(fft(s1)); % Take Fourier transform E1Aa2
sca2 = fftshift(fft(s2)); Jj!tRZT
sca3 = fftshift(fft(s3)); <