Power factor and harmonic distortion optimization in a photovoltaic generating power station