########################################################################### # Scriptfile: usr_power_direction_test.lsf # # Description: # This file should be used in conjunction with usr_power_direction.fsp # to test the monitor group "power direction" to see if it can # correctly separate the forward and backward propagating power. # # Copyright 2010, Lumerical Solutions, Inc. ########################################################################### run; # choose name of the monitor group mname = "power_dir"; # rerun analysis runanalysis(mname); # get net power reflected from R monitor located behind source R = getresult("R","T"); # get power flow results from power_dir monitor power_dir = getresult(mname,"power_dir"); # plot the results plot(c/R.f*1e9,power_dir.T_positive,R.T,"wavelength (nm)","Reflection"); legend("new method","standard method"); plot(c/R.f*1e9,power_dir.T,R.T-1,power_dir.T_positive-power_dir.T_negative,"wavelength (nm)","Total Transmission"); legend("T net","R-1","T_positive-T_negative");