# Lumerical script file: alignment.lsf # the purpose of this script is to calculate aligment sensitivities # for the combined ASAP2005/MODE Solutions photonic crystal fiber example # clear all the variables in the script environment clear; # define x and y misalignments x = linspace(-2e-6,2e-6,50); y = linspace(-2e-6,2e-6,50); # define a matrix for the results, both overlap and power coupling, for # both the fundamental modes result = matrix(length(x),length(y),2,2); # do the main loop for(i=1:length(x)) { ?"Completed: " + num2str(i/length(x)*100) + "% of calculation"; for(j=1:length(y)) { result(i,j,1:2,1) = overlap("fld_data","mode1",x(i),y(j),0); result(i,j,1:2,2) = overlap("fld_data","mode2",x(i),y(j),0); } } # display the results image(x*1e6,y*1e6,result(1:length(x),1:length(y),2,1),"x (microns)","y (microns)","Power coupling sensitivity for mode1"); image(x*1e6,y*1e6,result(1:length(x),1:length(y),2,2),"x (microns)","y (microns)","Power coupling sensitivity for mode2"); # show the region that satisfies our 3 dB requirement for alignment temp = result(1:length(x),1:length(y),2,1); temp = temp/max(temp); temp = temp > 10^(-3/10); image(x*1e6,y*1e6,temp,"x (microns)","y (microns)","region satisfying 3 dB requirement, mode 1");