## 2 Materials and Methods
### Battery Modeling  
BESS are increasingly being used in distribution systems. As a result, appropriate battery operation modeling is critical to delivering the desired ancillary services and supporting the ongoing expansion of renewable energy resources. BESS provides the greatest benefits when it charges during periods of high PV generation and low demand and discharges during periods of high demand. This is reflected by the voltage profile of the system on each bus. Hence, the optimal daily charge/discharge of BESS is determined by minimizing the following function, Equation (3), that uses the daily voltage signals to control each BESS operation, taking into consideration the operation assumptions and the BESS specifications, Equations (4)-(12):  
\[\textit{Minimize}\ \sum_{t=1}^{24}\Bigl{(}\left( \begin{matrix}P_{t}^{B, \textit{dich}}-P_{t}^{B,\textit{ch}}\end{matrix} \right)\times\left(\textit{ Voltage}_{signal}\right)\Bigr{)} \tag{3}\]  
\[\textit{Subject to} \tag{4}\]  
\[\sum\limits_{t=1}^{24}\left(\eta_{\textit{disch}}P_{t}^{B,\textit{dich}}-\eta_ {\textit{ch}}P_{t}^{B,\textit{ch}}\right)=0 \tag{5}\]  
\[0\leq P_{t}^{B,\textit{dich}}\leq S_{\textit{max}} \tag{6}\]  
\[0\leq P_{t}^{B,\textit{ch}}\leq S_{\textit{max}} \tag{7}\]  
\[0\leq P_{t}^{B,\textit{ch}}\leq\beta_{t}(PV_{t}) \tag{8}\]  
Figure 1: The framework of the voltage management strategy. \[SOC_{1}=\frac{\eta_{clh}P_{1}^{B,ch}}{M_{max}}-\frac{P_{1}^{B, dich}}{\eta_{disch}\ M_{max}}+SOC_{init},\quad For\ \ t=1 \tag{9}\] \[SOC_{t}=\frac{\eta_{clh}P_{1}^{B,ch}}{M_{max}}-\frac{P_{t}^{B, dich}}{\eta_{disch}\ M_{max}}+SOC_{t-1},\ \ \ \forall\ t>1\] (10) \[SOC_{max}\leq SOC_{t}\leq SOC_{min}\] (11) \[\alpha_{t}+\beta_{t}=1 \tag{12}\]  
The optimization cycle for LP is 24 h, and there are five decision variables to be optimized, namely \(P_{t}^{B,dich}\), \(P_{t}^{B,ch}\), \(SOC_{t}\), \(\alpha_{t}\), and \(\beta_{t}\). That is, 120 decision variables are generated in the optimization cycle. The \(P_{t}^{B,dich}\) and \(P_{t}^{B,ch}\) are real number variables representing the discharge and charge rates of BESS at \(t\) th hour. The \(\eta_{disch}\) and \(\eta_{ch}\) are the BESS discharging and charging efficiency, respectively. The sum of the discharging and charging efficiency is equal to the round-trip efficiency of the BESS technology. \(Volateg_{signal}\) is the daily voltage signal of the network at each load bus. \(PV_{t}\) is the available power from the PV system at time \(t\). \(M_{max}\) is the maximum energy capacity of BESS in kWh, while \(S_{max}\) is the maximum rated power of BESS in kW. \(M_{max}\) and \(S_{max}\) are obtained iteratively from the upper-level optimization, NNA. \(SOC_{1}\) is the state of charge of the 1 st hour of the day that depends on the initial state of charge of the BESS, \(SOC_{init}\). In this study, 10% is assumed as the initial state of charge. \(SOC_{t}\) is the BESS's state of charge for the next 23 h and is a real number variable. \(SOC_{max}\) and \(SOC_{min}\) are the prespecified maximum and minimum states of charge, respectively. \(\alpha_{t}\) is the discharging status of BESS at time \(t\), and \(\beta_{t}\) is the charging status of BESS at time \(t\). Both \(\alpha_{t}\) and \(\beta_{t}\) are either 1 if discharging/charging or 0 otherwise. In the optimization problem, there are four bounding constraints, one inequality constraint, and four equality constraints. From Equation (3), the goal is to minimize the amount of charging and discharging that is triggered by the daily network voltage signal. In other words, the goal is to maximize renewable energy exploitation while controlling the voltage levels. Equation (4) indicates that the battery is a daily refill, and the daily final state of charge is similar to the initial state of charge. The charging and discharging powers are limited to the rated kW capacity of the BESS technology and the available power from the PV systems, as shown in Equations (5)-(8).