Capacity estimation and energy allocation model of new energy vehicle battery management system based on optimization algorithm
Published Online: Sep 26, 2025
Received: Jan 20, 2025
Accepted: Apr 20, 2025
DOI: https://doi.org/10.2478/amns-2025-1064
Keywords
© 2025 Lei Han, published by Sciendo
This work is licensed under the Creative Commons Attribution 4.0 International License.
New energy vehicles have significant advantages in terms of environmental protection, energy saving, green, low-carbon and other aspects, and have a broad prospect [1-2]. As the “heart” of new energy vehicles, the performance of power batteries is directly related to the mileage, acceleration performance, and service life of the whole vehicle, and the battery management system plays the role of “commander-in-chief” in the energy management of new energy vehicles by monitoring the battery status in real time, optimizing energy scheduling, and ensuring battery safety [3-6]. Therefore, during the development of new energy vehicles, the battery management system should be scientifically designed on the basis of demand, and a variety of cutting-edge technologies should be mixed to control the battery state of new energy vehicles to avoid the phenomena of over-temperature, over-discharge, over-charging, etc., so as to improve the stability of the operation of the battery of new energy vehicles and prolong the life of the battery [7-10].
Battery management system is a link between the power battery of new energy vehicles and the vehicle control system, which plays an indispensable role in ensuring the safety of vehicle operation and improving the efficiency of battery utilization [11-13]. Battery management system through the sensor real-time collection of battery voltage, current, temperature and other key parameters of information, assessment of battery state of charge (SOC), state of health (SOH), etc., for the vehicle control system to optimize the energy management strategy, rational deployment of battery energy to provide a basis for decision-making, which can help to improve the efficiency of the battery energy utilization, extend the range [14-17]. The battery management system always monitors the working status of the battery, and once overcharge/overdischarge, overtemperature/low temperature, short circuit, leakage and other abnormalities are found, it sends a warning to the vehicle control system in a timely manner and takes measures to prevent safety accidents such as disconnecting the relay and restricting charging/discharging, so as to ensure the safety of the power battery and the reliable operation of the vehicle [18-21].
This paper firstly introduces the working principle and model characteristics of the Random Forest algorithm, and on this basis introduces the mothballing algorithm to optimize the parameters of the Random Forest algorithm, and searches for the optimal parameters to construct an ideal estimation model. After that, taking advantage of the characteristics of the hybrid braking region of pure electric new energy vehicles, where both electric motors and machinery are involved in braking, and on the basis of the multi-objective optimization direction to meet the braking safety and maximize the energy recovery, the multi-objective optimization strategy based on particle swarms is proposed, so as to select the global optimal value for the estimation of the capacity of the battery management system and the allocation of the energy. Finally, the multi-objective particle swarm optimization of battery management system capacity estimation and energy allocation is evaluated in the application of new energy vehicles.
Random forest regression algorithm [22] is an intelligent algorithm for integrated learning on decision trees. Between this RF will grow a large number of decision trees which will act as classification or regression functions. Suppose the original sample St is as follows:
Where,
RF is built on top of CART in constructing each regression tree and the decision trees constructed in the training phase are uncorrelated. The bagging algorithm is used to select a number of samples
Eq.
Moths in the Moth Flame Algorithm [23] have their own characteristics of the parameters to be optimized, while the position of the moths is determined by the parameters to be optimized, and each moth has a suitable corresponding value. Moth population and flame population are two important elements to construct the MOF algorithm, where the moths can reach is the set that constitutes the solution of the required problem, in which the best position reached by the moths is the optimal solution of the required problem as well as the flame position. The main job of the moth is to continuously update the position while calculating the adaptation values to find the optimal solution. The main role of the flame is to save the best position and the optimal solution searched by the moth at the moment. During the iteration process, moths and flames are always guaranteed one-to-one correspondence, and each moth searches only in the vicinity of the flame next to it until the constraints of the algorithm itself are reached.
The MOF algorithm can be thought of as a triad for finding the global optimum, i.e:
where
In the MOF algorithm, let
The position of each moth after flight is entered into the fitness function corresponding to that moth, and the moth’s fitness value is updated by storing the new fitness value in the
Assume that the size of the storage flame
The MOF algorithm searches for an optimal solution in the vicinity of the marker and updates this marker after finding a better solution, finding the optimal solution in the algorithm through iteration. The process is subdivided into two parts: flame capture and abandonment process.
Flame capture process Since the moth individual
where
Flame relinquishment process The process of flame volume reduction is as follows:
where
In this paper, MOF is used to optimize its parameters to construct the MOF-RFR estimation model, compared with other optimization algorithms, MOF has the advantages of fewer parameters, simpler principles, and lower requirements of the operating environment. Its optimization of random forests can prevent overfitting while ensuring the accuracy of the operation, and the iterative process of the MOF algorithm is shown in Fig. 1.

MOF algorithm iterative process
For the random forest algorithm parameter optimization specific steps are as follows:
Initialize the information and establish the parameters such as the size of the moth population Solve for individual moth positions within the required range and establish the initial moth matrix; Update the number of flames according to the parameters defined in the previous two steps using Equation (15); Updating the fitness value of individual moths, combining and sorting the order of moths according to the size of the value, and at the same time, transferring the sorting information to the flame to update the flame information in real time; Update the position of the moths according to Equation (13); Update the adaptability value of individual moths again, compare the value with the flame using the update result, and select the result with the best adaptability to be assigned to the flame; Determine whether the end condition can be satisfied, if not, continue to follow step 3), and conversely output the result; Use the amount of trees and the number of nodes as the random forest input, construct the random forest regression algorithm with optimized parameters and output the final result.
In this paper, the cycle life recession data of 2-8 batteries are selected to verify the estimation effect of the optimized RFR algorithm (MOF-RFR) model proposed in this paper.
When using a data-driven approach to estimate the battery capacity value, the amount of data affects the estimation accuracy of the model, and when comparing the estimation effect of different methods, it is necessary to use the same training data to train and validate the model. In this section, the full-life data of battery No. 1 is used to train different models, and the full-life dataset of batteries No. 2-5 is used to validate the capacity estimation effect of different models. Meanwhile, in order to prove that the proposed MOF-RFR model combines the advantages of MOF and RFR models and results in higher accuracy of battery capacity estimation, the estimation results of MOF-RFR model are compared with those of MOF and RFR models, respectively.
The estimation results of different methods for battery No. 2 are shown in Fig. 2, (a) and (b) are the capacity estimation results and capacity estimation errors, respectively. From the figure, it can be seen that the capacity of the battery decreases continuously with the increase of the number of cycles, and the capacity estimation values of the battery from the three models are better close to the real capacity reference value, but the battery capacity estimation results of the MOF-RFR model are better than those of the MOF or RFR models. In addition, it can be seen that the relative errors of the capacity estimation of the three models are large. Among them, the average error of capacity estimation of MOF-RFR model is 0.33%, and the average errors of MOF model and RFR model from the reference value are 4.35% and 5.79%, respectively.

Different methods for the estimate of battery 2
The estimation results of different methods for battery No. 5 are shown in Fig. 3, (a) and (b) show the capacity estimation junction capacity estimation results and capacity estimation error, respectively. From the figure, it can be seen that the capacity estimation results of the three models are better. Among them, the relative error of capacity estimation of MOF-RFR model is less than 0.38%, and the average errors of MOF model, RFR model and reference value are at 3.90% and 2.81%, respectively. And the capacity estimation of MOF-RFR is better than that of MOF model and RFR model. The synthesis of Fig. 2 and Fig. 3 can show that the estimation effect of MOF-RFR on battery capacity is indeed better than MOF model and RFR model.

Different methods for the estimate of battery 5
There are some limitations in testing the estimation of the model by using only the cycle life decline data of two batteries, and in order to better validate the estimation of the model, the full-life cycle decline data of six batteries were used for validation. Figure 4 shows the capacity estimation errors of No. 2-8 batteries under different methods, and (a)~(c) represent MOF-RFR, MOF and RFR models, respectively. The results show that under the three algorithms, the capacity estimation results of No. 5 battery are the best, except for the capacity estimation results of No. 6 battery using MOF-RFR, which has a larger ME, the capacity estimation results of other batteries using MOF-RFR are the smallest, and they are obviously smaller than those of MOF and RFR models. The combined estimation results of the three models are as follows: MOF-RFR model > MOF model > RFR model, in which the MAE, ME, and RMSE of the capacity estimation results of the MOF-RFR model for batteries of sizes 2-5 are less than 1.445 mAh, 4.765 mAh, and 1.974 mAh, respectively. It can be seen that the estimation of the battery capacity values using the MOF-RFR model has a good effect.

The capacity estimation error of the different methods of cell 2 battery
Particle Swarm Optimization (PSO) algorithm [25] is a classical population intelligence algorithm. The research background of the algorithm is to mimic a small bird flock searching for food, they compare each particle, that is, each solution, to a small bird flying alone to capture food, when the bird searches for food during flight, it is equivalent to each particle activity in
The multi-objective optimization problem can be expressed as follows:
Set of functions to be optimized:
Constraints:
Decision vectors:
Objective vectors:
The optimization function will map the decision vector

Multi-objective optimization mapping relation
From the above particle swarm optimization theory content can be summarized particle swarm optimization algorithm contains the basic elements include:
One or more objective functions, the purpose of which is to find the value or quantity that maximizes or minimizes the objective function. A set of unknowns or variable One or more constraint functions (conditions) that the objective function has in order to limit the range of values of each variable.
The multi-objective particle swarm optimization algorithm solves the problem of how to select the global optimal value problem, in the iterative process of the algorithm, the non-inferior solution with the sparsest density of non-inferior solutions is selected as the global optimal value, so as to guide the multi-objective particle swarm to find out the set of non-inferior solutions with uniform distribution as far as possible. Firstly, the network is divided in the target adaptation space, the value of each hypercube adaptation is assigned according to the number of non-inferior solutions contained in the hypercube, the hypercube is selected according to the roulette wheel method, and the global optimal value is an arbitrary particle of the hypercube, and during the algorithmic iteration process, the non-inferior solutions are obtained in each generation and saved in the non-inferior solution set, and then the non-inferior solution set is updated generation by generation. The steps of the algorithm are as follows:
Step1: Initialize the particle swarm. Randomly initialize the particle swarm position information, calculate the target of each particle in the particle swarm, and initialize the velocity of each particle in the particle swarm
Step2: Establish non-inferior solution set (REP). Calculate to find the best point
Step3: Update the particle population
Select Divide the network from the target space and calculate the fitness of each hypercube as follows:
Where Calculate the velocity The velocity update formula is:
Where:
Update the particle swarm position
Step4: Update the REP.
Step5: Update the optimal solution
Step6: Terminate the judgment, if satisfied then terminate the program, otherwise go to Step3.
The following multi-objective particle swarm optimization algorithm is applied to the braking force allocation strategy. The braking region division is shown in Fig. 6. On the

Brake area division
This can be obtained by bringing
Bringing in the parameters calculates
Similarly the coordinate values of I-ZM (I-Ff, I-Fr) can be obtained i.e:
The coordinate values of ECE-ZM (ECE-Ff, ECE-Fr) viz:
When the braking intensity
The braking force
Where The objective function In the pure electric vehicle for regenerative energy dynamics, taking into account the 0-100km/h acceleration time (s) and the maximum speed of the premise of the standard, the braking force distribution must be close to the ideal braking force distribution curve and below the According to the coordinate system distance equation can be seen:
Determination of objective function When the pure electric vehicle performs economic braking, the 100 km hydrogen consumption (L) maximization factor is considered, so that the 100 km hydrogen consumption (L) allocation on the same braking intensity
To summarize:
The objective function of particle swarm optimization is:
Constraints:
In summary, the parameters of the multi-objective particle swarm optimization algorithm are determined and the particle swarm algorithm parameters are set as shown in Table 1 below.
The particle swarm algorithm parameter Settings
| Parameter | Iteration number( |
Population scale( |
Acceleration constant( |
|---|---|---|---|
| Set value | 200 | 100 | |
| Parameter | Inertia weight | Decision vector dimension( |
Maximum speed ( |
| Set value | 3 | 50 |
The model of the fuel cell vehicle is established, and the relevant parameters of the vehicle are shown in Table 2. And according to the actual situation of urban road driving (acceleration, deceleration, starting, idling) to choose the appropriate cycle conditions used to simulate the actual road, you can choose a variety of cycle conditions or a combination of them in ADVISOR2000. After entering the software, first select the FUEL-CELL-defaults-in model, which is a fuel cell vehicle. Then each parameter in Table 2 is entered into the whole vehicle input interface. Variables such as half-load mass, full-load mass, transmission efficiency, rated power, and rated torque can be entered directly in the input interface. Other variables such as vehicle, energy storage, motor, transmission, wheel/axle, accessory, fuel converter, and power train control need to be written in the corresponding m-files of each component and added to the work list after they are written.
The parameters of the car
| Parameter name | Numerical value |
|---|---|
| Half load/kg | 2000 |
| Full load/kg | 2350 |
| Windward area/m2 | 2.16 |
| Wind resistance coefficient/cd | 0.33 |
| Rolling radius/m | 0.308 |
| Rolling resistance coefficient | 0.0014 |
| Main speed ratio | 8.8 |
| Transmission efficiency | 0.95 |
| Minimum power/kW | 40 |
| Maximum power/kW | 75 |
| Rated power (maximum power)/kW | 45(90) |
| Rated torque (maximum torque)/(N·m) | 110(220) |
| Rated speed (maximum speed)/(r/min) | 4100(12500) |
The NEDC condition is composed of four urban cycles and one suburban cycle, which is close to the daily demand, so the NEDC condition is adopted. When the car parameters are set, click Continue in the lower right corner to enter the next simulation setup. The experimental results of the original mixing degree under the NEDC condition are shown in Fig. 7, and (a)~(d) represent the speed, ess-soc-hist, emissions, and overall ratio, respectively. It can be seen from the figure that the car’s charging state (ess- soc-hist) has been maintained near 0.8 without substantial changes, which indicates that the car is working normally at this time and the battery is in good condition. After organizing the performance indexes of the whole car in the figure, it is found that the 100km hydrogen consumption of the fuel cell hybrid car under the NEDC condition is 83.26L, the maximum speed is 125.01km/h, and the acceleration time from 0 to 100km/h is 1088ms. By writing the m-file of FUEL_CELL_defaults_in the whole vehicle input interface for Fuel Converter and Energy Storage modules again, the mixing degree is inputted into the model. The car model was simulated again under NEDC conditions.

Experimental results of the original mixing degree under NEDC condition
The experimental results of the new mixing degree under NEDC conditions are shown in Fig. 8. From the figure, it can be seen that the charge state (ess-soc-hist) of the car has been still maintained near 0.8 without substantial changes, which indicates that the new mixing degree makes the car work normally and the battery is in good condition, and does not reduce the battery life. Under NEDC conditions, the fuel cell hybrid car has a 100km hydrogen consumption of 80.94L, a top speed of 125.01km/h and an acceleration time of 1088ms from 0-100km/h.

Experimental results of the new mixing degree under NEDC condition
The results of the performance index comparison before and after optimization are shown in Table 3. The optimized mixing degree ensures the 0-100km/h acceleration time and the maximum speed remains unchanged while the 100km hydrogen consumption is reduced by 2.32 L. This shows that the scheme improves the economy of the car without affecting the dynamics of the car, which leads to the improvement of the performance of the whole car. From the above, it can be seen that the feasibility of the scheme is confirmed under NEDC working conditions.
Comparison of performance indexes before and after optimization
| Survey content | Categories | Parametric performance | Numerical value | ||
|---|---|---|---|---|---|
| Performance indicators for new mixtures | Power | 0-100km/h acceleration (ms) | 1088 | ||
| Maximum speed (km/h) | 125.01 | ||||
| Economy | 100 kilometers of hydrogen consumption (L) | 83.26 | |||
| Comparison of performance indexes before and after optimization | Categories | Parametric performance | Preoptimize | After optimization | Contrast |
| Power | 0-100km/h acceleration (ms) | 1088 | 1088 | — | |
| Maximum speed (km/h) | 125.01 | 125.01 | — | ||
| Economy | 100 kilometers of hydrogen consumption (L) | 83.26 | 80.94 | ↓ | |
Starting from the battery management of new energy vehicles, this paper proposes a battery management system capacity estimation model (MOF-RFR) after optimizing the random forest algorithm using the mothballing algorithm. Then it combines the multi-objective particle swarm optimization algorithm to design the energy allocation strategy for new energy vehicles, realizes the electromechanical composite braking optimization algorithm based on power and economy, and verifies its application effect in new energy vehicles. The research results show that:
The battery capacity estimation effect of MOF-RFR model is better than other models, and its average error of different battery capacity estimation is only within 1.7%, and the evaluation effect is closest to the real situation. The charge state of the car is stable (maintained at about 0.8), which indicates that the car is working normally and the battery is in good condition. At this time, under the NEDC condition, the 100km hydrogen consumption of the fuel cell hybrid car with the new mixing degree is 80.94L, which is 2.32L less than that of the original mixing degree, and its maximum speed (125.01km/h) and 0-100km/h acceleration time (1088ms) remain unchanged. This indicates that the MOF-RFR model improves the economy of the vehicle without affecting its dynamics and improves the overall performance of the new energy vehicle.
