Photonics – Chinese

Photonics – Chinese

Topics related to Lumerical and more, in Chinese language.

关于官方例子MIE散射中scat_ff组的求助

TAGGED: 

    • chenymjxzs
      Subscriber

      ######## y-z plane (phi=0 corresponds to the direction (0,1,0))
          ?"    Projecting in y-z plane";
          x = 0; y = cos(phi*pi/180);  z = sin(phi*pi/180);

          # Calculate far field by summing contribution from each monitor
          temp = farfieldexact("x2",x,y,z,i) + farfieldexact("y2",x,y,z,i) + farfieldexact("z2",x,y,z,i);
          if(havedata("x1")){
            temp = temp - farfieldexact("x1",x,y,z,i);
          }else{
            temp2 = farfieldexact("x2",-x,y,z,i);
            s = symm_x*[1,-1,-1];
            temp2(1:npts,1) = s(1)*temp2(1:npts,1);
            temp2(1:npts,2) = s(2)*temp2(1:npts,2);
            temp2(1:npts,3) = s(3)*temp2(1:npts,3);
            temp = temp - temp2;
          }
          if(havedata("y1")){
            temp = temp - farfieldexact("y1",x,y,z,i);
          }else{
            temp2 = farfieldexact("y2",x,-y,z,i);
            s = symm_y*[-1,1,-1];      
            temp2(1:npts,1) = s(1)*temp2(1:npts,1);
            temp2(1:npts,2) = s(2)*temp2(1:npts,2);
            temp2(1:npts,3) = s(3)*temp2(1:npts,3);
            temp = temp - temp2;
          }
          if(havedata("z1")){
            temp = temp - farfieldexact("z1",x,y,z,i);
          }else{
            temp2 = farfieldexact("z2",x,y,-z,i);
            s = symm_z*[-1,-1,1];
            temp2(1:npts,1) = s(1)*temp2(1:npts,1);
            temp2(1:npts,2) = s(2)*temp2(1:npts,2);
            temp2(1:npts,3) = s(3)*temp2(1:npts,3);
            temp = temp - temp2;
          }
          E_yz (1:length(phi), 1:3, i) = temp;
          E2_yz (1:length(phi), i) = sum(abs(temp)^2,2); # E2 = |Ex|^2 + |Ey|^2 + |Ez|^2
          H2_yz (1:length(phi), i) = E2_yz (1:length(phi), i) * n^2 * eps0/mu0; # for a plane wave, E^2 and H^2 only differ by a factor of n^2*eps0/mu0
      首先我不能理解为什呢计算远场需要全部加起来:也就是:temp = farfieldexact("x2",x,y,z,i) + farfieldexact("y2",x,y,z,i) + farfieldexact("z2",x,y,z,i);

      其次,我不知道为什么加起来之后又需要这么处理

      if(havedata("x1")){ temp = temp - farfieldexact("x1",x,y,z,i); } else { temp2 = farfieldexact("x2",-x,y,z,i); s = symm_x*[1,-1,-1]; temp2(1:npts,1) = s(1)*temp2(1:npts,1); temp2(1:npts,2) = s(2)*temp2(1:npts,2); temp2(1:npts,3) = s(3)*temp2(1:npts,3); temp = temp - temp2; }

    • GuanYo Dong
      Subscriber

      你好

      此腳本算遠場概念就是把近場紀錄之後,用空間自由傳播傳到我們定義遠場中的特定位置
      farfieldexact - Script command – Ansys Optics  
      而我們用monitor來記錄近場,要怎麼都記錄起來呢?就是用6面體(6個面)把關心的物件包起來。
      如果只有其中一個比如說x2,那可能只有右側被接收到的近場信息,所以我們應該要加上6個monitor

      你的兩個問題其實不能分開看,
      腳本為了處理仿真的時候有沒有用對稱或是反對秤邊界的區別,對於x1,y1,z1要處理過才加上,
      問題1中的temp是不管有沒有用對稱/反對稱邊界,都不需要處理的部分
      問題2我分開來說明
             >>其中的 (havedata("x1")),代表沒有用對稱邊界,而用"減去"x1的遠場是因為FDTD對於monitor的法向量以及光源的方向之間有方向正負的關係,
                 舉一個簡單的例子,我要記錄一個物件的反射率,模型建立如果是物體下邊界在Z=0,光源放在Z=-1um往+Z方向入射,monitor放在0~-1um與放在-1.5um都可以但是結果會不同
                 假設物件的反射率是4%,monitor放在0~-1um之間,則會得到96%,意思是monitor接收到跟光源同方向的能量100%,還有跟光源反向的能量4%,後者會用負的表示所以相加是96%
                 monitor放在-1.5um則會收到-4%

          >>那 else裡面,則代表有用對稱或是反對稱邊界,此時數據會是x2 monitor數據的鏡像數據或是反鏡像數據,所以用symm_x(更前面腳本的判斷)來看鏡像的情況,
              y1 z1部分同理x1

      希望有解答到你的問題

      莎益博  董冠佑

Viewing 1 reply thread
  • You must be logged in to reply to this topic.