The proposed script operates in hourly time slots with energy units (Wh). The energy balance for each time slot can be formalized by Equation (9), where EPV is the energy produced by the photovoltaic installation for a given hour and TS is a time slot corresponding to 1 h. EPV=PPV·...