Energy viability of photovoltaic systems