Photonics

Photonics

EME mode convergence test

    • iqnlo
      Subscriber

      Hi all

      I'm doing the mode convergence test following this instruction:

      Convergence testing process for EME simulations – Lumerical Support

      But there is something wrong in the codes:

      pol_converter (1);

      Error: C:/Users/Downloads/pol_converter (1).lsf line 63: Can not find specified member 's52' in dataset 'S_mode_convergence_sweep'


      Below is my question:

      Why the transmission efficiency is called S52? The transmission should be s12 (forward propagation) or s21 (backward propagation). And also there is only s12, s21, s22, s11 in the matrix S.

    • iqnlo
      Subscriber
      By the way, the first 65 lines are:
      # convergence with number of cells in tapered region
      if(1){
      switchtolayout;

      # reset values of other settings in case convergence testing was
      # performed previously for other settings
      setnamed("EME","number of modes for all cell groups",10);
      setnamed("mesh","dy",0.01e-6);
      setnamed("mesh","dz",0.01e-6);

      npts = 10; # number of points to sweep
      ncells = linspace(2,20,npts); # values to sweep

      S52 = matrix(npts); # initialize result matrix

      for(i = 1:npts){ # sweep
      switchtolayout;
      setnamed("EME","cells",[1;ncells(i);1]);
      run;
      emepropagate;
      S = getresult("EME","user s matrix");
      S52(i) = S(2,1);
      }

      plot(ncells,abs(S52)^2,"Number of cells in tapered region" "|S52|^2");

      # delta_T
      delta_T = (abs(S52(2:npts))^2-abs(S52(1:npts-1))^2)^2/abs(S52(2:npts))^4;

      # delta_T_N
      delta_T_N = (abs(S52)^2-abs(S52(npts))^2)^2/abs(S52(npts))^4;

      # plot delta_T and delta_T_N
      plotxy(ncells(2:npts),delta_T, ncells,delta_T_N "Number of cells in tapered region","delta_T");
      legend("delta_T","delta_T_N");
      }

      # the convergence with number of eigenmodes
      if(1){
      switchtolayout;

      # reset values of other settings in case convergence testing was
      # performed previously for other settings

      setnamed("mesh","dy",0.01e-6);
      setnamed("mesh","dz",0.01e-6);

      start_mode = 4; #set smaller number of modes for convergence test
      mode_interval = 1; #set mode interval for convergence test

      setnamed("EME","number of modes for all cell groups",25); #should be the largest number of modes desired for test

      run;
      setemeanalysis("mode convergence sweep", 1);
      setemeanalysis("start mode", start_mode);
      setemeanalysis("mode interval", mode_interval);
      emesweep("mode convergence sweep");

      S = getemesweep("S_mode_convergence_sweep");
      nmodes = S.modes;
      S52 = S.s52;
      npts = length(S52);

      plot(nmodes,abs(S52)^2,"Number of eigenmodes","|S52|^2");
    • Guilin Sun
      Ansys Employee
      You are right that the script does not fit the simulation file. I guess originally the simulation file has 5 modes in the two ports so it has 5by5 S matrix. Current simulation file has one mode at each port, so please modify
      S52(i) = S(2,1);
      This will peak S21 even the variable name is called S52. If you want, please modify the output variable name.
    • iqnlo
      Subscriber
      Thanks for you reply!
      The problem was solved.
      But I meet another problem when I'm applying this code on my own structure (EME solver). In my original project, the "allow custom eigensolver settings" box need to be checked. Because I need to select the mode manually (also define the refractive index manually) rather than let the software choose mode at the highest refractive index. However for applying your codes, I need to uncheck this box and let the codes select the default mode. This make my simulation give a wrong result.







    • Guilin Sun
      Ansys Employee
      Ideally each topic only contains one question so we can suggest one solution. In this way the forum is more convenient for others to find the solution if they have the same issue, which is the main purpose of the forum. So please write a new post next for any new questions.
      The online script file has 3 different sweeps. So if you want manually set something, please do it before the sweep, and make sure the sweep does not need to modify what you set. For example, only when you sweep the number of cells, then the cell property needs to be specified. If you sweep the mesh size, or EME size (yz spans), it does not change the cell property. If the modes need to be specified manually, then you may not be able to use the script. In this case, you will do one simulation at a time and collect the results for later use.
      Please note that EME has a built-in mode number sweep. probably you can try it.


Viewing 4 reply threads
  • You must be logged in to reply to this topic.