Calculation of the size of a battery to store solar energy