Adding Ionized Dopants
In semiconductor physics, the concentration and distribution of the ionized dopants control the fermi-level. Note that even though the final solution variable here is called "Doping," that it is really the fixed and charged dopant ion that is used in semiconductor equations.
model
set small $1.0e-10 proc SetDoping {} { global small solution add name=Nd solve const val = "1.1e15";#n-type base solution add name=Na solve const val = "$small";#no p-type doping solution add name=Doping solve const val = "((Nd)-(Na))" AddCharge Silicon "Doping" }
warnings
This uses the procedure AddCharge to add the ionized (and therefore charged) dopant concentration to Poisson's equation.