## 4 Tests and Results
### Results, Indicators, and Discussion  
The amount of power exchange at the utility grid interface is shown in Figure 7, before application of loss coefficients. In particular, the represented quantity is \(P_{g}^{in}(t)-P_{g}^{out}(t)\). It is noted that on the sunny day, the DC microgrid exports power between 08:00 and 14:00 due to high PV production, and export is observed also in the intervals 16:00-20:00 and 00:00-02:00, in order to take advantage of the lower price differences, even in the absence of renewable internal production. The behavior on the cloudy day is similar, except for the late afternoon, where power purchase from the utility is observed. On the rainy day, no power delivery is observed, and energy is withdrawn from the grid in the period 15:00-18:00 due to lower internal production. In any case, the power exchange level does not exceed 30 kW, although the maximum level is fixed at 50 kW. Figure 5: Forecasted EV exploitation patterns on the three different days. Figure 6: Unitary cost trends on the three different days. For the sake of comparison, in Figures 8 and 9 the behaviors of EV1 and EV2 are reported for the three considered days in terms of exchanged power before losses, assuming positive values for charge and negative for discharge (i.e., \(P_{i}^{c}(t)-P_{j}^{d}(t)\)), and of state of charge. In the considered conditions, all EVs should attain a SOC of 95% at the end of the day. From the figures it can be noted that the EVs perform early discharge in the first hours of sunny and cloudy days (reaching 5 kW) due to high initial SOC. Therefore, they take advantage of PV availability in short parking intervals to perform intense though not continuous charge. In fact, in the charge stage, they can reach the maximum rate of 10 kW in many intervals, although some alternating behavior is seen in order to efficiently exploit PV production. At the end of the afternoon, SOC is maximum, and a slight discharge is performed. On rainy days, the early discharge is not present and EVs perform only the necessary charge to cover their mobility needs. This is evident for EV2, which is not supposed to be driven on the rainy day, whose battery is kept almost unexploited in order to prevent wearing. Figure 8: Power exchange between the test microgrid and EV 1 and the related SOC on the three days. Figure 7: Power exchanged with the utility grid in the three days. Figure 10 represents the power balance at each time interval for the case of the sunny day. It can be noted that the high PV energy production is mainly delivered to the external grid during the peak price interval (08:00-14:00) and it is used to charge the EVs in the afternoon. During the night, the EVs inject some of their stored energy into the main grid, yielding a revenue. The energy storage system has negligible influence on the algorithm results, because it involves only cost terms (due to the degradation cost of the batteries), and the procedure does not select it, since it is not convenient at current costs. On the cloudy day, as can be derived from Figure 7, the lower PV production causes a lower injection in the main grid, while on the rainy day the PV production is fully used to charge the EVs. In order to compare the performances of the proposed algorithm with the reference non-linear approach, a set of techno-economic indices is defined and evaluated. In particular, with the aim of analyzing EV behavior, total daily revenue from EV discharge \(R_{j}^{d}\) and total daily cost for EV charge \(C_{j}^{c}\) are determined using the terms contained in the objective function in Equation (5), as follows:  
Figure 10: Microgrid power balance on the sunny day. Figure 9: Power exchange between the test microgrid and EV 2 and the related SOC on the three days. \[R_{j}^{d}=\sum_{t=1}^{N_{t}}r_{j}(t)\cdot P_{j}^{d}(t)\cdot\Delta T\quad\forall j, \tag{32}\]  
\[C_{j}^{c}=\sum_{t=1}^{N_{t}}c_{j}(t)\cdot P_{j}^{c}(t)\cdot\Delta T\quad\forall j. \tag{33}\]  
Two further indicators are defined.