计算脉冲在非线性耦合器中演化的Matlab 程序 OhEL9"\< _AYF'o-Cm % This Matlab script file solves the coupled nonlinear Schrodinger equations of
3IFU{0a` % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
q|J] % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
_yUFe& % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
P7-3Vf_L >`'9V|1 %fid=fopen('e21.dat','w');
Kx0dOkE N = 128; % Number of Fourier modes (Time domain sampling points)
.vMi<U; M1 =3000; % Total number of space steps
kM`#U
*j J =100; % Steps between output of space
!&[4T#c T =10; % length of time windows:T*T0
q3`t0eLZ T0=0.1; % input pulse width
>k|[U[@ MN1=0; % initial value for the space output location
e.V){}{V dt = T/N; % time step
2wQ
CQ" n = [-N/2:1:N/2-1]'; % Index
PK"
C+o;: t = n.*dt;
hgGcUpJy? u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
%>TdTt u20=u10.*0.0; % input to waveguide 2
@jKB!z9{ u1=u10; u2=u20;
2l?J9c}Wo U1 = u1;
@4$E.q<0 U2 = u2; % Compute initial condition; save it in U
%R"Fx$tQ ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
ez{&Y>n w=2*pi*n./T;
Lt_]3go g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
y e'5A L=4; % length of evoluation to compare with S. Trillo's paper
}R$%MU5:: dz=L/M1; % space step, make sure nonlinear<0.05
4NV1v&" for m1 = 1:1:M1 % Start space evolution
-;}Wm[
u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
Gj 3/&'k6 u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
x]Ef}g ca1 = fftshift(fft(u1)); % Take Fourier transform
t
,$)PV ca2 = fftshift(fft(u2));
1CbC|q c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
k
W ,|> c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
k1J}9HNYR u2 = ifft(fftshift(c2)); % Return to physical space
2uIAnbW]M u1 = ifft(fftshift(c1));
4<|u~n*JF if rem(m1,J) == 0 % Save output every J steps.
7|rT*-Ia U1 = [U1 u1]; % put solutions in U array
5S LF1u; U2=[U2 u2];
dyd_dK/ MN1=[MN1 m1];
qb&*,zN z1=dz*MN1'; % output location
Ry C7 end
YSbN=Rj end
xXZN<<f59 hg=abs(U1').*abs(U1'); % for data write to excel
-|mABHjx* ha=[z1 hg]; % for data write to excel
x%1Rp[ t1=[0 t'];
]7;;uhn` hh=[t1' ha']; % for data write to excel file
s/V[tEC*z %dlmwrite('aa',hh,'\t'); % save data in the excel format
Cb.Aw! figure(1)
B_>
Fd& waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
YC~+r8ME$j figure(2)
J3=jC5=J4 waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
w]_a0{Uh ?=/l@ d 非线性超快脉冲耦合的数值方法的Matlab程序 i+}M#Y-O *"@P2F& 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
r_G`#Z_5F 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
D$\ EZ `|R{^Sk1o k.%F!sK M5]wU % This Matlab script file solves the nonlinear Schrodinger equations
-UO$$)Q % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
]P.S5s' % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
y03l_E, % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
Ne%X:h RaAq>B
WPr C=1;
#]rw@c M1=120, % integer for amplitude
VuGSP]$q M3=5000; % integer for length of coupler
@ o]F~x N = 512; % Number of Fourier modes (Time domain sampling points)
l<5!R;?$ dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
XZhhr1-<a T =40; % length of time:T*T0.
BtspnVBez dt = T/N; % time step
xfb%bkr n = [-N/2:1:N/2-1]'; % Index
lG2){){j t = n.*dt;
Ks4TBi&J ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
[30e>bSf` w=2*pi*n./T;
p~t$ll0s g1=-i*ww./2;
@B+];lr/- g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
-
0zo>[c/p g3=-i*ww./2;
.fgoEB,( P1=0;
Js'|N%pi P2=0;
:H~r
_>E P3=1;
6 `'^$wKs P=0;
4R6X"T9- for m1=1:M1
bbz86]AhY p=0.032*m1; %input amplitude
m|!sY[! s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
I)clGMS, s1=s10;
1!~9%=% s20=0.*s10; %input in waveguide 2
grZN.zTO s30=0.*s10; %input in waveguide 3
xaPTTa s2=s20;
BP` UB s3=s30;
d%WFgf} p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
mWZVO,t$ %energy in waveguide 1
K~uoZ~_gA p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
bp }~{]:b %energy in waveguide 2
fSj^/> p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
#]9yzyb_y %energy in waveguide 3
6uD Nqq for m3 = 1:1:M3 % Start space evolution
g%K3ah
v s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
IlH*s/ s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
Q~jUZ-qN s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
iKu5K0x{>I sca1 = fftshift(fft(s1)); % Take Fourier transform
,$*$w< sca2 = fftshift(fft(s2));
8$1<N sca3 = fftshift(fft(s3));
xk#/J]j sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
&Oe,$%{hBh sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
T3\Q< sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
$N~8^6 s3 = ifft(fftshift(sc3));
+ft?aB@ s2 = ifft(fftshift(sc2)); % Return to physical space
;#AV~Y-
s s1 = ifft(fftshift(sc1));
dD=dPi# end
|',Gy\Sj p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
J5429Soo p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
i),W1<A1 p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
*edB3!! P1=[P1 p1/p10];
^hU7QxW P2=[P2 p2/p10];
v=!]t=P)t P3=[P3 p3/p10];
k5((@[ P=[P p*p];
b?y3m +V` end
E;k'bz figure(1)
Iu=iC.50} plot(P,P1, P,P2, P,P3);
8!1vsEqv fxjs"rD5 转自:
http://blog.163.com/opto_wang/