and holes,

Conservation of charge carriers is forced by solving the charge carrier continuity equations for both electrons,

and holes

where and are the net recombination and generation rates per unit volume respectively.

To obtain the internal potential distribution within the device Poisson's equation is solved,

where , are the carrier densities of free and trapped electrons; and are the carrier densities of the free and trapped holes; and is the doping density.