Ring Resonator sweep Run issue

mode
script
parametersweep
sweep

#1

Hello,

Currently I am trying to do a radius gap and length nested sweep for ring resonator. I am doing it with scripting because I need to change positions of sources and monitors as the ring resonator gets larger. But I am having an issue trying to run. Whenever I run it says the error “Cannot update source1”. If I dont run the value change as I want.
Also when I am trying transmission results I cant get any, is it because of the error I have stated above.
Next post will contain my code.

Thanks you! Cheers.


#2

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"," ");
	}
}

}


#3

Hi @bturkmen16

Sorry for my late reply.

Can you please share the simulation file with me for a review?

In the mean time, can you please check and make sure that you are enabling user select before updating the mode source?

set("mode selection","user select");
updatesourcemode;

This link might be useful to review as well:
Method to skip "Updating mode source"?

Thanks