计算脉冲在非线性耦合器中演化的Matlab 程序 "15mOW(!+ dWwh?{n % This Matlab script file solves the coupled nonlinear Schrodinger equations of
W!
v8'T % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
dU+28 % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
Jb
Hn/$ % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
P(8zJk6h), 8q{
%n %fid=fopen('e21.dat','w');
@x3x/gU N = 128; % Number of Fourier modes (Time domain sampling points)
'z0@|a M1 =3000; % Total number of space steps
y)X1!3~( J =100; % Steps between output of space
D|}
y{~ T =10; % length of time windows:T*T0
O+A/thI%*S T0=0.1; % input pulse width
h1} x2 MN1=0; % initial value for the space output location
c7.%Bn, dt = T/N; % time step
xG@zy4 n = [-N/2:1:N/2-1]'; % Index
\^orl9 t = n.*dt;
3yn>9qt u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
H@GiHej u20=u10.*0.0; % input to waveguide 2
q|0Lu u1=u10; u2=u20;
k;/U6,LQ* U1 = u1;
P#]%C U2 = u2; % Compute initial condition; save it in U
:KGUO{_u ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
RZi]0l_A' w=2*pi*n./T;
WQv%57+
g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
g+|1khS) L=4; % length of evoluation to compare with S. Trillo's paper
,E2Tw-% dz=L/M1; % space step, make sure nonlinear<0.05
DyIuM{Owj for m1 = 1:1:M1 % Start space evolution
#9uNJla u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
BR*,E~% u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
. S4Xw2MS ca1 = fftshift(fft(u1)); % Take Fourier transform
e$}x;&c Q ca2 = fftshift(fft(u2));
&[ejxK" c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
NPF"_[RoeV c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
p3>p1tC u2 = ifft(fftshift(c2)); % Return to physical space
s ki'I u1 = ifft(fftshift(c1));
=S7Xj`/ if rem(m1,J) == 0 % Save output every J steps.
9;KQ3.Fa}q U1 = [U1 u1]; % put solutions in U array
E-\Wo3 U2=[U2 u2];
^u`1W^> MN1=[MN1 m1];
{Hg.ctam z1=dz*MN1'; % output location
yU]NgG=z:- end
qT}<D`\ end
w6(E$:#d hg=abs(U1').*abs(U1'); % for data write to excel
UPQ?vh2F2 ha=[z1 hg]; % for data write to excel
xwoK#eC~F t1=[0 t'];
3.>M=K~09 hh=[t1' ha']; % for data write to excel file
tjYqdbA) %dlmwrite('aa',hh,'\t'); % save data in the excel format
=0!PnBGYn figure(1)
6V)P4ao waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
<WhdQKFf- figure(2)
eK[8$1 waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
n?'I&0>M ;zk& 7P0 非线性超快脉冲耦合的数值方法的Matlab程序 C.`C T7 IJ >qs8 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
^ z!g3 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
3VNYDY`> x{y}pH "H =Ji+GJ<,9 s?r:McF` % This Matlab script file solves the nonlinear Schrodinger equations
b?S,% % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
=UY)U- % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
;pn*|Bsq % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
jNRR=0 ,=!_7'm C=1;
Uj]Tdg M1=120, % integer for amplitude
2ZUI~:U Z M3=5000; % integer for length of coupler
rD^ b{]E3 N = 512; % Number of Fourier modes (Time domain sampling points)
2Iv&XxSo dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
zY_?$9l0 T =40; % length of time:T*T0.
5,Rxc= dt = T/N; % time step
C]/]ot0%t n = [-N/2:1:N/2-1]'; % Index
39Nz>Nu: t = n.*dt;
]=Im0s ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
$aIq>vJO9 w=2*pi*n./T;
%a\!|/;6 g1=-i*ww./2;
iN\m:m g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
*nZe|)m g3=-i*ww./2;
ol^uM .k%_ P1=0;
B<^yT@Wc P2=0;
H{ yUKZH* P3=1;
I$yFCd Xr P=0;
e'"2yA8dh" for m1=1:M1
">zK1t5= p=0.032*m1; %input amplitude
(x)}k&B; s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
::goqajV s1=s10;
X8m@xFW} s20=0.*s10; %input in waveguide 2
sn>2dRW{ s30=0.*s10; %input in waveguide 3
U1oZ\Mh s2=s20;
GhlbYa s3=s30;
vMD%.tk p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
(*6kYkUK %energy in waveguide 1
hD)'bd p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
{Sl#z}@s %energy in waveguide 2
7\;4 d4u p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
VK)vb.: %energy in waveguide 3
+)J;4B for m3 = 1:1:M3 % Start space evolution
X%>nvp s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
A[7\!bq5 s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
yzH(\ x s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
JCe%;U sca1 = fftshift(fft(s1)); % Take Fourier transform
/-FvC^Fj sca2 = fftshift(fft(s2));
=qWcw7!" sca3 = fftshift(fft(s3));
r$Gz sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
^Kbq.4 sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
[{&GMc
sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
?:$aX@r s3 = ifft(fftshift(sc3));
$V/Hr/0 s2 = ifft(fftshift(sc2)); % Return to physical space
x^sSAI( s1 = ifft(fftshift(sc1));
iNO}</7? end
.
.5s2 p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
#B$r|rqamq p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
V7S[rI<<r p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
FN+x<VXo( P1=[P1 p1/p10];
uge~*S P2=[P2 p2/p10];
)(/Bw&$ P3=[P3 p3/p10];
/s~(? =qYH P=[P p*p];
4{v?<x8 end
GEs5@EH figure(1)
XI5TVxo(q plot(P,P1, P,P2, P,P3);
Jc=~BT_G jtH>&O 转自:
http://blog.163.com/opto_wang/