波在匹配介質間的傳播

來源:互聯網
上載者:User

標籤:

 1 %1D FDTD simulation with a simple absorbing boundary condition 2 % and a TFSF boundary between hy[49] and ez[50].  3 % dielectric material located ez[100] 4 SIZE = 400; 5 LOSS = 0.01; 6 LOSS_LAYER =250; 7 ez = zeros(1,SIZE); 8 hy = zeros(1,SIZE-1); 9 ceze = zeros(1,SIZE);10 cezh = zeros(1,SIZE);11 chyh = zeros(1,SIZE-1);12 chye = zeros(1,SIZE-1);13 imp0=377.0;14 maxTime = 10000;15 % initialize update coefficient16 for mm = 1 : 1 : SIZE -117     if mm < 10018         ceze(mm) =  1.0;19         cezh(mm) = imp0;20     else if mm < LOSS_LAYER21         ceze(mm) =  1.0;22         cezh(mm) = imp0/9.0;23         else            24        ceze(mm) =  (1-LOSS)/(1+LOSS);25        cezh(mm) = imp0 /9/(1+LOSS);26         end27         28     end29 end30 for mm = 1 : 1 : SIZE -131      if mm < LOSS_LAYER32        chyh(mm) = 1.0;33        chye(mm) = 1.0/imp0;34     else35         chyh(mm) = (1-LOSS)/(1+LOSS);36        chye(mm) = 1.0/imp0/(1+LOSS);37         38     end39 end40 for qTime = 0 : 1 : maxTime41     % hy(SIZE)=hy(SIZE-1);%42     43     % update magnetic field44     for mm = 1 : 1 : SIZE -145         hy(mm) = hy(mm)*chyh(mm) + (ez(mm+1)- ez(mm))*chye(mm);46     end   47 % correction for Hy adjacent to TFSF boundary */48  hy(50)=hy(50)-exp(-(qTime - 30)*(qTime - 30) / 100) / imp0;49  50     figure(1);51     subplot(211);t_hy = plot(hy);    52     title(‘Magnetic Field‘);  53     54     % ABC55     ez(1)=ez(2);%   56 %      ez(SIZE)=ez(SIZE-1);%57 58     for mm = 2 : 1 : SIZE-1 59          ez(mm) = ez(mm)*ceze(mm) + (hy(mm)- hy(mm-1))*cezh(mm);60     end    61 %     figure(2); 62     subplot(212);63     t_ez = plot(ez);64     title(‘Electric Field‘)65     ez(51) = ez(51) + exp(-(qTime+0.5-(-0.5)-30.0)*(qTime+0.5-(-0.5)-30.0)/100.0);66     67 %     pause(0.01);68 % %     refreshdata(t_hy);69 %     refreshdata(t_ez);70 %     drawnow;71 end

 

波在匹配介質間的傳播

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.