计算脉冲在非线性耦合器中演化的Matlab 程序 nw-%!}Ot" \0veld % This Matlab script file solves the coupled nonlinear Schrodinger equations of
a@S{A5j % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
Bra}HjHO % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
AM0CIRX$ % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
9RPZj>ezjA %M,^)lRP %fid=fopen('e21.dat','w');
u[E0jI N = 128; % Number of Fourier modes (Time domain sampling points)
LzQOzl@z M1 =3000; % Total number of space steps
K(,MtY* J =100; % Steps between output of space
,m Nd# T =10; % length of time windows:T*T0
JT! Cb$! T0=0.1; % input pulse width
I {%Y0S MN1=0; % initial value for the space output location
60G(jO14 dt = T/N; % time step
\iRmGvT n = [-N/2:1:N/2-1]'; % Index
!l-Q.=yw t = n.*dt;
cE^Ljk u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
P0/Ctke; u20=u10.*0.0; % input to waveguide 2
MCAWn
H u1=u10; u2=u20;
+bGO"* U1 = u1;
< V*/1{ U2 = u2; % Compute initial condition; save it in U
&u!MI ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
rI OKCL? w=2*pi*n./T;
-W{ !`<8D g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
t)5.m} L=4; % length of evoluation to compare with S. Trillo's paper
j+PLtE dz=L/M1; % space step, make sure nonlinear<0.05
C]Q`!e for m1 = 1:1:M1 % Start space evolution
DYF(O-hJK u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
OFxCV`>ce u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
Pm]lr|Q{I ca1 = fftshift(fft(u1)); % Take Fourier transform
;@*<M\O ca2 = fftshift(fft(u2));
?
q_% c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
%ol\ sO| c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
V aoqI u2 = ifft(fftshift(c2)); % Return to physical space
Zu*7t<W u1 = ifft(fftshift(c1));
]XASim:A if rem(m1,J) == 0 % Save output every J steps.
x];i?
4 U1 = [U1 u1]; % put solutions in U array
KF6N P U2=[U2 u2];
xn>N/+, MN1=[MN1 m1];
Mh2Zj z1=dz*MN1'; % output location
r~G amjS end
~z(0XKq0d end
<=Saf. hg=abs(U1').*abs(U1'); % for data write to excel
*a^wYWa ha=[z1 hg]; % for data write to excel
;9Qxq] t1=[0 t'];
!>N+a3
hh=[t1' ha']; % for data write to excel file
p"6ydXn% %dlmwrite('aa',hh,'\t'); % save data in the excel format
'h@&rr@5 figure(1)
3 Q~0b+k waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
2tg 07 figure(2)
1#*^+A E waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
@ULd~ C[';B)a 非线性超快脉冲耦合的数值方法的Matlab程序 kxR!hA8wv4 bXeJk]#y 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
1\%@oD_zG 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
4M!wm]n/%5 E5#ff5 wv`ar>qVL ^ZIs >.' % This Matlab script file solves the nonlinear Schrodinger equations
P'o]#Az % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
/'zXb_R,$ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
-Mf-8zw8G % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
=4sx(< |S~$IFN4 C=1;
3ZN\F M1=120, % integer for amplitude
d+vAm3.Dg M3=5000; % integer for length of coupler
K%W;-W*' N = 512; % Number of Fourier modes (Time domain sampling points)
)H`V\H[0P dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
7[mP@ { T =40; % length of time:T*T0.
P#MUS_x dt = T/N; % time step
&^w" n = [-N/2:1:N/2-1]'; % Index
Q{5.;{/eC t = n.*dt;
Y78DYbU. ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
$ce*W9` w=2*pi*n./T;
89j:YfA=v g1=-i*ww./2;
'(SivD g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
LqO=wK~ g3=-i*ww./2;
*&I
_fAh] P1=0;
l8J2Xd @ P2=0;
c[V.j+Iy#^ P3=1;
;>/yY]F7 P=0;
^QjkZ^<dD for m1=1:M1
U<r!G;^` p=0.032*m1; %input amplitude
j/q&qrlL s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
y>:U&P^ s1=s10;
7=NKbv] s20=0.*s10; %input in waveguide 2
>|`1aCg, s30=0.*s10; %input in waveguide 3
L0I|V[ s2=s20;
p5py3k s3=s30;
(>Nwd^ p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
HO_(it \ %energy in waveguide 1
{2QP6X sJ p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
;y{(#X# %energy in waveguide 2
;q5|If p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
6nJQP a %energy in waveguide 3
+sTPTCLE for m3 = 1:1:M3 % Start space evolution
~g%Ht#< s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
{LVA_7@ s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
? HNuffk s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
Sk C.A? sca1 = fftshift(fft(s1)); % Take Fourier transform
\rATmjsKzS sca2 = fftshift(fft(s2));
l@1=./L? sca3 = fftshift(fft(s3));
,jtaTG.> sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
pr1bsrMuL sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
19-V;F@; sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
717G
CL@ s3 = ifft(fftshift(sc3));
r&Qa;-4Pl s2 = ifft(fftshift(sc2)); % Return to physical space
ZR-64G=L, s1 = ifft(fftshift(sc1));
^ fyue~9u end
LEe{fc?{ p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
Ryygq,>VD. p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
A|]#b?- p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
_~D#?cFY6 P1=[P1 p1/p10];
-rjQ^ze P2=[P2 p2/p10];
Jf0i$ P3=[P3 p3/p10];
e ky1} P=[P p*p];
l!KPgRw end
)v11j.D figure(1)
()w;~$J plot(P,P1, P,P2, P,P3);
e*}GQ 8h4]<T 转自:
http://blog.163.com/opto_wang/