I need to find a way to go about how to simulate the behavior of carrier concentration in the depletion region of a p-n junction silicon diode given the doping concentration under "non-depletion region approximation conditions" using MATLAB and thus plot the energy band diagrams and then apply it to a BJT.

Firstly Im confused as to which road to take , uniformly doped P-N where the Nd and Na dopants remain constant (FIG 1) or whether to vary them linearly while approching the junction at which Na (acceptor concentration/cm3)= Nd(donor concentration/cm3) (FIG2)---> i.e P type formed on N type substrate.

HELP!!