######################################################### # mtm_phase_shifter.lsf # # Uses FDTD to calculate the phase shift across a negative # refractive index (NRI) transmission line metamaterial # implemented using coplanar waveguide technology and discrete # inductors and capacitors. # # This script runs a parameterization of the number of unit # cells (stages), in which the phase shift across multiple # stages are found and compared. # # The script runs the simulation, processes the data, # and generates the plots. The ::model analysis group contains # the setup of the simulation. # # # Copyright 2016 Lumerical Solutions Inc ########################################################## ########################################################## #Extract Port Data From the Sweep T1=getsweepresult("Unit Cell Sweep", "T1"); T2=getsweepresult("Unit Cell Sweep", "T2"); neff=getresult("Ports::Port 1 Expansion", "neff");neff=abs(neff.neff(2)); ###################################################### #Calculate scattering parameters S11=T1.b/T1.a; S21=T2.a/T1.a; f=T1.f;omega=2*pi*f; ####################################################### #Derive theory. Find effective permittivitiy from the mode expansion monitor eps_eff=neff^2; beta_TL=omega/(c/sqrt(eps_eff)); C0=12e-12; L0=50e-9; d=8e-3; beta_eff=beta_TL-1/(omega*sqrt(L0*C0)*d); ph_uc=beta_eff*d; ######################################################## #Generate phase plots and display prompt of difference plot(f/1e9,-ph_uc*180/pi,"","","","plot type=line, color=red, pen=-., linewidth=2");holdon; plot(f/1e9,unwrap(-angle(pinch(S21,3,1))*180/pi),"","","","plot type=line, color=red, pen=-, linewidth=2"); plot(f/1e9,-ph_uc*2*180/pi,"","","","plot type=line, color=green, pen=-., linewidth=2");holdon; plot(f/1e9,unwrap(-angle(pinch(S21,3,2))*180/pi),"","","","plot type=line, color=green, pen=-, linewidth=2"); plot(f/1e9,-ph_uc*4*180/pi,"","","","plot type=line, color=blue, pen=-., linewidth=2");holdon; plot(f/1e9,unwrap(-angle(pinch(S21,3,3))*180/pi),"","","","plot type=line, color=blue, pen=-, linewidth=2"); setplot("x label", "Frequency (GHz)");setplot("y label", "Phase of S21 (degrees)"); legend("1-stage: Theory", "1-stage: FDTD", "2-stage: Theory", "2-stage: FDTD", "4-stage: Theory", "4-stage: FDTD"); setplot("y min",-75);setplot("y max",100); ?msg = "============Maximum Difference in Simulated and Theoretical Phase==============="; ?msg = "1 - Stage - Delta Phase = "+num2str(max(abs(ph_uc-angle(pinch(S21,3,1)))*180/pi))+"deg / stage"; ?msg = "2 - Stage - Delta Phase = "+num2str(max(abs(ph_uc-angle(pinch(S21,3,2))/2)*180/pi))+"deg / stage"; ?msg = "4 - Stage - Delta Phase = "+num2str(max(abs(ph_uc-angle(pinch(S21,3,3))/4)*180/pi))+"deg / stage";