Calculation of solar cell quality factor