# Sizing Hybrid Energy Storage Systems for Distributed Power Systems under Multi-Time Scales
## 3 System Optimization
### Constraints
#### 3.2.2 Inequality Constraints  
* Carbon Emission Constraint  
In order to strictly control carbon dioxide emissions and reduce greenhouse gas outputs, carbon emissions need to be lower than the maximum carbon emissions (CO\({}_{2\text{max}}\)):  
\[\text{CO}_{2}(P_{d})\ \leq\ \text{CO}_{2\text{max}} \tag{19}\]* Loss of Load Constraint The increase of system loss of load probability will reduce system security. Therefore, the LOLP should be restricted to its maximum acceptable range (\(LOLP_{\text{max}}\)): \[LOLP\leq LOLP_{\text{max}}\] (20)
* Battery State-of-Charge (SOC) Constraint In order to extend the lifespan of battery system, the SOC of the battery should be set as: \[SOC_{\text{min}}\leq SOC(t)\leq SOC_{\text{max}}\] (21)  
where [34]:  
\[SOC(t)=\left\{\begin{array}{ll}20\%&t=0\\ \min(SOC(t-1)+\frac{\eta_{b}\times\eta_{c}\times\eta_{c}\times\tau}{Q_{b}}, 90\%)&\text{Charging}\\ \max(SOC(t-1)-\frac{P_{M}\times\tau}{Q_{b}\times\tau\eta_{c}\times\tau},10\% )&\text{Discharging}\\ SOC(t-1)-SDR\times\tau&\text{Standby}\end{array}\right. \tag{22}\]  
In Equations (20) and (21), \(SOC_{\text{min}}\), \(SOC_{\text{max}}\), \(SOC(t)\), and \(SOC(t-1)\) are the minimum SOC, the maximum SOC, battery SOC at time \(t\), and battery SOC at at time \(t-1\), respectively. \(\eta_{b}\) and \(\eta_{c}\) represent the nominal cycle efficiency of the battery system and the nominal efficiency of the power conversion system. \(P_{bc}\) and \(P_{bd}\) are the charge power of the battery system measured in AC before the AC/DC conversion stage, and the discharge power of the battery system measured in the AC after the DC/AC conversion stage. \(\tau\) is the dimension of the time period \(t\), and SDR is the self-discharge of the storage system.  
* Renewable Generation Fluctuation Constraint The fluctuation characteristics of wind speed and solar irradiance can lead to renewable system output power fluctuation. This paper takes one minute as the simulation step size, and defines that in order to keep the renewable system output power fluctuation within the certain range in a time period (\(\Delta t\)), the renewable power fluctuation rate (\(\gamma_{1}\)) of the renewable system should be limited to: \[\gamma_{1}\leq\gamma_{\text{max}}\] (23) where: \[\gamma_{1}=\frac{\max|P_{PV}\left(t\right)+P_{W}(t)-P_{PV}(t+\Delta t)-P_{W}(t+ \Delta t)|}{P_{WR}+P_{PVR}}\] (24)  
In Equation (23), \(\gamma_{\text{max}}\) is the maximum renewable power fluctuation rate. \(P_{W}(t)\), \(P_{PV}(t)\), \(P_{W}(t+\Delta t)\), and \(P_{PV}(t+\Delta t)\) represent the outputs of the wind turbine and PV systems at the time of \(t\) and \(t+\Delta t\), respectively. \(P_{WR}\) and \(P_{PVR}\) are the rated power of the wind turbine and PV systems.  
* Power System Peak Shaving Constraint Similar to the wind speed and solar irradiance, power system loads also fluctuate. However, it is important to consider that a distributed power system normally contains a variety of loads, and the use of these loads can be affected by many reasons, rather than a single reason. Therefore, power system loads may not change frequently. In this situation, many papers select a longer time scale (at the hour level) to optimize the capacity of a battery storage system. At this point, the research focuses on limiting the system peak valley difference. Equation (24) is the constraint of power system peak shaving: \[\theta_{1}\leq\theta_{\text{max}}\] (25) where: \[\theta_{1}=\frac{P_{L\text{max}}\ -P_{L\text{min}}}{P_{L\text{aver}}}\] (26)In Equations (24) and (25), \(\theta_{\text{max}}\) is the maximum allowance of the power system peak and valley difference. Meanwhile, \(P_{\text{Lmax}}\), \(P_{\text{Lmin}}\), and \(P_{Laver}\) are the maximum loads, minimum loads, and average loads of a power system.