| tianmen |
2011-06-12 18:33 |
求解光孤子或超短脉冲耦合方程的Matlab程序
计算脉冲在非线性耦合器中演化的Matlab 程序 #~-&&S4a.J J8?6G&0H % This Matlab script file solves the coupled nonlinear Schrodinger equations of {UC<I.5X % soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of qg:I+"u % Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear Fl3r!a!P, % pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 gsm^{jB B|$13dHfa %fid=fopen('e21.dat','w'); R$&&kmJ N = 128; % Number of Fourier modes (Time domain sampling points) #|1QA3KzO M1 =3000; % Total number of space steps B5r_+?=2e J =100; % Steps between output of space ?CZD^>6 T =10; % length of time windows:T*T0 ygY+2 T0=0.1; % input pulse width Qbpl$L MN1=0; % initial value for the space output location 4lf36K, dt = T/N; % time step HV7(6VSJ+ n = [-N/2:1:N/2-1]'; % Index ^JVP2L>o* t = n.*dt; $$f$$ u10=1.*sech(1*t); % input to waveguide1 amplitude: power=u10*u10 +9F#~{v`4a u20=u10.*0.0; % input to waveguide 2 4S EC4yO u1=u10; u2=u20; EAE\Xv U1 = u1; }w^ T9OC U2 = u2; % Compute initial condition; save it in U j/mp.'P1k ww = 4*n.*n*pi*pi/T/T; % Square of frequency. Note i^2=-1. qFChZ+3> w=2*pi*n./T; T*~)9o g=-i*ww./2; % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T VEKITBs L=4; % length of evoluation to compare with S. Trillo's paper q/-j`'A_pb dz=L/M1; % space step, make sure nonlinear<0.05 Q~!hr0
ZR for m1 = 1:1:M1 % Start space evolution et}Y4,: u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1; % 1st sSolve nonlinear part of NLS 3C[4!>| u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; F S+^r\) ca1 = fftshift(fft(u1)); % Take Fourier transform vK7,O%!S ca2 = fftshift(fft(u2)); !Lug5U} c2=exp(g.*dz).*(ca2+i*1*ca1.*dz); % approximation z n8ig/C c1=exp(g.*dz).*(ca1+i*1*ca2.*dz); % frequency domain phase shift >d
V@9 u2 = ifft(fftshift(c2)); % Return to physical space }lpm Hvs u1 = ifft(fftshift(c1)); 24/~gft if rem(m1,J) == 0 % Save output every J steps. |5B9tjJ" U1 = [U1 u1]; % put solutions in U array }V,M0b> U2=[U2 u2]; fQ4$@ MN1=[MN1 m1]; -gGK(PIf z1=dz*MN1'; % output location j6(IF5MqP end q$'&R | |