计算脉冲在非线性耦合器中演化的Matlab 程序 scTt53v^ OO'zIC<z % This Matlab script file solves the coupled nonlinear Schrodinger equations of
ZmycK:f % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
f3imkZ( % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
R](cko= % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
*K&
$9fah Bz|/TV?X( %fid=fopen('e21.dat','w');
]omBq<ox'Y N = 128; % Number of Fourier modes (Time domain sampling points)
{;m|\652B M1 =3000; % Total number of space steps
LM 1Vsh< J =100; % Steps between output of space
x8x-b>|$&< T =10; % length of time windows:T*T0
Jl6lZd(Np T0=0.1; % input pulse width
L4ct2|w}ul MN1=0; % initial value for the space output location
\j-:5M#m dt = T/N; % time step
`
@lNt} n = [-N/2:1:N/2-1]'; % Index
F\v~2/J5v t = n.*dt;
R,BINp u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
,b5vnW\ u20=u10.*0.0; % input to waveguide 2
]>ndFE6kl u1=u10; u2=u20;
PRNq8nmxC U1 = u1;
/{P-WRz> U2 = u2; % Compute initial condition; save it in U
<r(D\rmD ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
|
+uc;[` w=2*pi*n./T;
1*'gaa&y g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
5sj$XA?5 L=4; % length of evoluation to compare with S. Trillo's paper
I~Qi):&x dz=L/M1; % space step, make sure nonlinear<0.05
|7 Ab_ for m1 = 1:1:M1 % Start space evolution
NxDVU?@p* u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
yjq|8.L[
G u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
RTDplv; ] ca1 = fftshift(fft(u1)); % Take Fourier transform
f! )yE`4- ca2 = fftshift(fft(u2));
cct/mX2&~ c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
SSyARR+;c c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
Zz]/4 4t u2 = ifft(fftshift(c2)); % Return to physical space
G:wO1f6 u1 = ifft(fftshift(c1));
=zDvZ(5 if rem(m1,J) == 0 % Save output every J steps.
\rg;xZa5 U1 = [U1 u1]; % put solutions in U array
B/^o$i U2=[U2 u2];
:zvAlt'q= MN1=[MN1 m1];
d0f(U k z1=dz*MN1'; % output location
c/:k|x end
HD1/1?y!@q end
|5&7;;$ hg=abs(U1').*abs(U1'); % for data write to excel
XW\
3t tx ha=[z1 hg]; % for data write to excel
k7L4~W t1=[0 t'];
,H<nNBv3M hh=[t1' ha']; % for data write to excel file
3`RI[%AN~ %dlmwrite('aa',hh,'\t'); % save data in the excel format
~O!E &~ figure(1)
}RY Pr waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
Ts|;5ya5m figure(2)
rW_cLdh]# waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
#l.s>B4 ~*+evAP 非线性超快脉冲耦合的数值方法的Matlab程序 V$oj6i{ky o>T+fBHE 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
57]La^# 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
]2ycJ >w ?YDMl 8Bh
micU opu)9]`z % This Matlab script file solves the nonlinear Schrodinger equations
Bn=YGEvz % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
~V?\@R:g % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
w>}n1Nc$G % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
\OWxf[ _JA)""l% C=1;
^gNbcWc7CU M1=120, % integer for amplitude
0]$-}AYM M3=5000; % integer for length of coupler
B(6*U~Kn% N = 512; % Number of Fourier modes (Time domain sampling points)
]1|7V|N6 dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
l8_RA T =40; % length of time:T*T0.
_\=
/~>Xl dt = T/N; % time step
II[-6\d! n = [-N/2:1:N/2-1]'; % Index
(v:8p!QN t = n.*dt;
^ P
A|RFP ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
V`YmGo w=2*pi*n./T;
N pQOLX/<? g1=-i*ww./2;
] \!,yiVeU g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
v |pHbX g3=-i*ww./2;
8YgRJQZ! P1=0;
x") Bmw$ P2=0;
%|f@WxNrU P3=1;
$BB^xJ\O P=0;
kGakdLl for m1=1:M1
Bs>S2] p=0.032*m1; %input amplitude
ljz=u;O) s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
5$X 8|Ve s1=s10;
Y$j!-l5z s20=0.*s10; %input in waveguide 2
]gF=I5jn] s30=0.*s10; %input in waveguide 3
-~H
"zu` s2=s20;
/ T_v8{D s3=s30;
9y} J|z p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
BGOS( %energy in waveguide 1
1]A\@( p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
Zw%:mZN
%energy in waveguide 2
i~M-V=Zg p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
?[WUix; %energy in waveguide 3
Nd@/U
c for m3 = 1:1:M3 % Start space evolution
w_LkS/ s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
U7,.L s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
=KD[#au6a s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
iU=:YPE+. sca1 = fftshift(fft(s1)); % Take Fourier transform
YdB/s1|G sca2 = fftshift(fft(s2));
62G%.'7 sca3 = fftshift(fft(s3));
h=n\c6Q sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
(OavgJ+Y sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
9VIAOky- sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
L}_VT
J s3 = ifft(fftshift(sc3));
q6%m .X7 s2 = ifft(fftshift(sc2)); % Return to physical space
}>3jHWxLc s1 = ifft(fftshift(sc1));
ORXH<;^0y end
rsw=a_S p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
vNZ"x)? p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
_6YfPk+ p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
y`/:E<fVk P1=[P1 p1/p10];
!.4q{YWcYk P2=[P2 p2/p10];
E(f|LG[I P3=[P3 p3/p10];
9J<vkxG9` P=[P p*p];
' 8Q}pp` end
5a2;@}%V figure(1)
ygK,t*T20 plot(P,P1, P,P2, P,P3);
xf|C{XV@H %/!f^PIwX 转自:
http://blog.163.com/opto_wang/