##################################################### # quarter_wave_transformer_RLC.lsf # # Quarter-wavelength microstrip transmission line # terminated in load. # # This script calculates the frequency # response and compare the reflection coefficient # and SWR percent bandwidth to transmission line # theory. # # Copyright 2016 Lumerical Solutions Inc ##################################################### # Get S11 and freqeuncy vector result from port Port1=getresult("FDTD::ports::port 1","S"); S11_sim=Port1.S; freq=Port1.f; # Transmission-line theory to calculate reflection # coefficient. Assumes a TEM mode. Zfeed=100;ZL=350; fc=4e9; #center frequency/wavelengt Z0=187.1; #c eps_eff=1.66; l1=14.55e-3; lambda0=c/freq; lambdag=lambda0/sqrt(eps_eff); beta_l=2*pi*l1/lambdag; #propagation constant * length (assumes TEM mode) Zin=Z0*(ZL+1i*Z0*tan(beta_l))/(Z0+1i*ZL*tan(beta_l)); #input impedance seen by the feeding TL G_theory=(Zin-Zfeed)/(Zin+Zfeed); #theoretical reflection coefficient G_sim=S11_sim; #simulated absolute reflection coefficient # plot plot(freq/1e9,abs(G_theory),abs(G_sim),"Freq (GHz)","Reflection Coefficient","Quarter-wave Transformer"); legend("TL Theory", "Simulation"); #calculate SWR<=2 bandwidth SWR_theory=(1+abs(G_theory))/(1-abs(G_theory)); SWR_sim=(1+abs(G_sim))/(1-abs(G_sim)); fBW_t=[freq(min(find(SWR_theory<=2))),freq(max(find(SWR_theory<=2)))]; delta_t=(fBW_t(2)-fBW_t(1))/fc; fBW_s=[freq(min(find(SWR_sim<=2))),freq(max(find(SWR_sim<=2)))]; delta_s=(fBW_s(2)-fBW_s(1))/fc; ?"SWR<=2 Percent bandwidth from Theory is "+num2str(100*delta_t)+ "%" ; ?"SWR<=2 Percent bandwidth from Simulation is "+num2str(100*delta_s)+ "%" ;