计算脉冲在非线性耦合器中演化的Matlab 程序 bv:M
zYS S[zETRSG % This Matlab script file solves the coupled nonlinear Schrodinger equations of
b;;mhu[D % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
<Pn]{N % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
]`+J!G, % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
o|en"?4 Nh^
lC %fid=fopen('e21.dat','w');
Z:(Zy N = 128; % Number of Fourier modes (Time domain sampling points)
[[XbKg`"? M1 =3000; % Total number of space steps
wjzR 8g0bQ J =100; % Steps between output of space
h4,g pV>t T =10; % length of time windows:T*T0
OUtXu7E$ T0=0.1; % input pulse width
*DDqa?gQb MN1=0; % initial value for the space output location
e'l@M$^ dt = T/N; % time step
F=g+R~F n = [-N/2:1:N/2-1]'; % Index
C<B+! 16 t = n.*dt;
{,X}Btnwp u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
2%Mgg,/~ u20=u10.*0.0; % input to waveguide 2
DS|HN u1=u10; u2=u20;
dy'
J~Eo7 U1 = u1;
k>.n[`>$6| U2 = u2; % Compute initial condition; save it in U
E+"m@63 ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
'kb|! w=2*pi*n./T;
x=I|O;">< g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
Spm0DqqR? L=4; % length of evoluation to compare with S. Trillo's paper
Y=5}u&\ dz=L/M1; % space step, make sure nonlinear<0.05
b+#A=Z+Pr for m1 = 1:1:M1 % Start space evolution
Vi*HG &DD u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
o"gtWAGH u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
N|-'Fu ca1 = fftshift(fft(u1)); % Take Fourier transform
]EWEW*'j ca2 = fftshift(fft(u2));
]jRaR~[UN c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
ExxD
w_VGT c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
al1Nmc# u2 = ifft(fftshift(c2)); % Return to physical space
X/qLg+X u1 = ifft(fftshift(c1));
M5Q7izM if rem(m1,J) == 0 % Save output every J steps.
($T"m-e U1 = [U1 u1]; % put solutions in U array
vuoD~ =z U2=[U2 u2];
AuIg=-xR MN1=[MN1 m1];
1yd}F`{8UF z1=dz*MN1'; % output location
/H'F4-> end
!(i}FFn{: end
efrVF5,y? hg=abs(U1').*abs(U1'); % for data write to excel
zDohp 5, ha=[z1 hg]; % for data write to excel
<|>7?#s2= t1=[0 t'];
2A(?9
R9&h hh=[t1' ha']; % for data write to excel file
+ t7n6 %dlmwrite('aa',hh,'\t'); % save data in the excel format
MO-7yp:K figure(1)
xgq
`l# waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
0[In5I I figure(2)
P*:9u> waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
#`o]{UfW GX#SCZ&}C 非线性超快脉冲耦合的数值方法的Matlab程序 iOrpr,@ YwaWhBCIF 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
lN~V1(1B 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
`|`Qrv4} J.Fy0W@+k4 %f1>cO9[ _eZ*_H,\ % This Matlab script file solves the nonlinear Schrodinger equations
(T|q]29 % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
tDQuimYu7 % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
0K'^g0G % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
Q4h6K7 rWULv C=1;
z,K;GZuP M1=120, % integer for amplitude
Yaix\*II M3=5000; % integer for length of coupler
kK~,?l N = 512; % Number of Fourier modes (Time domain sampling points)
EWC{896, dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
<5E: ,< T =40; % length of time:T*T0.
.C\## dt = T/N; % time step
+rFAo00E| n = [-N/2:1:N/2-1]'; % Index
bnZ~jOHl t = n.*dt;
eufGU)M ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
W|CZA w=2*pi*n./T;
_?oofE:{ g1=-i*ww./2;
GV0-"9uwX~ g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
]$&N"&q g3=-i*ww./2;
f)19sjAJk P1=0;
wCgi@\ P2=0;
\'CA:9V} P3=1;
~-f"&@){,
P=0;
^`?M~e2FZ8 for m1=1:M1
A-f,&TO p=0.032*m1; %input amplitude
Fk#$@^c@ s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
KdXqW0nm s1=s10;
YhQ%S} s20=0.*s10; %input in waveguide 2
X" Upml s30=0.*s10; %input in waveguide 3
3eERY[ s2=s20;
tA8O(9OV s3=s30;
G\(cnqHk p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
O9ar|8y %energy in waveguide 1
"cz'|z` p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
K_ Od u^ %energy in waveguide 2
N|e#& p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
{Jc.49 %energy in waveguide 3
a.2Xl}2o5 for m3 = 1:1:M3 % Start space evolution
8(>2+#exw s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
2D2}
*);eW s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
/m|U2rrqb s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
Q<>b3X>O sca1 = fftshift(fft(s1)); % Take Fourier transform
*f o> sca2 = fftshift(fft(s2));
UY(\T8 sca3 = fftshift(fft(s3));
{I8C&GS sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
\l1==,wk sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
y.$Ae1a= sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
mtmTlGp6Lc s3 = ifft(fftshift(sc3));
G^Va$ike s2 = ifft(fftshift(sc2)); % Return to physical space
I8f=' s1 = ifft(fftshift(sc1));
~L4L|q 7 end
:i>If:>g p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
5x"eM= p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
l5/gM[0_7 p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
JbAmud, P1=[P1 p1/p10];
]d~2WX Y P2=[P2 p2/p10];
}<^QW't_Y P3=[P3 p3/p10];
..7"<"uH P=[P p*p];
|:]}u|O end
yA#nnu1 figure(1)
GfV#^qi plot(P,P1, P,P2, P,P3);
mKsJ[)#.
ejc> 转自:
http://blog.163.com/opto_wang/