A lifetime optimization method of new energy storage module based on new artificial fish swarm algorithm

The demand for new energy will continue to expand as the environment changes and fossil energy decreases. However, the instability of new energy has slowed down the development of new energy. The joint use of new energy and energy storage modules effectively solves the shortcomings of new energy. The article proposed a lifetime optimization method of new energy storage module based on new artificial fish swarm algorithm. Firstly the life model based on the battery capacity ( C ) , charging current ( I c ) , and discharge current ( I d ) is built. Secondly, the deep learning method is used to improve the step length and speed change of artificial fish-school algorithm. Finally, the simulation platform detects the optimized parameters ( I c , I d , C ) . The simulation results show that optimized parameters can help extend the life of the energy storage module.


Introduction
Domestic and foreign scholars are beginning to research the development of new energy technologies. [1][2][3] The energy storage module can solve the problem of instability of the power supply system caused by new energy. At present, most energy storage modules only have single battery pack. Research the single-batterystorage module under new energy in Divya and Østergaard 4 and Rehman et al. 5 Because of new energy have instability. The single battery storage device will face the question of frequent changes function. If the energy storage device frequent change function. The battery storage device will reduce using time. The double battery storage module solves the disadvantages of frequent switching. However, it has a problem of transient voltage during the switching. Transient voltage will damage the load. The problems of single lithium battery module and dual lithium batteries module were solved by the three lithium batteries module.
At present, there are many energy storage system optimization studies. For example, Liu et al. 6 uses composite differential evolution algorithm to optimize energy storage system energy balance, Ma et al. 7 uses particle swarm optimization algorithm to obtain the optimal operation strategy of energy storage battery, Terlouw et al. 8 uses the improved particle swarm algorithm obtains the highest economic benefit of the energy storage system. However, these methods are insufficiently considered the service life of the energy storage system.
In traditional fish school algorithm, if the step length is too long, the convergence accuracy is not high, and the step length is too short, the convergence speed will be too slow. Researchers have improved the fish school algorithm because of considering the limitations in its use. Gao et al. 9 adopts the method of mutation factor to obtain adaptive step size to improve the global optimization ability of fish school algorithm. He et al. 10 analyzes the key optimization steps of the artificial fish school algorithm, and uses the adaptive step size method to improve the global optimization ability.
Taking into the problems of existing energy storage devices, the article proposes to construct a three-lithium battery energy storage module. Three lithium battery power distribution modes of lithium battery modules are also proposed. At the same time, the article uses deep learning for improving the speed and accuracy of algorithm to optimize the step size. Tests show that the service life of the three-lithium battery energy storage module is longer than that of the single lithium battery energy storage module, and the output is more stable than the dual lithium battery energy storage module. The control strategy of the three-lithium battery energy storage module can ensure stable output energy, and the optimization performance of the new fish school algorithm is better than the original fish school algorithm and the firefly algorithm.

System structure
The energy storage module in the new energy ship power supply system mainly adopts distributed layout, as shown in Figure 1. Figure 1 is the part of the new energy power supply system. There is mainly includes an energy storage module and load. The three-lithium battery energy storage module mainly includes three lithium batteries (Li-ion 1 , Li-ion 2 , and Li-ion 3 ), monitor device, and control device. The monitor includes VM, CM1, CM2, CM3. (VM stands for voltage monitor, CM represents current monitor, CM 1 measure the output current of Li-ion 2 , CM 2 measure the output  The control device judges whether Li-ion 2 and  Li-ion 3 can provide enough energy for the apparatus  through the current detection message, and controls  the switching of Li-ion 2 and Li-ion 3 . The excess energy of the solar system will be transmitted to the ship's grid via the electric net when the energy storage module is full of energy. Energy management of energy storage modules. The power distribution of Li-ion 1 and Li-ion 2 (Li-ion 3 ) is performed by the controller in the tri-lithium battery energy storage module.
In the formula: I 3 is the output current of the trilithium battery energy storage module, I 1 represent Liion 1 's output current, and I 2 represent Li-ion 2 's output current.
Li-ion 2 (Li-ion 3 ) designs different expressions of functions according to different capacity intervals of Li-ion 1 to control Li-ion 2 (Li-ion 3 ) to charge and discharge under different capacity level of Li-ion 1 . There is a correlation between the battery capacity and current of the lithium battery, and the capacity change of the lithium battery can be obtained by detecting the current.
The mathematical formula of Li-ion 2 (Li-ion 3 ) allocated power is: I refi is the reference current output by the equipment, and C max , C min , C high , and C low are the maximum battery capacity, minimum battery capacity, charge capacity limit, and discharge capacity limit of the Li-ion 1 . Battery capacity is required to be greater than the charge capacity limit and less than the maximum battery capacity during charge. Battery capacity is required to be greater than the minimum battery capacity and less than discharge capacity limit during discharge. The charging and discharging state of three-lithium battery energy storage module can be obtained by detecting the deviation of the bus voltage from the ideal voltage: In the formula: V df .0, energy storage module provides energy to ship's power net, when V df \0, energy storage module obtains energy from the ship's power net.
During the charging phase, the higher current of the new energy power supply system, the more heat will be generated. On the premise of ensuring its own safety and lithium battery performance, 11 the new energy power supply system charges the lithium battery at the fastest speed. The output voltage of the AC/DC converter should make the charging current close to the desired charging current value as much as possible. The value of charging current generally has the following limitations The capacity of the battery can be obtained by the mathematical formula: C in the formula is the battery capacity,C i is the initial battery capacity, T is the running time, m is the charge and discharge efficiency, I c is the charge and discharge current.
The current will exceed the ideal value when the load is too small. In order to ensure the safety of the load, the new energy power supply system will output an appropriate voltage from the AC/DC converter to suppress the discharge current. The discharge current should in the following range. Otherwise it will cause damage to the lithium battery in the new energy power supply system.
The discharge current of the new energy power supply system is determined by the battery capacity and discharge time, where T d is the discharge time.
Working principle The three-lithium battery energy storage module has four states to support the load without considering the charging and discharging of the energy storage module to the ship's power net. As shown in Table 1, State 1 is that Li-ion 2 alone provides energy to support the load. State 2 is that Li-ion 1 and Li-ion 2 together provide energy to support the load. State 3 is that Li-ion 3 alone provides energy to support the load. State 4 is that Li-ion 1 and Li-ion 3 are connected in parallel to provide energy to support the load.
I 1 is the branch current of Li-ion 1 , the branch current of Li-ion 3 is I 2 .
Switch from state 1 to state 2 as shown in Figure 2. The process of switching from state 3 to state 4 is similar to the process of switching from state 1 to state 2. Switch to Li-ion 2 and Li-ion 1 to support the load when Li-ion 1 can't provide enough energy.
Set the ideal current (I min ł I ref ł I max ). The detection current of CM3 is I 3 .
Switch from state 2 to state 3 as shown in Figure 3. Switch to Li-ion 3 to support the load alone when Liion 2 and Li-ion 1 can't provide enough energy in parallel. Figure 4 is a flowchart of the procedure to avoid overcharging of lithium batteries by new energy. The voltage of Li-ion 2 (Li-ion 3 ) is U 1 . The maximum terminal voltage of the Li-ion 2 (Li-ion3) is set to U MAX .
When U 1 ø U MAX , Solar power device stops charging for Li-ion 2 (Li-ion 3 ), and the control center transmits the excess energy to the electric net.    Figure 5 is a control strategy for the energy storage module to output steady current in state 2. It is a single loop control strategy. CM represents the current detection device. Calculate the output current of Li-ion 1 according to formulas (2) and (4), and give the control signal. Figure 6 is the control strategy of module output energy to net. VM1 is the voltage detection device in module charging terminal. According to formula (3), judge the output and input of the energy storage module to the net, V df give the net control a signal.

Establishment of module life model
Because Li-ion 1 is used frequently than Li-ion 2 (Liion 3 ) in the three-lithium battery energy storage module, Li-ion 1 is the battery with the shortest lifespan in the energy storage module. 12,13 The Arrhenius equation is a formula between temperature and decay rate.
In the formula, k, A, and DE respectively represents the chemical reaction rate, a constant, the activation energy of the destruction mechanism. K is the Boltzmann constant. [14][15][16] T stands for temperature Lithium battery capacity reduction C r is C max represents the maximum capacity of lithium batteries. C low represents the lower limit of the minimum capacity that the lithium battery needs to be replaced.
t 1 , t 2 is the charging and discharging time of lithium battery.
The heat loss of the battery is R 1 represents the internal resistance of the battery. Temperature can be calculated according to the thermoelectric model of the lithium battery.
T f ,T c ,T s , and C c represent the external ambient temperature, the internal temperature, and surface temperature of the battery, the heat capacity of the battery internal. R c and R u are the thermal resistance belong the inside and outside of the battery, the battery surface and the environment, respectively.
The capacity loss of a lithium battery in a cycle at a non-constant temperature is [17][18][19] :T z is the capacity loss in n cycles.
New artificial fish swarm algorithm The Fish School Algorithm (AFSA) simulates the cooperative behavior of fish schools to achieve the goal of finding the best target. The behavior of foraging is the fish to find direction of more food. The artificial fish X i walks randomly through formula. 20,21 The perceived distance of individual fish called visual. If it is found the better state X j , the fish forward to X j state. If it is not find a better state after repeated attempts, X i will randomly reach a new state X j . D is the distance between individuals of artificial fish.
Fish will naturally behave in groups during swimming. The number of buddies in the field of view of artificial fish X i is N f , when f c =N f \df i , the fitness of the central position is better than that of the X i position and is not too crowded, then X i moves to the central position X c , otherwise the foraging behavior is performed.
df i is the crowding factor of artificial fish X i . f c and f i are the fitness values of X c and X i .
The rear-end behavior of artificial fish is an optimal behavior of artificial fish in its visual field. Determine whether the X j state is better and less crowded. When it is not crowded, f j =N f \df i , X i moves toward the X j position. Otherwise, the foraging behavior is performed.
f j and f i are the fitness values of X j and X i . The crowding factor used to determine the maximum value d = 1=(aÃn max ), a 2 (0, 1.
In the formula, a is the extreme value close to the level, and n max is the maximum number of artificial fish expected to gather in this field. The maximum number of artificial fish in the field expected in the article is 50.
Record the variables corresponding to the best state on the bulletin board. 22 The bulletin board is constantly updated in the optimization process.
The position of artificial fish is updated by formulas (19) and (20) in the traditional artificial fish school algorithm. The step control amount of position update affects the efficiency of artificial fish optimization. This article updates the step control amount of artificial fish according to Adam Optimization Algorithm Root Mean Square prop and Gradient Descent with Momentum in deep learning.
Using the idea of momentum gradient descent method to update the step length of the artificial fish, each step length update is determined by the step length change of the previous step and the step length change of the current stage, as shown in formula (23): DL is the size of the step update determined by Dl tÀ1 and Dl t . DL tÀ1 is the step size update at the previous moment, and h is the step size update learning rate. b 1 is the weight of DL tÀ1 . 23 The fish school algorithm adopts the root-meansquare algorithm to ensure the balance of artificial fish in the optimization direction. 24 As shown in equation (24): S dxyz is the average distance of each individual to the optimal position.
The Adam optimization algorithm combines the momentum gradient descent method with the root mean square algorithm. 25 The step size update of the fish school algorithm in this paper adopts the Adam algorithm idea, such as formula (25): w is Adam's learning rate. Adam has absorbed the advantages of the root mean square algorithm. Ensure the accuracy of the optimization direction. At the same time, the advantages of the momentum gradient descent method are used to improve the efficiency and accuracy in the optimization process.

Function test
In order to ensure the fairness and reliability of the comparison between the proposed algorithm and other algorithms, the experimental result is the average value obtained by the algorithm independently running 20 times. The classic test function f 1 is used to compare the algorithm in this paper (the fish school algorithm, and the firefly algorithm 26 ). The test function is a nonlinear function. There are many local optimal values around the optimal value. f 1 is suitable for verifying the performance of the algorithm.
The new fish school algorithm set the same parameters as the original fish school algorithm, Population size N = 50, fish field visual is 2.5, Weights b 1 = 0.1, e = 10-14. The parameters of the Firefly algorithm are set as in literature. 27 From Figure 7 and Table 2, it is known that under the same basic parameters. The convergence speed of the fish school algorithm is better than the original fish school algorithm and the firefly algorithm. The new fish school algorithm has higher accuracy after 20 iterations. The fish school algorithm is two orders of magnitude more accurate than the original fish school algorithm. The firefly algorithm is faster initially, but the optimization convergence speed and accuracy are not good as the fish school algorithm. The step length of the original fish school algorithm is fixed, and the step length of the new fish school algorithm is determined by the previous step change, so the new fish school algorithm optimizes faster in the initial stage of optimization. As the optimization progresses, the step size of the new fish school algorithm becomes shorter and the optimization accuracy increases. The new fish school algorithm only increases the accuracy of the calculation results, and does not enhance the optimization effect in the later stage of optimization (after 100 iterations). Compared with the original fish school algorithm, the new fish school algorithm can appropriately reduce the number of iterations and reduce the use of the processor in practical applications.
It can be seen from the Table 3 that in the iteration of the new fish school algorithm, the accuracy of the values of X 1 and X 2 and the accuracy of the function value are significantly better than the original fish school algorithm and the firefly algorithm. It shows that the new fish school algorithm has significantly improved the convergence speed and accuracy.

Analysis of the complexity
To complete the basic artificial fish swarm algorithm, max gen iterations are required. N artificial fish perform basic operations.
In the swarming behavior, N fish need to swarm N times, judge N times according to the crowding factor, and move N times. In the rear-end collision behavior, N fish rear-end N times, and also judge N times and move N times according to the congestion factor. At most try num attempts are performed during the foraging operation. 28,29 So the theoretical time complexity of the original fish school algorithm is O(max gen (3 3 N 2 + N 3 try num + 6N)) ð27Þ The weight is obtained through deep learning. The step length of the artificial fish is improved. The number of iterations of the algorithm, the number of population size, and the number of foraging attempts do not change. By improving the step length of artificial fish, the new fish school algorithm only achieves the same complexity from the perspective of algorithm parameter improvement. In the new fish school algorithm,

Parametric analysis
The artificial fish in the new fish school algorithm adjusts the step size adaptively, which improves the efficiency of individual utilization. However, the complexity is slightly increased. Each fish has to calculate the step. The new fish school algorithm needs to calculate the root mean square of the distance from each artificial fish to the optimal artificial fish, and at the same time calculate the step change of the fish. The step length of each fish in the new fish school algorithm is dynamically generated from the root mean square of each fish to the optimal artificial fish distance and the change of the previous two steps. So there is no need to consider how to choose the step size parameter. The parameters are reduced, and the influence of parameter changes on the optimization results becomes sensitive. The new fish school algorithm adjusts the step size through the weight ratio of the step changes and the learning rate. The weight ratio of the step difference is obtained through deep learning, but when the amount of learning data is too small or the training time is too short, the weight will appear unreasonable and affect the step length. So we get data and train through a large number of experiments in a variety of functions.
As the number of iterations increases, artificial fish will continue to gather, the step size will continue to decrease, and the accuracy will continue to increase. Artificial fish will gather at one point, and subsequent iterative optimization has little effect.

Function optimization
The optimization process uses the new fish school algorithm. As shown in Figure 8. The first step is to randomly generate a group of fish. Each fish in the population represents a decision variable (½I c I d C). The second step is to bring the decision variables to the using time model and get the life decay rate. The third step is to determine whether the number of optimization cycles reaches the limit. If the limit of the number of cycles is not exceeded, a new population will be obtained through the algorithm. I c ,I d , C are the decision variables of the degradation rate of the lithium battery. I c ,I d , C is recorded in the bulletin board. T zmin is the minimum amount of battery capacity reduction under a certain cycle period.
In this paper, the objective function F 0 use NASFA to get the best variables.
The capacity degradation rate can be got by the equation (17). The value of n is set to 1000.
When F 0 reaches the ideal, the corresponding variable X i of F 0 is the best decision in the optimization model.

Simulation experiment environment
Simulation experiment environment: the code is written by MatlabR2014a, the PC parameters are 64-bit win-dows10 operating system, the processor: intel(R)Core(TIM)i7-6500U CPU@2.50GHz 2.60GHz, 8.00G memory. Figure 9 is the physical diagram of the energy storage module. The picture includes lithium batteries, detection devices, control centers, and solar panels.  C max , I max , and I min are respectively 32 Ah, 10 A, 2 A when taking values.

Experiment statistics
The battery parameters before optimization and the corresponding using-time decay rate are shown in Table 4.
The variable X i keeps changing with the optimization process.
The C, I c , and I d was determined by using the AFSA. At the same time, the capacity decay rate of the battery is determined through these optimized parameters. The optimized parameters of battery are shown in Table 5.
The simulation compares the service life of the energy storage device determined by the initial parameters with the service life of the energy storage device determined by the optimized parameters. Figure 10 is a comparison diagram of two methods.
The abscissa of Figure 10 is the time of using battery, and the ordinate is the capacity of the battery. The capacity of the battery decreases continuously with time.
The capacity attenuation determined by the NASFA optimization decision variable is smaller under one charge and discharge cycle. Therefore, the battery capacity determination variable obtained by the NASFA can optimize the battery life.
The experiment not only used the measured parameters to compare with the optimized parameters of the new fish school algorithm. It also compares the optimization of energy storage systems with different algorithms. The first phase of the experiment began in 2019. In order to speed up the efficiency of the experiment and save the cost of the experiment, the experiment uses a small lithium battery pack. Each phase of the experiment is divided into three groups, each of which has three columns. The first column uses battery parameters optimized by the original fish school algorithm, the second column uses battery parameters optimized by the firefly algorithm, and the third column uses battery parameters optimized by the new fish school algorithm. Record the battery life separately to test the practicality of the new fish school algorithm. It is planned to do the fourth phase of the experiment, and the fourth phase of the experiment is currently being done. The following Table 6 shows the average value of each phase of the experiment.
The cost of energy storage module mainly includes: Initial investment cost 30 : C es is the capacity of the energy storage system. k q is the capacity cost coefficient, Z d is the controller cost, JL sensor cost, and k p is the sensor cost coefficient.
Maintenance cost: k om is the coefficient of operation and maintenance cost per hour per unit capacity. 31 Replacement cost: a is the average annual decline in battery cost, k is the number of battery replacements, and n is the battery life.
The benefits mainly include: Reducing electricity bill income E 1 : using solar energy to reduce the cost of users to obtain electricity from the grid.
Reliability benefits E 2 (after the installation of the energy storage module, the benefits due to the stable power supply 32 ): Dr is the loss of 1 h of power outage per unit capacity, and Dt is the average annual power outage time after the energy storage module is constructed and the reduced power outage load is converted to the energy storage module.
Loss reduction benefit: The energy storage system reduces the loss benefit of grid peak shaving and valley filling.
NPV calculation i 0 is the benchmark rate of return. When NPV ø 0, the solution using energy storage modules meets the profitability level stated by the benchmark rate of return. 33,34 At present, only small-scale experiments have been conducted in the laboratory, and the main benefit is the reduction of electricity bills. The cost is mainly the initial investment cost and replacement cost.
Due to the lack of reliability gains in laboratory experiments, there are less than losses in Table 7.

Lithium battery pack comparison
Appsim semi-physical simulation platform is a new simulation application platform. 28 Appsim semiphysical simulation platform can help engineers connect Matlab-based simulation models with actual equipment to jointly carry out accurate and efficient simulations. Appsim semi-physical simulation platform is compatible with all versions of Matlab.
Due to the high cost of equipment installation and disassembly of the ship's power Electric system. Appsim semi-physical simulation platform is used to test the impact of life parameters on energy storage modules life.
The experiment platform of the lithium-ion battery energy storage module's life is shown in Figure 11.
The platform controls battery capacity, I c and I d of the energy storage module to verify that the parameters optimized by the NASFA are conducive to extending the using time of the tri-lithium battery energy storage module.
The terminal current of the lithium battery is shown in Figure 12. The abscissa is the battery usage time, and the ordinate is the terminal current of the lithium battery.
(a) shows the current change of the single lithium battery energy storage module. Due to the randomness and instability of new energy sources, the terminal current of the single lithium battery energy storage module changes greatly, the charging and discharging modes often change. Frequent charge-discharge switching is likely to generate heat in the battery, which poses a  Li-ion 2 (Li-ion 3 ) and Li-ion 1 cooperate to stabilize the terminal current of the energy storage module. Figure 13 is a comparison chart of the capacity loss of the lithium battery inside the module. Only one lithium battery is used in the single lithium battery energy storage module. There are two lithium batteries in the dual lithium battery energy storage module. The working states and the capacity loss are similar in the dual lithium battery energy storage module. There are three lithium batteries in the three lithium battery energy storage module. Among them, Li-ion 2 and Liion 3 work states and the capacity loss are similar. Liion 1 has an independent work state.
The lithium battery needs to be replaced when the capacity of reduced to 20%. The ordinate in (a) is the process of lithium battery capacity loss in single lithium battery energy storage module and dual lithium battery energy storage module. The ordinate in (b) is the capacity loss process of Li-ion 2 (Li-ion 3 ) and Li-ion 1 in the triple lithium battery energy storage module.
Through comparison, it is found that the service life of the lithium battery in the dual lithium battery energy storage module is greater than the service life of the lithium battery in the single lithium battery energy  storage module. The battery service life in the triple lithium battery energy storage module is similar to dual lithium battery energy storage module. However, the output current of the three-lithium battery energy storage module is more stable, so the three-lithium battery energy storage module is better than the double lithium battery energy storage module.

Conclusions
The article improves the step size of the fish school algorithm based on deep learning. Experiments and simulations show that the optimization speed and optimization efficiency of the new fish school algorithm have been improved. The article considers the life issue of lithium battery packs for new energy ships. The three-lithium battery energy storage module is proposed and a life model of the lithium battery module is established. At the same time, the lithium battery pack life model is optimized through the new fish school algorithm.
The proposed battery life optimization method can provide an optimized reference for the grid system energy storage capacity, energy storage power, and battery charging protection settings. 35 In addition, it can also carry out applied research on complex optimization problems in power system operation. At the same time, it can also be applied to the operation and maintenance of electric energy metering equipment to improve work efficiency.
The development of electric vehicles and unmanned ships also requires new fish school algorithms. The new fish school algorithm is used to optimize the life of the energy storage system, reduce the cost of electric vehicles, and promote the promotion of electric vehicles.
The simulate results of the simulation platform show that the terminal current of the single lithium battery energy storage module fluctuates greatly. The dual lithium battery energy storage module will have transition current when the lithium battery function is switched. The three-lithium battery energy storage module terminal current is more stable and not have transition current compared with the single-lithium battery simulate results. The three-lithium battery energy storage module is the better energy storage module.
Compare the simulation results after parameter optimization. The simulation results appears that the C, I c , I d obtained based on the NASFA are the decision parameters for determining the battery using time. The optimization results appeared that battery using time determined by the parameters obtained using the NASFA is better than the battery lifetime determined by the variables through measuring.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science