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

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

    上一主题 下一主题
    离线tianmen
     
    发帖
    58
    光币
    15
    光券
    0
    只看楼主 倒序阅读 楼主  发表于: 2011-06-12
    计算脉冲在非线性耦合器中演化的Matlab 程序 r2 o-/$  
    -4'yC_8t  
    %  This Matlab script file solves the coupled nonlinear Schrodinger equations of ;&G8e* bM2  
    %  soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of zq&,KZ  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear ~85Pgb<  
    %   pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 p*Hbc|?{Q&  
    Z CS{D  
    %fid=fopen('e21.dat','w'); 5x; y{qT  
    N = 128;                       % Number of Fourier modes (Time domain sampling points) x?MSHOia`P  
    M1 =3000;              % Total number of space steps *,d>(\&[f  
    J =100;                % Steps between output of space VC@{cVT  
    T =10;                  % length of time windows:T*T0 . ;q 4<_  
    T0=0.1;                 % input pulse width ? $LKn2C  
    MN1=0;                 % initial value for the space output location B?)=d,E  
    dt = T/N;                      % time step GwaU7[6  
    n = [-N/2:1:N/2-1]';           % Index F,-S&d  
    t = n.*dt;   _o-D},f*e  
    u10=1.*sech(1*t);              % input to waveguide1 amplitude: power=u10*u10 V_"K  
    u20=u10.*0.0;                  % input to waveguide 2 |KxFi H  
    u1=u10; u2=u20;                 h_Cac@F0  
    U1 = u1;   ^UAL5}CQt  
    U2 = u2;                       % Compute initial condition; save it in U =D2x@ank[  
    ww = 4*n.*n*pi*pi/T/T;         % Square of frequency. Note i^2=-1. aPMqJ#fIr  
    w=2*pi*n./T; ZNvnVW<  
    g=-i*ww./2;                    % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T $!_]mz6*  
    L=4;                           % length of evoluation to compare with S. Trillo's paper 30v 3C7o=  
    dz=L/M1;                       % space step, make sure nonlinear<0.05 ;f7;U=gl,  
    for m1 = 1:1:M1                                    % Start space evolution Z;#Ei.7p|  
       u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1;          % 1st sSolve nonlinear part of NLS `Vqp o/  
       u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; )m Uc !TP  
       ca1 = fftshift(fft(u1));                        % Take Fourier transform :5`BhFAd  
       ca2 = fftshift(fft(u2)); A+lP]Oy0S  
       c2=exp(g.*dz).*(ca2+i*1*ca1.*dz);               % approximation -S"$S16D  
       c1=exp(g.*dz).*(ca1+i*1*ca2.*dz);               % frequency domain phase shift   @i[z4)"S  
       u2 = ifft(fftshift(c2));                        % Return to physical space JS<4%@  
       u1 = ifft(fftshift(c1)); 1wpeYn7>W  
    if rem(m1,J) == 0                                 % Save output every J steps. $MEKt}S  
        U1 = [U1 u1];                                  % put solutions in U array zp2IpYQ,3  
        U2=[U2 u2]; "38ya2*  
        MN1=[MN1 m1]; wcT0XXh  
        z1=dz*MN1';                                    % output location D{aN_0mT  
      end 8U07]=Bt<  
    end D$RQD{*  
    hg=abs(U1').*abs(U1');                             % for data write to excel G,8LF/sR  
    ha=[z1 hg];                                        % for data write to excel Ta38/v;S  
    t1=[0 t']; iraO/KhD*3  
    hh=[t1' ha'];                                      % for data write to excel file IZ;%lV7t  
    %dlmwrite('aa',hh,'\t');                           % save data in the excel format EQkv&k5X  
    figure(1) . ` OdnLGy  
    waterfall(t',z1',abs(U1').*abs(U1'))               % t' is 1xn, z' is 1xm, and U1' is mxn U. 1Vpfy  
    figure(2) /?jAG3"  
    waterfall(t',z1',abs(U2').*abs(U2'))               % t' is 1xn, z' is 1xm, and U1' is mxn P!{ O<P  
    /2&jId  
    非线性超快脉冲耦合的数值方法的Matlab程序 3JiDi X"|  
    zhDmZ  
    在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。   rZDlPp>BPZ  
    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 s e9X  
    f.`noZN  
    lbv9 kk[  
    AWP CJmr  
    %  This Matlab script file solves the nonlinear Schrodinger equations 'Dq!o[2y  
    %  for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of r`|/qP:T[  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear ;K:)R_H  
    %  pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 )jK"\'cK  
    {ZH9W  
    C=1;                           )POuH*j  
    M1=120,                       % integer for amplitude Y#_,Ig5.  
    M3=5000;                      % integer for length of coupler J3fcnI  
    N = 512;                      % Number of Fourier modes (Time domain sampling points) D 5]sf>~  
    dz =3.14159/(sqrt(2.)*C)/M3;  % length of coupler is divided into M3 segments,  make sure nonlinearity<0.05. 9d4PH  
    T =40;                        % length of time:T*T0. e`#c[lbAAM  
    dt = T/N;                     % time step n\}!'>d'  
    n = [-N/2:1:N/2-1]';          % Index |\ j'Z0  
    t = n.*dt;   SLL%XF~/Sb  
    ww = 4*n.*n*pi*pi/T/T;        % Square of frequency. Note i^2=-1. H'E >QT  
    w=2*pi*n./T; > _1*/o JO  
    g1=-i*ww./2; <h2WM (n  
    g2=-i*ww./2;                  % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0; 0+0+%#?  
    g3=-i*ww./2; DKCPi0  
    P1=0; s% "MaDz  
    P2=0; |~bl%g8xP  
    P3=1; h5&l#>8&  
    P=0;  UfEF>@0  
    for m1=1:M1                 tm~V+t!mj  
    p=0.032*m1;                %input amplitude @eN x:}  
    s10=p.*sech(p.*t);         %input soliton pulse in waveguide 1 dF*@G/p>V  
    s1=s10; mu2r#I  
    s20=0.*s10;                %input in waveguide 2 }u&.n pc  
    s30=0.*s10;                %input in waveguide 3 "_JGe#=  
    s2=s20; FW:x XK  
    s3=s30; F kp;G  
    p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));   ;}{%|UAsx  
    %energy in waveguide 1 | eIN<RY5  
    p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));   (b Q1,y  
    %energy in waveguide 2 %^m6Q!  
    p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));   p6]4YGw*^  
    %energy in waveguide 3 <k'=_mC_  
    for m3 = 1:1:M3                                    % Start space evolution cA1"Nek  
       s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1;          % 1st step, Solve nonlinear part of NLS 6~sb8pK.=  
       s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2; {[PoLOCI  
       s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3; Z9s tB>?  
       sca1 = fftshift(fft(s1));                       % Take Fourier transform !Ac<A.  
       sca2 = fftshift(fft(s2)); $ +;`[b   
       sca3 = fftshift(fft(s3)); 7=t4;8|j;  
       sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz);           % 2nd step, frequency domain phase shift   ]:JoGGE a0  
       sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz); pq7G[  
       sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz); BEyg 63=  
       s3 = ifft(fftshift(sc3)); ^!-*xH.dK  
       s2 = ifft(fftshift(sc2));                       % Return to physical space n4+l, ~  
       s1 = ifft(fftshift(sc1)); jEsP: H(0^  
    end Y@N}XH<4R  
       p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1)))); 9D:p~_"g  
       p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1)))); "o/:LCE  
       p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1)))); q-gN0"z^6$  
       P1=[P1 p1/p10]; \5 IB/ *  
       P2=[P2 p2/p10]; XKB)++Q=  
       P3=[P3 p3/p10]; m5SJB]a/  
       P=[P p*p]; quHq?oXV,  
    end <\GP\G  
    figure(1) 7y:%^sl  
    plot(P,P1, P,P2, P,P3); ~U#afGH$  
    *{8K b>D  
    转自:http://blog.163.com/opto_wang/
     
    分享到
    离线ciomplj
    发帖
    319
    光币
    1
    光券
    0
    只看该作者 1楼 发表于: 2014-06-22
    谢谢哈~!~