Application of the superposition principle to solar-cell analysis