for(r=0:10){

switchtolayout;

setnamed(“ring_resonator”,“radius”, r*1e-6);

```
for(g=0:10){
switchtolayout;
setnamed("ring_resonator","gap", g*1e-6);
for(L=0:10){
switchtolayout;
setnamed("ring_resonator","Lc", L*1e-6);
#Solver
setnamed("varFDTD","x span", (8*r+L)*1e-6);
setnamed("varFDTD","y span", (8*r+8*g)*1e-6);
#Source
setnamed("source1","x",(-(L/2)-3*r)*1e-6);
setnamed("source1","y",(r+g)*1e-6);
select("source1");
updatesourcemode;
#Monitors
setnamed("full_profile","x span",(16*r+2*L)*1e-6);
setnamed("full_profile","y span",(8*r+8*g)*1e-6);
setnamed("index","x span",(16*r+2*L)*1e-6);
setnamed("index","y span",(8*r+8*g)*1e-6);
setnamed("through","x",((r+L)+1)*1e-6);
q=getnamed("ring_resonator::rectangle","y");
setnamed("through","y",(q)*1e-6);
setnamed("time_through","x",((r+L)+1)*1e-6);
q=getnamed("ring_resonator::rectangle","y");
setnamed("time_through","y",(q)*1e-6);
setnamed("drop","x",(-(r+L)-1)*1e-6);
q=getnamed("ring_resonator::rectangle","y");
setnamed("drop","y",(-q)*1e-6);
setnamed("time_drop","x",(-(r+L)-1)*1e-6);
q=getnamed("ring_resonator::rectangle","y");
setnamed("time_drop","y",(-q)*1e-6);
run;
Tr = transmission("trans_box::x2");
#Tr = getresult("through","T");
write("the_sweep.txt","Tr = "+num2str(Tr)+", r = "+num2str(r));
write("the_sweep.txt","Tr = "+num2str(Tr)+", L = "+num2str(L));
write("the_sweep.txt","Tr = "+num2str(Tr)+", g = "+num2str(g));
write("the_sweep.txt"," ");
#write("the_sweep.txt","r = "+num2str(r));
#write("the_sweep.txt","L = "+num2str(L));
#write("the_sweep.txt","g = "+num2str(g));
#write("the_sweep.txt"," ");
}
}
```

}