计算脉冲在非线性耦合器中演化的Matlab 程序 jC>l<d_ X9C)FS % This Matlab script file solves the coupled nonlinear Schrodinger equations of
@=q,,t$r % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
lob{{AB,! % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
DG}YQr.L % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
cy8+@77 #<|5<U %fid=fopen('e21.dat','w');
[vb>5EhL! N = 128; % Number of Fourier modes (Time domain sampling points)
j>X;a39| M1 =3000; % Total number of space steps
PI~LbDE J =100; % Steps between output of space
7q?u`3l T =10; % length of time windows:T*T0
zlzr;7m T0=0.1; % input pulse width
J&%vBg^ MN1=0; % initial value for the space output location
C-4NiXa dt = T/N; % time step
{^gbS n = [-N/2:1:N/2-1]'; % Index
itb0dF1G t = n.*dt;
Z)Y--`*
u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
]^MOFzSz~ u20=u10.*0.0; % input to waveguide 2
{?m;DYv u1=u10; u2=u20;
Dv?'(.z U1 = u1;
Z#YkAQHv5 U2 = u2; % Compute initial condition; save it in U
?F' gh4 ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
#=/eu= w=2*pi*n./T;
(v(!l=3 g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
&P{ L=4; % length of evoluation to compare with S. Trillo's paper
/'?Fz*b dz=L/M1; % space step, make sure nonlinear<0.05
IQ[?ej3W for m1 = 1:1:M1 % Start space evolution
j(/Bf m u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
> ^fY`x, u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
?T-6|vZA ca1 = fftshift(fft(u1)); % Take Fourier transform
6dQa|ACX_ ca2 = fftshift(fft(u2));
.E:[\H" c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
2/S~l;x c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
uV.3g 1m
u2 = ifft(fftshift(c2)); % Return to physical space
\7z&iGe! u1 = ifft(fftshift(c1));
\ &1)k/ if rem(m1,J) == 0 % Save output every J steps.
P
lJl#-BO U1 = [U1 u1]; % put solutions in U array
2h0I1a,7 U2=[U2 u2];
oZ95 )'L, MN1=[MN1 m1];
A3ad9?LR[R z1=dz*MN1'; % output location
K1#Y{k5D} end
Ao)hb4ex end
/=Bz[O hg=abs(U1').*abs(U1'); % for data write to excel
k^AI7H ha=[z1 hg]; % for data write to excel
S W(h%`U t1=[0 t'];
(;YO]U4 hh=[t1' ha']; % for data write to excel file
8>a/x , %dlmwrite('aa',hh,'\t'); % save data in the excel format
Knsb`1"E^6 figure(1)
k+S+: 5 waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
+4^XFPq~ figure(2)
[Z6]$$!#2 waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
pj>b6^TI6C 'Y3>+7bI 非线性超快脉冲耦合的数值方法的Matlab程序 D3Lu]=G e'aKI]>a 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
|sz`w^# 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
'JY*K:- VpSk.WY/ e G3&ES3L 9PhdoREb % This Matlab script file solves the nonlinear Schrodinger equations
tVQfR*= % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
p3O%|)yV % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
}/BwFB+(/ % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
adtK$@Yeg WmLl.Vv= C=1;
Rt~Aud[ M1=120, % integer for amplitude
a%f{mP$m M3=5000; % integer for length of coupler
>R3~P~@30 N = 512; % Number of Fourier modes (Time domain sampling points)
Qfo'w%px dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
d_#\^!9 T =40; % length of time:T*T0.
ERQa,h/ dt = T/N; % time step
E
}|g3 n = [-N/2:1:N/2-1]'; % Index
>U~.I2sz t = n.*dt;
6u/3"A]' ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
nMc3.fM w=2*pi*n./T;
{OP-9P=p g1=-i*ww./2;
t+Mr1e g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
3P Twpq1 g3=-i*ww./2;
@8C^[fDL P1=0;
,S;?3? a P2=0;
K1uN(T.Ju P3=1;
,R0@`t1 p P=0;
W]5kM~Q@ for m1=1:M1
8
W8ahG} p=0.032*m1; %input amplitude
gVCkj!{ s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
_dppUUm s1=s10;
Pgf$GXE s20=0.*s10; %input in waveguide 2
u,[Yaw"L s30=0.*s10; %input in waveguide 3
M]!\X6<_ s2=s20;
;&e5.K+.Z s3=s30;
w( `X P p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
Mo
&Ia6^ %energy in waveguide 1
,HS\(Z p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
!.iu_xJ %energy in waveguide 2
R6dw#;6{I p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
aAO[Y"-:,Y %energy in waveguide 3
},0fPkVsU for m3 = 1:1:M3 % Start space evolution
isHa4 D0 s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
mB;W9[ s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
=Y|TShKk s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
jEklf0Z sca1 = fftshift(fft(s1)); % Take Fourier transform
rS/Q sca2 = fftshift(fft(s2));
e.G&hJr sca3 = fftshift(fft(s3));
:BCjt@K} sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
oLk>|J sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
e%x$Cb:znn sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
V'pNo&O= s3 = ifft(fftshift(sc3));
Jjik~[<q: s2 = ifft(fftshift(sc2)); % Return to physical space
ih2H~c>O s1 = ifft(fftshift(sc1));
U/,`xA;v> end
al=Dy60|z p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
k]Y+C@g p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
>!E:$;i@ p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
/fA:Fnv P1=[P1 p1/p10];
BMU~1[r P2=[P2 p2/p10];
e`4OlM] P3=[P3 p3/p10];
jnt0,y A P=[P p*p];
9C[3w[G~C end
Cst\_j figure(1)
n5 @H plot(P,P1, P,P2, P,P3);
GhLgV nk1(/~` 转自:
http://blog.163.com/opto_wang/