计算脉冲在非线性耦合器中演化的Matlab 程序 XDot3)2` 4!I;U>b b % This Matlab script file solves the coupled nonlinear Schrodinger equations of
{m<NPtp910 % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
.5t|FJ]`$ % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
"1-|ahW % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
kOQq+_Y
Wg V'T#* %fid=fopen('e21.dat','w');
#VLO6 N = 128; % Number of Fourier modes (Time domain sampling points)
ITq$8 M1 =3000; % Total number of space steps
hv6w=?7 J =100; % Steps between output of space
&ND8^lR=Y; T =10; % length of time windows:T*T0
E&RiEhuv T0=0.1; % input pulse width
;)SWUXa;{ MN1=0; % initial value for the space output location
dV:vM9+x dt = T/N; % time step
DaK2P;WP n = [-N/2:1:N/2-1]'; % Index
r
N.<S[ t = n.*dt;
Xyf7sHQ u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
w<4,;FFlZ/ u20=u10.*0.0; % input to waveguide 2
VkD8h+) u1=u10; u2=u20;
/.[;u1z"^ U1 = u1;
<21@jdu3n, U2 = u2; % Compute initial condition; save it in U
lwhVP$q} ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
RyJN=;5p w=2*pi*n./T;
MmvMuX]#) g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
\N?,6;%xB L=4; % length of evoluation to compare with S. Trillo's paper
]rhxB4*1 dz=L/M1; % space step, make sure nonlinear<0.05
>`@c9
m for m1 = 1:1:M1 % Start space evolution
S]P80|!| u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
VgoN=S u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
6z (eW]p ca1 = fftshift(fft(u1)); % Take Fourier transform
}EW@/; kC ca2 = fftshift(fft(u2));
"]"!"#aMv c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
N?7vcN+-t) c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
p-6(>,+E[ u2 = ifft(fftshift(c2)); % Return to physical space
l5 FM>q u1 = ifft(fftshift(c1));
] VN4;R if rem(m1,J) == 0 % Save output every J steps.
<0,szw U1 = [U1 u1]; % put solutions in U array
;M95A U2=[U2 u2];
c<(LXf+61 MN1=[MN1 m1];
bay7%[BLB z1=dz*MN1'; % output location
xz#.3|_(' end
Ke_&dgsq end
j.5;0b_L^ hg=abs(U1').*abs(U1'); % for data write to excel
&)8-iO ha=[z1 hg]; % for data write to excel
Q]?Lg t1=[0 t'];
$c WO`\XM hh=[t1' ha']; % for data write to excel file
g.cD3N %dlmwrite('aa',hh,'\t'); % save data in the excel format
uMB|x,X I figure(1)
c04"d"$ x waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
jMT];%$[ figure(2)
l9 K 3E<g waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
0Q]p#; K]b_JDEk 非线性超快脉冲耦合的数值方法的Matlab程序 VHyP@JB
Rilr)$ 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
]/_GHG9 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
^aW?0qsH L
1fK q0}?F &|:T+LVv$+ % This Matlab script file solves the nonlinear Schrodinger equations
s 4Mi9h_ % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
""dX4^gtU % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
K-xmLEu % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
aWLeyXsAu f>u{e~Q, C=1;
Tz=YSQy$9 M1=120, % integer for amplitude
/R_*u4}iD M3=5000; % integer for length of coupler
$rZ:$d.C N = 512; % Number of Fourier modes (Time domain sampling points)
Ozygr?*X dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
#$vef
T =40; % length of time:T*T0.
sH^?v0^a dt = T/N; % time step
$J~~.PUXQ n = [-N/2:1:N/2-1]'; % Index
pearf2F t = n.*dt;
tGKIJ`w*h ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
A/ eZ!"Y w=2*pi*n./T;
iw,F)O g1=-i*ww./2;
NZ\aK}?~! g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
~dIb>[7wy g3=-i*ww./2;
kXj%thDx P1=0;
FmALmS P2=0;
!n=@(bT*wT P3=1;
/12D >OK
P=0;
"CEy r0h for m1=1:M1
W~1/vJ.*l p=0.032*m1; %input amplitude
]~,V(K s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
5-277? s1=s10;
,_66U;T s20=0.*s10; %input in waveguide 2
:'OCQ.[{s s30=0.*s10; %input in waveguide 3
BO5gwvyI s2=s20;
G -U% s3=s30;
+[ _)i9a p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
iA~b[20& %energy in waveguide 1
Dm@wTt8N( p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
ASuxty %energy in waveguide 2
8ycmvpJ p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
{__Z\D2I %energy in waveguide 3
-R!qDA" for m3 = 1:1:M3 % Start space evolution
W|U!kqU s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
0Fw0#eE s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
:<%q9)aPf` s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
5zlgmCGow sca1 = fftshift(fft(s1)); % Take Fourier transform
Sx,O) sca2 = fftshift(fft(s2));
Lw=.LN sca3 = fftshift(fft(s3));
q Yg4H|6 sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
ObC sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
>'i
d/ sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
/j]r?KAzw s3 = ifft(fftshift(sc3));
"y>\
mC s2 = ifft(fftshift(sc2)); % Return to physical space
]P TTI\n s1 = ifft(fftshift(sc1));
,L+tm>I end
#@,39!;,:O p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
v>3)^l:=Y* p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
Sti)YCXH p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
;Ef:mr"Nu P1=[P1 p1/p10];
PXGS5, P2=[P2 p2/p10];
S;$@?vF P3=[P3 p3/p10];
4z-sR/ d P=[P p*p];
P'#m1ntxQ end
?~rF3M.=| figure(1)
%3e}YQe) plot(P,P1, P,P2, P,P3);
Y&xmy|O# 0fvQPs!O 转自:
http://blog.163.com/opto_wang/