计算脉冲在非线性耦合器中演化的Matlab 程序 [P0c,97_
H y~Yv^'Epf % This Matlab script file solves the coupled nonlinear Schrodinger equations of
xFJT&=Af W % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
v;-0^s/P % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
JG&E"j#q % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
kM@e_YtpY *M$mAy< %fid=fopen('e21.dat','w');
N"tX K N = 128; % Number of Fourier modes (Time domain sampling points)
gPA8A>U)[ M1 =3000; % Total number of space steps
t=My=pG J =100; % Steps between output of space
x>,wmk5) T =10; % length of time windows:T*T0
6
8fnh'I! T0=0.1; % input pulse width
tOte[~, MN1=0; % initial value for the space output location
2}bXX'Y dt = T/N; % time step
S6\E
I5S n = [-N/2:1:N/2-1]'; % Index
X\w["!B t = n.*dt;
P.g./8N`z u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
*3OlWnZ? u20=u10.*0.0; % input to waveguide 2
q2OF-.rE u1=u10; u2=u20;
c<~DYe;; U1 = u1;
J_j4Zb% K U2 = u2; % Compute initial condition; save it in U
SUIu.4Mz ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
L_|iQwU% w=2*pi*n./T;
Wb#<ctM> g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
MRZN4<}9 L=4; % length of evoluation to compare with S. Trillo's paper
O2yD{i#l*# dz=L/M1; % space step, make sure nonlinear<0.05
XiV
K4sD8 for m1 = 1:1:M1 % Start space evolution
xls
US'Eo u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
9i
lJ u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
,\1Rf. ca1 = fftshift(fft(u1)); % Take Fourier transform
b|may/xWH ca2 = fftshift(fft(u2));
!KT.p2\ c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
QFN 9j c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
tUW^dGo. u2 = ifft(fftshift(c2)); % Return to physical space
nv7)X2jja u1 = ifft(fftshift(c1));
h,-i\8gq if rem(m1,J) == 0 % Save output every J steps.
9b&;4Yq!f U1 = [U1 u1]; % put solutions in U array
ke KsLrd U2=[U2 u2];
*a0#PfS[ MN1=[MN1 m1];
Os].
IL$ z1=dz*MN1'; % output location
r+6 DlT
a end
[}
d39 end
lPC{R k.\C hg=abs(U1').*abs(U1'); % for data write to excel
^^24a_+2 ha=[z1 hg]; % for data write to excel
-UAMHd}4 t1=[0 t'];
DHyQ:0q hh=[t1' ha']; % for data write to excel file
ftRdK>a
D %dlmwrite('aa',hh,'\t'); % save data in the excel format
\}<J>R@ figure(1)
^y93h8\y waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
R<hsG%BS(D figure(2)
&B1!,joH~ waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
ar'VoL} 0B2f[A 非线性超快脉冲耦合的数值方法的Matlab程序 ACFEM9 [= #Aj#C> 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
a@9W'/?igk 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
C43I(.2g 7Up-a^k^`
J-azBi %U.x9UL % This Matlab script file solves the nonlinear Schrodinger equations
vXSA_"0t % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
rTOex]@N % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
{K|ds($ 5 % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
q1 BpE8 m(5LXHJnv C=1;
Q&@<?K9 M1=120, % integer for amplitude
P]2 /}\f M3=5000; % integer for length of coupler
Cv&>:k0V N = 512; % Number of Fourier modes (Time domain sampling points)
`r}a:w- dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
.vIRz-S T =40; % length of time:T*T0.
&N3a`Ua dt = T/N; % time step
$RHw6*COG n = [-N/2:1:N/2-1]'; % Index
e(OKE7 t = n.*dt;
uKJo5%> ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
1gvh6eE
F w=2*pi*n./T;
!:uh? RW g1=-i*ww./2;
naeppBo g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
nDLiER;U g3=-i*ww./2;
9\E];~"iP P1=0;
~H[_= P2=0;
]D^; Ca P3=1;
JuRWR0@` P=0;
RaymSh for m1=1:M1
Pp4Q)2X p=0.032*m1; %input amplitude
=BV_? s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
+K2HMf' s1=s10;
c"Q9ob s20=0.*s10; %input in waveguide 2
h^w# I s30=0.*s10; %input in waveguide 3
:Fh _Ya0 s2=s20;
"CFU$~ s3=s30;
!NKPy+v p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
jCg4$),b %energy in waveguide 1
a",
8N"' p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
ZLf(m35 %energy in waveguide 2
\!0~$?_)P p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
n2["Ln mO %energy in waveguide 3
&##JZ for m3 = 1:1:M3 % Start space evolution
/CbM-jf s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
h<WTN_i} s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
v|jwz.jM s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
=}e{U&CX sca1 = fftshift(fft(s1)); % Take Fourier transform
6}\J-A/ sca2 = fftshift(fft(s2));
lZ`@ }^& sca3 = fftshift(fft(s3));
hsI9{j]f sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
^~bAixH^k sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
Ro2!$[P sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
KJV],6d s3 = ifft(fftshift(sc3));
:<1PCX2 s2 = ifft(fftshift(sc2)); % Return to physical space
|4` ;G(ta s1 = ifft(fftshift(sc1));
Dkg-y9 end
WxtB:7J p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
HLq2avs\ p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
yoBR'$-= p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
VlxHZ P1=[P1 p1/p10];
C33RXt$X P2=[P2 p2/p10];
}. V!|R, P3=[P3 p3/p10];
bHzH0v]: P=[P p*p];
SMA' VU end
0j' Xi_uM figure(1)
)hfI,9I~ plot(P,P1, P,P2, P,P3);
sz4;hSTy l?x'R("{ 转自:
http://blog.163.com/opto_wang/