# Two-Stage Configuration of User-Side Hybrid Energy Storage Based on Fuzzy Optimization
## 2 Two-Stage Optimization Model of Hybrid Energy Storage on the User-Side
### Stage 2: Large Capacity Battery Configuration  
According to the IEC 600300-3-3 standard [25], under the two-part tariff system, the user's tariff is closely related to the peak load on the grid side during the CC. According formula (2), the grid side load is related to the PV output after stabilization. Therefore, the user's load after PV compensation is used as the underlying optimization parameter to input the battery optimization configuration model for optimization. The optimal allocation model of batteries in the life cycle is as follows.  
_Maximum total revenue:_  
\[Max:C_{invest2}=C_{inc}+C_{rec}-C_{invest}-C_{maintain} \tag{11}\]  
_Minimum number of charging and discharging cycles:_  
\[Min:N=\sum_{t=1}^{T}B_{cha}(t)+\sum_{t=1}^{T}B_{dis}(t) \tag{12}\]  
_Energy storage scheduling revenue can be divided into demand and cost savings:_  
\[C_{inc}=C_{need}+C_{strategy} \tag{13}\]  
\[C_{strategy}=\sum_{y=1}^{Y}\sum_{day=1}^{DAY}(\sum_{t=1}^{T}d(t)(P_{dis,day,y}(t )-P_{cha,day,y}(t))\Delta t)(\frac{1+i}{1+d})^{y} \tag{14}\]  
\[C_{need}=\sum_{y=1}^{Y}(\sum_{m=1}^{M}(\alpha*\delta P_{peak,m,y}))(\frac{1+ i}{1+d})^{y} \tag{15}\]  
_Energy storage recovery income:_  
\[C_{rec}=\beta C_{invest} \tag{16}\]  
_Investment cost of energy storage:_  
\[C_{invest}=c_{P}P_{max}+c_{E}E_{max} \tag{17}\]  
_Energy storage operation and maintenance cost:_  
\[C_{maintain}=\sum_{y=1}^{Y}(C_{m}P_{max})(\frac{1+i}{1+d})^{y} \tag{18}\]  
_Constraint condition:_  
\[s.t.\hskip 28.452756 ptC_{invest}\leq C_{investmax} \tag{19}\]  
\[load_{after}=load-output_{pv} \tag{20}\]  
\[load_{after}-P_{dis}+P_{cha}\leq(1-\delta)P_{peak,m,y} \tag{21}\]  
\[0\leq P_{dis}(t)\leq P_{max}B_{dis}(t) \tag{22}\]  
\[0\leq P_{cha}(t)\leq P_{max}B_{cha}(t) \tag{23}\]  
\[B_{dis}(t)+B_{cha}(t)\leq 1 \tag{24}\]\(B\) denotes the state of charge and discharge. \(B_{dis}=1\) if energy storage is in the discharge state, \(B_{dis}=0\) if energy storage is in the charge state, and \(B_{cha}\) is the same as \(B_{dis}\). Therefore, the sum of these two boolean variables can be used to calculate the total number of charging and discharging cycles.  
\[SOC_{min}<SOC_{battery}<SOC_{max} \tag{25}\] \[SOC_{battery,initial,m}=SOC_{battery,final,m}\] (26) \[SOC_{battery}(t)=SOC_{battery}(t-1)+\frac{[\eta^{cha}P_{cha}(t)- P_{dis}(t)/\eta^{dis}]\Delta t}{E_{max}} \tag{27}\]  
where \(C_{inc}\) represents the benefit of peak-valley arbitrage, \(C_{strategy}\), and demand savings \(C_{need}\), \(C_{rec}\) is the revenue of recycling energy storage; \(C_{invest}\) represents the energy storage investment; \(C_{maintain}\) represents the cost of energy storage operation and maintenance; \(P_{dis,day,y}\) denotes the discharge power of energy storage on the day-th day of the y-th year; and \(P_{cha,day,y}\) denotes energy storage charging power. \(\alpha\) represents electricity demand price, \(\delta\) denotes peak shaving rate, \(P_{peak,m,y}\) represents the peak value of the original load in the m-th month of the y-th year. \(i\) denotes inflation rate, and \(d\) denotes the discount rate. \(P_{max}\) denotes the rated battery power, and \(E_{max}\) represents the rated capacity of the battery. \(d(t)\) denotes the peak-valley time-of-use tariff at t-time. \(\eta\) denotes the charge-discharge coefficient. The \(SOC\) constraints of the batteries are consistent with the \(SOC\) constraints of the supercapacitors.