Calculation of photovoltaic energy storage battery demand