Photonics

Photonics

Topics related to Lumerical and more.

the outputs of AWG

TAGGED: 

    • jing wang
      Subscriber
      Hello, may I ask how the result graph of VarFDTD simulation from the example of array waveguide grating simulation was extracted from the monitor of the output port, and what formula is needed to process it?
      https://optics.ansys.com/hc/en-us/articles/360042800633-Arrayed-waveguide-grating-AWG
      These are a few lines of code that I added to process the results, but they should not be correct.
       
      jingwang uploaded a photo
    • Afroditi Petropoulou
      Ansys Employee

      Dear Jing,

       

      Thank you for contacting us.

       

      To get the plot described in Step 4 of the Arrayed waveguide grating (AWG) – Ansys Optics, you need to run the “AWG” analysis first. Then you can either right-click on the T result that has appeared in the Result View window and visualize it or run a script to do that.


      If you choose the first option, you will need to go to the plot settings to check the “log10y” option and to change the lambda units.


       You can also change the axis limits.

       

      If you want to use script so that you can also post-process the results, you can use the following script:

      ###################################################################################

      n=8;

       

      Tres=getresult("AWG","T");

      lambda=Tres.lambda;

       

      T=matrix(n,length(lambda));

       

      for (i=1:n) {

          T(i,:)=Tres.getattribute("T"+num2str(i));

          plot(lambda*1e9,pinch(T,1,i),"lambda", "T");

          holdon;

      }

       

      leg=cell(n);

      y=linspace(1,n,n);

      for (i=1:n){

      leg{i}="Re(T"+num2str(y(i))+")";

      }

       

      legend(leg);

      setplot("log10y",1);

      setplot("y max",1);

      setplot("y min",1e-7);

      setplot("legend position",8);

      holdoff;

      #################################################################################

      The above script should be used as an external script and not in the AWG analysis group. If you want to use it inside the AWG analysis group you can add it at the end of the analysis script but you need to remove the second line (i.e. the T=getresult("AWG","T"); line).

      Does the above answer your question or do you need something regarding the analysis script?

       

      Best regards,

      Afroditi

    • Afroditi Petropoulou
      Ansys Employee

      Dear Jing,

      A small correction. Use this script:

      n=8;

       

      T=getresult("AWG","T");

      lambda=T.lambda;

       

      Tres=matrix(n,length(lambda));

       

      for (i=1:n) {

      Tres(i,:)=T.getattribute("T"+num2str(i));

      plot(lambda*1e9,pinch(Tres,1,i),"lambda", "T");

      holdon;

      }

       

      leg=cell(n);

      y=linspace(1,n,n);

      for (i=1:n){

      leg{i}="Re(T"+num2str(y(i))+")";

      }

       

      legend(leg);

      setplot("log10y",1);

      setplot("y max",1);

      setplot("y min",1e-7);

      setplot("legend position",8);

      holdoff;

       

      The previous one will work as external script but will not work inside the analysis. Again if you want to use it in the analysis you need to remove the second line (T=getresult("AWG","T");). In this case, when you run the analysis, the results will be automatecally plotted.

       

      Best regards,

      Afroditi

    • jing wang
      Subscriber

      Dear Afroditi,

      thank you very much,  it really helps me a lot~

       

      Best regards,

      Jing

Viewing 3 reply threads
  • The topic ‘the outputs of AWG’ is closed to new replies.