Calculation of photovoltaic battery discharge time