计算脉冲在非线性耦合器中演化的Matlab 程序 ,%6P0#- 2SD`OABf# % This Matlab script file solves the coupled nonlinear Schrodinger equations of
au N6prGe % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
i=ea
?eT` % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
VdPtPq1 % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
kd>hhiz| 6RG)`bu %fid=fopen('e21.dat','w');
rT M}})81 N = 128; % Number of Fourier modes (Time domain sampling points)
cIUHa M1 =3000; % Total number of space steps
.@2m07*1 J =100; % Steps between output of space
PZ2;v< T =10; % length of time windows:T*T0
G"klu T0=0.1; % input pulse width
aL*&r~`&e' MN1=0; % initial value for the space output location
t;\kR4P dt = T/N; % time step
M*y)6H k~ n = [-N/2:1:N/2-1]'; % Index
kv]~'Srk t = n.*dt;
bhID#& u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
+:8fC$vVfC u20=u10.*0.0; % input to waveguide 2
*e<[SZzYZ u1=u10; u2=u20;
NYyh|X:m U1 = u1;
wZG\>9~ U2 = u2; % Compute initial condition; save it in U
DD7h^-x ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
T,7Y7c/3V w=2*pi*n./T;
1uG"f<TsR g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
7zA'ri3w L=4; % length of evoluation to compare with S. Trillo's paper
dOa+(fMe dz=L/M1; % space step, make sure nonlinear<0.05
ht7l- AK for m1 = 1:1:M1 % Start space evolution
"/)#O~ u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
uYn_? G u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
dpJ_r>NI ca1 = fftshift(fft(u1)); % Take Fourier transform
2K<
8 ca2 = fftshift(fft(u2));
:a^t3s c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
u_hD}V^x4 c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
O#b6mKPt;t u2 = ifft(fftshift(c2)); % Return to physical space
+$u$<z3Q u1 = ifft(fftshift(c1));
2gc/3*F8 if rem(m1,J) == 0 % Save output every J steps.
7_%"BVb" U1 = [U1 u1]; % put solutions in U array
4F)-"ck U2=[U2 u2];
hq%?=2'9? MN1=[MN1 m1];
$Oq^jUJ z1=dz*MN1'; % output location
uPhK3nCGo end
vBRQp&YwX end
3XL#0\im?s hg=abs(U1').*abs(U1'); % for data write to excel
x8wD0D ha=[z1 hg]; % for data write to excel
0Z~p%C<LW t1=[0 t'];
AZ0;3<FfLp hh=[t1' ha']; % for data write to excel file
MTsM]o %dlmwrite('aa',hh,'\t'); % save data in the excel format
>go,K{cK6 figure(1)
<nE>XAI_7 waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
?/BqD;{?I figure(2)
D'7SAFOM waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
%4ePc- 4
K!JQ|9 非线性超快脉冲耦合的数值方法的Matlab程序 5XO;N s nKS7Q1+ 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
Xp >7iX!: 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
,ek_R)&[o |L-]fjBbF `)`
n(B M%Ji0v38 % This Matlab script file solves the nonlinear Schrodinger equations
@$lG@I,[ % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
}#.L7SIJ<J % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
@*OZx 9 % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
uZM{BgXXD ZZk=E4aae C=1;
rQk<90Ar M1=120, % integer for amplitude
s1=X>'q M3=5000; % integer for length of coupler
IzsphBI N = 512; % Number of Fourier modes (Time domain sampling points)
8WtsKOno dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
PRr2F-!P T =40; % length of time:T*T0.
(0j}-iaQEZ dt = T/N; % time step
hakKs.U|[ n = [-N/2:1:N/2-1]'; % Index
9)}[7Mg:C t = n.*dt;
Id'X*U7Q ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
0TCBQ~ " w=2*pi*n./T;
K#EvFs`s; g1=-i*ww./2;
9
TvV= g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
eb.O#Y g3=-i*ww./2;
t\NqR P1=0;
DBPRGQ P2=0;
m6TNBX P3=1;
G"\`r* O P=0;
%C$%!C for m1=1:M1
_jJPbKz p=0.032*m1; %input amplitude
M*z~gOZ s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
`dFq:8v s1=s10;
wp#'nO s20=0.*s10; %input in waveguide 2
FuVnk~gq s30=0.*s10; %input in waveguide 3
=+ytTQc*ot s2=s20;
TcIcS]w% s3=s30;
OZx
W?wnd p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
aa?w:3 %energy in waveguide 1
n1~o1 p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
3 DD ML, %energy in waveguide 2
l;JA8o\x p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
x$IX5:E#e %energy in waveguide 3
d{XO/YQw for m3 = 1:1:M3 % Start space evolution
"5-^l.CKH s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
X *&[u7No s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
2@9Tfm(= s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
3{ LP?w:@ sca1 = fftshift(fft(s1)); % Take Fourier transform
|UK} sca2 = fftshift(fft(s2));
[ JpKSTg[ sca3 = fftshift(fft(s3));
lL{5SH<Q sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
y=`2\L" O sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
&0NFb^8+ sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
`wus\&!W s3 = ifft(fftshift(sc3));
j<u@j+V s2 = ifft(fftshift(sc2)); % Return to physical space
TR<<+ s1 = ifft(fftshift(sc1));
99}(~B end
Qk\A
c p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
dik:4; p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
q8s0AN'@t' p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
-M[$Z y^ P1=[P1 p1/p10];
^SxY IFL P2=[P2 p2/p10];
>;L6xt3 P3=[P3 p3/p10];
G>wqt@%r9 P=[P p*p];
v'VD0+3[H end
zoOaVV&1 figure(1)
}RmU%IYc plot(P,P1, P,P2, P,P3);
:Qumb Rn{iaM2Y< 转自:
http://blog.163.com/opto_wang/