*6.1. Green Algorithm*

This algorithm allows one to take advantage of the renewable resource in order to recharge the EVs. Its basic principle is illustrated in the flowchart of Figure 15 and it is structured in a manner that allows recharging only when energy comes from the photovoltaic system, otherwise the vehicles are not recharged. In this way, the recharging phase minimizes the impact on the distribution network. Let us therefore see a practical application of the "green" algorithm to the case in question. In the previous paragraphs, both the energy absorption of the car park under analysis and the photovoltaic production of the designed power plant were analyzed.

Figures 16 and 17 present a comparative analysis of both. As a reference month, January was chosen because it has the lowest amount of energy produced and thus represents the most critical case. The presence of a fleet of five vehicles was also assumed. A 25% charge was set for each vehicle. In Figure 18, the orange boxes indicate the load curve of the parking lot, while the green boxes indicate the power generated by the photovoltaic system. At a glance, even considering January's low producibility, photovoltaic production appears to effectively compensate for the parking energy demand, thus leaving a good margin of power for recharging the EVs.

**Figure 15.** Flowchart of the "green" algorithm.

**Figure 16.** Comparison of load curve of the car park and PV production distributions.

**Figure 17.** Comparison between the old load curve and the new one.

Figure 18 presents the load curve before and after the energy introduced by the PV plant has been used.

**Figure 18.** Net power production and power absorption distributions.

Due to the residual energy produced, it is possible to recharge the fleet of vehicles in approximately 5 h, as Figure 19 indicates. The red curve shows the power used to completely recharge the fleet composed of five vehicles. This power is not absorbed by the network, but is entirely produced on site.

**Figure 19.** Final energy absorption of the car park distribution.

The green curve represents instead the residual photovoltaic energy that is still usable. From the producibility analysis carried out in the other months, it is also shown that the addition of the new electric load still leaves a good margin of unused power, which can thus be transferred to the network, for example, through the net-metering.

Alternatively, the design of a suitable energy storage system can also be assumed. In January for example, photovoltaic production provided 75% of energy needs. Instead, if we consider the

most productive month, the estimated average daily reducibility would be about 0.77 MWh. If the energy needed to feed the parking lot and the EVs is subtracted, the portion of energy that can be exchanged with the network would be equal to 0.58 MWh. This amounts to nearly three times the energy actually needed.
