# # Set up and run the static capacitance analysis # dV = 0.025; N = 13; vmax = 2.4; # # Accumulation # Va = linspace(0,-vmax,N); V = matrix(2*length(Va),1); V(1:2:length(V)) = Va; V(2:2:length(V)) = Va - dV; switchtolayout; select('CHARGE::boundary conditions::gate'); set('bc mode','steady state'); set('sweep type','value'); set('value table',V); run; gate = getresult('CHARGE','gate'); net_charge = getresult('CHARGE::monitor_gate_field','net_charge'); Q = pinch(net_charge.Q); Ca = abs(Q(2:2:(2*N))-Q(1:2:(2*N)))/dV; # # Depletion # Vd = linspace(0,vmax,N); V = matrix(2*length(Vd),1); V(1:2:length(V)) = Vd; V(2:2:length(V)) = Vd + dV; switchtolayout; select('CHARGE::boundary conditions::gate'); set('value table',V); run; gate = getresult('CHARGE','gate'); net_charge = getresult('CHARGE::monitor_gate_field','net_charge'); Q = pinch(net_charge.Q); Cd = abs(Q(2:2:(2*N))-Q(1:2:(2*N)))/dV; # # Collect results # V = [flip(Va,1); Vd(2:N)]; C = [flip(Ca,1); Cd(2:N)]; plot(V,C*1e15*1e-6,"Voltage (V)","Capacitance (fF/um)");