## 2 Profit-Maximizing Several Revenue Streams for a BESS
### The Set of Constraint  
Based on the multi terms objective function in (1) and the terms described in (2)-(7), a set of constrains are mathematically developed to consider the technical and the economical constraints of the system. * Hourly power of battery:  
This constrain is formulated to count for the charging and discharging modes of the battery. In the charging mode, the battery power is assumed to have a negative value, while in the discharging mode the battery power has a positive value. The net battery power is assumed to be the sum of the charging and discharging power such that the battery is only operating in one of these two modes. \[PB_{t}=\ P_{t}^{B+}\ +\ P_{t}^{B-} \tag{8}\]  
* Battery power at discharging mode:  
During the discharging mode the battery power is restricted based on (9). The integer variable \(\ u_{t}\), is employed to distinguish between the charging and discharging modes of the battery such that the value of this integer will be one for the discharge mode and zero for charging mode. :  
\[0\leq P^{B+}\leq\overline{PB}\cdot u_{t} \tag{9}\]  
* Battery power at charging mode:  
Akin to (9), the charging power is limited to the battery capacity during charging mode as in (10), the integer \(u_{t}\) has a zero value during the charging mode:  
\[-\overline{PB}\cdot(1-u_{t})\leq P^{B-}\leq 0 \tag{10}\]  
* Peak demand factor (PDF):  
This factor describes the share of this customer into the aggregate loading of the province during the five coincidental peaks as in (11). The PDF is the key variable that determines the GA charges during the following adjustment period. \[PDF=\ \frac{\sum_{q=1}\ P_{q}^{T}}{\sum_{q=1}\ \overline{\text{PD}_{PS}}}\,q\in\Omega_{5 PH} \tag{11}\]* The battery intertemporal constrain:  
This battery intertemporal constraint describes the relation between the battery power and energy from time to time as in (12) and (13). \[0 \leq E^{0}-\ P^{B+}\cdot\eta^{+}+\ P^{B-}\cdot\eta^{-}\leq\overline{EB} \tag{12}\] \[-\sum_{t\in N_{t}}P_{t}^{B+}\cdot\eta^{+}+\sum_{t\in N_{t}}P_{t}^{B -}\cdot\eta^{-}=0 \tag{13}\]  
* The life cycle limit:  
The actual battery cycle life is calculated based on the charging and discharging profile, and has been limited to be less than or equal to the battery manufacturer cycle life as in (14):  
\[\sum_{t=1}^{N_{t}}u_{t}\cdot(u_{t}-u_{t-1})\cdot\frac{P_{t}^{B+}}{\overline{ PB}}\ \leq\overline{NC} \tag{14}\]  
* Power balance constrain:  
The power balance for the individual large customer bus is formulated as in (15). \[P_{t}^{T}\ +\ PB_{t}\ =\ P_{t}^{D}-P_{t}^{DR} \tag{15}\]  
* The battery deployment during the considered set of peak hours:  
As the global adjustment is the biggest utility cost for large customers in Ontario, Equation (16) is formulated to enforce the battery discharging to cover the customer load during the set of considered peak hours (\(\Omega_{PH}\)). This set of peak hours are estimated based on the historical data to avoid the uncertainty of forecasting of the five coincident peaks of this year. The coefficient KD represents the percentage of the customer demand load which will be supplied by the battery during the peak hours:  
\[PB_{ph}\ \geq KD\cdot P_{ph}^{D},\ ph\in\Omega_{PH} \tag{16}\]  
* Limits to the battery capital cost:  
In constrain (17), the battery capital cost is limited to the annual budget available for battery purchasing. It is important to mention that the maximum budget depends on many factors. However, our application is very specifically tuned to eliminate the GAC, so the budget based on the historical data of the paid bills for a class-A customer. We can estimate the average budget that will make this investment economically feasible. In other words, this investment budget should be returned to the customer in the form of GAC savings within the planning horizon:  
\[AIC_{B}\leq\ \overline{IC_{B}}\ /\ N_{y} \tag{17}\]  
* C-rate (ratio between \(\overline{PB}\) and \(\overline{EB}\)):  
This constrain defines the limit of the battery power to energy ratio which is defined as C-rate.