计算脉冲在非线性耦合器中演化的Matlab 程序 ,cwjieM -,pw[R % This Matlab script file solves the coupled nonlinear Schrodinger equations of
~7O.}RP0 % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
$e/[!3CASP % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
bVW2Tjc: % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
#4wia%}u ^hyp}WN %fid=fopen('e21.dat','w');
T@gm0igW/; N = 128; % Number of Fourier modes (Time domain sampling points)
y%@C-: M1 =3000; % Total number of space steps
k35E,?T J =100; % Steps between output of space
OqlP_^Zz7p T =10; % length of time windows:T*T0
V}po T0=0.1; % input pulse width
|0s)aV|K MN1=0; % initial value for the space output location
4u+4LB* dt = T/N; % time step
rpMjDjW n = [-N/2:1:N/2-1]'; % Index
$G D@e0 t = n.*dt;
mb#&yK(h u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
Mx_O'D u20=u10.*0.0; % input to waveguide 2
?8TIPz J u1=u10; u2=u20;
:Lh`Q"a U1 = u1;
-;W`0k^ U2 = u2; % Compute initial condition; save it in U
v i~NfD@s ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
qN@0k>11? w=2*pi*n./T;
L3|~
i&k g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
[;, Xp/ L=4; % length of evoluation to compare with S. Trillo's paper
Vm]u-R`{ dz=L/M1; % space step, make sure nonlinear<0.05
B4{clI _i for m1 = 1:1:M1 % Start space evolution
Mcm%G# u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
~X<Ie9m1x u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
WLA LXJ7 ca1 = fftshift(fft(u1)); % Take Fourier transform
(GB*+@ ca2 = fftshift(fft(u2));
-0:Equ?pz c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
(\*+HZ`(Uu c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
||o :A u2 = ifft(fftshift(c2)); % Return to physical space
"|6763.{4 u1 = ifft(fftshift(c1));
YAJr@v+Ls if rem(m1,J) == 0 % Save output every J steps.
aZB$%#'vR U1 = [U1 u1]; % put solutions in U array
C)qy=lx% U2=[U2 u2];
q&d5V~q MN1=[MN1 m1];
j@C*kj;- z1=dz*MN1'; % output location
vq-#%o end
MGfIA?u end
z!>ml3 hg=abs(U1').*abs(U1'); % for data write to excel
v|@1W Uc,g ha=[z1 hg]; % for data write to excel
Kp?j\67S t1=[0 t'];
5sI9GC hh=[t1' ha']; % for data write to excel file
%mr6p}E| %dlmwrite('aa',hh,'\t'); % save data in the excel format
{/}p"(^ figure(1)
m'YYkq(5%Z waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
oa2v/P1` figure(2)
L6n<h waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
EB2 5N~7 <EM'|IR? 非线性超快脉冲耦合的数值方法的Matlab程序 d[$YTw Z<W`5sop^ 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
+xn59V 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
_>4Qh#6K }/g1s71 _(0GAz%9 C[s='v~} % This Matlab script file solves the nonlinear Schrodinger equations
D9;s% % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
M.0N`NmS % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
M$MFUGS' % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
Yu_`
>so <0!)}O C=1;
ZP;WXB` M1=120, % integer for amplitude
qY$]^gS M3=5000; % integer for length of coupler
Dx>~^ ^< N = 512; % Number of Fourier modes (Time domain sampling points)
w
.+B h dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
4">C0m;ks T =40; % length of time:T*T0.
#5=!ew dt = T/N; % time step
dO|n[/qL0 n = [-N/2:1:N/2-1]'; % Index
W}rL HAaDh t = n.*dt;
Wk-jaz ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
t:yJ~En]= w=2*pi*n./T;
h[}e5A]} g1=-i*ww./2;
K}TSwY g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
Y JMaIFt g3=-i*ww./2;
X}G3>HcP P1=0;
r(DW,xoK0 P2=0;
XG;Dj<Dm P3=1;
[28Vf"#] P=0;
J[jzkzSu` for m1=1:M1
K\y
W{y1 p=0.032*m1; %input amplitude
6<m9guv s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
|P(8T' s1=s10;
)bR`uV9< s20=0.*s10; %input in waveguide 2
Yrmd
hSY s30=0.*s10; %input in waveguide 3
gib'f@i ; s2=s20;
bPUldkB: s3=s30;
23*OuY p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
akV-|v_ %energy in waveguide 1
4StoEgFS p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
( Qj;B) %energy in waveguide 2
*rv7#!]. p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
#55_hY# %energy in waveguide 3
!G~`5?CvE for m3 = 1:1:M3 % Start space evolution
7Kn}KO!Y8 s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
L#Rj~&U s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
prO ~g s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
"s.s(TR8 sca1 = fftshift(fft(s1)); % Take Fourier transform
b3l~wp6> sca2 = fftshift(fft(s2));
a}5/?/ sca3 = fftshift(fft(s3));
U}^`R,C sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
!A'3Mw\Nm sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
%{ +>\0x sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
y?ypRCgO.u s3 = ifft(fftshift(sc3));
\<Di|X1 s2 = ifft(fftshift(sc2)); % Return to physical space
/5"RedP< s1 = ifft(fftshift(sc1));
Zx
U?d end
!T
RU p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
'l6SL-
< p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
(65|QA p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
Fb<fQIa P1=[P1 p1/p10];
}-T
: P2=[P2 p2/p10];
gX;)A|9e P3=[P3 p3/p10];
]@
N::!m P=[P p*p];
xy+hrbD)j end
't'2z figure(1)
h_\OtoRa plot(P,P1, P,P2, P,P3);
*IIuGtS ~en' E 转自:
http://blog.163.com/opto_wang/