Studies on the effects of doping gradation and heavy doping on the performance of bipolar transistors and solar cells