计算脉冲在非线性耦合器中演化的Matlab 程序 M%dXy^e Zu\(XN?62 % This Matlab script file solves the coupled nonlinear Schrodinger equations of
x?:[:Hf % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
,c@^u6a % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
{q%wr* % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
ISI\<qx )QGj\2I %fid=fopen('e21.dat','w');
a
W`q N = 128; % Number of Fourier modes (Time domain sampling points)
uoYG@L2 M1 =3000; % Total number of space steps
yVvO! J =100; % Steps between output of space
3[E3]]OVa T =10; % length of time windows:T*T0
C:/O]slH T0=0.1; % input pulse width
gRS}Y8 MN1=0; % initial value for the space output location
TKpka]nJ dt = T/N; % time step
Sni Ck*T, n = [-N/2:1:N/2-1]'; % Index
.v36xX K( t = n.*dt;
XO+^q9 u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
4tR:O#($V u20=u10.*0.0; % input to waveguide 2
(PjC]`FK u1=u10; u2=u20;
84UH&
b'n U1 = u1;
|*W`}i U2 = u2; % Compute initial condition; save it in U
|1zoT|}q ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
.az+'1 w=2*pi*n./T;
Y]aVa2!Wb g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
5A,@$yp+ L=4; % length of evoluation to compare with S. Trillo's paper
PG<tic<? dz=L/M1; % space step, make sure nonlinear<0.05
m$ZPQ0X for m1 = 1:1:M1 % Start space evolution
f"zXiUV u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
CfKvC u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
bI
3o| ca1 = fftshift(fft(u1)); % Take Fourier transform
6]yYiz2Xn ca2 = fftshift(fft(u2));
v/{LC4BF c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
ufE;rcYE c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
>4>!zZ u2 = ifft(fftshift(c2)); % Return to physical space
`9BZ))Pg u1 = ifft(fftshift(c1));
ct+ ;W if rem(m1,J) == 0 % Save output every J steps.
S"ZH5O( U1 = [U1 u1]; % put solutions in U array
LeDty_ U2=[U2 u2];
U|QLc MN1=[MN1 m1];
QH:k5V~ z1=dz*MN1'; % output location
XdX1GH*C end
jj2 [Zh/h end
YvD+Lk' hm hg=abs(U1').*abs(U1'); % for data write to excel
6?I,sZW ha=[z1 hg]; % for data write to excel
q}[g/% t1=[0 t'];
h+)XLs hh=[t1' ha']; % for data write to excel file
~u-DuOZ8 %dlmwrite('aa',hh,'\t'); % save data in the excel format
egMl(~D figure(1)
C7#ji"t waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
D#}t)$" figure(2)
f%fD>a waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
fYrC;&n #zflU99d 非线性超快脉冲耦合的数值方法的Matlab程序 wVU.j$+_# c++GnQc. 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
Y5nj _xQJL 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
\c1u$'| v E9e|+$ N>kY$ *
b&[bfM< % This Matlab script file solves the nonlinear Schrodinger equations
a *?bnw? % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
Fk(nf9M% % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
:.8@ xVH % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
VfWU-lJ G?`{OW3:_ C=1;
iNj*Gj M1=120, % integer for amplitude
v_M-:e3` M3=5000; % integer for length of coupler
}LK +w+h~ N = 512; % Number of Fourier modes (Time domain sampling points)
T1,Nb>gBq^ dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
En01LrC? T =40; % length of time:T*T0.
h9<*+T dt = T/N; % time step
M)sM G
C n = [-N/2:1:N/2-1]'; % Index
+9LIpU&5 t = n.*dt;
\ZN> 7?Vs ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
.nDB{@# w=2*pi*n./T;
jSi\/(E g1=-i*ww./2;
Rq`B'G9|c g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
mhh^kwW g3=-i*ww./2;
{}gx;v) P1=0;
%gBulvg P2=0;
kAc8[Hn P3=1;
u={A4A# P=0;
90g=&O5@O for m1=1:M1
>\f'Q Q p=0.032*m1; %input amplitude
v_U+wga s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
Tvp ~~Dk s1=s10;
jEK{QOq0 s20=0.*s10; %input in waveguide 2
Z`jc*jgy s30=0.*s10; %input in waveguide 3
d\eTyN'rA s2=s20;
M N-j$-y} s3=s30;
l!S}gbM p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
\%],pZsA ~ %energy in waveguide 1
=:neGqd\_E p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
%=w@c %energy in waveguide 2
"~V|p3 p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
6gr?#D -F %energy in waveguide 3
IOL5p*:gz for m3 = 1:1:M3 % Start space evolution
4Nylc.2mi s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
M~h^~:Lk s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
]2zzY::Sd= s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
9Rf})$o+ sca1 = fftshift(fft(s1)); % Take Fourier transform
`1xJ1z# sca2 = fftshift(fft(s2));
_;zIH5 H sca3 = fftshift(fft(s3));
r<)>k.]
! sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
d ,"L8 sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
PiL[&_8g sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
P3e}G-Oz s3 = ifft(fftshift(sc3));
3'*}ZDC s2 = ifft(fftshift(sc2)); % Return to physical space
v35!?
5{ s1 = ifft(fftshift(sc1));
:o37 V! end
yb/v?q?Fk p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
K^6fg,& p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
@Z+(J:Grm5 p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
z5tOsU P1=[P1 p1/p10];
n0
q$/Y. P2=[P2 p2/p10];
dj}y6V& P3=[P3 p3/p10];
tNbL) P=[P p*p];
~;AJB end
:qAF}|6 figure(1)
fkHCfcU plot(P,P1, P,P2, P,P3);
^X\{MW'>4 bVgmjt2&> 转自:
http://blog.163.com/opto_wang/