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

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

    上一主题 下一主题
    离线tianmen
     
    发帖
    58
    光币
    15
    光券
    0
    只看楼主 倒序阅读 楼主  发表于: 2011-06-12
    计算脉冲在非线性耦合器中演化的Matlab 程序 8wmQ4){  
    U=QA  e  
    %  This Matlab script file solves the coupled nonlinear Schrodinger equations of WFDCPQ@  
    %  soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of ,Xtj;@~-  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear AY88h$a  
    %   pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 :tbd,Uo  
    c1#+Vse  
    %fid=fopen('e21.dat','w'); $>r5>6  
    N = 128;                       % Number of Fourier modes (Time domain sampling points) V|: qow:F  
    M1 =3000;              % Total number of space steps U\bC0q   
    J =100;                % Steps between output of space vaB!R 0  
    T =10;                  % length of time windows:T*T0 D/:3R ZF  
    T0=0.1;                 % input pulse width `eD1|Go9  
    MN1=0;                 % initial value for the space output location 5v|EAjB6o  
    dt = T/N;                      % time step gDC2 >nV  
    n = [-N/2:1:N/2-1]';           % Index ;;Tq$#vd  
    t = n.*dt;   vyU!+mlc  
    u10=1.*sech(1*t);              % input to waveguide1 amplitude: power=u10*u10 Yt{&rPv,  
    u20=u10.*0.0;                  % input to waveguide 2 1Es qQz*$u  
    u1=u10; u2=u20;                 n&d/?aJ7a\  
    U1 = u1;   /b%Q[ Ck_  
    U2 = u2;                       % Compute initial condition; save it in U $[z<oN_Q  
    ww = 4*n.*n*pi*pi/T/T;         % Square of frequency. Note i^2=-1. YgimJsm  
    w=2*pi*n./T; :1_mfX  
    g=-i*ww./2;                    % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T (Ilsk{aB;A  
    L=4;                           % length of evoluation to compare with S. Trillo's paper vpLMhf`  
    dz=L/M1;                       % space step, make sure nonlinear<0.05 >rf5)Y~f  
    for m1 = 1:1:M1                                    % Start space evolution (p,}'I#i*  
       u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1;          % 1st sSolve nonlinear part of NLS 8 Z8Y[p  
       u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; |^Kjz{  
       ca1 = fftshift(fft(u1));                        % Take Fourier transform C}Qt "-%  
       ca2 = fftshift(fft(u2)); >| m.?{^  
       c2=exp(g.*dz).*(ca2+i*1*ca1.*dz);               % approximation ab4LTF|  
       c1=exp(g.*dz).*(ca1+i*1*ca2.*dz);               % frequency domain phase shift   V^rW?Do  
       u2 = ifft(fftshift(c2));                        % Return to physical space : Ss3ck*=  
       u1 = ifft(fftshift(c1)); dG0VBE  
    if rem(m1,J) == 0                                 % Save output every J steps. 1exfCm  
        U1 = [U1 u1];                                  % put solutions in U array CDCC1BG"  
        U2=[U2 u2]; ti9}*8  
        MN1=[MN1 m1]; P {H{UKs#  
        z1=dz*MN1';                                    % output location vr4S9`,  
      end ] .5O X84  
    end '9q6aM/&  
    hg=abs(U1').*abs(U1');                             % for data write to excel m UgRm]  
    ha=[z1 hg];                                        % for data write to excel z_l. V/G)  
    t1=[0 t']; k ,fTW^?  
    hh=[t1' ha'];                                      % for data write to excel file HJ@5B"  
    %dlmwrite('aa',hh,'\t');                           % save data in the excel format vGN3 YcH  
    figure(1) % wL,v.}  
    waterfall(t',z1',abs(U1').*abs(U1'))               % t' is 1xn, z' is 1xm, and U1' is mxn Xw^X&Pp  
    figure(2) ik\S88|  
    waterfall(t',z1',abs(U2').*abs(U2'))               % t' is 1xn, z' is 1xm, and U1' is mxn Pfan7fq+  
    1JeJxzv>C  
    非线性超快脉冲耦合的数值方法的Matlab程序 3dm'xe tM  
    it,w^VU_]  
    在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。   o0`q#>7!_b  
    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 jVYH;B%%z  
    @]?R2bI  
    #U@| J}a  
    a D|Yo  
    %  This Matlab script file solves the nonlinear Schrodinger equations YoAg  
    %  for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of Ub)M*Cq0(o  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear p(?3 V  
    %  pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 /b{HG7i\  
    M&[b.t*  
    C=1;                           woau'7}XOu  
    M1=120,                       % integer for amplitude * nCx[  
    M3=5000;                      % integer for length of coupler c<tmj{$  
    N = 512;                      % Number of Fourier modes (Time domain sampling points) q[c Etp28h  
    dz =3.14159/(sqrt(2.)*C)/M3;  % length of coupler is divided into M3 segments,  make sure nonlinearity<0.05. v}P!HczmMP  
    T =40;                        % length of time:T*T0. $?f]ZyZr.  
    dt = T/N;                     % time step A.U'Q|  
    n = [-N/2:1:N/2-1]';          % Index %U?)?iZdL  
    t = n.*dt;   @?a4i  
    ww = 4*n.*n*pi*pi/T/T;        % Square of frequency. Note i^2=-1. CQ>]jQ,2  
    w=2*pi*n./T; O<X )p`,`  
    g1=-i*ww./2; Jck"Ks  
    g2=-i*ww./2;                  % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0; 3;Hd2 ;G  
    g3=-i*ww./2; ]^ 'ZiyJX  
    P1=0; >{XScxaB`  
    P2=0; J]\^QMX  
    P3=1; o4~kX  
    P=0; /qXzOd  
    for m1=1:M1                 ,8VXA +'_  
    p=0.032*m1;                %input amplitude +-ewE-:|L  
    s10=p.*sech(p.*t);         %input soliton pulse in waveguide 1 e5OVq ,  
    s1=s10; FL&dv  
    s20=0.*s10;                %input in waveguide 2 P` ]ps?l  
    s30=0.*s10;                %input in waveguide 3 =|V" #3$f  
    s2=s20; OjATSmZ@@  
    s3=s30; +WL  D  
    p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));   4J}3,+  
    %energy in waveguide 1 Tf[dZ(+\  
    p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));   b1)\Zi  
    %energy in waveguide 2 [*HiI=  
    p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));   OG}KqG!n  
    %energy in waveguide 3 0WXVc  
    for m3 = 1:1:M3                                    % Start space evolution [q"NU&SX  
       s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1;          % 1st step, Solve nonlinear part of NLS ~`[8"YUL  
       s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2; .vaJ Avg  
       s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3; T#r=<YH[C  
       sca1 = fftshift(fft(s1));                       % Take Fourier transform 24X=5Aj  
       sca2 = fftshift(fft(s2)); K?YEoz'y[  
       sca3 = fftshift(fft(s3)); +{*)}[w{x  
       sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz);           % 2nd step, frequency domain phase shift   Pz1G<eh#{g  
       sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz); 3?^NN|xg  
       sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz); JV%nH! Fs  
       s3 = ifft(fftshift(sc3)); @,Jb7V<  
       s2 = ifft(fftshift(sc2));                       % Return to physical space iAHZ0Du  
       s1 = ifft(fftshift(sc1)); uMpl#N p  
    end ArX]L$ D  
       p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1)))); H &fTh  
       p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1)))); L!vWRwZwC  
       p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1)))); |D+p$^L  
       P1=[P1 p1/p10]; M:(&n@e  
       P2=[P2 p2/p10]; CjV7q y  
       P3=[P3 p3/p10]; D-D #`  
       P=[P p*p]; X+*<B(E  
    end #G~wE*VR$  
    figure(1) tWX7dspx/  
    plot(P,P1, P,P2, P,P3); i'iO H|s  
    6VFirLd  
    转自:http://blog.163.com/opto_wang/
     
    分享到
    离线ciomplj
    发帖
    319
    光币
    1
    光券
    0
    只看该作者 1楼 发表于: 2014-06-22
    谢谢哈~!~