计算脉冲在非线性耦合器中演化的Matlab 程序 S=_vv)6+4 xI>A6 % This Matlab script file solves the coupled nonlinear Schrodinger equations of
kJWN. % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
x.8TRMk^ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
s"Pf+aTW % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
=K{\p`? TuW %zF/ %fid=fopen('e21.dat','w');
`tjH< N = 128; % Number of Fourier modes (Time domain sampling points)
GA7}K:LP'k M1 =3000; % Total number of space steps
6JKqn~0Kk J =100; % Steps between output of space
~"UV]Udn T =10; % length of time windows:T*T0
&WNf
M+ T0=0.1; % input pulse width
%Y!Yvw^&P( MN1=0; % initial value for the space output location
)M__
t5L dt = T/N; % time step
~ek$C n = [-N/2:1:N/2-1]'; % Index
|9~GM t = n.*dt;
j"AU z)x u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
Q#nOJ(KV u20=u10.*0.0; % input to waveguide 2
#j *d^j& u1=u10; u2=u20;
gJ2>(k03y U1 = u1;
71vkyn@" U2 = u2; % Compute initial condition; save it in U
]E] 2o ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
E;<l(.Ar w=2*pi*n./T;
kOh{l: 2-+ g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
$.9{if#o& L=4; % length of evoluation to compare with S. Trillo's paper
)T;?^kho dz=L/M1; % space step, make sure nonlinear<0.05
6252N]* for m1 = 1:1:M1 % Start space evolution
i hh/sPi u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
KiJT!moB u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
< yC ca1 = fftshift(fft(u1)); % Take Fourier transform
&3yD_P_3 ca2 = fftshift(fft(u2));
wm+/e#'& c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
ID#I`}h.k c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
Ug&,Y/tFw2 u2 = ifft(fftshift(c2)); % Return to physical space
q$aaA`E% u1 = ifft(fftshift(c1));
R'S0 zp6 if rem(m1,J) == 0 % Save output every J steps.
Q>n|^y6 U1 = [U1 u1]; % put solutions in U array
}1>[ U2=[U2 u2];
F'hHK.tT MN1=[MN1 m1];
msVOH%wH z1=dz*MN1'; % output location
v%fu end
h,Q3oy\s1 end
JA)] _H
P hg=abs(U1').*abs(U1'); % for data write to excel
ei
rzYt ha=[z1 hg]; % for data write to excel
<vXGi t1=[0 t'];
)c8j} hh=[t1' ha']; % for data write to excel file
?(R]9.5S %dlmwrite('aa',hh,'\t'); % save data in the excel format
gdkwWoN. figure(1)
=2@B& waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
Vb9',a?#n figure(2)
-YsLd 9^4 waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
\?je Wyo +wkjS r`e 非线性超快脉冲耦合的数值方法的Matlab程序 IEU^#=n 1AU#%wIEP 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
o`Ta("9^ 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
&gjF4~W] !E T~KL! fJ ,1Ef;Z ",!1m7[wF % This Matlab script file solves the nonlinear Schrodinger equations
J9=m]R8T % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
9]e V?yoA8 % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
yrR1[aT % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
Q:5KZm[ [ l&[;rh C=1;
~q~MoN<R M1=120, % integer for amplitude
X$yN_7|+ M3=5000; % integer for length of coupler
hXA6D) N = 512; % Number of Fourier modes (Time domain sampling points)
a<@N-E xr dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
Z ,EvQ8i T =40; % length of time:T*T0.
G_SG dt = T/N; % time step
v'BZs n = [-N/2:1:N/2-1]'; % Index
,u/aT5\_ t = n.*dt;
@WI2hHD ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
hiUD]5Kp w=2*pi*n./T;
D&S26jrZ g1=-i*ww./2;
&o<F7U'R g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
6,9o>zT%H g3=-i*ww./2;
/IsS;0K%L P1=0;
I}t#%/'YA P2=0;
7[.6axL P3=1;
. Z%{'CC P=0;
lIProF0 for m1=1:M1
AhNq/?Q Q~ p=0.032*m1; %input amplitude
Hbpqyl%O> s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
##4GK08! s1=s10;
4)("v-p s20=0.*s10; %input in waveguide 2
&SrO) s30=0.*s10; %input in waveguide 3
*f?4
s2=s20;
ZfB"
E s3=s30;
*<J*S#] p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
KhMSL %energy in waveguide 1
qs QNjt p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
CXC`sPY %energy in waveguide 2
rs~wv(' p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
' Tc]KXD6 %energy in waveguide 3
&0`)
Q for m3 = 1:1:M3 % Start space evolution
[B|MlrZ
s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
EbdfV-E s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
*Q,0W:~- s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
7R\oj8[ sca1 = fftshift(fft(s1)); % Take Fourier transform
.<Zy|1
4 sca2 = fftshift(fft(s2));
-*XCxU' sca3 = fftshift(fft(s3));
]Ei0d8Uo sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
|Z*J/v'@p sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
}|XtypbL sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
(e[}/hf6 s3 = ifft(fftshift(sc3));
D`VM6/iQR s2 = ifft(fftshift(sc2)); % Return to physical space
VL*ovD%- s1 = ifft(fftshift(sc1));
|P%DkM*X end
67VT\f p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
iURk=*Z= p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
fF V!)Zj p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
)lZp9O P1=[P1 p1/p10];
YWxc-fPZ P2=[P2 p2/p10];
0gfA#|' P3=[P3 p3/p10];
zNIsf" P=[P p*p];
%y%j*B!% end
YE9,KVV;$n figure(1)
pb=cBZ$ plot(P,P1, P,P2, P,P3);
ZAXN6h
!OuWPH.
: 转自:
http://blog.163.com/opto_wang/