Control method for improving stable operation of fuel cell system based on ISSA-EKF
By improving the sparrow search algorithm and optimizing the extended Kalman filter algorithm, the sensor signal noise problem in the fuel cell system is solved, the accuracy and stability of the system state estimation are improved, the cost is reduced, and more efficient fuel cell control is achieved.
Patent Information
- Application Number
- CN202410777420.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-17
AI Technical Summary
Sensor measurement signals in fuel cell systems have interference noise and fluctuations, which lead to unstable control signals and affect the efficient operation of the system. In addition, high-precision sensors are costly, so measurement signals need to be optimized to reduce costs.
The improved sparrow search algorithm is used to optimize the extended Kalman filter algorithm, and the sparrow population is initialized through a control strategy that integrates SPM chaos mapping and dynamic mirror learning mechanisms. The dynamic inertial weight and triangle walk composite strategies update the discoverer position, and the Cauchy inverse cumulative distribution mutation update Follower and alerter positions to improve the Kalman filtering effect.
It improves the prediction and estimation accuracy of the fuel cell system sensor signal and the stability of the system state, enhances the tracking and convergence capabilities of the Kalman filter, reduces the impact of system noise, and improves the stability of the control signal.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_4
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fuel cell control, and in particular to a control method for improving the stable operation of a fuel cell system based on ISSA-EKF. Background Art
[0002] The proton exchange membrane fuel cell system is composed of a stack, an air supply system, a hydrogen supply system, a water and heat management system, and a control system. A fuel cell is a multi-input and multi-output nonlinear system. The signals in the system are often collected by sensors and uploaded to the controller. The sensors in the proton exchange membrane fuel cell system include a reaction gas flow sensor, a reaction gas pressure sensor, a cooling water inlet and outlet stack temperature sensor, a water tank level sensor, etc. The sensor measurement accuracy is closely related to the price. The higher the sensor accuracy, the higher the price, which increases the system cost. When ordinary sensors measure signals, due to defects such as friction and clearance in the mechanical transmission part of the sensor, signal hysteresis will occur, which will cause interference noise in the measurement signal and generate fluctuations. In addition, the control signals (air compressor control signal, water pump control signal, cooling fan control signal, hydrogen circulation pump control signal, etc.) obtained by the controller are also unstable, contain noise, and have ripples, which are not conducive to the efficient operation of the system. Therefore, it is particularly important to optimize the sensor measurement signal to obtain the best measurement signal while controlling the sensor cost. Summary of the invention
[0003] The purpose of the present invention is to solve the above-mentioned problems and to provide a control method based on ISSA-EKF to improve the stable operation of a fuel cell system.
[0004] To achieve the above object, the technical solution adopted by the present invention is:
[0005] According to one aspect of the present invention, a control method for improving the stable operation of a fuel cell system based on ISSA-EKF is provided, including using an improved sparrow search algorithm to optimize an extended Kalman filter algorithm to predict and estimate sensor signals of a proton exchange membrane fuel cell system; the improved sparrow search algorithm is improved as follows:
[0006] 1. Initialize the sparrow population using a control strategy that combines SPM chaotic mapping with dynamic mirror learning mechanism
[0007] Set the population size in the sparrow search algorithm to N, use random initialization to get the original population 0 with a population size of N, use SPM chaotic mapping to get a new population 1 with a population size of N, use dynamic mirror learning mechanism to get a new population 2 with a population size of N, and sort the sparrow population with a population size of 3N. Take the first N populations with better fitness to enrich the population diversity, speed up convergence, and avoid the generated population falling into the trap of small cycles.
[0008] The chaotic sequence is generated by SPM mapping and converted into a new population initial position. The function is as follows:
[0009] (5)
[0010] In the formula, mod(y1,y2) is the remainder function, r is a random number between (0,1), when (0,1), (0,1), the system is in a chaotic state. , When , the generated chaotic sequence has better ergodicity and randomness, and the range of chaotic orbit state is (0,1);
[0011] The new initial population after SPM chaos mapping is 1 for:
[0012] (6)
[0013] In the formula, is the lower bound of the population, is the upper bound of the population, is the chaotic sequence obtained by iterating t times;
[0014] Using dynamic mirror learning to obtain a new population of sparrows with a number of N The formula is as follows:
[0015] (7)
[0016] In the formula, and is the upper and lower limits of each dimension of the positions of all individuals in the population at the tth iteration, is the randomly generated individual position of a population of N, and is the dynamic mirror learning coefficient;
[0017] Through the random initialization of the original sparrow search algorithm, SPM chaotic mapping, and dynamic mirror learning, a sparrow population of 3N is obtained, and the fitness values are calculated and sorted respectively. The first N individuals with better fitness values are taken as the population size in the improved sparrow search algorithm, which increases the population diversity and accelerates the convergence.
[0018] 2. Dynamic inertia weight and triangle walk compound strategy update finder position formula
[0019] In the process of sparrows searching for food, the food is randomly located in the safe area or the dangerous area. When the food is found, if the food is in the safe area, the finder adopts the sparrow search algorithm with dynamic inertia weight, and introduces the inertia weight in the particle swarm algorithm. In the early stage of iteration, a larger inertia weight is conducive to the global exploration of the finder, while a smaller inertia weight in the later stage of iteration is conducive to the local search of the finder, improving the convergence speed and accuracy of the algorithm; if the food is in the dangerous area, the finder adopts the sparrow search algorithm with triangular walk, which does not need to approach the food directly, but walks around the food to increase the randomness of the sparrow; the improved finder position update formula is as follows:
[0020] (8)
[0021] (9)
[0022] (10)
[0023] In the formula, is the maximum value of inertia weight, which is 0.9. is the minimum value of inertia weight, which is 0.4. is the maximum number of iterations, It is defined as the distance between the current sparrow individual and the food, which is approximately equal to the distance between the global optimal individual position and the current sparrow individual position at the tth iteration. It is defined as the step length range of the current individual sparrow, and δ is the direction in which the individual sparrow walks;
[0024] 3. Cauchy inverse cumulative distribution mutation update follower and guard position formula
[0025] The Cauchy inverse cumulative distribution mutation is introduced into the follower update formula, the individual with the best current fitness is selected for mutation, and the better position is selected for the next iteration. The dynamic change of the individual position after mutation is characterized by weight, which increases the randomness of the optimal individual position of the sparrow population.
[0026] The improved follower position update formula is as follows:
[0027] (11)
[0028] In the formula, the weight (t) changes dynamically according to formula (9), is the d-th position of the i-th sparrow individual in the t-th generation before mutation, is the position of the individual with the best fitness in the t+1th generation, that is, the position of the individual closest to the food, is the optimal individual position after mutation, and the specific expression is as follows:
[0029] (12)
[0030] Compare the fitness values of the optimal individual positions before and after the mutation, and select the individual position with a larger fitness value to determine the updated optimal individual position. The implementation formula is as follows:
[0031] (13)
[0032] In formula (12), ICCDF( ,γ) is subject to C( ,γ), the inverse Cauchy cumulative distribution function is expressed as follows:
[0033] (14)
[0034] In the formula, is the inverse cumulative distribution function of the Cauchy distribution, is the location parameter that defines the peak position of the distribution, γ is the scale parameter of the half width at half the maximum value;
[0035] Similarly, the Cauchy inverse cumulative distribution is used to mutate the optimal individual position in the sentinel position update formula, and the individual fitness values before and after the mutation are compared. The individual position with a larger fitness value is selected to determine the optimal individual position for updating. The improved sentinel position update formula is as follows:
[0036] (15)
[0037] In the formula, is the global optimal individual position after mutation, and mutation is performed according to the Cauchy inverse cumulative distribution function of formula (14). The specific expression is as follows:
[0038] (16)
[0039] Compare the fitness values of the optimal individual positions before and after the mutation, and select the individual position with a larger fitness value to determine the updated optimal individual position. The implementation formula is as follows:
[0040] (17).
[0041] Furthermore, the steps of using the improved sparrow search optimized extended Kalman filter algorithm to predict and estimate the sensor signal of the proton exchange membrane fuel cell system are as follows:
[0042] The first step is to establish a discretized nonlinear system state space equation with air flow, air pressure, cooling water flow, cooling water temperature and hydrogen flow as variables based on the proton exchange membrane fuel cell system;
[0043] The second step is to set the initial values of the state variables and error covariance matrix of the Kalman filter;
[0044] The third step is to use the strategy of SPM chaos mapping and dynamic mirror learning mechanism to initialize the sparrow population; initialize the proportion of discoverers and followers;
[0045] The fourth step is to replace the elements in the error covariance matrix with the initial sparrow population position, and use the "mean square error" as the fitness function to calculate the fitness value of the sparrow;
[0046] Step 5: Use dynamic inertia weight and triangle walk composite strategy to update the discoverer position formula, and use Cauchy inverse cumulative distribution variation to update the follower and sentinel position formula;
[0047] Step 6: Calculate the best fitness and update the best individual position;
[0048] The seventh step is to determine whether the number of iterations has reached the maximum number of iterations. If so, the iteration is terminated, the current optimal solution is output, the covariance matrix Q and R are assigned, the Kalman gain is calculated, and the optimal state estimation value of the PEMFC system variables is updated and iterated. Otherwise, the iteration continues.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] In order to improve the filtering effect, the improved sparrow algorithm is used to optimize the Kalman gain. The improved sparrow algorithm uses a control strategy that integrates SPM chaotic mapping and dynamic mirror learning mechanism to initialize the sparrow population and the diversity of the population; the dynamic inertia weight and triangle walk composite strategy update the discoverer position formula; the Cauchy inverse cumulative distribution mutation updates the follower and guard position formula. The improved sparrow algorithm outputs the optimal solution of the covariance matrix when the system state variables are iteratively updated to improve the Kalman filtering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is the overall structure diagram of the proton exchange membrane fuel cell power generation system of the present invention;
[0052] Figure 2 It is a structural diagram of an extended Kalman filter algorithm based on improved sparrow algorithm optimization of the present invention;
[0053] Figure 3 is the extended Kalman filter flow chart of the present invention;
[0054] Figure 4 It is the ISSA-EKF implementation flow chart of the present invention. DETAILED DESCRIPTION
[0055] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.
[0056] like Figure 1 and Figure 2 As shown, the present invention provides a control method for improving the stable operation of a fuel cell system based on ISSA-EKF. The overall structure of the proton exchange membrane fuel cell power generation system is shown in FIG. Figure 1 As shown, it consists of a fuel cell stack, a gas supply system, a water thermal management system and a control system. The control system uses various types of sensors (flow, pressure, temperature, liquid level, etc.) to collect variables of each subsystem, make judgments through the controller, and control the corresponding actuators (air compressor, solenoid valve, humidifier, hydrogen circulation pump, cooling water pump, cooling fan, etc.).
[0057] The extended Kalman filter algorithm structure based on the improved sparrow algorithm optimization for fuel cell systems is as follows: Figure 2 As shown, the filter input represents the noisy measurement signal measured by the sensor in the fuel cell system, mainly including the flow, pressure, and temperature signals collected by the air path; the flow, pressure, and temperature signals collected by the hydrogen path; the flow, temperature, and liquid level signals collected by the cooling circuit; and the voltage, current, and temperature signals collected at the stack outlet. The core principle of the extended Kalman filter is "minimum mean square error". In the prediction step, the discrete fuel cell system model is used to predict the state at the next moment. In the update step, the difference between the predicted value and the actual measured value is calculated, the estimated value of the minimum mean square error is found, and the weighted average method is used to update the state estimate. Periodically repeating the prediction and update steps can continuously provide an estimate of the system state.
[0058] In the extended Kalman filter algorithm, the updated value of the system state variable is closely related to the Kalman gain. In each iteration process update, the value of the system noise and observation noise covariance matrix in each recursive iteration needs to be given by the outside world and cannot be updated through the iteration process. When the system noise covariance value is large, the system state update value depends on the estimated value; when the system noise covariance value is small, the system state update value depends on the measured value. The improved sparrow algorithm is used to correct the value of the covariance matrix in the iteration process. The sparrow search algorithm is improved as follows:
[0059] 1) A control strategy combining SPM chaotic mapping and dynamic mirror learning mechanism is used to initialize the sparrow population.
[0060] 2) Dynamic inertia weight and triangle walk compound strategy update the finder position formula.
[0061] 3) Cauchy inverse cumulative distribution mutation to update the follower and sentinel position formula.
[0062] The proposed control strategy is as follows:
[0063] The Extended Kalman Filter (EKF) is an extended form of the standard Kalman filter in the nonlinear case. It is a highly efficient recursive filter (autoregressive filter). It is suitable for strongly nonlinear fuel cell systems. The basic idea of EKF is to linearize the nonlinear system using Taylor series expansion, and then filter the signal using the Kalman filter framework. The recursive state algorithm is used to estimate the dynamic state space, and the state parameters are updated by the prior parameter estimation and the new observation value, which has high computational efficiency.
[0064] For the system states (air flow, air pressure, cooling water flow, cooling water temperature, hydrogen flow, etc.) represented by the actuators containing motors (air compressor, circulating water pump, cooling fan, hydrogen circulating pump, etc.) in the proton exchange membrane fuel cell system, the nonlinear system state space equation of the fuel cell after the system discretization is obtained as follows:
[0065] (1)
[0066] In the formula, x k represents the system state variable at time k; u k Indicates input; w k Represents the system process noise, indicating that the estimated state value has deviation; z k represents the system state observation value, v k represents the observation noise, which represents the deviation between the observed value and the true value. k , v k Obey Gaussian distribution, that is, w k ~N(0,Q),v k ~N(0,R). Q is the system process noise covariance, and R is the observation noise covariance. The parameters in the Q and R matrices are unknown quantities, and they need to be tuned to obtain the optimal values through the improved sparrow search algorithm, where the Q and R covariance matrices are defined as follows:
[0067] (2)
[0068] Linearization using Taylor expansion: Use Taylor expansion to estimate the system state at the last time Expanded to:
[0069] (3)
[0070] In the formula Represents the estimated value of the system state variable at the last moment, and A is the estimated value of the state variable at the last moment by the system nonlinear function f The Jacobian matrix W is composed of the partial derivatives of the system nonlinear function f with respect to the system process noise w.
[0071] The observation equation is linearized using Taylor expansion, z k The estimated value of the current system state Linearization at can be obtained:
[0072] (4)
[0073] In the formula, H is the estimated value of the state at the current moment by the nonlinear function h of the observation equation. The Jacobian matrix V is composed of the partial derivatives of the observation equation nonlinear function h with respect to the observation noise v at the current moment.
[0074] Get three values of state quantity: state prediction value, prior state estimation value ; The optimal estimate of the state, the posterior state estimate ; Status true value The principle of Kalman filtering is to use Kalman gain to correct the state prediction value to make it close to the true value. The first process of the derivation of Kalman filtering is divided into the prediction part and the state estimation covariance The second step is the update part, that is, the Kalman gain matrix and the derivation of other criteria.
[0075] Prediction part:
[0076] Status prediction
[0077] The prior state estimate is obtained from the state prediction equation (system state equation):
[0078] (5)
[0079] Define the prior state error ; Posterior state error e k ; Covariance matrix of true value and predicted value ; The covariance matrix P between the true value and the optimal estimate k The specific formula is as follows:
[0080] (6)
[0081] Prior state prediction covariance:
[0082] (7)
[0083] Determining the gain matrix is the most important part of EKF state estimation, and the gain matrix can be determined by determining the initial values of the covariance matrices P, Q, and R. R is the covariance of the measurement noise v(k). If the covariance matrix R increases, it means that the strong noise comes from the current measurement part, and it will weaken the filter gain, reduce the weight of the feedback, and slow down the transient characteristics of the system. Q is the covariance of the system noise w(k). The increase of Q means the strengthening of the system noise, or the increase of the uncertainty of the mathematical model. The filter gain K(k) will also increase, which increases the weighted effect of the measurement feedback and reduces the stability of the system, but also enhances the dynamic performance. For the covariance matrices Q and R, under the premise of assuming that the system noise w(k) and the measurement noise v(k) are unrelated, it can be determined that Q and R are both diagonal matrices. According to the above discussion, in order to maintain the stability of the system, the matrices Q and R should be guaranteed to be within a certain range.
[0084] The Kalman gain actually represents the ratio of the model prediction error to the measurement error in the state optimal estimation process. k = 0, that is, the prediction error is 0, and the state value of the system depends entirely on the prediction value ( ), when K k =1, that is, the measurement error is 0, and the state value of the system depends entirely on the measurement side value.
[0085] (8)
[0086] Correction update state value (posterior estimated state value):
[0087] (9)
[0088] Posterior update state covariance:
[0089] (10)
[0090] The extended Kalman filter flow chart is as follows Figure 3 shown.
[0091] If the process noise w(k) of the system is larger, its covariance matrix Q will also be larger, which will result in the algorithm's filtering accuracy being worse, but the convergence speed will be faster, which is more beneficial for observing the overall state change of the target system; if the process noise w(k) is smaller, then Q will also be smaller, the convergence speed will be slower, and signal tracking loss may occur, but the accuracy will be higher. The system process noise covariance matrix Q affects the algorithm's filtering performance and parameter estimation accuracy, increasing the uncertainty of the system; the measurement noise covariance matrix R will affect the filter's correction speed, and in severe cases will make the filtering process unstable or even divergent. Therefore, the improved sparrow search algorithm is used to correct Q and R during the iteration process to improve the Kalman filter algorithm's ability to track and converge signals.
[0092] The Sparrow Search Algorithm (SSA) is a new type of swarm intelligence optimization algorithm proposed in 2020, which is mainly inspired by the foraging behavior and anti-predation behavior of sparrows. The algorithm simulates the foraging process of a sparrow group, adopts a finder-follower model, and adds a reconnaissance and early warning mechanism. In SSA, the finder is responsible for finding food and providing foraging areas and directions for the entire population, while the followers rely on the finder to obtain food.
[0093] The sparrow search algorithm is an efficient, flexible, low-memory, easy-to-implement search algorithm suitable for large-scale search problems. The basic idea is to divide the search space into several subspaces, and then search each subspace until the target is found or the search space is empty. The sparrow search algorithm focuses on the local optimal solution, which to a certain extent overcomes the limitation of the PSO algorithm that it is easy to fall into the local optimal solution.
[0094] The sparrow group achieves global optimal foraging (optimal objective function) through searching and position adjustment. The sparrow group has three states that can be switched at any time: 1) Acting as a discoverer. The discoverer occupies a dominant position in the sparrow group, and generally accounts for 10%-20% of the group. It is responsible for finding food for the entire group and providing the direction of food and the area with food, leading the group to find food. 2) Acting as a follower. The follower will always monitor the discoverer. Once the discoverer finds food, the follower will immediately follow the discoverer to snatch the food. Follow the discoverer to forage. 3) Acting as a sentinel. The sentinel is responsible for monitoring the area around the foraging area. When a predator appears around the foraging area, the sentinel will immediately issue an early warning. If the early warning signal exceeds the warning value, the entire group will move to find the next foraging location under the leadership of the discoverer.
[0095] The sparrow search algorithm process is as follows:
[0096] Step 1: Randomly initialize the population, number of iterations, and the ratio of discoverers to followers. Randomly select 10% to 20% of the sparrows from the population as sentinels to guard and sound an alarm when necessary.
[0097] Step 2: Calculate the fitness value and sort it, select the individuals with better fitness, and determine the current optimal sparrow individual position and the best fitness value. The mean square error between the estimated value and the measured value of the detection signal is used as the fitness function, and the formula is as follows:
[0098] (1)
[0099] Step 3: Update the locations of discoverers, joiners, and sentinels.
[0100] Step 4: Calculate the fitness value and update the position of the sparrow.
[0101] Step 5: Check whether the stopping condition is met (such as reaching the maximum number of iterations or reaching the preset target value). If so, exit and output the result; otherwise, repeat steps 2 to 4.
[0102] The formula for updating the discoverer's position is as follows:
[0103] (2)
[0104] Where t is the current iteration number, is the position of the i-th sparrow in the t-th generation in the d-th dimension, α is a random number between (0,1), is the maximum number of iterations, R A Alarm value (0,1), ST is the safety threshold (0.5,1), L is an i×d matrix whose elements are all 1, and q is a random number that follows a normal distribution. A < ST means that the foraging environment is safe and the discoverer can search extensively, guiding the population to obtain higher fitness; when R A ≥ ST indicates that a predator may appear and you need to move to a safe area immediately.
[0105] The follower position update formula is as follows:
[0106] (3)
[0107] In the formula, is the position of the individual with the worst fitness in the tth generation, is the position of the individual with the best fitness in the t+1 generation, A is a 1×d matrix, each element in the matrix is randomly preset to 1 or -1, and . The population size is n, when When , it means that the i-th joiner needs to fly to other areas to find food because of its low fitness value; when When Foraging nearby.
[0108] The formula for updating the position of the sentinel is as follows:
[0109] (4)
[0110] In the formula, is the global optimal position in the tth generation, β is the control step size that follows a normal distribution with mean 0 and variance 1, (-1,1), ε is a constant to avoid the denominator being 0, generally taken as 10E-8, is the fitness value of the current sparrow individual, is the fitness value of the current global optimal sparrow individual, is the fitness value of the current worst sparrow individual. When the individual is at the periphery of the population, it adopts anti-predator behavior to change its position to improve its fitness. When , individuals are in the center of the population, close to nearby companions and away from dangerous areas.
[0111] The sparrow search algorithm has defects such as low population diversity, weak local development ability, easy to fall into local optimality, and insufficient convergence accuracy during the optimization process. In order to improve the global exploration ability and convergence accuracy of the sparrow search algorithm, the specific improvement methods are as follows:
[0112] 1) A control strategy combining SPM chaotic mapping and dynamic mirror learning mechanism is used to initialize the sparrow population.
[0113] 2) Dynamic inertia weight and triangle walk compound strategy update the finder position formula.
[0114] 3) Cauchy inverse cumulative distribution mutation to update the follower and sentinel position formula.
[0115] The control strategy combining SPM chaotic mapping and dynamic mirror learning mechanism is used to initialize the sparrow population:
[0116] In order to enhance the diversity of the sparrow population, the population size in the sparrow search algorithm is set to N, random initialization is used to obtain the original population 0 with a population size of N, SPM chaotic mapping is used to obtain a new population 1 with a population size of N, and a dynamic mirror learning mechanism is used to obtain a new population 2 with a population size of N. The sparrow population with a population size of 3N is sorted, and the first N populations with better fitness are taken to enrich the population diversity, accelerate convergence, and avoid the generated population falling into the trap of small cycles.
[0117] In the field of optimization, chaotic mapping has good randomness and ergodicity. Its mapping of population members helps to improve the global optimization ability of the algorithm and thus improve the performance of the algorithm. Compared with the common Logistic mapping, Tent mapping and other local ergodicity, SPM chaotic mapping is a segmented mapping that generates chaotic sequences in a mapping manner and converts them into new population initial positions. Its function is as follows:
[0118] (5)
[0119] In the formula, mod(y1,y2) is the remainder function, r is a random number between (0,1), when (0,1), (0,1), the system is in a chaotic state. , When , the generated chaotic sequence has better ergodicity and randomness, and the range of the chaotic orbit state is (0,1).
[0120] The new initial population after SPM chaos mapping is 1 for:
[0121] (6)
[0122] In the formula, is the lower bound of the population, is the upper bound of the population, is the chaotic sequence obtained after t iterations.
[0123] The main idea of dynamic mirror learning is to use the current coordinates as a reference to generate a reverse position through the principle of convex lens imaging to expand the search range. This can not only jump out of the current position, but also expand the search range and improve the diversity of the population. Using dynamic mirror learning to obtain a new population of sparrows with a number of N 2 The formula is as follows:
[0124] (7)
[0125] In the formula, and is the upper and lower limits of each dimension of the positions of all individuals in the population at the tth iteration, is the randomly generated individual position of a population of N, and is the dynamic mirror learning coefficient.
[0126] Through random initialization of the original sparrow search algorithm, SPM chaotic mapping, and dynamic mirror learning, a sparrow population of 3N is obtained. The fitness values are calculated and sorted respectively, and the first N individuals with better fitness values are taken as the population size in the improved sparrow search algorithm, which increases the population diversity and accelerates convergence.
[0127] Dynamic inertia weight and triangle walk composite strategy update finder position formula:
[0128] In the process of sparrows searching for food, sparrows gradually approach the food. The location of the food is random, which may be in the safe area or in the dangerous area. Therefore, after finding the food, if the food is in the safe area, the finder adopts the sparrow search algorithm with dynamic inertia weight. Introducing the inertia weight in the particle swarm algorithm, in the early stage of iteration, a larger inertia weight is conducive to the finder's global exploration, while a smaller inertia weight in the later stage of iteration is conducive to the finder's local search, improving the convergence speed and accuracy of the algorithm. If the food is in the dangerous area, the finder adopts the sparrow search algorithm using triangular wandering, which does not need to approach the food directly, but wanders around the food to increase the randomness of the sparrow. The improved finder position update formula is as follows:
[0129] (8)
[0130] (9)
[0131] (10)
[0132] In the formula, is the maximum value of inertia weight, which is 0.9. is the minimum value of inertia weight, which is 0.4. is the maximum number of iterations. It is defined as the distance between the current sparrow individual and the food, which is approximately equal to the distance between the global optimal individual position and the current sparrow individual position at the tth iteration. It is defined as the range of the current individual sparrow’s walking steps. δ is the direction in which the individual sparrow walks.
[0133] The Cauchy inverse cumulative distribution mutation updates the follower and sentinel position formula:
[0134] During the foraging process, followers often forage around the best finder, and food competition may occur during the process, making them the finder themselves. In the late iteration of the sparrow search algorithm, the sparrow population will quickly gather near the optimal solution, resulting in serious population convergence and stagnation of the algorithm. In order to avoid the algorithm falling into the local optimum, the Cauchy inverse cumulative distribution mutation is introduced into the follower update formula, and the individual with the best current fitness is selected for mutation, and the better position is selected for the next iteration. After the mutation, the individual position uses weights to represent the dynamic change, which increases the randomness of the optimal individual position of the sparrow population.
[0135] The improved follower position update formula is as follows:
[0136] (11)
[0137] In the formula, the weight (t) changes dynamically according to formula (9), is the d-th position of the i-th sparrow individual in the t-th generation before mutation, is the position of the individual with the best fitness in the t+1th generation, that is, the position of the individual closest to the food. is the optimal individual position after mutation, and the specific expression is as follows:
[0138] (12)
[0139] Compare the fitness values of the optimal individual positions before and after the mutation, and select the individual position with a larger fitness value to determine the updated optimal individual position. The implementation formula is as follows:
[0140] (13)
[0141] In formula (12), ICCDF( ,γ) is subject to C( ,γ), the inverse Cauchy cumulative distribution function is expressed as follows:
[0142] (14)
[0143] In the formula, is the inverse cumulative distribution function of the Cauchy distribution, The location parameter that defines the peak position of the distribution, γ is the scale parameter of the half width at half maximum.
[0144] Cauchy inverse cumulative distribution mutation update vigilant position formula
[0145] Similarly, the Cauchy inverse cumulative distribution is used to mutate the optimal individual position in the sentinel position update formula, and the individual fitness values before and after the mutation are compared. The individual position with a larger fitness value is selected to determine the optimal individual position for updating. The improved sentinel position update formula is as follows:
[0146] (15)
[0147] In the formula, is the global optimal individual position after mutation, and mutation is performed according to the Cauchy inverse cumulative distribution function of formula (14). The specific expression is as follows:
[0148] (16)
[0149] Compare the fitness values of the optimal individual positions before and after the mutation, and select the individual position with a larger fitness value to determine the updated optimal individual position. The implementation formula is as follows:
[0150] (17)
[0151] The flowchart of using the improved sparrow search algorithm-Extended Kalman Filtering (ISSA-EKF) to predict and estimate the sensor signal of the proton exchange membrane fuel cell system is as follows: Figure 4 shown.
[0152] In the first step, a discretized nonlinear system state space equation is established based on the proton exchange membrane fuel cell system with air flow, air pressure, cooling water flow, cooling water temperature and hydrogen flow as variables.
[0153] The second step is to set the initial values of the Kalman filter's state variables and error covariance matrix.
[0154] The third step is to initialize the sparrow population by adopting the strategy of integrating SPM chaotic mapping and dynamic mirror learning mechanism; and to initialize the ratio of discoverers to followers.
[0155] The fourth step is to replace the elements in the error covariance matrix with the initial sparrow population positions, use the “mean square error” as the fitness function, and calculate the fitness value of the sparrows.
[0156] The fifth step is to use the dynamic inertia weight and triangle walk composite strategy to update the discoverer position formula, and use the Cauchy inverse cumulative distribution variation to update the follower and sentinel position formula.
[0157] Step 6: Calculate the optimal fitness and update the best individual position.
[0158] The seventh step is to determine whether the number of iterations has reached the maximum number of iterations. If so, the iteration is terminated, the current optimal solution is output, the covariance matrix Q and R are assigned, the Kalman gain is calculated, and the optimal state estimation value of the PEMFC system variables is updated and iterated. Otherwise, the iteration continues.
[0159] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0160] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A control method for improving the stable operation of a fuel cell system based on ISSA-EKF, characterized in that: The invention includes using an improved sparrow search algorithm to optimize an extended Kalman filter algorithm to predict and estimate sensor signals of a proton exchange membrane fuel cell system; the improved sparrow search algorithm is improved as follows:
1. Initialize the sparrow population using a control strategy that combines SPM chaotic mapping with dynamic mirror learning mechanism Set the population size in the sparrow search algorithm to N, use random initialization to get the original population 0 with a population size of N, use SPM chaotic mapping to get a new population 1 with a population size of N, use dynamic mirror learning mechanism to get a new population 2 with a population size of N, and sort the sparrow population with a population size of 3N. Take the first N populations with better fitness to enrich the population diversity, speed up convergence, and avoid the generated population falling into the trap of small cycles. The chaotic sequence is generated by SPM mapping and converted into a new population initial position. The function is as follows: (5) In the formula, mod(y1,y2) is the remainder function, r is a random number between (0,1), when (0,1), (0,1), the system is in a chaotic state. , When , the generated chaotic sequence has better ergodicity and randomness, and the range of chaotic orbit state is (0,1); The new initial population after SPM chaos mapping is 1 for: (6) In the formula, is the lower bound of the population, is the upper bound of the population, is the chaotic sequence obtained by iterating t times; Using dynamic mirror learning to obtain a new population of sparrows with a number of N The formula is as follows: (7) In the formula, and is the upper and lower limits of each dimension of the positions of all individuals in the population at the tth iteration, is the randomly generated individual position of a population of N, and is the dynamic mirror learning coefficient; Through the random initialization of the original sparrow search algorithm, SPM chaotic mapping, and dynamic mirror learning, a sparrow population of 3N is obtained, and the fitness values are calculated and sorted respectively. The first N individuals with better fitness values are taken as the population size in the improved sparrow search algorithm, which increases the population diversity and accelerates the convergence.
2. Dynamic inertia weight and triangle walk compound strategy update finder position formula In the process of sparrows searching for food, the food is randomly located in the safe area or the dangerous area. When the food is found, if the food is in the safe area, the finder adopts the sparrow search algorithm with dynamic inertia weight, and introduces the inertia weight in the particle swarm algorithm. In the early stage of iteration, a larger inertia weight is conducive to the global exploration of the finder, while a smaller inertia weight in the later stage of iteration is conducive to the local search of the finder, improving the convergence speed and accuracy of the algorithm; if the food is in the dangerous area, the finder adopts the sparrow search algorithm with triangular walk, which does not need to approach the food directly, but walks around the food to increase the randomness of the sparrow; The improved discoverer position update formula is as follows: (8) (9) (10) In the formula, is the maximum value of inertia weight, which is 0.
9. is the minimum value of inertia weight, which is 0.
4. is the maximum number of iterations, It is defined as the distance between the current sparrow individual and the food, which is approximately equal to the distance between the global optimal individual position and the current sparrow individual position at the tth iteration. It is defined as the step length range of the current individual sparrow, and δ is the direction in which the individual sparrow walks; 3. Cauchy inverse cumulative distribution mutation update follower and guard position formula The Cauchy inverse cumulative distribution mutation is introduced into the follower update formula, the individual with the best current fitness is selected for mutation, and the better position is selected for the next iteration. The dynamic change of the individual position after mutation is characterized by weight, which increases the randomness of the optimal individual position of the sparrow population. The improved follower position update formula is as follows: (11) In the formula, the weight (t) changes dynamically according to formula (9), is the d-th position of the i-th sparrow individual in the t-th generation before mutation, is the position of the individual with the best fitness in the t+1th generation, that is, the position of the individual closest to the food, is the optimal individual position after mutation, and the specific expression is as follows: (12) Compare the fitness values of the optimal individual positions before and after the mutation, and select the individual position with a larger fitness value to determine the updated optimal individual position. The implementation formula is as follows: (13) In formula (12), ICCDF( ,γ) is subject to C( ,γ), the inverse Cauchy cumulative distribution function is expressed as follows: (14) In the formula, is the inverse cumulative distribution function of the Cauchy distribution, is the location parameter that defines the peak position of the distribution, γ is the scale parameter of the half width at half the maximum value; Similarly, the Cauchy inverse cumulative distribution is used to mutate the optimal individual position in the sentinel position update formula, and the individual fitness values before and after the mutation are compared. The individual position with a larger fitness value is selected to determine the optimal individual position for updating. The improved sentinel position update formula is as follows: (15) In the formula, is the global optimal individual position after mutation, and mutation is performed according to the Cauchy inverse cumulative distribution function of formula (14). The specific expression is as follows: (16) Compare the fitness values of the optimal individual positions before and after the mutation, and select the individual position with a larger fitness value to determine the updated optimal individual position. The implementation formula is as follows: (17)。 2. The control method for improving the stable operation of a fuel cell system based on ISSA-EKF according to claim 1, characterized in that: The steps of using the improved sparrow search optimized extended Kalman filter algorithm to predict and estimate the sensor signal of the proton exchange membrane fuel cell system are as follows: The first step is to establish a discretized nonlinear system state space equation with air flow, air pressure, cooling water flow, cooling water temperature and hydrogen flow as variables based on the proton exchange membrane fuel cell system; The second step is to set the initial values of the state variables and error covariance matrix of the Kalman filter; The third step is to use the strategy of SPM chaos mapping and dynamic mirror learning mechanism to initialize the sparrow population; initialize the proportion of discoverers and followers; The fourth step is to replace the elements in the error covariance matrix with the initial sparrow population position, and use the "mean square error" as the fitness function to calculate the fitness value of the sparrow; Step 5: Use dynamic inertia weight and triangle walk composite strategy to update the discoverer position formula, and use Cauchy inverse cumulative distribution variation to update the follower and sentinel position formula; Step 6: Calculate the best fitness and update the best individual position; The seventh step is to determine whether the number of iterations has reached the maximum number of iterations. If so, the iteration is terminated, the current optimal solution is output and the covariance matrices Q and R are assigned, the Kalman gain is calculated, and the optimal state estimation value of the PEMFC system variables is updated and iterated. Otherwise, the iteration continues.
Citation Information
Cited By
State estimation method, device and equipment for energy storage battery and medium
CN120468679A
A method, apparatus, device, and medium for state estimation of energy storage batteries.
CN120468679B
Fuel cell cathode supply cooperation and fault-tolerant control method, medium and equipment
CN121172187A
