计算脉冲在非线性耦合器中演化的Matlab 程序 !-T#dU fhZwYx&t % This Matlab script file solves the coupled nonlinear Schrodinger equations of
pW8?EGO@ % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
"24d:vf\ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
+&"W:Le: % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
5YPIv- P\WHM( %fid=fopen('e21.dat','w');
gYbvCs8O! N = 128; % Number of Fourier modes (Time domain sampling points)
;Co"bP's M1 =3000; % Total number of space steps
?z M J =100; % Steps between output of space
}`
`oojz T =10; % length of time windows:T*T0
GB `n T0=0.1; % input pulse width
BeRs;^r+ MN1=0; % initial value for the space output location
8bMw.u=F dt = T/N; % time step
{=I,+[( n = [-N/2:1:N/2-1]'; % Index
"K>!+< t = n.*dt;
l]DRJ u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
o/
\o-kC} u20=u10.*0.0; % input to waveguide 2
p=[dt u1=u10; u2=u20;
Hh](n<Bs U1 = u1;
Z{(Gib~{N U2 = u2; % Compute initial condition; save it in U
|1ry*~ ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
:,H_
e!
X w=2*pi*n./T;
|:(B I5&S g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
ZHA&gdK@ L=4; % length of evoluation to compare with S. Trillo's paper
vr47PM2al dz=L/M1; % space step, make sure nonlinear<0.05
.6n|hYe for m1 = 1:1:M1 % Start space evolution
J.2BBy u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
E.$//P n|1 u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
HWoMzp5="3 ca1 = fftshift(fft(u1)); % Take Fourier transform
"AJ>pU3 ca2 = fftshift(fft(u2));
Qh3+4nLFtb c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
$aXYtHI c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
X+emJ&Z$@ u2 = ifft(fftshift(c2)); % Return to physical space
-$s1k~o u1 = ifft(fftshift(c1));
p(4Ek" if rem(m1,J) == 0 % Save output every J steps.
0=`aXb- U1 = [U1 u1]; % put solutions in U array
/mE:2K]C U2=[U2 u2];
%E,-dw MN1=[MN1 m1];
P'_ aNU z1=dz*MN1'; % output location
*sfz+8Y end
Obc, end
3 5-FD{ hg=abs(U1').*abs(U1'); % for data write to excel
]6=opvm ha=[z1 hg]; % for data write to excel
uTbMp~cYB t1=[0 t'];
Y=pRenV' hh=[t1' ha']; % for data write to excel file
F r2
+p %dlmwrite('aa',hh,'\t'); % save data in the excel format
OB,T>o@ figure(1)
TKw>eGe waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
?aG ~E figure(2)
@J@bD+Q+0 waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
IfRrl/!nw ^kB9
I8u 非线性超快脉冲耦合的数值方法的Matlab程序 v Ma$JPauI 84Hm
PPt 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
~;I{d7z,; 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
U/(R_U>= mW_A3S5 0XIrEwm@% \BsvUGd % This Matlab script file solves the nonlinear Schrodinger equations
9qZ|=r]y' % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
QQ,w:OjA0 % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
<* PjG}Z. % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
e8]mdU{) 10/3 -)+ C=1;
0j/i):@ M1=120, % integer for amplitude
T?5F0WKi M3=5000; % integer for length of coupler
-gS/ N = 512; % Number of Fourier modes (Time domain sampling points)
Q;1$gImFz dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
yFP#z5G T =40; % length of time:T*T0.
3^&pb dt = T/N; % time step
b;|^62 n = [-N/2:1:N/2-1]'; % Index
tQ?}x#J t = n.*dt;
p/s5[>N ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
}S&SL) w=2*pi*n./T;
9=~jKl%\vJ g1=-i*ww./2;
XlNB9\"5 g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
Md m(xUs g3=-i*ww./2;
~RE`@/wQ] P1=0;
R?\8SdJ P2=0;
Vk~}^;`Y P3=1;
`wG&Cy]v P=0;
r>q`# ~ for m1=1:M1
4 ]8PF p=0.032*m1; %input amplitude
7~`6~qg. s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
u09OnP\ s1=s10;
qOa-@MN s20=0.*s10; %input in waveguide 2
`^N;%[c`z s30=0.*s10; %input in waveguide 3
I3aEg s2=s20;
||,;07 s3=s30;
N4mQN90t p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
/ci.IT$Q^ %energy in waveguide 1
Ap> n4~ p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
,|c_l) %energy in waveguide 2
$S cjEG:6 p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
#6m//0 u %energy in waveguide 3
T@HozZ for m3 = 1:1:M3 % Start space evolution
;NPb s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
I~T?tm s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
nocH~bAf2 s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
KJkcmF}Q sca1 = fftshift(fft(s1)); % Take Fourier transform
$1@{Zz!S sca2 = fftshift(fft(s2));
/iQ>he~fy sca3 = fftshift(fft(s3));
i\eykYc, sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
Rx<pV_|H, sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
U&a]gkr sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
nMbV{h , s3 = ifft(fftshift(sc3));
E|Lh$9XONA s2 = ifft(fftshift(sc2)); % Return to physical space
G0&w#j s1 = ifft(fftshift(sc1));
BzUx@, end
Q\z*q,^R p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
3a S>U # p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
p.IfJ| p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
Zj^H3h P1=[P1 p1/p10];
CUd'*Ewu P2=[P2 p2/p10];
~gDtj&F P3=[P3 p3/p10];
]-`{kX P=[P p*p];
gddGl=rm end
zj)[Sntn? figure(1)
+]_} \ plot(P,P1, P,P2, P,P3);
Q&\k"X 1 eK@Y] !lz 转自:
http://blog.163.com/opto_wang/