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

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

    上一主题 下一主题
    离线tianmen
     
    发帖
    58
    光币
    15
    光券
    0
    只看楼主 倒序阅读 楼主  发表于: 2011-06-12
    计算脉冲在非线性耦合器中演化的Matlab 程序 h83ho  
    /<:9NP'^  
    %  This Matlab script file solves the coupled nonlinear Schrodinger equations of 6}iIK,Om  
    %  soliton in 2 cores coupler. The output pulse evolution plot is shown in Fig.1 of %h|z)  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear K'?ab 0  
    %   pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 ccD+o$7LT  
    `m2F.^qrr  
    %fid=fopen('e21.dat','w'); JS(KCY9  
    N = 128;                       % Number of Fourier modes (Time domain sampling points) "vLqYc4$  
    M1 =3000;              % Total number of space steps x?CjRvT $  
    J =100;                % Steps between output of space VPN@q<BV  
    T =10;                  % length of time windows:T*T0 O.rk!&N  
    T0=0.1;                 % input pulse width {h9#JMIA  
    MN1=0;                 % initial value for the space output location !YJdi~q  
    dt = T/N;                      % time step o\|dm. "f  
    n = [-N/2:1:N/2-1]';           % Index nt;A7pI`  
    t = n.*dt;   0?p_|X'_  
    u10=1.*sech(1*t);              % input to waveguide1 amplitude: power=u10*u10 8.-PQ  
    u20=u10.*0.0;                  % input to waveguide 2 -HoPECe  
    u1=u10; u2=u20;                 pbqa  
    U1 = u1;   $,i:#KT`  
    U2 = u2;                       % Compute initial condition; save it in U &)s A(  
    ww = 4*n.*n*pi*pi/T/T;         % Square of frequency. Note i^2=-1. =Rb,`%  
    w=2*pi*n./T; xmiF!R  
    g=-i*ww./2;                    % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./T $6y1';A  
    L=4;                           % length of evoluation to compare with S. Trillo's paper ;uoH+`pf  
    dz=L/M1;                       % space step, make sure nonlinear<0.05 ][G<CO`k  
    for m1 = 1:1:M1                                    % Start space evolution B/5C jHz  
       u1 = exp(dz*i*(abs(u1).*abs(u1))).*u1;          % 1st sSolve nonlinear part of NLS I*lq0&  
       u2 = exp(dz*i*(abs(u2).*abs(u2))).*u2; ~S-x-cZ  
       ca1 = fftshift(fft(u1));                        % Take Fourier transform I5x/N.  
       ca2 = fftshift(fft(u2)); 2A`EFk7_X  
       c2=exp(g.*dz).*(ca2+i*1*ca1.*dz);               % approximation PI?-gc?[  
       c1=exp(g.*dz).*(ca1+i*1*ca2.*dz);               % frequency domain phase shift   dDpe$N  
       u2 = ifft(fftshift(c2));                        % Return to physical space 6 Dg[ b  
       u1 = ifft(fftshift(c1)); )3)L  
    if rem(m1,J) == 0                                 % Save output every J steps. *3 9sh[*}  
        U1 = [U1 u1];                                  % put solutions in U array =z=Guvcn`  
        U2=[U2 u2]; d+&V^qLJ  
        MN1=[MN1 m1]; #mllVQ  
        z1=dz*MN1';                                    % output location 4uNcp0  
      end v11mu2  
    end GuDus2#+  
    hg=abs(U1').*abs(U1');                             % for data write to excel h+Q ==  
    ha=[z1 hg];                                        % for data write to excel '|FM|0~-J  
    t1=[0 t']; 3[V|C=u0  
    hh=[t1' ha'];                                      % for data write to excel file u|QfCwQ  
    %dlmwrite('aa',hh,'\t');                           % save data in the excel format ;OdUH   
    figure(1) (9cIU2e  
    waterfall(t',z1',abs(U1').*abs(U1'))               % t' is 1xn, z' is 1xm, and U1' is mxn L3<XWpv  
    figure(2) Qy6Avw/$  
    waterfall(t',z1',abs(U2').*abs(U2'))               % t' is 1xn, z' is 1xm, and U1' is mxn #Jm_~k  
    CS"p[-0  
    非线性超快脉冲耦合的数值方法的Matlab程序 tS!~> X  
    sWX   
    在研究脉冲在非线性耦合器中的演变时,我们需要求解非线性偏微分方程组。在如下的论文中,我们提出了一种简洁的数值方法。 这里我们提供给大家用Matlab编写的计算程序。   C62<pLJf  
    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 "V9!srIC  
    ]AHUo;(f%  
    pnqjAT GU  
    z4f5@  
    %  This Matlab script file solves the nonlinear Schrodinger equations ,#c-"x Y  
    %  for 3 cores nonlinear coupler. The output plot is shown in Fig.2 of jM7}LV1Ck  
    %  Youfa Wang and Wenfeng Wang, “A simple and effective numerical method for nonlinear DG:=E/@  
    %  pulse propagation in N-core optical couplers”, IEEE Photonics Technology lett. Vol.16, No.4, pp1077-1079, 2004 y!v$5wi  
    g:2/!tujL  
    C=1;                           Aga7X@fV(  
    M1=120,                       % integer for amplitude MiSFT5$v6  
    M3=5000;                      % integer for length of coupler u@gYEx}  
    N = 512;                      % Number of Fourier modes (Time domain sampling points) nEGku]pCH{  
    dz =3.14159/(sqrt(2.)*C)/M3;  % length of coupler is divided into M3 segments,  make sure nonlinearity<0.05. 3)3'-wu  
    T =40;                        % length of time:T*T0. G4RsH/  
    dt = T/N;                     % time step k~q[qKb8y:  
    n = [-N/2:1:N/2-1]';          % Index m.^6e f  
    t = n.*dt;   F(XWnfUv  
    ww = 4*n.*n*pi*pi/T/T;        % Square of frequency. Note i^2=-1. |2oB3 \)/  
    w=2*pi*n./T; 3[e@mcO  
    g1=-i*ww./2; R 7{ rY  
    g2=-i*ww./2;                  % w=2*pi*f*n./N, f=1/dt=N/T,so w=2*pi*n./TP=0; KK] >0QAY  
    g3=-i*ww./2; PkVXn  
    P1=0; BFEo:!'F  
    P2=0; SjJUhTb  
    P3=1; d@w I: 7  
    P=0; D^TKv;%d  
    for m1=1:M1                 Lte\;Se.tu  
    p=0.032*m1;                %input amplitude WYh7Y  
    s10=p.*sech(p.*t);         %input soliton pulse in waveguide 1 8bK}& *z<  
    s1=s10; '8Gw{&&  
    s20=0.*s10;                %input in waveguide 2 3; M!]9ms  
    s30=0.*s10;                %input in waveguide 3 8WyG49eic  
    s2=s20; XG [%oL  
    s3=s30; @e Myq1ZU  
    p10=dt*(sum(abs(s10').*abs(s10'))-0.5*(abs(s10(N,1)*s10(N,1))+abs(s10(1,1)*s10(1,1))));   -!}1{   
    %energy in waveguide 1 <y'ttxeS  
    p20=dt*(sum(abs(s20').*abs(s20'))-0.5*(abs(s20(N,1)*s20(N,1))+abs(s20(1,1)*s20(1,1))));   !PQRlgcG  
    %energy in waveguide 2 $"UAJ-  
    p30=dt*(sum(abs(s30').*abs(s30'))-0.5*(abs(s30(N,1)*s30(N,1))+abs(s30(1,1)*s30(1,1))));   ;{ezK8FJ}@  
    %energy in waveguide 3 (*;u{m=  
    for m3 = 1:1:M3                                    % Start space evolution AVJF[t,  
       s1 = exp(dz*i*(abs(s1).*abs(s1))).*s1;          % 1st step, Solve nonlinear part of NLS  ?Z!KV=  
       s2 = exp(dz*i*(abs(s2).*abs(s2))).*s2; Jg Xbs+.  
       s3 = exp(dz*i*(abs(s3).*abs(s3))).*s3; ^Gyl:hN  
       sca1 = fftshift(fft(s1));                       % Take Fourier transform Zn^E   
       sca2 = fftshift(fft(s2)); rcbixOT  
       sca3 = fftshift(fft(s3)); vIG,!^*3  
       sc1=exp(g1.*dz).*(sca1+i*C*sca2.*dz);           % 2nd step, frequency domain phase shift   MUo?ajbqOd  
       sc2=exp(g2.*dz).*(sca2+i*C*(sca1+sca3).*dz); bc"{ZL!C  
       sc3=exp(g3.*dz).*(sca3+i*C*sca2.*dz); @%TQ/L^|  
       s3 = ifft(fftshift(sc3)); \vT8 )\  
       s2 = ifft(fftshift(sc2));                       % Return to physical space dKMuo'H'%  
       s1 = ifft(fftshift(sc1)); bHMlh^{`%  
    end iKK=A.g  
       p1=dt*(sum(abs(s1').*abs(s1'))-0.5*(abs(s1(N,1)*s1(N,1))+abs(s1(1,1)*s1(1,1)))); K)v(Z"  
       p2=dt*(sum(abs(s2').*abs(s2'))-0.5*(abs(s2(N,1)*s2(N,1))+abs(s2(1,1)*s2(1,1)))); !uZ+r%  
       p3=dt*(sum(abs(s3').*abs(s3'))-0.5*(abs(s3(N,1)*s3(N,1))+abs(s3(1,1)*s3(1,1)))); 8jZYy!  
       P1=[P1 p1/p10]; J)-owu;  
       P2=[P2 p2/p10]; Z/I!\  
       P3=[P3 p3/p10]; U-k;kmaj  
       P=[P p*p]; 8t^"1ND  
    end f>'7~69  
    figure(1) "2h#i nS  
    plot(P,P1, P,P2, P,P3); 2KG j !w  
    ZD<,h` lZ  
    转自:http://blog.163.com/opto_wang/
     
    分享到
    离线ciomplj
    发帖
    319
    光币
    1
    光券
    0
    只看该作者 1楼 发表于: 2014-06-22
    谢谢哈~!~