#Testing the possibility to manually track a certain mode profile vs #changing structure dimensions clear; #dimension sweep minWidth=0.5e-6; maxWidth=1e-6; stepNum=6; dimSweep=linspace(minWidth,maxWidth,stepNum); #mode number to start with in the first rounds at minimum width firstMode=2; #Do you want to visually check the selected modes after the sweep 1=yes 0=no check=1; #Initialize neff vesctor where all neff indeces from the sweep are going to be saved neff=linspace(1,stepNum,stepNum); for (i=1:stepNum) { switchtolayout; select("structure group"); set("ridgeWidth",dimSweep(i)); findmodes; if (i==1) { #get the e field profile of the original mode copydcard("mode"+num2str(firstMode),"testMode"); neff(i)=getdata("mode"+num2str(firstMode),"neff"); if (check==1) { E=getresult("FDE::data::mode"+num2str(firstMode),"E"); visualize(E); } } else { #find mode with best overlap and replace theprevious dcard mode with it bestMode=bestoverlap("testMode"); neff(i)=getdata(bestMode,"neff"); cleardcard("testMode"); copydcard(bestMode,"testMode"); if (check==1) { E=getresult(bestMode,"E"); visualize(E); } } #if statement end } #for loop end #Purge deck cleardcard("testMode"); #Plot the found indices (complex numbers) plot(dimSweep*1e6,neff,"Ridge Width[um]","Effective Index");