########################################################################### # Scriptfile: pn_junction_capacitance.lsf # # Description: # This file extracts the carrier densitiy changes as a function of voltage, # and determines the change in net charge between two adjacent bias points # # # Copyright 2016, Lumerical Solutions, Inc. ########################################################################### V_start = -0.2; V_stop = -4; points = 10; switchtolayout; select('CHARGE::boundary conditions::emitter'); set('sweep type','range'); set('range start',V_start); set('range stop',V_stop); set('range num points',points); run; Q = getresult("CHARGE::charge","total_charge"); n = pinch(Q.n); # unit is /m p = pinch(Q.p); # unit is /m V_bias = Q.V_emitter; V = (V_bias(1:points-1) + V_bias(2:points))/2; dQn = e * ( n(2:points) - n(1:points-1)); dQp = e * ( p(2:points) - p(1:points-1)); dV = V_bias(2) - V_bias(1); Cn = dQn/dV; # unit is F/m Cp = dQp/dV; # unit is F/m # Compare to analytic junction capacitance epsr = 11.7; ND = 1e21; Vbi = 0.712; A = 1e-6 * 1; # 1 um * 1 m Cj = A * sqrt((e*eps0*epsr*ND)/(2*(Vbi-V))); # unit is F/m plot(V,Cn*1e10,Cp*1e10,Cj*1e10,"Voltage (V)","Capacitance (pF/cm)"); legend("Cn","Cp","Cj");