Ansys Learning Forum › Forums › Discuss Simulation › Photonics › the outputs of AWG › Reply To: the outputs of AWG
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