## 4 Optimization of Multi-Scenario Parameters Based on PSO  
### Parameter Optimization Method Based on PSO  
The minimum discharge capacity, SOCmin, is an important parameter associated with battery life. The energy storage charging priority preset value, SOCpro, and the minimum value, SOCmin, of the discharged energy of the ESS are two key parameters that affect the energy storage life and system operation economy. The determination of SOCpro and SOCmin is key to achieving the best operating results. The simulation of real-time operation strategy was implemented in Simulink. Figure 6 shows the flow chart of the PSO optimization strategy. The PSO randomly generates the initial particles of the SOCpro and SOCmin parameters and inputs the generated parameters into the Simulink simulation model. The Simulink model simulates according to the parameters, calculates performance indicators, and informs the PSO of the results. The particle swarm algorithm judges whether to terminate based on the termination conditions. When the conditions are not met, new particles are updated and continue to be assigned to the simulation model until the parameters with the best running indicators are obtained. First, we need to establish a mathematical model of the operating battery cost of the energy storage batteries. The commonly used loss cost calculation method is the depreciation method. In an actual PV and storage microgrid system, the depth and rate of charge and discharge are constantly changing. The accuracy of the depreciation method cannot satisfy the needs of practical applications. This article  
Figure 6: Particle swarm optimization (PSO) optimization strategy parameter flow chart. has carried out a quantitative calculation of the loss for a lead-carbon battery system. The loss cost can be accurately expressed by the initial investment of the system and the loss coefficient:  
\[C_{BS}=IC_{BS}\times DAM \tag{49}\]  
where \(C_{BS}\) is the loss cost of the ESS in a specified period, \(IC_{BS}\) is the total cost, and \(DAM\) is the loss coefficient. The throughput method is used to calculate the life loss coefficient \(DAM\). The throughput of the equivalent total current of the energy storage batteries during the entire life cycle [19] can be used to measure the life loss. The ESS life loss rate can be expressed by the following formula:  
\[DAM=\frac{A_{c}}{A_{total}} \tag{50}\]  
where \(A_{c}\) is the equivalent throughput generated in the time period to calculate and \(A_{total}\) is the equivalent throughput of the entire life cycle. The approximate calculation formula for the life-cycle throughput of a lead-acid battery is \(A_{total}=390Q\), where \(Q\) is the rated ampere-hour of the battery [20]. According to the reference data given by manufacturers, the life of lead-carbon batteries is more than six times longer than that of ordinary lead-acid batteries. It can be roughly obtained that the total throughput of the life cycle of the lead-carbon battery is \(A_{total}=2340Q\). The calculation of the equivalent throughput, \(A_{c}\), is related to the actual SOC throughput and the SOC level at runtime. Here, an equivalent conversion coefficient for SOC throughput is introduced. The specific expression is:  
\[A_{c}=\mu_{soc}A_{rc} \tag{51}\]  
where \(\mu_{soc}\) is the equivalent throughput conversion factor and \(A_{rc}\) is the throughput of the actual energy storage battery. The calculation formula of the actual throughput is (52). This method calculates both charge and discharge, so the throughput is half of the value:  
\[A_{rc}=Q\times\sum_{t=1}^{T}\abs{SOC(t+1)-SOC(t)} \tag{52}\]  
The determination of \(\mu_{soc}\) is related to the performance of the battery, and needs to be confirmed by referring to the relevant experimental data of the battery. Different SOC states correspond to different throughput conversion coefficients.