计算脉冲在非线性耦合器中演化的Matlab 程序 Ccw6,2`& rTiW % This Matlab script file solves the coupled nonlinear Schrodinger equations of
8Q&hhmOnz % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
Y7yh0r_ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
R)AFaP | % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
`[<j5(T d?RKobk %fid=fopen('e21.dat','w');
GB1[`U% N = 128; % Number of Fourier modes (Time domain sampling points)
S(^*DV M1 =3000; % Total number of space steps
!4 4 )=xW J =100; % Steps between output of space
=gCv`SFW T =10; % length of time windows:T*T0
\>8"r,hG| T0=0.1; % input pulse width
=rV*iLy MN1=0; % initial value for the space output location
xD}ha dt = T/N; % time step
f -N: n = [-N/2:1:N/2-1]'; % Index
<n iq* t = n.*dt;
-0 [^w u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
AR i_m u20=u10.*0.0; % input to waveguide 2
P#/k5]g u1=u10; u2=u20;
#<X+)B6t U1 = u1;
0f).F U2 = u2; % Compute initial condition; save it in U
t>J 43 ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
5eI3a!E]O w=2*pi*n./T;
;?>xuC$ g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
_7(>0GY L=4; % length of evoluation to compare with S. Trillo's paper
N4$!V}pp dz=L/M1; % space step, make sure nonlinear<0.05
_cqBp7 for m1 = 1:1:M1 % Start space evolution
#{)=%5=c u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
_L mDF8Q( u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
/ c1=`OJ ca1 = fftshift(fft(u1)); % Take Fourier transform
[HJ^'/bB' ca2 = fftshift(fft(u2));
z116i?7EnV c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
7]t$t3I` c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
seh1(q?Va4 u2 = ifft(fftshift(c2)); % Return to physical space
eeX^zaKl] u1 = ifft(fftshift(c1));
| I_,;c if rem(m1,J) == 0 % Save output every J steps.
kw8?::
< U1 = [U1 u1]; % put solutions in U array
fRp+-QvE U2=[U2 u2];
&>UI { MN1=[MN1 m1];
jTbJL z1=dz*MN1'; % output location
WQ/H8rOs end
=v-BzF15 end
e_Na_l] hg=abs(U1').*abs(U1'); % for data write to excel
@!0@f'}e ha=[z1 hg]; % for data write to excel
6/ir("LK t1=[0 t'];
TAbd[:2{F hh=[t1' ha']; % for data write to excel file
<]6])f,y\ %dlmwrite('aa',hh,'\t'); % save data in the excel format
NIcPjo figure(1)
{_0m0
8 waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
^nu~q+:+# figure(2)
i1]*5;q waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
eMk?#&a) 0xbx2jlkY 非线性超快脉冲耦合的数值方法的Matlab程序 Fp>iwdjFg `mTpL^f 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
a?bSMt}
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
fZK&h. }D_h*9 413,O~^ PtySPDClj % This Matlab script file solves the nonlinear Schrodinger equations
.
:Q[Z % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
LAG*H % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
6/`$Y!.ub % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
x8i;uH\8 n?vw|'(} C=1;
+cQGX5 K M1=120, % integer for amplitude
}gQ FWT M3=5000; % integer for length of coupler
)N`a4p N = 512; % Number of Fourier modes (Time domain sampling points)
C8qA+dri dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
Kh<xQ:eMy T =40; % length of time:T*T0.
_5'OQ'P2 dt = T/N; % time step
J;|r00M n = [-N/2:1:N/2-1]'; % Index
ydo"H9NOS t = n.*dt;
U4]>8L ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
KE3/sw0 w=2*pi*n./T;
5$o]D g1=-i*ww./2;
}oHA@o5 g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
BgLW!|T[ g3=-i*ww./2;
'\qd{mM\r P1=0;
M>hHTa?W P2=0;
+g8wc(<ik P3=1;
G}1?lO_d` P=0;
<Cc}MDM604 for m1=1:M1
<rd7<@>5D p=0.032*m1; %input amplitude
fC>3{@h}* s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
VT1Nd s1=s10;
t2Dx$vT*& s20=0.*s10; %input in waveguide 2
`2 X~3im s30=0.*s10; %input in waveguide 3
E)liuu!qI s2=s20;
'EFSr!+ s3=s30;
K7 >Z)21 p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
zlC|Sp af %energy in waveguide 1
fx@Hd!nO~" p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
*sI`+4h[ %energy in waveguide 2
8F|8zX& p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
"Sp+Q&2U %energy in waveguide 3
s)Bmi for m3 = 1:1:M3 % Start space evolution
u^H: z0 s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
l]Ozy@
Ib s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
?n o.hf s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
!yAg!V
KY sca1 = fftshift(fft(s1)); % Take Fourier transform
vJ96qX sca2 = fftshift(fft(s2));
'^f,H1oW sca3 = fftshift(fft(s3));
2Cd#~ sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
&6%%_Lw$ sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
D<9FSxl6 sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
jUjgxP*7m s3 = ifft(fftshift(sc3));
U
X)k;h s2 = ifft(fftshift(sc2)); % Return to physical space
6u>${} s1 = ifft(fftshift(sc1));
S#+Dfa`8X end
9-)D"ZhLe p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
&oJ= p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
AF5.)Y@. p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
9?c0cwP? P1=[P1 p1/p10];
/mLOh2T P2=[P2 p2/p10];
Xq`|'6]/ P3=[P3 p3/p10];
uM"G)$I\ P=[P p*p];
y/t{*a
end
FHpS ?htRy figure(1)
j'Ry.8} plot(P,P1, P,P2, P,P3);
"N'tmzifh g:0-`,[ 转自:
http://blog.163.com/opto_wang/