计算脉冲在非线性耦合器中演化的Matlab 程序 CRb8WD6. [{znwK@ % This Matlab script file solves the coupled nonlinear Schrodinger equations of
p4'
.1.@ % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of
ejROJXB % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
jEc_!Q % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
DXFu9RE\{ |3*9+4]a %fid=fopen('e21.dat','w');
IGdiIhH~2 N = 128; % Number of Fourier modes (Time domain sampling points)
n
~t{]if" M1 =3000; % Total number of space steps
1K72}Gj)ZL J =100; % Steps between output of space
6K/RO) T =10; % length of time windows:T*T0
g 9_ zkGc7 T0=0.1; % input pulse width
p=8Qv MN1=0; % initial value for the space output location
1|bXIY.J* dt = T/N; % time step
LD$5KaOW n = [-N/2:1:N/2-1]'; % Index
~P4C`Q1PT# t = n.*dt;
B VBn.ut u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10
zTz}H*U u20=u10.*0.0; % input to waveguide 2
/x<g$!`X u1=u10; u2=u20;
wu41Mz7 U1 = u1;
7+O)AU{ U2 = u2; % Compute initial condition; save it in U
)DSeXS[
e ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
,UNb#=it w=2*pi*n./T;
!NXjax\r g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T
pGbfdX
L=4; % length of evoluation to compare with S. Trillo's paper
A~zn; dz=L/M1; % space step, make sure nonlinear<0.05
IpP%WW u for m1 = 1:1:M1 % Start space evolution
ke4E1T-1n u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS
Y-VDi.]W u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2;
4>JSZ6i#n ca1 = fftshift(fft(u1)); % Take Fourier transform
vgfC{]v<W] ca2 = fftshift(fft(u2));
>p_W(u@ z$ c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation
H;Wrcf2 c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift
!`69.v u2 = ifft(fftshift(c2)); % Return to physical space
E$d#4x u1 = ifft(fftshift(c1));
+C(-f if rem(m1,J) == 0 % Save output every J steps.
YEL0h0gn U1 = [U1 u1]; % put solutions in U array
nL@'??I1 U2=[U2 u2];
uYJS=NGNA MN1=[MN1 m1];
%xt9k9=vZ z1=dz*MN1'; % output location
> I2rj2M# end
-JW~_Q[ end
--yF%tRMP hg=abs(U1').*abs(U1'); % for data write to excel
#mxOwvJ ha=[z1 hg]; % for data write to excel
@HT\Y%E t1=[0 t'];
' \JE># hh=[t1' ha']; % for data write to excel file
)M0YX?5AR %dlmwrite('aa',hh,'\t'); % save data in the excel format
s :vNr@TS figure(1)
p|>*M\LE# waterfall(t',z1',abs(U1').*abs(U1')) % t' is 1xn, z' is 1xm, and U1' is mxn
u'YXI="( figure(2)
|/Nh# waterfall(t',z1',abs(U2').*abs(U2')) % t' is 1xn, z' is 1xm, and U1' is mxn
_~kw^!p>Kr ?
SFBUX(p 非线性超快脉冲耦合的数值方法的Matlab程序 6h 0qtXn- ZU4=&K 在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的
论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。
^T=9j.e'ja 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
3I)~;>meo IH|zNg{\Y pUIN`ya[[ ,jU>V]YC % This Matlab script file solves the nonlinear Schrodinger equations
qu=~\t1[6 % for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of
?N#I2jxaD % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear
TdhfX {nk % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004
%~rEJB@{ oD)x\ )t8 C=1;
byHc0ktI\ M1=120, % integer for amplitude
E`HoJhB M3=5000; % integer for length of coupler
XlppA3JON| N = 512; % Number of Fourier modes (Time domain sampling points)
4:/]Y=)x dz =3.14159/(sqrt(2.)*C)/M3; % length of coupler is divided into M3 segments, make sure nonlinearity<0.05.
^e:z ul{;] T =40; % length of time:T*T0.
hkK>h dt = T/N; % time step
-@v^. @[Z& n = [-N/2:1:N/2-1]'; % Index
!:{Qbv&T t = n.*dt;
ak(s@@k ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1.
eG=d)`.JaV w=2*pi*n./T;
.N(R~_ g1=-i*ww./2;
L+t
/
E` g2=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0;
B=SA
+{o g3=-i*ww./2;
lhUGo = P1=0;
a>4/2#J P2=0;
~q>jXi P3=1;
;-d b/$O P=0;
{^]qaQ[5N for m1=1:M1
HQ-[k$d
W4 p=0.032*m1; %input amplitude
>6es
5}
s10=p.*sech(p.*t); %input soliton pulse in waveguide 1
;
476t s1=s10;
d i\.*7l? s20=0.*s10; %input in waveguide 2
Bm~^d7;Cw s30=0.*s10; %input in waveguide 3
-l[H]BAMXy s2=s20;
.k#PrT1C s3=s30;
P`tOL#UeZL p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));
X5WA-s(?0 %energy in waveguide 1
Y3~Uz#`SU p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));
E|=x+M1sH %energy in waveguide 2
3u@,OE p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));
j.M]F/j %energy in waveguide 3
u`ir(JIj] for m3 = 1:1:M3 % Start space evolution
q<}IO s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1; % 1st step, Solve nonlinear part of NLS
[^"}jbn/ s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2;
{_7hX`p s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3;
lMv6QL\>' sca1 = fftshift(fft(s1)); % Take Fourier transform
FSuC)Xg sca2 = fftshift(fft(s2));
FB k7Cn! sca3 = fftshift(fft(s3));
z~{08M7
sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz); % 2nd step, frequency domain phase shift
HT7,B(.} sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz);
!t% 1G. sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz);
f6r!3y s3 = ifft(fftshift(sc3));
GMU!GSY s2 = ifft(fftshift(sc2)); % Return to physical space
`E~"T0RX s1 = ifft(fftshift(sc1));
1^_W[+<S/ end
C(>!?-. p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1))));
xM())Z|2 p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1))));
)U/Kz1U p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1))));
XX=OyDLqP P1=[P1 p1/p10];
ch#)XomN P2=[P2 p2/p10];
{-)^?Zb
@ P3=[P3 p3/p10];
U|wST&rU| P=[P p*p];
%YVPm*J~ end
uc9h}QJ* figure(1)
`;mgJD plot(P,P1, P,P2, P,P3);
jHEP1rNHE (-<hx~ 转自:
http://blog.163.com/opto_wang/