## 6 Results and Discussion
### Multiple Hour Analysis  
If the contingency lasts for more than one hour or happens more than one time within the typical day, the time-interval T of the robust optimization tool has to be set greater than one hour. The two situations described in Figures 7 and 8 has been tested: the first one  
Figure 11: Ending part of \(F2\) voltage profile with and without BESS when \(B_{cap}\) = 40 k\(\ell\) (\(e_{n}^{prio}=10\%\)). related to the normal operating conditions (\(T=24\) h of the typical day), and the second one associated to the repair time (\(T=5\) h) of the faulted line 1-2 and the network reconfigured by closing tie-line 4-15. In normal operating conditions, due to the excessive voltage drops in the early morning and in the evening hours, a massive exploitation of DR actions is required if no BESS is installed. The optimization correctly identifies the capacity reserved for each resource (corresponding to the maximum demand curtailment requested among the 24 h) and the hourly requests of demand modulation needed to solve the technical issue. As example, in Figure 12 are depicted the DR requests in the deterministic optimization (all DERs behave as expected) and in the robust optimization with an a priori risk of 1%. As expected, the last entails a higher amount of demand curtailment due to the uncertain behavior of DERs, i.e., the DSO must sign all the resources available for their maximum capacity offered in order to face this technical issue with a low residual risk. Looking deeply on the results, it has been noted that, also considering the maximum DR exploitation during the 21 st hour (the most loaded), the possible excessive voltage drop has not been completely answered (insufficient availability of flexibility), and the furthest two nodes may still suffer a voltage lower than the technical limit (slack variables activated with \(\hat{\gamma}_{22}^{min}=0.9583\) [p.u.] and \(\hat{\gamma}_{21}^{min}=0.9592\) [p.u]). The comparisons among deterministic and robust approaches, for different a priori risks, with and without BESS, are substantially similar to those obtained with the previous studies of a single hour: deterministic solutions are always better than corresponding robust ones (because they disregard uncertainties), the cost of flexibility decreases by increasing the residual (a priori) risk accepted, the exploitation of BESS allows limiting the recourse to DR actions and obtaining solutions at lower flexibility cost and with reduced a posteriori risk in respect to those without BESS. The optimal allocation of storage devices has been again identified in the peripheral secondary substations (nodes 22 and 21), so as to raise their available flexibility and reduce the overall amount of load curtailment (Figure 13). The anomalous load curtailment of the 24 th hour (no violation of minimum voltage exists before DSO active management) has been caused by the BESS operation and the presence of constraint (16) that imposes the same State of Charge at the beginning and at the end of the typical days. Indeed, the storage devices have been charged to their maximum capacity before 17 th to be totally discharged between 18 th and 23 rd (peak shaving service). By so doing, in the last hour of the day they must be recharged at their maximum power in order to achieve their original SoC, so creating a new contingency (an artificial growth of the demand that is limited with an additional DR request). Despite this extra demand curtailment, the global objective function stays below the solutions obtained without BESS, i.e., the solution is still optimal. This example stresses the importance of extending the time-interval \(T\) of the optimization for more than one hour, when the optimal exploitation of some resources depends on the chronological sequence of their states (like for storage devices) [10]. Obviously, this behavior can be avoided by assuming a different SoC\({}_{0}\): e.g., with 10% of \(E_{n}{}^{B}\) the need of recharging in the 24 th hour does not exist.