切换到宽版
  • 广告投放
  • 稿件投递
  • 繁體中文
    • 8927阅读
    • 1回复

    [分享]求解光孤子或超短脉冲耦合方程的Matlab程序 [复制链接]

    上一主题 下一主题
    离线tianmen
     
    发帖
    58
    光币
    15
    光券
    0
    只看楼主 倒序阅读 楼主  发表于: 2011-06-12
    计算脉冲在非线性耦合器中演化的Matlab 程序 $jDD0<F.#  
    EzwF`3RjK  
    %  This Matlab script file solves the coupled nonlinear Schrodinger equations of @#J H=-06  
    %  soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of R7y-#?  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear e1Dj0s?i~K  
    %   pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 1gO//fdI  
    8~rT  
    %fid=fopen('e21.dat','w'); ;%lJD"yF  
    N = 128;                       % Number of Fourier modes (Time domain sampling points) FxMMxY,*%  
    M1 =3000;              % Total number of space steps Z7ZWf'o  
    J =100;                % Steps between output of space zbdOCfA;  
    T =10;                  % length of time windows:T*T0 7Co3P@@  
    T0=0.1;                 % input pulse width c lq <$-  
    MN1=0;                 % initial value for the space output location 1j8/4:  
    dt = T/N;                      % time step ">rsA&hN-  
    n = [-N/2:1:N/2-1]';           % Index :Fq2x_IUE  
    t = n.*dt;   d;IJ0xB+by  
    u10=1.*sech(1*t);              % input to waveguide1 amplitude: power=u10*u10 vQE` c@^{  
    u20=u10.*0.0;                  % input to waveguide 2 h/w]  
    u1=u10; u2=u20;                 WIhIEU7/  
    U1 = u1;   #zh6=.,7  
    U2 = u2;                       % Compute initial condition; save it in U * N2#{eF&]  
    ww = 4*n.*n*pi*pi/T/T;         % Square of frequency. Note i^2=-1. HE4`9$kVLr  
    w=2*pi*n./T; *(>F'>F1"  
    g=-i*ww./2;                    % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T s2kGU^]y  
    L=4;                           % length of evoluation to compare with S. Trillo's paper noWRYS%  
    dz=L/M1;                       % space step, make sure nonlinear<0.05 99=[>Ck)G  
    for m1 = 1:1:M1                                    % Start space evolution K7YT0cG  
       u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1;          % 1st sSolve nonlinear part of NLS aA!@;rR<yU  
       u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; eU<]h>2  
       ca1 = fftshift(fft(u1));                        % Take Fourier transform & C!g(fS  
       ca2 = fftshift(fft(u2)); UzP@{?  
       c2=exp(g.*dz).*(ca2+i*1*ca1.*dz);               % approximation .CB"@.7  
       c1=exp(g.*dz).*(ca1+i*1*ca2.*dz);               % frequency domain phase shift   S8rW'}XJ=H  
       u2 = ifft(fftshift(c2));                        % Return to physical space ~`a#h#  
       u1 = ifft(fftshift(c1)); i|:: v l  
    if rem(m1,J) == 0                                 % Save output every J steps. Uj y6vgU;  
        U1 = [U1 u1];                                  % put solutions in U array $NH`Iu9t  
        U2=[U2 u2]; 0$Qn#K  
        MN1=[MN1 m1]; W\ZV0T;<]  
        z1=dz*MN1';                                    % output location H"kc^G+(R"  
      end P W0q71  
    end uk>q\j  
    hg=abs(U1').*abs(U1');                             % for data write to excel X}ey0)g%  
    ha=[z1 hg];                                        % for data write to excel bs4fyb  
    t1=[0 t']; 5+#?7J1  
    hh=[t1' ha'];                                      % for data write to excel file g%KGF)+H  
    %dlmwrite('aa',hh,'\t');                           % save data in the excel format "oKj~:$  
    figure(1) \ZmFH8=|f  
    waterfall(t',z1',abs(U1').*abs(U1'))               % t' is 1xn, z' is 1xm, and U1' is mxn Q7OnhGA  
    figure(2) rZwf%}  
    waterfall(t',z1',abs(U2').*abs(U2'))               % t' is 1xn, z' is 1xm, and U1' is mxn tOp:e KN  
    H-PW(  
    非线性超快脉冲耦合的数值方法的Matlab程序 QmDhZ04f  
    `t/@ L:  
    在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。   kfG65aa>_  
    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 gXJ19zB+  
    EusfgU:  
    uH~ TugQ~  
    h<!khWFS  
    %  This Matlab script file solves the nonlinear Schrodinger equations d[qEP6B  
    %  for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of UlLM<33_)  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear nATfmUN L  
    %  pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 %^)JaEUC  
    J_((o  
    C=1;                           !Barc ,kA  
    M1=120,                       % integer for amplitude ~L Bq5a  
    M3=5000;                      % integer for length of coupler vb80J<4  
    N = 512;                      % Number of Fourier modes (Time domain sampling points) 2rE~V.)%  
    dz =3.14159/(sqrt(2.)*C)/M3;  % length of coupler is divided into M3 segments,  make sure nonlinearity<0.05. E?;T:7.%  
    T =40;                        % length of time:T*T0. G Yy!`E  
    dt = T/N;                     % time step is _ dPc  
    n = [-N/2:1:N/2-1]';          % Index #xJGuYdv  
    t = n.*dt;   cxF?&0[mY  
    ww = 4*n.*n*pi*pi/T/T;        % Square of frequency. Note i^2=-1. )b:~kuHi  
    w=2*pi*n./T; V+@%(x@D_  
    g1=-i*ww./2; WEY97_@  
    g2=-i*ww./2;                  % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0; Q,`2DHhK  
    g3=-i*ww./2; osgS?=8  
    P1=0; _|5FrN  
    P2=0; S<bz7 k9  
    P3=1; GwIfGixqH  
    P=0; c<t3y7  
    for m1=1:M1                 ]oWZ{#r2  
    p=0.032*m1;                %input amplitude <PuB3PEvV  
    s10=p.*sech(p.*t);         %input soliton pulse in waveguide 1 s poWdRM2  
    s1=s10; 9OO_Hp#|9  
    s20=0.*s10;                %input in waveguide 2 $'mB8 S  
    s30=0.*s10;                %input in waveguide 3 KE)D =P  
    s2=s20; B$[%pm`'2  
    s3=s30; po](6V  
    p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));   /B#lju!  
    %energy in waveguide 1 O|7{%5h  
    p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));   zL!~,B8C  
    %energy in waveguide 2 ^J}$y7  
    p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));   h/+I-],RF  
    %energy in waveguide 3 +hvIJv ?  
    for m3 = 1:1:M3                                    % Start space evolution 6/WK((Fd  
       s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1;          % 1st step, Solve nonlinear part of NLS 0)]C&;}_M  
       s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2; MnrGD>M@|  
       s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3; 1b]PCNz  
       sca1 = fftshift(fft(s1));                       % Take Fourier transform ]OCJ~Zw  
       sca2 = fftshift(fft(s2)); +]~w ?^h  
       sca3 = fftshift(fft(s3)); ~RLx;  
       sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz);           % 2nd step, frequency domain phase shift   oJ;O>J@c  
       sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz); kI[O{<kQ  
       sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz); P@S;>t{TD  
       s3 = ifft(fftshift(sc3)); cPBy(5^  
       s2 = ifft(fftshift(sc2));                       % Return to physical space `J7Lecgo  
       s1 = ifft(fftshift(sc1)); LXfeXWw?,  
    end /5'<w(  
       p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1)))); _Ag/gu2-?  
       p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1)))); -$MC  
       p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1)))); bZlLivi  
       P1=[P1 p1/p10]; 0jZ{?  
       P2=[P2 p2/p10]; j{w,<Wt>  
       P3=[P3 p3/p10]; SUi1*S  
       P=[P p*p]; !DUg"o3G>  
    end Jc#)T;# 6  
    figure(1) Xgth|C}k  
    plot(P,P1, P,P2, P,P3); /$.vHt 5nt  
    huD\dmQ:]  
    转自:http://blog.163.com/opto_wang/
     
    分享到
    离线ciomplj
    发帖
    319
    光币
    1
    光券
    0
    只看该作者 1楼 发表于: 2014-06-22
    谢谢哈~!~