We report on the results of a computer simulation of amorphous silicon-based alloy p-i-n solar cells based on the complete set of transport equations. Our model takes into account the spatial and energy variations of the localized state spectrum, nonuniform doping profiles, and nonuniform optical excitation. The computed dark and light current-voltage characteristics are in good agreement with experimental data. Our results suggest that carrier back diffusion is not a significant effect in optimized p-in devices and that the open circuit voltage is determined by the recombination current. We also show the importance of residual boron doping in the intrinsic layer for cells illuminated through the n+ layer, and that hole transport limits device performance.