计算脉冲在非线性耦合器中演化的Matlab 程序 pm-SDp>s =U6%Wdth % This Matlab script file solves the coupled nonlinear Schrodinger equations of
l;I)$=={= % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
==[a7|q % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
2\xv Yf- % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
+6=2B0$
r Gu-*@C:^& %fid=fopen('e21.dat','w');
LV'@JFT- N = 128; % Number of Fourier modes (Time domain sampling points)
LCrE1Q%VP M1 =3000; % Total number of space steps
ydCVG," J =100; % Steps between output of space
asDq(J`sQ T =10; % length of time windows:T*T0
K +oFu% T0=0.1; % input pulse width
+`_I! MN1=0; % initial value for the space output location
,7mRb-*p dt = T/N; % time step
m]yt6b4 n = [-N/2:1:N/2-1]'; % Index
JCu3,O!q t = n.*dt;
I<q=lK u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
x<'(b7{U0 u20=u10.*0.0; % input to waveguide 2
*TpzX
y u1=u10; u2=u20;
R6ynL([xh U1 = u1;
}nDKSC/[V! U2 = u2; % Compute initial condition; save it in U
u.wm;eK[ ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
1sL#XB$@N w=2*pi*n./T;
E$-u:Z<- g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
h)EHaaf L=4; % length of evoluation to compare with S. Trillo's paper
E\V-<]o dz=L/M1; % space step, make sure nonlinear<0.05
"5]Fl8c?
for m1 = 1:1:M1 % Start space evolution
I*/?*p/I u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
Th&*
d; u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
S4j` =<T, ca1 = fftshift(fft(u1)); % Take Fourier transform
b_&;i4[ ca2 = fftshift(fft(u2));
?*}^xXI/ c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
B5>1T[T'- c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
yJx{6 u2 = ifft(fftshift(c2)); % Return to physical space
i2ap] u1 = ifft(fftshift(c1));
jXEuK:exQ if rem(m1,J) == 0 % Save output every J steps.
({#9gTP2b U1 = [U1 u1]; % put solutions in U array
6N}>@Y5 U2=[U2 u2];
~+1t3M e MN1=[MN1 m1];
*x EcX6ZHX z1=dz*MN1'; % output location
6&pI{ end
olNgtSX end
uqy b hg=abs(U1').*abs(U1'); % for data write to excel
%RE-_~GF ha=[z1 hg]; % for data write to excel
d,fX3 t1=[0 t'];
O2|[g8(_F hh=[t1' ha']; % for data write to excel file
|wASeZMO2 %dlmwrite('aa',hh,'\t'); % save data in the excel format
\Kph?l9Ww figure(1)
`I(#.* waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
sd;J(<Ofh figure(2)
{shf\pm!o waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
RbUhLcG5 box(FjrZE 非线性超快脉冲耦合的数值方法的Matlab程序
?*i qg[: vEJ2d& 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
tAfdbt 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
#}50oWE usb.cE3z ;[*jLi,uc }cK<2J# % This Matlab script file solves the nonlinear Schrodinger equations
<eU28M?\ % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
8}m bfuo1 % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
kG:,Ff> % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
@SREyqC4 VeixwGZ. C=1;
a+$WlG/x M1=120, % integer for amplitude
/ ,3,l^kZ M3=5000; % integer for length of coupler
>[ r
TUn; N = 512; % Number of Fourier modes (Time domain sampling points)
O$}p}%%y7 dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
r<]Db&k
T =40; % length of time:T*T0.
Qe=,EXf dt = T/N; % time step
MWv_BXQ n = [-N/2:1:N/2-1]'; % Index
6"^Yn.
t = n.*dt;
S Rs~p ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
N&`VMEB)k w=2*pi*n./T;
,3_;JT"5 g1=-i*ww./2;
x{Y}1+Y4 g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
j4wcxZYY~ g3=-i*ww./2;
)i&z!|/2 P1=0;
%T]NM3|U P2=0;
mQmn &:R P3=1;
J /3qJst P=0;
D}|PBR for m1=1:M1
zzsQfI# p=0.032*m1; %input amplitude
0-H! \IB s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
IUco
8 s1=s10;
yT Pi/=G s20=0.*s10; %input in waveguide 2
^06f\7A s30=0.*s10; %input in waveguide 3
8d9&LPv s2=s20;
H`/QhE s3=s30;
rrK&XP& p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
5y7rY!]Bf %energy in waveguide 1
9-;ujl?{ p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
k9j_#\E[ %energy in waveguide 2
8H4"mxO p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
jEj#|w %energy in waveguide 3
gakmg#ki for m3 = 1:1:M3 % Start space evolution
u.(
WW(/N s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
av>c s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
ea3;1-b: s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
uGm~ Oo sca1 = fftshift(fft(s1)); % Take Fourier transform
y:Xs/RS sca2 = fftshift(fft(s2));
RXa&*Jtr - sca3 = fftshift(fft(s3));
|cpBoU sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
(4_7ICFI sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
-x~h.s, sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
>r%L=22+ s3 = ifft(fftshift(sc3));
&V7@ TZ s2 = ifft(fftshift(sc2)); % Return to physical space
QjH;'OVt s1 = ifft(fftshift(sc1));
70NQ9*AAy end
r\7F}ZW/ p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
yX%T-/XJ p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
oJC-? p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
K8NoY6 P1=[P1 p1/p10];
j.Ro(0% P2=[P2 p2/p10];
,Y&LlB 2 P3=[P3 p3/p10];
}X{#=*$GQ P=[P p*p];
,bT|:T@ny end
L3:dANG figure(1)
7'wt/9 plot(P,P1, P,P2, P,P3);
2N_8ahc n:JWu0,h 转自:
http://blog.163.com/opto_wang/