########################################################################### # Scriptfile: pn_diode.lsf # # Description: # This script should be used with pn_diode.ldev DEVICE file # Run the script file after running the simulation # # Copyright 2015, Lumerical Solutions, Inc. ########################################################################### # built-in-potential V0 and depletion width W band = getresult("CHARGE::band","bandstructure"); Ec = pinch(band.Ec); z = pinch(band.z); # built-in-potential V0 = max(Ec) - min(Ec); ?"V0 = "+num2str(V0)+" Volt"; # because of the exponential nature of the curve, we set the edge of the depletion # region to the point where Ec reaches 95% of its max and min values Ecmin = min(Ec) + 0.01 * V0; Ecmax = max(Ec) - 0.01 * V0; zmin = find(Ec>Ecmin); zmin = zmin(1)-1; zmax = find(Ec>Ecmax); zmax = zmax(1); # depletion width W = z(zmax) - z(zmin); ?"W = "+num2str(W*1e6)+" micron";