计算脉冲在非线性耦合器中演化的Matlab 程序 XN6$TNsD$ 7sQHz.4 % This Matlab script file solves the coupled nonlinear Schrodinger equations of
JIw?]xa* % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
%o4v} mzV % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
AX%}ip[PC % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
rNJU &
.] j1qU 4#Y %fid=fopen('e21.dat','w');
tFc<f7k N = 128; % Number of Fourier modes (Time domain sampling points)
!ht2*8$lQ M1 =3000; % Total number of space steps
9d^m 7}2 J =100; % Steps between output of space
ykJ+LS{+ T =10; % length of time windows:T*T0
Dq<DW2It> T0=0.1; % input pulse width
N%>h>HJ MN1=0; % initial value for the space output location
F .Zk};lb dt = T/N; % time step
;+(_stxqV9 n = [-N/2:1:N/2-1]'; % Index
DZ\ '7%c t = n.*dt;
2A@oa9 u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
[;7zg@Sa u20=u10.*0.0; % input to waveguide 2
B|"/bQ u1=u10; u2=u20;
Ipq0
1
+ U1 = u1;
^'`(E_2u U2 = u2; % Compute initial condition; save it in U
i ]8bj5j{ ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
%XeN_
V w=2*pi*n./T;
@VW1^{.do^ g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
(y6q}#< L=4; % length of evoluation to compare with S. Trillo's paper
G/FDD{y dz=L/M1; % space step, make sure nonlinear<0.05
iX{2U lF7 for m1 = 1:1:M1 % Start space evolution
WA1d8nl u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
Kr'? h'F u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
g(X`.0 ca1 = fftshift(fft(u1)); % Take Fourier transform
QICxSk ca2 = fftshift(fft(u2));
j;E$7QH[ c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
T%&vq6 c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
%i/|}K u2 = ifft(fftshift(c2)); % Return to physical space
;`Xm?N u1 = ifft(fftshift(c1));
Y$"m*0 if rem(m1,J) == 0 % Save output every J steps.
$z*"@ U1 = [U1 u1]; % put solutions in U array
d>mZY66P U2=[U2 u2];
- E GZ MN1=[MN1 m1];
](Wa:U}Xs z1=dz*MN1'; % output location
|>xuH#Q end
g.di3GGi end
*S.FM.r hg=abs(U1').*abs(U1'); % for data write to excel
gCPH>8JwS0 ha=[z1 hg]; % for data write to excel
[pp|*@1T t1=[0 t'];
r,.j^a hh=[t1' ha']; % for data write to excel file
,aUbB8 %dlmwrite('aa',hh,'\t'); % save data in the excel format
f 42F@M(: figure(1)
/;Hqv`X7 waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
KMkD6g figure(2)
QN$s%&O waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
;b=diZE 1aIGC9xQ` 非线性超快脉冲耦合的数值方法的Matlab程序 *A8*FX>\F Spx%`O< 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
{_*G"A 9 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
MG.c`t/w c CDT27@ !',%kvJI "u4x#7n| % This Matlab script file solves the nonlinear Schrodinger equations
#[x*0K-h % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
/D;ugc*3 % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
CC"a2Hu/ % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
DMsqTB` }T\.;$f C=1;
5vR])T/S0 M1=120, % integer for amplitude
cMT:Ij]; M3=5000; % integer for length of coupler
}PBL N = 512; % Number of Fourier modes (Time domain sampling points)
'Z.C&6_ dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
M \k[?i T =40; % length of time:T*T0.
!lFNG:&` dt = T/N; % time step
H.>EO|p n = [-N/2:1:N/2-1]'; % Index
/0gr?I1wr7 t = n.*dt;
ak_y:O| ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
Hc>yZ:c; w=2*pi*n./T;
Zazs". g1=-i*ww./2;
Z:AB(c g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
fa/o4S< g3=-i*ww./2;
Qb)c>r P1=0;
yF6AI@y P2=0;
.5s58Hcg, P3=1;
l1<=3+d P=0;
Twd*HH for m1=1:M1
*My9r.F5o p=0.032*m1; %input amplitude
t>N2K-8Qh s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
2SlL`hN>Z s1=s10;
M6Xzyt| s20=0.*s10; %input in waveguide 2
zY*~2|q,s s30=0.*s10; %input in waveguide 3
zGz}.-F s2=s20;
YRBJ(v"9 s3=s30;
'-N5F p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
MS#*3Md&y %energy in waveguide 1
u tkdL4G}' p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
sxRKWM@4 %energy in waveguide 2
ackeq# p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
Z}vDP^rf %energy in waveguide 3
cU ?F D for m3 = 1:1:M3 % Start space evolution
UNiK6h_% s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
]v>[r?X#V s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
pi#a!Quf\ s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
Z+6WG sca1 = fftshift(fft(s1)); % Take Fourier transform
d6[' [dG sca2 = fftshift(fft(s2));
j-**\.4a~ sca3 = fftshift(fft(s3));
7 qn=W sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
z(%tu sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
wY%t# [T3 sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
6[R6P:v&'G s3 = ifft(fftshift(sc3));
8`)* ?Q9~ s2 = ifft(fftshift(sc2)); % Return to physical space
}xBO; s1 = ifft(fftshift(sc1));
FF^h(Ea end
xgkCN$zQ` p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
i
g7|kl p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
RkF^V( p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
Pke8RLg2A P1=[P1 p1/p10];
9a]o?>`E P2=[P2 p2/p10];
$]};EI# P3=[P3 p3/p10];
{4/*2IRN9h P=[P p*p];
d&|5Rk
~ end
u$5.GmKm figure(1)
~Yl.(R plot(P,P1, P,P2, P,P3);
`5Z'8^ *3={s"a.( 转自:
http://blog.163.com/opto_wang/