计算脉冲在非线性耦合器中演化的Matlab 程序 XK4idC |,Xrt8O/[ % This Matlab script file solves the coupled nonlinear Schrodinger equations of
pn6!QpV5 % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
yp:_W@ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
TGe{NUO % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
)Vb_0 n=^ *k#M;e %fid=fopen('e21.dat','w');
vS|uN(a.P N = 128; % Number of Fourier modes (Time domain sampling points)
x0!5z1KQh M1 =3000; % Total number of space steps
KW.QVBuVO# J =100; % Steps between output of space
DIurFDQSS T =10; % length of time windows:T*T0
uM9[ T0=0.1; % input pulse width
vQpR0IEf]e MN1=0; % initial value for the space output location
v"&Fj dt = T/N; % time step
:LwNOuavN n = [-N/2:1:N/2-1]'; % Index
51k^?5cO t = n.*dt;
BI,j/SRK u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
$Z;?d@6yI u20=u10.*0.0; % input to waveguide 2
//}[(9b'\ u1=u10; u2=u20;
s]=s| U1 = u1;
1>SCY_Cv U2 = u2; % Compute initial condition; save it in U
3./4] _p ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
YkKq}DXj w=2*pi*n./T;
j&.MT@ g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
|NcfR"[c L=4; % length of evoluation to compare with S. Trillo's paper
`% x6;Ha dz=L/M1; % space step, make sure nonlinear<0.05
=-c"~4 for m1 = 1:1:M1 % Start space evolution
4S]`S\w u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
P#g"c.?; u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
D+.h*{gD ca1 = fftshift(fft(u1)); % Take Fourier transform
U>z8gdzu ca2 = fftshift(fft(u2));
"s]c79t c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
rI5)w_E? c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
\Om<
FH} u2 = ifft(fftshift(c2)); % Return to physical space
0vs9# <&V u1 = ifft(fftshift(c1));
xrK%3nA4s" if rem(m1,J) == 0 % Save output every J steps.
tndtwM*B' U1 = [U1 u1]; % put solutions in U array
I T)rhi: U2=[U2 u2];
K bY5
qou MN1=[MN1 m1];
1|VnPQqA z1=dz*MN1'; % output location
`V@{#+X end
*FkG32k end
F(8>"(C hg=abs(U1').*abs(U1'); % for data write to excel
p*rBT,' ha=[z1 hg]; % for data write to excel
CqUK[#kW( t1=[0 t'];
l("Dw8H hh=[t1' ha']; % for data write to excel file
s fxQ %dlmwrite('aa',hh,'\t'); % save data in the excel format
?6!7fs, figure(1)
N4%q-fi waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
4425,AR figure(2)
g(\FG waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
? {Lp
oY:6a 非线性超快脉冲耦合的数值方法的Matlab程序 GQTMQXn( zQ$*!1FmN 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
oXgKuR 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
Zi=Nr3b M?4)U"_VE |Ebwl] X2 j(!M % This Matlab script file solves the nonlinear Schrodinger equations
J'O</o@e % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
AlNiqnZ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
zxtx~XO % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
=uZ[ m<wng2`NTv C=1;
31LXzQvFG
M1=120, % integer for amplitude
qWf7k+7G M3=5000; % integer for length of coupler
[0D( PV(n N = 512; % Number of Fourier modes (Time domain sampling points)
LoLmT7 dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
?9_<LE
q T =40; % length of time:T*T0.
Z;bzp3v dt = T/N; % time step
AHP_B&s,Qe n = [-N/2:1:N/2-1]'; % Index
maLKUSgo t = n.*dt;
ZD] ^Y} ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
KAm v7 w=2*pi*n./T;
iK6L\'k g1=-i*ww./2;
V+X>t7.Q g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
D;It0" g3=-i*ww./2;
'H2TwSbIXI P1=0;
mxhO:.l P2=0;
2/qP:3) P3=1;
I|JMkP P=0;
M-u:8dPu for m1=1:M1
,V!s w5_5m p=0.032*m1; %input amplitude
\~1M\gZP s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
ci>+Zi6 s1=s10;
xR2E? 0T s20=0.*s10; %input in waveguide 2
imAsE;: s30=0.*s10; %input in waveguide 3
QF(.fq8, U s2=s20;
$
+;`[b s3=s30;
7=t4;8|j; p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
]:JoGGE a0 %energy in waveguide 1
m]BxGwT=m p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
V2cLwQ'0 %energy in waveguide 2
L5E.`^? p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
.oYUA} %energy in waveguide 3
0.C y4sH' for m3 = 1:1:M3 % Start space evolution
S,m)yh. s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
v'7,(.E s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
(,`ypD +3q s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
2&O!<C j sca1 = fftshift(fft(s1)); % Take Fourier transform
" 4#V$V sca2 = fftshift(fft(s2));
1q<BYc+z sca3 = fftshift(fft(s3));
m5SJB]a/ sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
quHq?oXV, sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
D\ ]gIXg sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
{,tEe'H7 s3 = ifft(fftshift(sc3));
.`&($W s2 = ifft(fftshift(sc2)); % Return to physical space
~h6aw s1 = ifft(fftshift(sc1));
X>j% y7v end
i
~fkjn p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
s@K)RhTY p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
+M! f}=H
p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
T>s~bIzL*e P1=[P1 p1/p10];
Io *`hA] P2=[P2 p2/p10];
BB5(=n+ P3=[P3 p3/p10];
0&2(1 P=[P p*p];
I.TdYSB end
oCdWf63D figure(1)
~YKe:K+&z plot(P,P1, P,P2, P,P3);
BpZE +0\BI<aG 转自:
http://blog.163.com/opto_wang/