计算脉冲在非线性耦合器中演化的Matlab 程序 q(.:9A*0 EuyXgK>g % This Matlab script file solves the coupled nonlinear Schrodinger equations of
Nz],IG. % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
CJJzCVj % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
'F$l{iR % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
:=/>Vbd: ) .tzG_ %fid=fopen('e21.dat','w');
Dm-zMCf}Q N = 128; % Number of Fourier modes (Time domain sampling points)
@++.FEf M1 =3000; % Total number of space steps
iTAx=SG J =100; % Steps between output of space
EodQ*{l T =10; % length of time windows:T*T0
2L} SJUk* T0=0.1; % input pulse width
1][S#H/? MN1=0; % initial value for the space output location
Y!gCMLL dt = T/N; % time step
.5y+fL n = [-N/2:1:N/2-1]'; % Index
_;UE9S% t = n.*dt;
h?8]C#6^ u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
h9Y%{v u20=u10.*0.0; % input to waveguide 2
zN:K%AiGxe u1=u10; u2=u20;
/|eA9 ] U1 = u1;
0QOBL'{7) U2 = u2; % Compute initial condition; save it in U
=aoMii ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
#EsNeBu w=2*pi*n./T;
p~,]*y:XT g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
K3x.RQQ- L=4; % length of evoluation to compare with S. Trillo's paper
~?FpU dz=L/M1; % space step, make sure nonlinear<0.05
Ou1JIxZ)| for m1 = 1:1:M1 % Start space evolution
li 6%) u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
7TDy.] u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
zOa_X~!@ ca1 = fftshift(fft(u1)); % Take Fourier transform
x*nSHb ca2 = fftshift(fft(u2));
OC<5E121>Y c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
Hr]h
Jc c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
ktdW`R\+ u2 = ifft(fftshift(c2)); % Return to physical space
/S(zff[at u1 = ifft(fftshift(c1));
HAJ 7m!P if rem(m1,J) == 0 % Save output every J steps.
pFHz"] U1 = [U1 u1]; % put solutions in U array
(m:Zk$ U2=[U2 u2];
q11>f MN1=[MN1 m1];
_cJ2\`M z1=dz*MN1'; % output location
rjP L+T_ end
FTQ%JTgT end
GrAujc5| hg=abs(U1').*abs(U1'); % for data write to excel
frT]5?{ ha=[z1 hg]; % for data write to excel
4W)B'+ZK8 t1=[0 t'];
x>* Drm 7 hh=[t1' ha']; % for data write to excel file
tP2qK_\e= %dlmwrite('aa',hh,'\t'); % save data in the excel format
$W9{P; figure(1)
^,;z|f'%* waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
?hWwj6i& figure(2)
\&i P`v`K waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
[zlN!.Z [vHv0" 非线性超快脉冲耦合的数值方法的Matlab程序 [5MJwRM^!; ZOQTINf 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
z3K6%rb- 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
Q'YH>oGh^ d)R:9M}v j/nWb`#y sh`s/JRf % This Matlab script file solves the nonlinear Schrodinger equations
pk3<| % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
N%"Y % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
YJ;j x0 % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
{jho&Ai (jFGa2{ C=1;
v%s`~~u%^ M1=120, % integer for amplitude
i]|Yg$ M3=5000; % integer for length of coupler
tdSfi<y5I N = 512; % Number of Fourier modes (Time domain sampling points)
UF<uU-C" dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
{6c2{@ T =40; % length of time:T*T0.
pm\x~3jHs dt = T/N; % time step
LK, bO| n = [-N/2:1:N/2-1]'; % Index
5KDGSo t = n.*dt;
HaYE9/xS ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
'C
~y5j w=2*pi*n./T;
_',prZ* g1=-i*ww./2;
ALNc'MW! g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
OV%Q3$15 g3=-i*ww./2;
HN.3 P1=0;
&*7?)eI!i P2=0;
MwR0@S}* P3=1;
0LfU=X0#7 P=0;
H*Kj3NgY for m1=1:M1
a e*Mf7 p=0.032*m1; %input amplitude
LF~*^n> s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
f"9q^ s1=s10;
>9q&PEc s20=0.*s10; %input in waveguide 2
KTn}w:+B\ s30=0.*s10; %input in waveguide 3
}*ZHgf]~# s2=s20;
1e>s{ s3=s30;
NDs!a p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
sp5eVAd %energy in waveguide 1
u)V#S:9] p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
72X0Tq 4 %energy in waveguide 2
HE'2"t[a p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
8 XICF %energy in waveguide 3
Xy@7y[s] for m3 = 1:1:M3 % Start space evolution
n< ud> JIb s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
GF>'\@Th s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
( @3\`\X s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
L dm?JrU sca1 = fftshift(fft(s1)); % Take Fourier transform
0MkSf* sca2 = fftshift(fft(s2));
CMCO}# sca3 = fftshift(fft(s3));
z%e8K( sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
)E,\H@A sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
Rhe Re sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
-Y
H< s3 = ifft(fftshift(sc3));
Pp|*J^U 4 s2 = ifft(fftshift(sc2)); % Return to physical space
7hi"6, s1 = ifft(fftshift(sc1));
c{&*w")J end
8S<@"v p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
KM!k$;my p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
2con[!U p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
nIoPC[%_
P1=[P1 p1/p10];
:J:,m P2=[P2 p2/p10];
* 0|IXGr P3=[P3 p3/p10];
.>mr%#p P=[P p*p];
5e}A@GyC end
CXO2N1~(J figure(1)
x)JOClLr plot(P,P1, P,P2, P,P3);
>A<bBK# .%^]9/4 转自:
http://blog.163.com/opto_wang/