Anion exchange membrane water electrolysis hydrogen production control method and system based on data-driven model predictive control
By using a data-driven model predictive control method, a non-mechanistic model is constructed using BP neural network and LSTM algorithm, and the control quantity is optimized by combining NSGA-II algorithm. This solves the problems of high model construction difficulty and low control accuracy in traditional methods, and achieves efficient control and improved stability of AEM water electrolysis hydrogen production system.
Patent Information
- Application Number
- CN202610138659.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-31
- Publication Date
- 2026-04-14
AI Technical Summary
Due to the nonlinear, strongly coupled, and multivariable characteristics of existing anion exchange membrane electrolysis water production systems, traditional model predictive control methods struggle to construct accurate models, resulting in low control accuracy, high computational burden, and poor system stability.
A data-driven model predictive control method is adopted, which constructs a non-mechanistic model of the system through BP neural network and LSTM algorithm, and optimizes the control quantity by combining NSGA-II algorithm to achieve effective control of AEM water electrolysis hydrogen production system.
The controller's control accuracy and computational efficiency have been improved, enabling effective prediction and control of hydrogen production, energy consumption, and electrolysis efficiency. It adapts to dynamic changes in the system and enhances the system's stability and self-adaptability.
Smart Images

Figure CN121853060A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of anion exchange membrane electrolysis for hydrogen production technology, and in particular to a control method and system for anion exchange membrane electrolysis for hydrogen production based on data-driven model predictive control. Background Technology
[0002] Anion exchange membrane (AEM) electrolyzers are key equipment in AEM water electrolysis hydrogen production systems. Changes in their physicochemical properties during operation can lead to high failure rates, shorter service life, lower stability, and lower hydrogen production rates, significantly limiting the commercialization of AEM water electrolysis hydrogen production. Improving the efficiency of water electrolysis hydrogen production and reducing costs are current research priorities. Therefore, selecting appropriate control strategies for AEM water electrolysis hydrogen production systems is crucial for ensuring safe, reliable, efficient, and economical operation.
[0003] Data-driven Model Predictive Control (DDMPC) is a novel control strategy that combines data-driven and predictive control. DDMPC does not rely on a precise model of the system; it only requires input and output data. The controller is designed using this data, overcoming the challenges of modeling nonlinear, strongly coupled, and multivariable characteristics in AEM water electrolysis hydrogen production systems. Furthermore, the controller has low complexity and meets the control requirements of AEM water electrolysis hydrogen production. In the process of selecting algorithms to build the control model, combining the advantages of different algorithms through a reasonable selection of multiple models can improve the overall performance of the control model.
[0004] However, traditional MPC (model predictive control) methods require constructing a clear physical model of the controlled object. The AEM water electrolysis hydrogen production system is a complex dynamic system that is nonlinear, strongly coupled, and multivariable. Its control process is affected by various factors, making model construction difficult and hard to obtain. Furthermore, traditional MPC control methods suffer from low accuracy and struggle to guarantee the stability of the control system. Moreover, traditional MPC methods have a high computational burden, easily leading to low computational efficiency. Summary of the Invention
[0005] This invention aims to address the problems of existing AEM water electrolysis hydrogen production systems, which are affected by various factors, resulting in high model construction difficulty, low control accuracy of traditional MPC controllers, difficulty in ensuring the stability of the control system, high computational burden, and low computational efficiency. The invention provides a data-driven model predictive control-based anion exchange membrane water electrolysis hydrogen production control method and system.
[0006] This invention provides a method for controlling hydrogen production via anion exchange membrane water electrolysis based on data-driven model predictive control, comprising the following steps: S1. Collect operating data from the preset AEM water electrolysis hydrogen production system and construct a non-mechanistic model of the system using a BP neural network algorithm; wherein, the operating data includes at least the operating voltage, operating temperature, current density, electrolyte pH, operating pressure, cathode liquid flow rate, gas flow rate, hydrogen production, energy consumption, and electrolysis efficiency. S2, Based on the non-mechanistic model of the system and the input parameters at the current moment, a prediction model is constructed using the LSTM algorithm, and the output parameters of the AEM water electrolysis hydrogen production system at several future moments are predicted. S3, the set output reference value y(t) is input into the system non-mechanistic model and the controller; wherein, the system non-mechanistic model outputs the corresponding operating parameter x(t) according to the output reference value y(t), and inputs x(t) into the controller; S4, the x(t) is optimized using the optimization model constructed by the NSGA-II algorithm in the controller to obtain the control quantity Δx(t); S5, apply Δx(t) to the AEM water electrolysis hydrogen production system and obtain the actual output y(t+1). At the same time, input Δx(t) into the prediction model to obtain the predicted output y'(t+1). S6, compare the actual output with the predicted output to obtain the error value, and perform feedback correction on the controller; S7, dynamically update the non-mechanistic model of the system and the prediction model with the newly collected data; S8, in the next control cycle, executes S1-S7 in a loop.
[0007] Furthermore, the step of collecting operational data from the preset AEM water electrolysis hydrogen production system and constructing a non-mechanistic model of the system using a BP neural network algorithm includes: Clean the aforementioned operational data: Using the operating voltage V, operating temperature T, current density J, electrolyte pH value pH, operating pressure P, cathode liquid flow rate Q, and gas flow rate v as input variables, and defining the input parameter as x, we get x=(V,T,J,pH,P,Q,v). Using hydrogen production A, energy consumption B, and electrolysis efficiency C as output parameters, we obtain yA, yB, and yC.
[0008] Furthermore, the step of collecting operational data from the preset AEM water electrolysis hydrogen production system and constructing a non-mechanistic model of the system using a BP neural network algorithm includes: A non-mechanistic model of the system was established using the BP neural network algorithm based on the output parameters of hydrogen production A, energy consumption B, and electrolysis efficiency C, and A(x), B(x), and C(x) were obtained respectively. The BP neural network algorithm includes a hidden layer and an output layer; The hidden layer uses the Tan-Sigmoid function as the transfer function, and the output layer uses a linear function as the transfer function.
[0009] Furthermore, the step of constructing a prediction model using the LSTM algorithm based on the non-mechanistic model of the system and the input parameters at the current moment, and predicting the output parameters of the AEM water electrolysis hydrogen production system at several future moments, includes: The process of establishing the prediction model is as follows: Each LSTM model includes at least an input layer, one or more LSTM hidden layers, and an output layer, and the dimension of the input layer corresponds to the number of features in the input data; The input data is X=[x1,x2,···,xm]; where m is the number of data points; the input feature vector at time t is xt.
[0010] The number of hidden layers in the LSTM is L, and the number of neurons in each hidden layer is n. The LSTM hidden layer includes an input gate, a forget gate, and an output gate, and the number of neurons in the output layer corresponds to the number of targets to be predicted; The calculation process for a single LSTM neuron at time t+1 is as follows: The forget gate is used to determine whether information should be retained or discarded; the calculation formula is: ; Among them, W f Let h be the weight matrix of the forget gate. t Let x be the hidden state at time t. t+1 For the input at time t+1, b f Let σ be the bias vector of the forget gate, and σ be the sigmoid function. ; The input gate is used to determine the information that needs to be updated in the cell state; the calculation formula is: ; ; ; Among them, W i W C This is the weight matrix of the forget gate; b i b CC is the bias vector for the forget gate; t+1 To update the cell state; tanh is the hyperbolic tangent function; The output gate is used to determine the information to be output; the calculation formula is: ; ; Among them, W o Let b be the weight matrix of the forget gate. o This is the bias vector for the forget gate.
[0011] Furthermore, the step of inputting the set output reference value y(t) into the system non-mechanistic model and controller includes: The output reference value y(t) is the target output value set according to demand at time t. The target output value includes at least hydrogen production A, energy consumption B, and electrolysis efficiency C, which are represented as yA(t), yB(t), and yC(t), respectively.
[0012] Furthermore, step S4, which optimizes x(t) using the optimization model constructed by the NSGA-II algorithm in the controller to obtain the control quantity Δx(t), includes: At least one set of candidate individuals is retained in each iteration through selection, crossover, and mutation operations, and this process is repeated; The optimization model establishment process is as follows: Based on the non-mechanistic models A(x), B(x), and C(x) of the system, the optimization function is obtained: ; Limit the upper and lower limits of the input variables, and limit the range of each input variable to establish a constraint function; Set the population size N, and randomly generate N individuals; where each individual represents a combination of input parameters; Substituting the input parameters of each individual into the non-mechanistic model of the system, the corresponding hydrogen production A(x) is calculated. i Energy consumption B(x) i ) and electrolysis efficiency C(x) i ).
[0013] Furthermore, S4-1, which involves retaining a set of candidate individuals in each iteration through selection, crossover, and mutation operations, and repeating the process, includes: Selection, crossover, and mutation operations: The selected individuals are obtained through either roulette wheel selection or optimal individual selection: When selecting for the roulette wheel, the probability of each individual being selected is proportional to the value of its fitness function. When making the selection for the optimal individual, the following steps are included: Step 1: Calculate the fitness f of each individual in the population i and the sum F of the fitness values of all individuals in the population to obtain ; Step 2: Calculate the probability that each individual is inherited into the next generation population; the probability that the i-th individual is selected is p i , p i is the ratio of its fitness value to the total fitness value: ; Step 3: Construct a roulette wheel and calculate the cumulative probability of each individual, and set the cumulative probability of the individual as q i , to obtain: When i = 1, q1 = p1; When i > 1, q i = q i-1 + p i ; Step 4: Generate a uniformly distributed pseudo-random number r in the interval [0, 1]; Step 5: If r < q1, select individual 1, otherwise, select individual i such that: q i-1 < r ≤ q i ; Repeat steps 4 and 5 N times; Perform a simulated binary crossover operation on the individuals in the mating pool; Perform a polynomial mutation operation.
[0014] Furthermore, after the steps of at least retaining a set of candidate individuals through selection, crossover, and mutation operations in each iteration and repeating the execution, it includes: New population generation and iteration: Merge the parental population and the offspring population after selection, crossover, and mutation operations to obtain a merged population; where the size of the population is 2N; Perform non-dominated sorting and crowding distance calculation on the merged population, and select the first N individuals to form a new population.
[0015] Furthermore, repeat the selection, crossover, and mutation operations and the new population generation and iteration until the preset number of iterations G is reached or the preset convergence condition is satisfied, to obtain an optimal solution dataset of different weight coefficients a, b, c for hydrogen production, energy consumption, and electrolysis efficiency; where a + b + c = 1, and the weight coefficients a, b, c can be set according to actual requirements.
[0016] The present invention also provides an anion exchange membrane electrolytic water hydrogen production control system based on data-driven model predictive control, including: AEM water electrolysis hydrogen production subsystem, controller, system non-mechanistic model and predictive model; The controller is used to output control quantities to the AEM water electrolysis hydrogen production subsystem; The non-mechanistic model of the system is used to give the corresponding operating parameters x(t) based on the input y(t), and input x(t) into the controller; The prediction model is used to obtain the predicted output y'(t+1); The first model building module is used to collect operational data from the AEM water electrolysis hydrogen production subsystem and construct a non-mechanistic model of the system using a BP neural network algorithm. The second model building module is used to build a prediction model based on the non-mechanistic model of the system and the input parameters at the current moment using the LSTM algorithm, and to predict the output parameters of the AEM water electrolysis hydrogen production system at several future moments. The input module is used to input the set output reference value y(t) into the non-mechanistic model and controller of the system; The model optimization module is used to optimize x(t) using the optimization model constructed by the NSGA-II algorithm in the controller, so as to obtain the control quantity Δx(t); The model application module is used to apply Δx(t) to the AEM water electrolysis hydrogen production system and obtain the actual output y(t+1). At the same time, Δx(t) is input into the prediction model to obtain the predicted output y'(t+1). The feedback correction module is used to compare the actual output and the predicted output to obtain an error value, and to perform feedback correction on the controller. The dynamic update module is used to dynamically update the non-mechanistic model of the system and the prediction model with newly collected data; The loop module is used for loop execution.
[0017] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program and the processor executes the computer program to implement the steps in any of the above methods.
[0018] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above methods.
[0019] This invention provides a method and system for controlling hydrogen production via anion exchange membrane water electrolysis based on data-driven model predictive control, which has the following advantages: Based on a large amount of operational data from the AEM water electrolysis hydrogen production process, a data-driven model predictive control strategy is designed to predict hydrogen production, energy consumption, and electrolysis efficiency. This strategy effectively improves the controller's control accuracy, computational efficiency, and stability, enabling effective prediction and control of hydrogen production, energy consumption, and electrolysis efficiency in the AEM water electrolysis hydrogen production system.
[0020] This invention employs a data-driven model predictive control strategy that does not rely on a precise physical model of the controlled system. It is applicable to strongly coupled, multivariable, and complex dynamic AEM (Aqueous Electrolysis Mechanism) water electrolysis hydrogen production systems, achieving effective prediction and control of hydrogen production, energy consumption, and electrolysis efficiency. The BP neural network algorithm can establish a non-mechanistic model of the system based on operational data to replace the physical model, solving the problem of the difficulty in establishing a physical model for AEM water electrolysis hydrogen production systems. Furthermore, it is computationally efficient and less complex to model. The LSTM (Laser-Based Memory) algorithm is used to construct the predictive control model. The LSTM algorithm can flexibly control the inflow and outflow of information, thus better handling long-sequence data and effectively mitigating gradient vanishing and gradient exploding problems. It is computationally efficient and less complex to calculate. Finally, this invention uses the NSGA-II algorithm to construct the controller optimization model, achieving high computational efficiency and optimization accuracy when processing large-scale data.
[0021] This invention dynamically updates the constructed non-mechanistic and predictive models of the system using newly acquired data, enabling real-time reflection of the dynamic changes in the AEM water electrolysis hydrogen production system and exhibiting adaptive capabilities. As the AEM electrolyzer operates, its performance changes; dynamically updating the control model effectively improves its accuracy. Furthermore, this application introduces data-driven model predictive control of the AEM water electrolysis hydrogen production system and optimizes the control method by combining multiple algorithm models. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the method steps of an anion exchange membrane electrolysis water production hydrogen control method based on data-driven model predictive control in this invention. Figure 2 This is a schematic diagram of the workflow in one embodiment of a data-driven model predictive control method for hydrogen production via anion exchange membrane electrolysis. Figure 3 This is a structural block diagram of an embodiment of an anion exchange membrane water electrolysis hydrogen production control system based on data-driven model predictive control according to the present invention. Figure 4 This is a structural block diagram of an anion exchange membrane water electrolysis hydrogen production control system based on data-driven model predictive control, as described in this invention.
[0023] Labeling description: AEM water electrolysis hydrogen production subsystem 10, controller 20, system non-mechanistic model 30, prediction model 40, first model construction module 50, second model construction module 60, input module 70, model optimization module 80, model application module 90, feedback correction module 110, dynamic update module 111, and loop module 112. Detailed Implementation
[0024] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Reference Appendix Figure 1 This invention provides a data-driven model predictive control-based method for controlling hydrogen production via anion exchange membrane water electrolysis, comprising the following steps: S1. Collect operating data from the preset AEM water electrolysis hydrogen production system and construct a non-mechanistic model 30 of the system through a BP neural network algorithm; wherein, the operating data includes at least the operating voltage, operating temperature, current density, electrolyte pH, operating pressure, cathode liquid flow rate, gas flow rate, hydrogen production, energy consumption, and electrolysis efficiency. S2. Based on the non-mechanistic model 30 of the system and the input parameters at the current moment, a prediction model 40 is constructed using the LSTM algorithm, and the output parameters of the AEM water electrolysis hydrogen production system at several future moments are predicted. S3, the set output reference value y(t) is input into the system non-mechanistic model 30 and the controller 20; wherein, the system non-mechanistic model 30 outputs the corresponding operating parameter x(t) according to the output reference value y(t) and inputs x(t) into the controller 20; S4, the control quantity Δx(t) is obtained by optimizing x(t) using the optimization model constructed by the NSGA-II algorithm in controller 20; S5, apply Δx(t) to the AEM water electrolysis hydrogen production system and obtain the actual output y(t+1). At the same time, input Δx(t) into the prediction model 40 to obtain the predicted output y'(t+1). S6, compare the actual output with the predicted output to obtain the error value, and perform feedback correction on the controller 20; S7, dynamically update the system non-mechanistic model 30 and prediction model 40 with the newly collected data; S8, in the next control cycle, executes S1-S7 in a loop.
[0027] In the above steps, the operating data is first collected from the preset AEM water electrolysis hydrogen production system. Specifically, the data is acquired through high-precision sensors, such as a high-precision pressure sensor to obtain the working pressure. The operating data includes at least the working voltage, working temperature, current density, electrolyte pH, working pressure, cathode liquid flow rate, gas flow rate, hydrogen production, energy consumption, and electrolysis efficiency.
[0028] Next, the collected operational data is cleaned. Specifically, the operating voltage V, operating temperature T, current density J, electrolyte pH value pH, operating pressure P, cathode liquid flow rate Q, and gas flow rate v are used as input variables, and the input parameter is defined as x, resulting in x=(V,T,J,pH,P,Q,v). Then, hydrogen production A, energy consumption B, and electrolysis efficiency C are used as output parameters, represented as yA, yB, and yC, respectively.
[0029] Then, a non-mechanistic model of the system is established using the BP neural network algorithm to calculate the output parameters of hydrogen production (A), energy consumption (B), and electrolysis efficiency (C), yielding A(x), B(x), and C(x), respectively. The hidden layer of the BP neural network algorithm uses the Tan-Sigmoid function as the transfer function, and the output layer uses a linear function as the transfer function.
[0030] Next, based on the non-mechanistic model 30 and the input parameters at the current moment, a prediction model 40 is constructed using the LSTM (Long Short-Term Memory) algorithm to predict the output parameters of the AEM water electrolysis hydrogen production system at several future moments. The set output reference value y(t) is then input into the non-mechanistic model 30 and the controller 20. The non-mechanistic model 30 outputs the corresponding operating parameter x(t) based on the output reference value y(t) and inputs x(t) into the controller 20. Then, the optimization model constructed using the NSGA-II (Elite Non-dominated Sorting Genetic Algorithm) in the controller 20 optimizes x(t) to obtain the control quantity Δx(t). Δx(t) is then applied to the AEM water electrolysis hydrogen production system to obtain the actual output y(t+1). Simultaneously, Δx(t) is input into the prediction model 40 to obtain the predicted output y'(t+1). Next, the actual output and the predicted output are compared to obtain the error value, and the controller 20 is corrected by feedback. Then, the newly acquired data is used to dynamically update the system non-mechanistic model 30 and the predictive model 40. Finally, S1-S7 are executed cyclically in the next control cycle.
[0031] like Figure 2As shown, in a specific embodiment, a non-mechanistic model of the AEM water electrolysis hydrogen production system is first constructed using a BP neural network algorithm. Then, a prediction model is constructed using an LSTM algorithm based on the non-mechanistic model. Next, the set output reference value y(t) is input into both the non-mechanistic model and the controller. The non-mechanistic model then provides the corresponding operating parameters x(t) based on the input y(t), and x(t) is input into the controller. The controller then optimizes x(t) using an optimization model constructed using the NSGA-II algorithm, obtaining the control quantity Δx(t). Δx(t) is then applied to the AEM water electrolysis hydrogen production system, yielding the actual output y(t+1). Simultaneously, Δx(t) is input into the prediction model, obtaining the predicted output y'(t+1). The actual output and the predicted output are compared to obtain the error value, and the controller is corrected using Dankü correction. Finally, newly acquired data is used to dynamically update the constructed data model and the prediction model. In a new cycle, the above steps are repeated.
[0032] Based on extensive operational data from the AEM water electrolysis hydrogen production process, this application designs a data-driven model predictive control strategy for hydrogen production, energy consumption, and electrolysis efficiency. This strategy effectively improves the control accuracy, computational efficiency, and stability of the controller 20, enabling effective prediction and control of hydrogen production, energy consumption, and electrolysis efficiency in the AEM water electrolysis hydrogen production system. Furthermore, by dynamically updating the constructed non-mechanistic model 30 and predictive model 40 using newly acquired data, the system can reflect real-time dynamic changes in the AEM water electrolysis hydrogen production system and exhibits adaptive capabilities. As the AEM electrolyzer operates, its performance changes due to factors such as electrode aging and changes in electrolyte composition. Dynamically updating the control model effectively improves its accuracy.
[0033] In one embodiment, the step of collecting operational data from a pre-set AEM water electrolysis hydrogen production system and constructing a non-mechanistic model 30 of the system using a BP neural network algorithm includes: Cleaning operation data: Using the operating voltage V, operating temperature T, current density J, electrolyte pH value pH, operating pressure P, cathode liquid flow rate Q, and gas flow rate v as input variables, and defining the input parameter as x, we get x=(V,T,J,pH,P,Q,v). Using hydrogen production A, energy consumption B, and electrolysis efficiency C as output parameters, we obtain yA, yB, and yC.
[0034] In this embodiment, operational data is collected from a pre-set AEM water electrolysis hydrogen production system. This data is then cleaned. Specifically, the operating voltage V, operating temperature T, current density J, electrolyte pH value pH, operating pressure P, cathode liquid flow rate Q, and gas flow rate v are used as input variables, and the input parameter is defined as x, resulting in x=(V,T,J,pH,P,Q,v). Hydrogen production A, energy consumption B, and electrolysis efficiency C are used as output parameters, yielding yA, yB, and yC, respectively. Next, a BP neural network algorithm is used to establish a non-mechanistic model 30 based on the operational data to replace the physical model, addressing the difficulty in establishing a physical model for the AEM water electrolysis hydrogen production system. This approach offers lower computational modeling difficulty and higher efficiency.
[0035] In one embodiment, the step of constructing a prediction model 40 using the LSTM algorithm based on the system non-mechanistic model 30 and the input parameters at the current moment, and predicting the output parameters of the AEM water electrolysis hydrogen production system at several future moments, includes: A non-mechanistic model of the system was established using the BP neural network algorithm based on the output parameters of hydrogen production A, energy consumption B, and electrolysis efficiency C, and A(x), B(x), and C(x) were obtained respectively. The BP neural network algorithm includes a hidden layer and an output layer. The hidden layer uses the Tan-Sigmoid function as the transfer function, and the output layer uses a linear function as the transfer function.
[0036] In this embodiment, a non-mechanistic model 30 of the system is established using a BP neural network algorithm based on the output parameters of hydrogen production A, energy consumption B, and electrolysis efficiency C, yielding A(x), B(x), and C(x) respectively. The BP neural network algorithm includes a hidden layer and an output layer; the hidden layer uses the Tan-Sigmoid function as the transfer function, and the output layer uses a linear function as the transfer function.
[0037] In one embodiment, the steps of constructing a prediction model 40 based on the system's non-mechanistic model 30 and using the LSTM algorithm, and predicting the output parameters of the AEM water electrolysis hydrogen production system at several future times based on the input parameters at the current time, include: The process of establishing prediction model 40 is as follows: Each LSTM model includes at least an input layer, one or more LSTM hidden layers, and an output layer, and the dimension of the input layer corresponds to the number of features in the input data; The input data is X=[x1,x2,···,xm], where m is the number of data points; the input feature vector at time t is xt.
[0038] The LSTM has L hidden layers, and each hidden layer has n neurons. The hidden layer of LSTM includes an input gate, a forget gate, and an output gate, and the number of neurons in the output layer corresponds to the number of targets to be predicted; The calculation process for a single LSTM neuron at time t+1 is as follows: The forget gate is used to determine whether information should be retained or discarded; the calculation formula is: ; Among them, W f Let h be the weight matrix of the forget gate. t Let x be the hidden state at time t. t+1 For the input at time t+1, b f Let σ be the bias vector of the forget gate, and σ be the sigmoid function. ; The input gate is used to determine the information that needs to be updated in the cell state; the calculation formula is: ; ; ; Among them, W i W C This is the weight matrix of the forget gate; b i b C C is the bias vector for the forget gate; t+1 To update the cell state; tanh is the hyperbolic tangent function; The output gate is used to determine the information to be output; the calculation formula is: ; ; Among them, W o Let b be the weight matrix of the forget gate. o This is the bias vector for the forget gate.
[0039] In this embodiment, the prediction model 40 is established using the LSTM algorithm. Specifically, the process of establishing the prediction model 40 is as follows: An LSTM model consists of an input layer, one or more LSTM hidden layers, and an output layer.
[0040] The dimension of the input layer is determined by the number of features in the input data. In one specific embodiment, the present invention includes seven features: operating voltage V, operating temperature T, current density J, electrolyte pH value pH, operating pressure P, cathode liquid flow rate Q, and gas flow rate v. Therefore, the dimension of the input layer is 7. Let the input data be X = [x1, x2, ..., x...]. m ]; where m is the number of data points, x t=[V(t),T(t),J(t),pH(t),P(t),Q(t),v(t)] is the input feature vector at time t. The operation parameter x(t)=[V(t),T(t),J(t),pH(t),P(t),Q(t),v(t)].
[0041] Next, the number of LSTM hidden layers L and the number of neurons n in each hidden layer are determined. The computation of an LSTM layer involves operations of multiple gates (input gate, forget gate, and output gate). The computation for a single LSTM neuron at time t+1 is as follows: Forget Gate: Determines which information should be retained or discarded. The formula is: ; Among them, W f Let h be the weight matrix of the forget gate. t Let x be the hidden state at time t. t+1 For the input at time t+1, b f Let σ be the bias vector of the forget gate, and σ be the sigmoid function. .
[0042] Input gate: Determines which information needs to be updated in the cell state. The formula is: ; ; ; Among them, W i W C Let b be the weight matrix of the forget gate. i b C C is the bias vector for the forget gate. t+1 For cell state updates, tanh is the hyperbolic tangent function.
[0043] Output gate: Determines which information needs to be output. The formula is: ; ; Among them, W o Let b be the weight matrix of the forget gate. o This is the bias vector for the forget gate.
[0044] The number of neurons in the output layer is determined by the number of targets to be predicted. In one specific embodiment, the output layer has one neuron used to predict hydrogen production, and the calculation formula for the output layer is as follows: Among them, W A Let b be the weight matrix of the output layer. A y is the bias vector of the output layer. A'(t+1) represents the predicted hydrogen production at time t+1. This application uses the LSTM algorithm to construct the prediction model 40, which can flexibly control the inflow and outflow of information, thereby better processing long sequence data, effectively alleviating the problems of gradient vanishing and gradient exploding, and has low computational difficulty and high efficiency.
[0045] In one embodiment, the step of inputting the set output reference value y(t) into the system non-mechanistic model 30 and the controller 20 includes: The output reference value y(t) is the target output value set according to demand at time t. The target output value includes at least hydrogen production A, energy consumption B, and electrolysis efficiency C, which are represented as yA(t), yB(t), and yC(t), respectively.
[0046] In this embodiment, the output reference value y(t) is the target output value set as required at time t. The target output includes at least hydrogen production A, energy consumption B, and electrolysis efficiency C, which are represented as yA(t), yB(t), and yC(t), respectively.
[0047] In one embodiment, the step of optimizing x(t) using the optimization model constructed by the NSGA-II algorithm in controller 20 to obtain the control quantity Δx(t) includes: At least one set of candidate individuals is retained in each iteration through selection, crossover, and mutation operations, and this process is repeated; the optimization model building process is as follows: Based on the non-mechanistic model of the system 30A(x), B(x), and C(x), the optimization function is obtained: ; Limit the upper and lower limits of the input variables, and limit the range of each input variable to establish a constraint function; Set the population size N, and randomly generate N individuals; where each individual represents a combination of input parameters; Substituting the input parameters of each individual into the non-mechanistic model 30 of the system, the corresponding hydrogen production A(x) is calculated. i Energy consumption B(x) i ) and electrolysis efficiency C(x) i ).
[0048] In this embodiment, the optimization model in controller 20 is established using the NSGA-II algorithm. The principle of the NSGA-II algorithm is to retain a set of candidate individuals in each iteration through mechanisms such as selection, crossover, and mutation, and repeat this process. After several generations of evolution, the fitness of the population reaches the optimal state. This application uses the NSGA-II algorithm to construct the optimization model of controller 20, which has high computational efficiency and high accuracy of optimization results when processing large-scale data.
[0049] Furthermore, based on the non-mechanistic model of the system 30A(x), B(x), and C(x), the optimization function is obtained: ; Based on the operating variable ranges in the actual operation of the AEM water electrolysis hydrogen production system, such as operating voltage ≤2.2V, operating temperature ≤60℃, and current density ≥1.2A / cm², it is also necessary to limit the upper and lower limits of the input variables, that is, to establish constraint functions to limit the range of each input variable.
[0050] Set the population size N, and randomly generate N individuals, each representing a combination of input parameters. In a specific embodiment, for the i-th individual x... i =(V i ,T i J i pH i ,P i Q i ,v i In this model, the value of each parameter is randomly generated within its corresponding range. The input parameters for each individual parameter are substituted into the non-mechanistic model 30 of the water electrolysis hydrogen production system to calculate the corresponding hydrogen production A(x). i Energy consumption B(x) i ) and electrolysis efficiency C(x) i ).
[0051] In one embodiment, the step of retaining a set of candidate individuals in each iteration through at least selection, crossover, and mutation operations, and repeating the process, includes: Selection, crossover, and mutation operations: The selected individuals are obtained through either roulette wheel selection or optimal individual selection: When choosing using a roulette wheel, the probability of each individual being selected is proportional to the value of its fitness function. When selecting the optimal individual, the following steps are included: Step 1: Calculate the fitness f of each individual in the population. i And the sum of the fitness values F of all individuals in the population, we get ; Step 2: Calculate the probability that each individual will be inherited by the next generation; the probability that the i-th individual is selected is p. i p i The ratio of its fitness value to the total fitness value: ; Step 3: Construct the roulette wheel and calculate the cumulative probability of each individual. Let the cumulative probability of an individual be q. i ,get: When i=1, q1=p1; When i > 1, q i = q i-1 + p i Step 4: Generate a uniformly distributed pseudo-random number r in the interval [0, 1]; Step 5: If r < q1, select individual 1; otherwise, select individual i, such that: q i-1 < r ≤ q i ; Repeat Step 4 and Step 5 N times; Perform simulated binary crossover operation on the individuals in the mating pool; Perform polynomial mutation operation.
[0052] In this embodiment, the system non-mechanistic model 30 obtains the hit individuals through roulette selection or optimal individual selection. When it is roulette selection, the probability of each individual being selected is proportional to the value of its fitness function. However, the roulette wheel selection method has randomness, and better individuals may be lost during the selection process. Therefore, the optimal individual can also be directly selected through optimal individual selection.
[0053] Specifically, when it is optimal individual selection, it includes the following steps: Step 1: Calculate the fitness f of each individual in the population i and the sum F of the fitness values of all individuals in the population to obtain ; Step 2: Calculate the probability that each individual is inherited into the next generation population; the probability that the i-th individual is selected is p i , p i is the ratio of its fitness value to the total fitness value: ; Step 3: Construct a roulette wheel and calculate the cumulative probability of each individual, and set the cumulative probability of the individual as q i , to obtain: When i = 1, q1 = p1; When i > 1, q i = q i-1 + p i Step 4: Generate a uniformly distributed pseudo-random number r in the interval [0, 1]; Step 5: If r < q1, select individual 1; otherwise, select individual i, such that: q i-1 < r ≤ q i ; Then, steps four and five are repeated N times; a simulated binary crossover (SBX) operation is then performed on the individuals in the mating pool; where the mating pool refers to a group of candidate individuals selected after the "selection" operation for subsequent "crossover" and "mutation" operations. Multiple optimal individuals selected by the roulette wheel constitute the mating pool. In a specific embodiment, taking the working voltage as an example, let the parent individuals be x1=(V1) and x2=(V2), and the child individuals be x1' and x2', then the calculation formula is: For the working voltage: , ; Where β is the crossover probability p c and distribution index η c The resulting random number is then used, and similar cross-operations are performed on the other input parameters.
[0054] Finally, a polynomial mutation operation is performed. In a specific embodiment, taking the working voltage as an example, let individual x = (V), and the mutated individual x' be the result. The calculation formula is: , where δ is the value based on the mutation probability p m and distribution index η m The generated random number is then used, and similar mutation operations are performed on other input parameters.
[0055] In one embodiment, after repeatedly performing the steps of retaining a set of candidate individuals in each iteration through at least selection, crossover, and mutation operations, the process includes: New population generation and iteration: The parent population and the offspring population after selection, crossover, and mutation are merged to obtain a merged population; the size of the merged population is 2N. The merged population is sorted by non-dominated order and crowding distance is calculated, and the top N individuals are selected to form a new population.
[0056] In this embodiment, after selection, crossover, and mutation operations, a new population is generated and iterated. Specifically, the parent population and the offspring population after selection, crossover, and mutation operations are merged to obtain a population size of 2N. The merged population is then sorted using non-dominated ranking and crowding distance calculation, and the top N individuals are selected to form a new population. The selection, crossover, and mutation operations, as well as the generation and iteration of the new population, are repeated until a preset number of iterations G is reached or a preset convergence condition is met. The convergence condition refers to conditions artificially set during the operation of the AEM water electrolysis hydrogen production system, such as the actual upper and lower limits of operating parameters like operating voltage V, operating temperature T, current density J, electrolyte pH, operating pressure P, cathode flow rate Q, and gas flow rate v. Finally, the optimal solution dataset with different weighting coefficients a, b, and c among hydrogen production, energy consumption, and electrolysis efficiency is obtained, where a + b + c = 1.
[0057] Furthermore, in the optimization model, weighting coefficients a, b, and c can be set according to actual needs to obtain the most suitable target output. In a specific embodiment, if the target is to focus on hydrogen production, the value of a can be appropriately increased; if the focus is on low energy consumption, the value of b can be appropriately increased; and if the focus is on high electrolysis efficiency, the value of c can be appropriately increased.
[0058] Reference Appendix Figure 3A data-driven model predictive control system for anion exchange membrane (AEM) water electrolysis hydrogen production includes an AEM water electrolysis hydrogen production subsystem 10, a controller 20, a system non-mechanistic model 30, and a predictive model 40. The controller 20 outputs control parameters to the AEM water electrolysis hydrogen production subsystem 10. The system non-mechanistic model 30 provides the corresponding operating parameters x(t) based on the input y(t) and inputs x(t) into the controller 20. The predictive model 40 obtains the predicted output y'(t+1). A first model construction module 50 collects operating data from the AEM water electrolysis hydrogen production subsystem 10 and constructs the system non-mechanistic model 30 using a BP neural network algorithm. A second model construction module 60 constructs the predictive model 40 using an LSTM algorithm based on the system non-mechanistic model 30 and the current input parameters, and predicts the AEM water electrolysis hydrogen production at several future times. The system output parameters include: an input module 70, which inputs the set output reference value y(t) into the system non-mechanistic model 30 and the controller 20; a model optimization module 80, which optimizes x(t) using the optimization model constructed by the NSGA-II algorithm in the controller 20 to obtain the control quantity Δx(t); a model application module 90, which applies Δx(t) to the AEM water electrolysis hydrogen production system to obtain the actual output y(t+1), and simultaneously inputs Δx(t) into the prediction model 40 to obtain the predicted output y'(t+1); a feedback correction module 110, which compares the actual output and the predicted output to obtain the error value and performs feedback correction on the controller 20; a dynamic update module 111, which dynamically updates the system non-mechanistic model 30 and the prediction model 40 with newly acquired data; and a loop module 112, which executes the loop in the next control cycle.
[0059] In this embodiment, the system includes an AEM water electrolysis hydrogen production subsystem 10, a controller 20, a system non-mechanistic model 30, and a prediction model 40. Specifically, the controller 20 outputs control quantities to the AEM water electrolysis hydrogen production subsystem 10; the system non-mechanistic model 30 provides corresponding operating parameters x(t) based on the input y(t) and inputs x(t) into the controller 20; the prediction model 40 obtains the predicted output y'(t+1); the first model building module 50 collects operating data from the AEM water electrolysis hydrogen production subsystem 10 and constructs the system non-mechanistic model 30 using a BP neural network algorithm; the second model building module 60 constructs the prediction model 40 using an LSTM algorithm based on the system non-mechanistic model 30 and the current input parameters, and predicts the output parameters of the AEM water electrolysis hydrogen production system at several future times; and the input module 70 inputs the set output reference value y(t). The system consists of a non-mechanistic model 30 and a controller 20; a model optimization module 80 is used to optimize x(t) using the optimization model constructed by the NSGA-II algorithm in the controller 20 to obtain the control quantity Δx(t); a model application module 90 is used to apply Δx(t) to the AEM water electrolysis hydrogen production system and obtain the actual output y(t+1). At the same time, Δx(t) is input into the prediction model 40 to obtain the predicted output y'(t+1); a feedback correction module 110 is used to compare the actual output and the predicted output to obtain the error value and perform feedback correction on the controller 20; a dynamic update module 111 is used to dynamically update the system non-mechanistic model 30 and the prediction model 40 with newly acquired data; and a loop module 112 is used to execute the loop in the next control cycle.
[0060] In one embodiment, such as Figure 4As shown, the set output reference value y(t) is input into the system non-mechanistic model 30 and the controller 20. The system non-mechanistic model 30 then provides the corresponding operating parameter x(t) based on the input y(t), and inputs x(t) into the controller 20. In the controller 20, an optimization model is constructed using the NSGA-II algorithm to optimize x(t), obtaining the control quantity Δx(t). Δx(t) is then applied to the AEM water electrolysis hydrogen production system and the prediction model 40, obtaining the actual output y(t+1) and the predicted output y'(t+1), respectively. The actual output and the predicted output are then compared to obtain the error value, which is sent to the controller 20 for feedback correction. Newly acquired data is also sent to the system non-mechanistic model 30 and the prediction model 40 for dynamic updates. This application introduces a data-driven model predictive control system for AEM water electrolysis hydrogen production, and combines multiple algorithm models to optimize the control method; it uses a BP neural network algorithm to construct a non-mechanistic model 30 to replace the traditional physical model, uses an LSTM algorithm to construct a predictive model 40 for the controller 20, and uses an NSGA-II algorithm to construct an optimization model for the controller 20; and uses newly acquired data to dynamically update the constructed non-mechanistic model 30 and predictive model 40.
[0061] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0062] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for controlling hydrogen production via anion exchange membrane water electrolysis based on data-driven model predictive control, characterized in that, Includes the following steps: S1. Collect operating data from the preset AEM water electrolysis hydrogen production system and construct a non-mechanistic model of the system using a BP neural network algorithm; wherein, the operating data includes at least the operating voltage, operating temperature, current density, electrolyte pH, operating pressure, cathode liquid flow rate, gas flow rate, hydrogen production, energy consumption, and electrolysis efficiency. S2, Based on the non-mechanistic model of the system and the input parameters at the current moment, a prediction model is constructed using the LSTM algorithm, and the output parameters of the AEM water electrolysis hydrogen production system at several future moments are predicted. S3, the set output reference value y(t) is input into the system non-mechanistic model and the controller; wherein, the system non-mechanistic model outputs the corresponding operating parameter x(t) according to the output reference value y(t), and inputs x(t) into the controller; S4, the x(t) is optimized using the optimization model constructed by the NSGA-II algorithm in the controller to obtain the control quantity Δx(t); S5, apply Δx(t) to the AEM water electrolysis hydrogen production system and obtain the actual output y(t+1). At the same time, input Δx(t) into the prediction model to obtain the predicted output y'(t+1). S6, compare the actual output with the predicted output to obtain the error value, and perform feedback correction on the controller; S7, dynamically update the non-mechanistic model of the system and the prediction model with the newly collected data; S8, in the next control cycle, executes S1-S7 in a loop.
2. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 1, characterized in that, The step of collecting operational data from a pre-set AEM water electrolysis hydrogen production system and constructing a non-mechanistic model of the system using a BP neural network algorithm includes: Clean the aforementioned operational data: Using the operating voltage V, operating temperature T, current density J, electrolyte pH value pH, operating pressure P, cathode liquid flow rate Q, and gas flow rate v as input variables, and defining the input parameter as x, we get x=(V,T,J,pH,P,Q,v). Using hydrogen production A, energy consumption B, and electrolysis efficiency C as output parameters, we obtain yA, yB, and yC.
3. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 1, characterized in that, The step of collecting operational data from a pre-set AEM water electrolysis hydrogen production system and constructing a non-mechanistic model of the system using a BP neural network algorithm includes: A non-mechanistic model of the system was established using the BP neural network algorithm based on the output parameters of hydrogen production A, energy consumption B, and electrolysis efficiency C, and A(x), B(x), and C(x) were obtained respectively. The BP neural network algorithm includes a hidden layer and an output layer; The hidden layer uses the Tan-Sigmoid function as the transfer function, and the output layer uses a linear function as the transfer function.
4. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 1, characterized in that, The step of constructing a prediction model using the LSTM algorithm based on the non-mechanistic model of the system and the input parameters at the current moment to predict the output parameters of the AEM water electrolysis hydrogen production system at several future moments includes: The process of establishing the prediction model is as follows: Each LSTM model includes at least an input layer, one or more LSTM hidden layers, and an output layer, and the dimension of the input layer corresponds to the number of features in the input data; The input data is X=[x1,x2,···,xm]; where m is the number of data points; the input feature vector at time t is xt; The number of hidden layers in the LSTM is L, and the number of neurons in each hidden layer is n. The LSTM hidden layer includes an input gate, a forget gate, and an output gate, and the number of neurons in the output layer corresponds to the number of targets to be predicted; The calculation process for a single LSTM neuron at time t+1 is as follows: The forget gate is used to determine whether information should be retained or discarded; the calculation formula is: ; Among them, W f Let h be the weight matrix of the forget gate. t Let x be the hidden state at time t. t+1 For the input at time t+1, b f Let σ be the bias vector of the forget gate, and σ be the sigmoid function. ; The input gate is used to determine the information that needs to be updated in the cell state; the calculation formula is: ; ; ; Among them, W i W C This is the weight matrix of the forget gate; b i b C C is the bias vector for the forget gate; t+1 To update the cell state; tanh is the hyperbolic tangent function; The output gate is used to determine the information to be output; the calculation formula is: ; ; Among them, W o Let b be the weight matrix of the forget gate. o This is the bias vector for the forget gate.
5. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 1, characterized in that, The step of inputting the set output reference value y(t) into the system non-mechanistic model and controller includes: The output reference value y(t) is the target output value set according to demand at time t. The target output value includes at least hydrogen production A, energy consumption B, and electrolysis efficiency C, which are represented as yA(t), yB(t), and yC(t), respectively.
6. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 3, characterized in that, The step S4, which optimizes x(t) using the optimization model constructed by the NSGA-II algorithm in the controller to obtain the control quantity Δx(t), includes: At least one set of candidate individuals is retained in each iteration through selection, crossover, and mutation operations, and this process is repeated; The optimization model establishment process is as follows: Based on the non-mechanistic models A(x), B(x), and C(x) of the system, the optimization function is obtained: ; Limit the upper and lower limits of the input variables, and limit the range of each input variable to establish a constraint function; Set the population size N, and randomly generate N individuals; where each individual represents a combination of input parameters; Substituting the input parameters of each individual into the non-mechanistic model of the system, the corresponding hydrogen production A(x) is calculated. i Energy consumption B(x) i ) and electrolysis efficiency C(x) i ).
7. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 6, characterized in that, The step S4-1, which involves retaining a set of candidate individuals in each iteration through selection, crossover, and mutation operations and repeating the process, includes: Selection, crossover, and mutation operations: The selected individuals are obtained through either roulette wheel selection or optimal individual selection. When selecting for the roulette wheel, the probability of each individual being selected is proportional to the value of its fitness function. When selecting the optimal individual, the following steps are included: Step 1: Calculate the fitness f of each individual in the population. i And the sum of the fitness values F of all individuals in the population, we get ; Step 2: Calculate the probability that each individual will be inherited by the next generation; the probability that the i-th individual is selected is p. i p i The ratio of its fitness value to the total fitness value: ; Step 3: Construct the roulette wheel and calculate the cumulative probability of each individual, setting the cumulative probability of each individual as q. i ,get: When i=1, q1=p1; When i>1, q i =q i-1 +p i ; Step 4: Generate a uniformly distributed pseudo-random number r in the interval [0,1]. Step 5, if r < q1, then select individual 1, otherwise, select individual i such that: q i-1 <r ≤ q i ; Repeat steps four and five N times; Simulate binary crossover operations on individuals in the mating pool; Perform polynomial mutation operations.
8. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 7, characterized in that, After the step of retaining a set of candidate individuals in each iteration through at least selection, crossover, and mutation operations, and repeating the process, it includes: New population generation and iteration: The parent population and the offspring population after selection, crossover, and mutation are merged to obtain a merged population; the size of the merged population is 2N. The merged population is sorted by non-dominated order and crowding distance is calculated, and the top N individuals are selected to form a new population.
9. The method for controlling hydrogen production via anion exchange membrane electrolysis based on data-driven model predictive control according to claim 8, characterized in that, Repeat the selection, crossover, and mutation operations, as well as the generation and iteration of new populations, until a preset number of iterations G is reached or a preset convergence condition is met, to obtain the optimal solution dataset with different weight coefficients a, b, and c for hydrogen production, energy consumption, and electrolysis efficiency; where a+b+c=1, and the weight coefficients of a, b, and c can be set according to actual needs.
10. A data-driven model predictive control-based anion exchange membrane water electrolysis hydrogen production control system, characterized in that, This includes the AEM water electrolysis hydrogen production subsystem, controller, system non-mechanistic model, and predictive model; The controller is used to output control quantities to the AEM water electrolysis hydrogen production subsystem; The non-mechanistic model of the system is used to give the corresponding operating parameters x(t) based on the input y(t), and input x(t) into the controller; The prediction model is used to obtain the predicted output y'(t+1); The first model building module is used to collect operational data from the AEM water electrolysis hydrogen production subsystem and construct a non-mechanistic model of the system using a BP neural network algorithm. The second model building module is used to build a prediction model based on the non-mechanistic model of the system and the input parameters at the current moment using the LSTM algorithm, and to predict the output parameters of the AEM water electrolysis hydrogen production system at several future moments. The input module is used to input the set output reference value y(t) into the non-mechanistic model and controller of the system; The model optimization module is used to optimize x(t) using the optimization model constructed by the NSGA-II algorithm in the controller, so as to obtain the control quantity Δx(t); The model application module is used to apply Δx(t) to the AEM water electrolysis hydrogen production system and obtain the actual output y(t+1). At the same time, Δx(t) is input into the prediction model to obtain the predicted output y'(t+1). The feedback correction module is used to compare the actual output and the predicted output to obtain an error value, and to perform feedback correction on the controller. The dynamic update module is used to dynamically update the non-mechanistic model of the system and the prediction model with newly collected data; The loop module is used for loop execution.