计算脉冲在非线性耦合器中演化的Matlab 程序 ilr'<5rq bji^b@us_ % This Matlab script file solves the coupled nonlinear Schrodinger equations of
PRQEk.C % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
S2,tv % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
|(77ao3 % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
7wB*@a- _KZ&/ %fid=fopen('e21.dat','w');
Q$lgC
v^M N = 128; % Number of Fourier modes (Time domain sampling points)
N&jHU+{OU M1 =3000; % Total number of space steps
J*FUJT J =100; % Steps between output of space
lNs;-`I~ T =10; % length of time windows:T*T0
%]1.)j T0=0.1; % input pulse width
0LD$"0v/C3 MN1=0; % initial value for the space output location
%(YU*Tf~ dt = T/N; % time step
Wkj0z]]? n = [-N/2:1:N/2-1]'; % Index
CD:$22*] t = n.*dt;
YQ$EN>.eO u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
V(c>1xLlz u20=u10.*0.0; % input to waveguide 2
N3$%!\~O u1=u10; u2=u20;
V N<omi+4 U1 = u1;
1];OGJuJ2 U2 = u2; % Compute initial condition; save it in U
s=[T,:Z ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
} 8&? w=2*pi*n./T;
UEeq@ot/ 4 g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
,:=g}i L=4; % length of evoluation to compare with S. Trillo's paper
7GG:1:2+> dz=L/M1; % space step, make sure nonlinear<0.05
Q@0Zh,l for m1 = 1:1:M1 % Start space evolution
Ahf71YP u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
&w'1 u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
wS+ekt5 ca1 = fftshift(fft(u1)); % Take Fourier transform
tQWjNP~ ca2 = fftshift(fft(u2));
sEzl4I c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
+Z=%4 c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
Hzc5BC u2 = ifft(fftshift(c2)); % Return to physical space
R8bKE(*rxj u1 = ifft(fftshift(c1));
dng^#|X)? if rem(m1,J) == 0 % Save output every J steps.
f[fH1cu&` U1 = [U1 u1]; % put solutions in U array
NE5H\ U2=[U2 u2];
[x8_ax}w MN1=[MN1 m1];
%Kzu&*9Hb z1=dz*MN1'; % output location
s8V:;$ ! end
W87kE?, end
&qyXi[vw hg=abs(U1').*abs(U1'); % for data write to excel
vTsMq>%,< ha=[z1 hg]; % for data write to excel
z0T9tN!( t1=[0 t'];
;6}> Shs hh=[t1' ha']; % for data write to excel file
^d@ME<mb %dlmwrite('aa',hh,'\t'); % save data in the excel format
}Yargj_Gn figure(1)
FxdWJ|rN9D waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
9 .18E(- figure(2)
*4OB
88$ waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
VOGx w\lc;4U 非线性超快脉冲耦合的数值方法的Matlab程序 f<y-{.VnN$ +F]=Z 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
MREB 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
`R
m<1 a3J'
c Z9q1z~qSQ vI \8@97 % This Matlab script file solves the nonlinear Schrodinger equations
MGLcM&oR % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
vlC$0P % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
}fZ~HqS2w % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
7* R
%zJ tSVU,m C=1;
h@CP M1=120, % integer for amplitude
?
J/NYV M3=5000; % integer for length of coupler
Go)}%[@w N = 512; % Number of Fourier modes (Time domain sampling points)
Vy 7 )_D dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
q+ 2v9K@ T =40; % length of time:T*T0.
PwnfXsR dt = T/N; % time step
N nq r{ub n = [-N/2:1:N/2-1]'; % Index
Hq
aay t = n.*dt;
xV"~?vD ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
{RN-rF3w w=2*pi*n./T;
#H;1)G(/ g1=-i*ww./2;
i
hcSS Um g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
s0m k<>z g3=-i*ww./2;
KM9H<;A P1=0;
I#/"6%e P2=0;
GG
%*d] P3=1;
x}~Z[ bx P=0;
PckAL for m1=1:M1
HdRwDW@7= p=0.032*m1; %input amplitude
-ND1+`yD s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
/^$n&gI s1=s10;
S;j"@'gz9 s20=0.*s10; %input in waveguide 2
%gu | s30=0.*s10; %input in waveguide 3
qRL45[ K s2=s20;
|]eWO#vs s3=s30;
Y-+JDrK p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
Ym?VF{e, %energy in waveguide 1
{wD:!\5 p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
S5\KI+;PW %energy in waveguide 2
xoQ(GrBY p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
LKgo(&mY %energy in waveguide 3
pP%9MSCi for m3 = 1:1:M3 % Start space evolution
)cU$I) s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
JC#5CCz s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
63QF1*gPH s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
Fg0!2MKq* sca1 = fftshift(fft(s1)); % Take Fourier transform
wW7# M sca2 = fftshift(fft(s2));
oG\lejO sca3 = fftshift(fft(s3));
W9;9\k sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
UAGh2?q2 sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
:OV6R, sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
"gt1pf~y s3 = ifft(fftshift(sc3));
h0")NBRV& s2 = ifft(fftshift(sc2)); % Return to physical space
{E.A?yej9 s1 = ifft(fftshift(sc1));
Y8c,+D,Ww end
7n*"9Ai( p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
{a]u p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
6Zx5^f(qd p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
0,B"p P1=[P1 p1/p10];
wQ8<%qi"L P2=[P2 p2/p10];
h-\Ov{~ P3=[P3 p3/p10];
<j1r6.E) P=[P p*p];
i,rX.K}X end
e.W <pI, figure(1)
'n}] plot(P,P1, P,P2, P,P3);
Y]!&, e, KE-0/m4yJ 转自:
http://blog.163.com/opto_wang/