A hybrid electrolyzer data-driven modeling method and system

CN122528629APending Publication Date: 2026-08-07NARI JIDIAN NEW ENERGY (NANJING) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NARI JIDIAN NEW ENERGY (NANJING) CO LTD
Filing Date
2026-05-14
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

在同一个仿真步长内,同时求解具有极大时间常数差异的微分方程,会导致极其严重的数学“刚性方程问题”

Benefits of technology

[0035]有益效果:与现有技术相比,本发明具有如下显著优点:(1)解决了现有Simulink仿真中机理模型“刚性求解极慢”以及纯黑箱数据驱动模型“违背能量守恒与引发代数环发散”的技术痛点,从而实现对ALK/PEM混合系统的高效、精确仿真;(2)将复杂的偏微分方程求解转化为轻量级的矩阵乘加运算,在保留混合电解槽极高保真度的同时,实现计算速度的指数级提升,并首创性地解决了纯数据驱动模型的物理失真和代数环发散问题;(3)针对ALK和PEM响应时间尺度差异的物理特性,构建频域解耦双通道预处理架构,对ALK基荷特性数据施加重度滑动平均滤波,对PEM调峰特性数据施加轻度滤波,适配不同电解槽的响应特性;(4)采用由四个独立专家网络构成的混合专家架构,结合Z-Score标准化与贝叶斯正则化算法,将预测目标拆分为独立的物理量预测任务,避免不同变量间的梯度竞争问题;(5)提出“黑箱预测特性,白箱约束能量”的融合架构,在黑箱外部设置功率守恒与法拉第转化定律硬约束,通过功率计算与等效内阻倒推的闭环架构,保障底层能量守恒,打破Simulink中的代数环死锁。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122528629A_ABST
    Figure CN122528629A_ABST
Patent Text Reader

Abstract

The application discloses a kind of hybrid electrolytic cell data-driven modeling method and system, including data generation and extraction, double-scale frequency domain decoupling and standardization preprocessing, independent expert neural network group training, proxy model reconstruction, module packaging and in situ replacement simulation;Through the data generated by mechanism model offline double-scale frequency domain decoupling, separate high and low frequency response characteristics, while building four completely independent expert neural networks, respectively accurately fitting the voltage and current nonlinear characteristics of hybrid electrolytic cell, finally introduce power conservation and faraday law as hard constraint outside proxy model, eliminate algebraic ring through physical back calculation equivalent resistance, and packaged as Simulink real-time simulation module.The application greatly improves the operation speed of green electricity hydrogen production 8760 hours long period simulation in the premise of ensuring 100% conservation of underlying energy and closed-loop absolute stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a hybrid electrolyzer modeling technique, and more particularly to a data-driven modeling method and system for hybrid electrolyzers based on frequency domain decoupling and physical prior constraints. Background Technology

[0002] In green electricity-to-hydrogen systems, the output power of renewable energy sources such as wind and solar power exhibits strong randomness and volatility. While a single alkaline electrolyzer (ALK) is economical, its slow response speed makes it unable to adapt to drastic power fluctuations. Proton exchange membrane (PEM) electrolyzers offer extremely fast response but are prohibitively expensive. Therefore, the industry typically employs a hybrid ALK / PEM electrolyzer system to balance hydrogen production economics with rapid response to fluctuating power conditions. Establishing a highly accurate and computationally efficient electrolyzer model is crucial for verifying control strategies and simulating long-term (8760 hours) operation of such microgrid systems.

[0003] However, existing simulation modeling methods reveal two major insurmountable technical bottlenecks when dealing with the special case of hybrid electrolyzers:

[0004] First, traditional mechanistic modeling suffers from rigid solution challenges and consumes enormous computational resources. For example, the patent CN121302706A, which proposes a modeling method based on electrochemical and thermodynamic mechanism formulas, requires solving a complex set of nonlinear partial differential algebraic equations involving activation polarization, ohmic polarization, and concentration polarization in dynamic simulation software like Simulink. More critically, ALK systems exhibit significant physical thermal inertia and bubble effects (manifesting as low-frequency, slow-response systems), while PEM systems have extremely fast responses and minimal capacitance effects (manifesting as high-frequency, fast-response systems). Simultaneously solving differential equations with vastly different time constants within the same simulation step size leads to a severe mathematical "rigid equation problem." The simulation solver step size is forced to shrink drastically, resulting in a single system-level simulation lasting several hours or even days, which is completely unacceptable for engineering requirements involving hundreds or thousands of parameter optimization iterations during system design.

[0005] Second, existing pure data-driven (black box) models suffer from frequency domain conflicts, physical distortions, and algebraic loop deadlocks. To accelerate simulations, some studies have introduced data-driven methods such as artificial neural networks. For example, the patent CN114880941A, which describes a method and apparatus for establishing an electrolyzer model in a water electrolysis hydrogen production system, proposes using a neural network to establish the electrolyzer model and focuses on cleaning abnormal data. However, if this method is applied to a hybrid electrolyzer system, it has the following three fatal flaws: First, frequency domain conflicts and gradient loss: For a single electrolyzer, if high-frequency data (PEM) and low-frequency data (ALK) of a hybrid system are simply mixed together in a neural network for training, it will lead to extremely serious gradient loss. Because the drastically fluctuating current signal will generate huge gradients, the network will "bias" itself, desperately fitting signals with large fluctuations, and completely losing its ability to fit small voltage fluctuations, resulting in a low prediction determination coefficient R² (as in actual measurements). In the experiment, the V_ALK prediction R² of the hybrid network was only 0.66; secondly, the dimensional distribution was extremely uneven: traditional normalization methods (such as mapminmax) would compress 99% of the steady-state operating data into an extremely narrow range when facing the voltage spike of hundreds of volts at the moment of electrolytic cell startup, causing the network to fall into local optima; thirdly, physical distortion and algebraic loop deadlock: the pure black box model completely lacks the constraints of the physical underlying layer. In the closed-loop simulation, if the neural network is allowed to directly predict the equivalent internal resistance of the system, due to the prediction error of the network itself, even if it is only 1%, the predicted voltage and current product will not be equal to the total power demand of the system input, which violates the law of conservation of energy. In addition, the network predicts the resistance based on the input voltage, while the resistance in the simulation system instantly determines the bus current, which in turn affects the voltage. This pure algebraic mapping will form a fatal algebraic loop in Simulink, which amplifies small errors through positive feedback, causing the closed-loop simulation to diverge and collapse instantly. Summary of the Invention

[0006] Purpose of the invention: The purpose of this invention is to provide a data-driven modeling method for hybrid electrolyzers based on frequency domain decoupling and physical prior constraints. Another purpose of this invention is to provide a system for implementing this method.

[0007] Technical solution: The data-driven modeling method for hybrid electrolyzers described in this invention includes:

[0008] (1) Data generation and extraction: A simulation platform for green electricity hydrogen production system and a high-fidelity hybrid electrolyzer mechanism model coupled with alkaline and proton exchange membrane electrolyzer units were constructed. Dynamic input power signals were injected for offline simulation. The original time series datasets including actual bus voltage, actual bus current, and operating voltage and current of the electrolyzer units were extracted.

[0009] (2) Dual-scale frequency domain decoupling and normalization preprocessing: Based on the response characteristics of alkaline and proton exchange membrane electrolyzer units, the original dataset is decoupled and separated in the frequency domain to establish high and low frequency dual-channel data, and Z-Score normalization preprocessing is performed to eliminate the compression effect of extreme abrupt peaks on the steady-state data dimensions.

[0010] (3) Training of independent expert neural network group: Construct an expert neural network group, perform parallel training on the preprocessed dataset, and establish a nonlinear mapping matrix between the bus input features and the output of each electrolytic cell unit;

[0011] (4) Proxy model reconstruction: Apply physical law constraints to the output of the expert neural network group, use the voltage and current predicted by the network to calculate the power, and combine the energy conservation to back-calculate the equivalent feedback internal resistance of the system to construct a physical information proxy model that combines black box prediction features and white box constraint energy.

[0012] (5) Module encapsulation and in-situ replacement simulation: The physical information proxy model with the required accuracy is encapsulated as a Simulink compatible module and replaced in-situ in the high-fidelity hybrid electrolyzer mechanism model in long-cycle system-level simulation.

[0013] In step (1), the green electricity hydrogen production system simulation platform includes wind turbines, photovoltaic arrays, energy storage equipment and high-fidelity hybrid electrolyzer mechanism models; the dynamic input power signal includes full-condition step response test signals and second-level and minute-level wind and solar power fluctuation curves extracted from real meteorological historical data, so as to ensure the completeness of the original dataset in phase space, so that the trained proxy model can be generalized to any extreme real operating scenario.

[0014] In step (2), the specific steps of the dual-scale frequency domain decoupling and normalization preprocessing include:

[0015] (21) Outlier removal: Clean up non-numerical, infinite values ​​and data frames with unreasonable physical boundaries in the original dataset;

[0016] (22) Peak-shaving channel filtering of proton exchange membrane electrolyzer unit: The bus and voltage and current data of the proton exchange membrane electrolyzer unit, which characterize the fast response characteristics of the proton exchange membrane electrolyzer unit, are filtered by moving average with a small time window to remove high-frequency switching noise while retaining the peak response characteristics of wind and solar second-level fluctuations.

[0017] (23) Base load channel filtering of alkaline electrolyzer unit: The voltage and current data of the bus and the unit, which characterize the slow response characteristics of the alkaline electrolyzer unit, are filtered by moving average with a large time window to characterize the physical hysteresis inertia caused by the heat capacity of alkaline solution and bubble effect of alkaline electrolyzer unit.

[0018] (24) Z-Score standardization: The mean-variance normalization formula is used to convert the decoupled dual-channel feature set and label set into a normal distribution with a mean of 0 and a variance of 1, thus solving the problem of gradient vanishing in neural networks caused by extremely uneven data distribution.

[0019] In step (3), the training of the independent expert neural network group adopts the following strategy: four independent feedforward neural networks are constructed to predict voltage and current respectively; the input layer of each independent expert neural network is decoupled from the corresponding frequency domain bus voltage and bus current; Bayesian regularization algorithm is used for training, and no validation set is divided to maximize the use of training data; by increasing the upper limit of the Marquardt parameter and combining it with the weight decay mechanism, the weights of neurons with fitting noise are suppressed, and the global optimal solution of the nonlinear polarization curve is approximated in the long-period iteration process.

[0020] In step (4), the core of the proxy model reconstruction lies in using algebraic hard constraints to ensure 100% energy conservation, including real-time power restoration and physical deduction of equivalent internal resistance. The real-time power restoration is based on the accurate individual voltage and current output by the four expert neural networks, and calculates the actual power consumption of each electrolytic cell according to physical laws. The physical deduction of equivalent internal resistance is combined with the conversion efficiency of the front-end DC-DC power electronic converter to find the total physical power required for the bus, and then dynamically deduces the equivalent internal resistance of the current system, which is fed back to the system power supply as a closed-loop control signal. The equivalent internal resistance physical reverse calculation process also includes singularity point collapse prevention and algebraic loop deadlock prevention mechanisms. The singularity point collapse prevention mechanism sets a power minimum threshold. When the system is in the start-up / shutdown phase or the wind and solar input is extremely small, causing the calculated total physical power demand on the bus to be lower than the threshold, the division-to-zero protection is triggered, and the power is forcibly assigned to the preset maximum impedance value. The algebraic loop deadlock prevention mechanism forcibly inserts a time delay element at the output equivalent feedback internal resistance interface. This delay element is used to cut off the time-difference dead loop where voltage determines resistance, resistance instantaneously determines current, and current again determines voltage. While maintaining the dynamic response characteristics of the hybrid system, it absolutely ensures the numerical stability of the closed-loop simulation. The surrogate model reconstruction also includes a Faraday law hydrogen production reconstruction step: instead of using neural networks to predict hydrogen production, the high-precision alkaline electrolyzer unit current and proton exchange membrane electrolyzer unit current predicted by expert neural networks are directly input into the solidified Faraday electrolysis law mechanism equation. Combined with the number of electrolyzer series sections and the Faraday constant, the real-time hydrogen production rate and specific energy consumption of the system are accurately calculated, ensuring the strict consistency between macroscopic mass conservation and electrochemical mechanism.

[0021] The hybrid electrolyzer data-driven modeling system of the present invention includes:

[0022] Data generation and extraction module: Construct a high-fidelity hybrid electrolyzer mechanism model including alkaline electrolyzer unit and proton exchange membrane electrolyzer unit, perform offline simulation by injecting dynamic input power signal, and extract time series raw data sample set including actual bus voltage, actual bus current, and operating voltage and current of each internal unit;

[0023] Dual-scale frequency domain decoupling and preprocessing module: connected to the data generation and extraction module, used to physically decouple and separate the original data sample set in the frequency domain to establish high- and low-frequency dual-channel data, taking into account the large inertia response characteristics of the alkaline electrolyzer unit and the fast response characteristics of the proton exchange membrane electrolyzer unit; and to perform Z-Score normalization processing on the decoupled data;

[0024] Independent expert neural network group module: connected to the dual-scale frequency domain decoupling and preprocessing module, containing four completely decoupled independent expert neural network units, which are trained in parallel using preprocessed dual-channel data to establish nonlinear mapping matrices between bus input features and alkaline electrolyzer unit voltage, alkaline electrolyzer unit current, proton exchange membrane electrolyzer voltage, and proton exchange membrane electrolyzer current, respectively.

[0025] Physical prior constraints and reconstruction module: Located at the output end of the independent expert neural network group module, it is used to apply physical law constraints outside the network, calculate the actual physical power based on the predicted voltage and current of each individual unit, and dynamically deduce the equivalent feedback internal resistance of the hybrid system by combining the energy conservation equation.

[0026] Simulation In-situ Replacement and Execution Module: This module encapsulates the physical prior constraints and reconstruction module and the independent expert neural network group module into an independent functional module compatible with the Simulink environment, enabling in-situ replacement of high-fidelity mechanism models in long-cycle system-level simulations.

[0027] The dual-scale frequency domain decoupling and preprocessing module further includes:

[0028] Abnormal data cleaning unit: used to remove unreasonable non-physical extreme points and dead data frames from the original data sample set;

[0029] The high-frequency peak-shaving channel unit of the proton exchange membrane electrolyzer unit: adopts a moving average filter with a small time window to eliminate high-frequency switching noise of power electronics, while retaining the physical peak response to the second-level fluctuations of wind and solar power.

[0030] Low-frequency base charge channel unit of alkaline electrolyzer: A moving average filter with a large time window is used to characterize the physical hysteresis inertia caused by the heat capacity and bubble effect of the alkaline electrolyzer unit by utilizing the delay smoothing effect.

[0031] Normal distribution transformation unit: The Z-Score formula is used to eliminate the compression effect of extreme abrupt peaks on the dimensions of steady-state data.

[0032] The physical prior constraints and reconstruction module further includes a crash prevention subsystem to ensure the absolute stability of the closed-loop simulation:

[0033] Singularity protection unit: It has a minimum power threshold. When the calculated total physical power demand is lower than the threshold, the equivalent internal resistance of the feedback is forcibly assigned to the preset high impedance circuit breaking value to avoid division by zero calculation error.

[0034] Algebraic loop breaking unit: A discrete time delay element or a first-order low-pass filter element is rigidly connected in series on the signal path of the output equivalent feedback internal resistance to cut off the simulation dead loop divergence caused by pure algebraic mapping.

[0035] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) It solves the technical pain points of "rigid solution is extremely slow" in the mechanism model and "violation of energy conservation and algebraic loop divergence" in the pure black box data-driven model in the existing Simulink simulation, thereby realizing efficient and accurate simulation of ALK / PEM hybrid system; (2) It transforms the solution of complex partial differential equations into lightweight matrix multiplication and addition operations, while maintaining the extremely high fidelity of the hybrid electrolytic cell, it achieves an exponential increase in calculation speed, and innovatively solves the physical distortion and algebraic loop divergence problem of pure data-driven model; (3) It constructs a frequency domain decoupled dual-mode system based on the physical characteristics of the difference in response time scale between ALK and PEM. The channel preprocessing architecture applies a heavy moving average filter to the ALK base load characteristic data and a light filter to the PEM peak shaving characteristic data to adapt to the response characteristics of different electrolyzers; (4) A hybrid expert architecture consisting of four independent expert networks is adopted, which combines Z-Score normalization and Bayesian regularization algorithms to split the prediction target into independent physical quantity prediction tasks, thus avoiding gradient competition between different variables; (5) A fusion architecture of "black box prediction characteristics and white box constraint energy" is proposed. Power conservation and Faraday transformation law hard constraints are set outside the black box. Through the closed-loop architecture of power calculation and equivalent internal resistance back-reasoning, the underlying energy conservation is guaranteed, breaking the algebraic loop deadlock in Simulink. Attached Figure Description

[0036] Figure 1 This covers the entire lifecycle of the engineering application of the method of this invention;

[0037] Figure 2 This is a flowchart of the method of the present invention;

[0038] Figure 3 This is a schematic diagram of the dual-scale frequency domain decoupling data processing and channel partitioning of the present invention;

[0039] Figure 4 This is a schematic diagram of the four expert neural network topologies of the present invention;

[0040] Figure 5 This is a diagram of the reconfigurable agent model and closed-loop anti-crash control architecture of the present invention;

[0041] Figure 6 This is the traditional black-box model of the present invention without frequency domain decoupling and physical constraints;

[0042] Figure 7 This is the prediction curve of the physical prior surrogate model of this invention. Detailed Implementation

[0043] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0044] Example 1

[0045] like Figure 1 As shown, this embodiment provides a data-driven modeling method for hybrid electrolyzers based on frequency domain decoupling and physical prior constraints. This includes dual-scale frequency domain decoupling of data generated offline from the mechanistic model, constructing four completely independent expert neural networks, introducing hard constraints outside the proxy module, and encapsulating a real-time simulation module. The aim is to address the technical pain points in existing Simulink simulations, such as the extremely slow rigid solution of the mechanistic model and the violation of energy conservation and algebraic loop divergence caused by pure black-box data-driven models. This allows for efficient and accurate simulation of ALK / PEM hybrid systems. To handle various extreme conditions and boundary situations that may occur during data acquisition, network training, and system closed-loop simulation, rigorous error-proofing designs were implemented for each step. The specific implementation steps are as follows:

[0046] Because conducting destructive experiments covering the entire lifecycle and all operating conditions directly on a large-scale green electricity hydrogen production physics platform is extremely costly, this embodiment first constructs a high-fidelity mechanism model containing ALK and PEM units in a simulation environment (such as MATLAB / Simulink). Figure 2 As shown in the figure, this diagram macroscopically illustrates the closed-loop architecture of the present invention, clearly outlining the complete technical chain from offline simulation data extraction of the mechanistic model, dual-scale frequency domain feature decoupling preprocessing, independent parallel training of four expert networks, all the way to the final reconstruction of the physical information proxy model of the black box and white box and in-situ replacement simulation. Specifically, as follows:

[0047] S100, offline simulation data extraction:

[0048] S101. Setting Boundary Conditions and Excitation Signals: In order to ensure that the data-driven model does not diverge under any operating conditions, excitation signals containing extreme dynamic characteristics must be injected into the mechanism model. Specifically, this includes: (1) a step change signal of 0-100-0% load, used to capture the system's extremely fast transient response; (2) second-level high-frequency wind speed and photovoltaic power fluctuation curves extracted from real weather stations, used to simulate the randomness of wind and solar energy; (3) setting the environment and electrolytic cell operating temperature to dynamically change between 5℃ and 90℃.

[0049] S102, Offline Simulation and Data Acquisition: Using high precision (e.g.) The simulation step-size operation mechanism model is used to collect the system's input and output timing data. The input feature matrix includes the actual bus voltage ( ), actual current ( The output tag matrix includes the voltage of the internal ALK (); ), current ( ) and the voltage of PEM ( ), current ( The above data are packaged to form the original time series dataset. .

[0050] S200, dual-scale frequency domain decoupling of data and Z-Score normalization

[0051] Because hybrid systems contain both high-frequency features (PEM response time in milliseconds) and low-frequency features (ALK response time in seconds / minutes), direct training with these hybrid systems can lead to "gradient loss" in neural networks. This step involves physical preprocessing of the data:

[0052] S201. Cleaning up abnormal and dead data: Traversing the dataset The algorithm identifies and removes data frames containing NaN (not a number) and Inf (infinity); it also removes data that violates physical laws (such as...). or (Data rows). Preferably, it can be combined with The principle is to eliminate non-physical extreme points caused by sudden changes in the step size of the simulation solver.

[0053] S202, Dual-scale frequency domain decoupling: Constructing two completely independent data processing channels, combined with Figure 3 (A schematic diagram illustrating the principle and channel partitioning of dual-scale frequency domain decoupling data processing) shows the physical separation mechanism of the original input data. By applying moving average filters with different time windows, the system accurately separates the original signal containing complex frequency components into two independent channels:

[0054] Channel A (PEM Peak Shaving Channel): Designed for characterizing the fast response properties of PEM. Use a very small window (such as The moving average filter is used. Its mathematical expression is:

[0055]

[0056] The purpose of this step is to eliminate only the pure numerical noise caused by the high-frequency switching of the power electronic IGBT, but to retain 100% of its peak response characteristics to wind and solar fluctuations.

[0057] Channel B (ALK base charge channel): Designed for characterizing the large inertial properties of ALK. Use large windows (such as A heavy moving average filter is applied. Utilizing the delay smoothing effect of a large window, high-frequency jitter is forcibly filtered out at the data level, accurately simulating the physical hysteresis inertia caused by the large alkali heat capacity and bubble effect of ALK.

[0058] S203, Z-Score Normalization (mapstd): Since the start-up of an electrolytic cell is often accompanied by extremely high voltage spikes in the hundreds of volts, using conventional minimum-maximum normalization (Min-Max) would compress 99% of the steady-state data into an extremely narrow range. Therefore, this embodiment performs Z-Score normalization on all decoupled features and labels separately:

[0059]

[0060] In the formula, This represents the mean of the variable in the sample set. The standard deviation is 1. This forces the extremely skewed running data into a normal distribution with a mean of 0 and a variance of 1, providing the neural network with a perfect gradient descent space.

[0061] S300, building and training four types of expert networks (Mixture of Experts) with complete decoupling of all personnel, such as Figure 4 To avoid the situation where drastically fluctuating current variables compete for gradient resources from minutely fluctuating voltage variables in the same multi-output network, this embodiment abandons the traditional architecture. For example... Figure 4 The internal topology is clearly presented; this invention constructs four completely independent feedforward neural network models. The left side receives preprocessed data. , as well as , The signals are input in parallel to four independent network channels, each dedicated to predicting the core physical quantities in the hybrid system. This completely isolates the mutual interference between multiple output variables.

[0062] S301. Network Topology Design: All four expert networks adopt the same Multilayer Perceptron (MLP) architecture. The number of input layer nodes is 2 (each receiving the frequency-domain decoupled data). and To fully fit the complex electrochemical polarization surface, the hidden layer is configured as a two-layer broad structure, with an optimal number of nodes. The hidden layer activation function uses non-linear tansig (hyperbolic tangent) or ReLU; the output layer has 1 node and uses purelin (linear activation) as the activation function.

[0063] S302, Model Training (Two optional implementation methods are provided):

[0064] Approach 1: Bayesian regularization training based on the MATLAB ecosystem (suitable for integrated rapid deployment)

[0065] This study utilizes MATLAB's built-in Deep Learning / Neural Network Toolbox. Due to the widened network structure, which is prone to overfitting, the traditional Levenberg-Marquardt algorithm (trainlm) and early stopping mechanism were abandoned. Instead, a Bayesian regularization algorithm (trainbr) was fully adopted. This algorithm does not require a validation set, using 100% of the data for training. The maximum number of iterations was set to 3000-5000 epochs, and the upper limit of the Marquardt parameter was set to mu_max = 1e11. The algorithm leverages its built-in probability constraint to automatically decay the weights of ineffective neurons (Weight Decay), relentlessly pursuing the global optimum to ensure the predictive determination coefficients of each variable are optimal. All reached around 0.99.

[0066] Approach 2: Deep training and cross-platform embedding based on the Python ecosystem (PyTorch / TensorFlow) (suitable for massive data and GPU acceleration)

[0067] When the training data reaches tens of millions, the above four expert networks can be built using the PyTorch framework in a Python environment.

[0068] (1) Loss function optimization: In order to simulate the anti-overfitting effect of Bayesian regularization, the MSE (mean squared error) loss function is adopted in Python, and a very strong L2 regularization penalty term (weight_decay=1e-4) is forcibly added to the optimizer (such as Adam or LBFGS).

[0069] (2) Learning rate scheduling: Cosine annealing or ReduceLROnPlateau learning rate decay strategy is adopted to help the model escape local saddle points in the later stage.

[0070] (3) Cross-platform embedding in Simulink: After training convergence, the PyTorch model is exported as a cross-platform universal ONNX format (.onnx file). On the MATLAB / Simulink side, the importONNXNetwork function in the Deep Learning Toolbox is used to parse the Python-trained model into a MATLAB object, or the ONNX model is loaded directly by calling the "Predict" module in the Simulink library, so as to achieve seamless integration between Python computing power and Simulink dynamic simulation.

[0071] S400, Proxy Model Reconstruction and Encapsulation Based on Physical Prior Knowledge (Physics-Informed Deployment)

[0072] Extract the weight matrices (or ONNX models) from the converged training results of the four expert networks mentioned above, and encapsulate them into a Simulink module that can be directly called (such as a MATLAB Function script or a Deep Learning Predict module). Figure 5 As shown, the complete simulation closed loop details the signal flow and physical hard constraint mechanism inside the proxy model: including the wind source input and dual-channel layering at the top, the prediction of the four expert networks and the white box power reconstruction in the middle, and the equivalent internal resistance physical backward deduction module in the core on the right.

[0073] S401, Real-time decoupling of input and boundary limiting protection:

[0074] Real-time reception of bus feedback A fast moving average is performed within the module to obtain... ; Use four expert networks to obtain predicted values.

[0075] Boundary protection mechanism: To prevent the neural network from outputting negative results that violate physical common sense under extreme and unseen conditions, a mathematical limiting function is connected in series at the network output.

[0076]

[0077] S402, White Box Physical Power Reconstruction (Anti-Energy Distortion Constraint):

[0078] The traditional approach of having neural networks directly predict the system's macroscopic energy is abandoned. Instead, the actual power consumption of the electrolyzer is calculated strictly according to the laws of physics.

[0079]

[0080] Introducing the conversion efficiency of the front-end DC-DC power electronic converter (e.g., 0.95), calculate the total physical power required for the bus:

[0081]

[0082] S403, Equivalent Internal Resistance Physical Back-Depth Deduction and Algebraic Loop Breaking (Core Anti-Collapse Mechanism):

[0083] The network does not directly output the equivalent internal resistance. Instead, it is derived by working backward from the power equation:

[0084]

[0085] (1) Singularity (division by zero) protection mechanism: In the event of a sudden drop in wind and solar power causing system shutdown, If the result approaches 0, direct division will cause the Simulink solver to report an Inf error. Therefore, a conditional check is added: when... At that time, a mandatory order (or preset maximum value), indicating that the circuit is in a high blocking state.

[0086] (2) Algebraic Loop Breaking Mechanism: In the output Before reaching the simulation bus, a discrete time delay module (Delay / Memory, with transfer function ) is forcibly connected in series. ) or a first-order inertial element with a very small time constant (such as This completely breaks the time-delayed loop of "voltage V instantaneously determines resistance R → resistance R instantaneously changes the bus current → current I instantaneously reacts to voltage V," giving the closed-loop control system absolute numerical stability and ensuring the final output... .

[0087] S404, Faraday's Law: Hydrogen Production Reconstruction

[0088] Hydrogen production is not predicted using neural networks. The high accuracy of network predictions is achieved. and It is directly input into the internally fixed Faraday law equation:

[0089]

[0090] In the formula, The number of cells in series It is Faraday's constant. Let be the molar mass of hydrogen. Based on this, the dynamic specific energy consumption (SEC) of the system is calculated synchronously.

[0091] The data-driven module constructed in this invention can directly replace the original mechanism model in situ in the green electricity hydrogen production microgrid. Through the triple protection of black box fitting characteristics, white box forced constraints, and boundary logic error prevention, the energy conservation and simulation convergence are guaranteed under any extreme fluctuation operating environment while the computing speed is greatly improved (the simulation time throughout the year is reduced to the second level).

[0092] The comparative verification and effect analysis are as follows:

[0093] To verify the superiority of the present invention (Physics-Informed expert network) over traditional mechanistic models and ordinary black-box models (single hybrid neural networks), a detailed simulation data comparison was conducted.

[0094] (1) Comparison and analysis of fitting accuracy (R² and RMSE):

[0095] like Figure 6 As shown in the ordinary black-box model without frequency domain decoupling and splitting, a severe "gradient grabbing" consequence can be intuitively observed; because the network focuses on fitting drastically fluctuating signals, it completely loses the ability to capture the core, minute voltage characteristics. (Bus voltage) Predictive Determination Coefficient It fell to -0.0563, internally. and The predictions even showed serious divergence distortion. The values ​​are only -54.3800 and -198.3920 respectively. The fitted red dashed line in the figure deviates greatly and irregularly from the actual light blue mechanistic model curve, proving that the conventional black box model faces complete failure in complex rigid systems.

[0096] In contrast, such as Figure 7 As shown, by adopting the frequency domain decoupling, four expert networks, Bayesian regularization, and Z-Score normalization architecture proposed in this invention, the prediction accuracy of the four key indicators has achieved a qualitative leap:

[0097] from Figure 7 As clearly seen, the red dashed line representing the surrogate model and the light blue solid line representing the mechanistic model almost perfectly overlap. (Busline level) and of Up to 0.9978 and 0.9967; Internal core parameters and of They even reached extremely high values ​​of 0.9978 and 0.9992. Even in... Figure 7 The PEM peaking condition at the bottom experienced a severe high-frequency oscillation, yet the model maintained an extremely high tracking accuracy of 0.9954, strongly demonstrating the extremely high fidelity of this invention across the entire frequency band.

[0098] (2) Analysis of energy conservation characteristics:

[0099] Extracting the step size data from a specific simulation, the mechanistic model (reference) outputs the total system power. .

[0100] If a standard black-box model is used to directly predict the system's internal resistance R, the small fitting error will be amplified by the system, causing a sudden change in the input power after the feedback loop. This produced near The non-physical energy increment is severely distorted.

[0101] By employing the physical prior constraint architecture of this invention, utilizing... Calculate and reverse-engineer based on external constraints Subsequently, the output power curve of the data-driven model and the mechanism model achieved 100% close fit, with the absolute error approaching zero.

[0102] (3) Calculate the resource saving effect:

[0103] Traditional mechanistic models suffer from extremely high computational costs when dealing with rigid equation sets in hybrid systems, especially in single-step simulations. By replacing the core mechanistic module with the pure algebraic matrix multiply-accumulate network of this invention, the step size limitation of the Simulink solver is completely eliminated. Under a long-term green electricity fluctuation condition input of 8760 hours per year, the total simulation time is drastically reduced from 4.5 hours, significantly improving computational efficiency, and no algebraic loop deadlocks or solution crashes occur throughout the process.

[0104] Example 2

[0105] This embodiment provides a data-driven modeling system for hybrid electrolyzers based on frequency domain decoupling and physical prior constraints, corresponding to the method described above. This system solves the computational bottleneck in long-period energy flow simulation. The specific module structure and its interaction logic are as follows:

[0106] (1) Data generation and extraction module

[0107] Components: Full-condition excitation signal generator, high-fidelity mechanism model runner, and time-series feature acquisition unit.

[0108] Purpose and Interaction: This module is the system's fundamental data source. The excitation generator simulates the injection mechanism model of real extreme wind and solar fluctuations, while the data acquisition unit is responsible for processing the massive amounts of rigid solution results generated by the simulation (including busbars). and internal parameters The data is written to disk as a time series matrix and then transmitted to the next-level preprocessing module.

[0109] (2) Dual-scale frequency domain decoupling and preprocessing module

[0110] Components: Dead data cleaning filter, dual-channel signal divider (including small window sliding filter and large window sliding filter), feature space converter (Z-Score).

[0111] Applications and Interactions: After receiving raw data, the signal is split at the physical level. The high-frequency PEM channel filters out PWM glitches to preserve responsiveness, while the low-frequency ALK channel is heavily smoothed to forcefully inject "thermal inertia physical priors." Subsequently, the converter eliminates dimensional compression caused by voltage spikes, providing gradient descent space for the downstream neural network.

[0112] (3) Independent Expert Neural Network Group Module

[0113] Components: Four structurally decoupled multilayer perceptron (MLP) prediction channels.

[0114] Applications and Interactions: This is the system's "black box fitting engine." To prevent variables with different volatility rates from competing for computational resources, four expert networks operate independently, each receiving its corresponding frequency domain features and performing limit fitting using a Bayesian regularization algorithm. They only output pure voltage and current values ​​and do not involve any macroscopic energy prediction.

[0115] (4) Physical Prior Constraints and Reconstruction Module

[0116] Real-time power restoration unit: Receives microscopic electrical quantities output by four expert networks, and based on... Reproduce the true physical power of the system.

[0117] Equivalent internal resistance physical reverse calculation unit: Calculate the total power demand by combining the front-end DC-DC efficiency. And using the formula

[0118] The core principle of dynamically calculating the equivalent internal resistance of the current electrolytic cell cluster to ensure 100% energy conservation at the bottom layer is as follows:

[0119]

[0120] (5) Closed-loop anti-crash interception unit

[0121] This unit serves as the last line of defense for the system output. When a sudden drop in wind and solar power is detected, causing the system to operate at extremely low power, the "singularity protection" (with a maximum impedance) is triggered; before the impedance signal is fed back to the bus, the "algebraic loop breaker" (delay module)... This eliminates the time-difference-free infinite loop in the simulator, giving the closed-loop system absolute numerical stability.

[0122] (6) Faraday's Law Hydrogen Production Calculation Unit

[0123] The parallel bypass receives the predicted current and uses the fixed Faraday constant equation to calculate the real-time hydrogen production rate and specific energy consumption, ensuring the conservation of matter.

[0124] In summary, this invention has achieved significant breakthroughs in model lightweighting, physical conservation, closed-loop robustness, and computational speed, providing a highly adaptable and practical digital twin modeling scheme for large-scale planning and control algorithm iteration of industrial-grade green electricity hydrogen production systems.

Claims

1. A data-driven modeling method for hybrid electrolyzers, characterized in that, include: (1) Data generation and extraction: A simulation platform for green electricity hydrogen production system and a high-fidelity hybrid electrolyzer mechanism model coupled with alkaline and proton exchange membrane electrolyzer units were constructed. Dynamic input power signals were injected for offline simulation and the original time series dataset was extracted. (2) Dual-scale frequency domain decoupling and normalization preprocessing: Based on the response characteristics of alkaline and proton exchange membrane electrolyzer units, the original dataset is decoupled and separated in the frequency domain to establish high and low frequency dual-channel data, and Z-Score normalization preprocessing is performed; (3) Training of independent expert neural network group: Construct an expert neural network group, perform parallel training on the preprocessed dataset, and establish a nonlinear mapping matrix between the bus input features and the output of each electrolytic cell unit; (4) Proxy model reconstruction: Apply physical law constraints to the output of the expert neural network group, use the voltage and current predicted by the network to calculate the power, and combine energy conservation to back-calculate the equivalent feedback internal resistance of the system to construct a physical information proxy model; (5) Module encapsulation and in-situ replacement simulation: The physical information proxy model with the required accuracy is encapsulated as a Simulink compatible module and replaced in-situ in the high-fidelity hybrid electrolyzer mechanism model in long-cycle system-level simulation.

2. The data-driven modeling method for hybrid electrolyzers according to claim 1, characterized in that, In step (1), the green electricity hydrogen production system simulation platform includes wind turbine, photovoltaic array, energy storage equipment and high-fidelity hybrid electrolyzer mechanism model; the dynamic input power signal includes full-condition step response test signal and second-level and minute-level wind and solar power fluctuation curves extracted from real meteorological historical data.

3. The data-driven modeling method for hybrid electrolyzers according to claim 1, characterized in that, In step (2), the specific steps of the dual-scale frequency domain decoupling and normalization preprocessing include: (21) Outlier removal: Clean up non-numerical, infinite values ​​and data frames with unreasonable physical boundaries in the original dataset; (22) Peak-shaving channel filtering of proton exchange membrane electrolyzer unit: The bus and voltage and current data of the proton exchange membrane electrolyzer unit, which characterize the fast response characteristics of the proton exchange membrane electrolyzer unit, are filtered by moving average with a small time window to remove high-frequency switching noise while retaining the peak response characteristics of wind and solar second-level fluctuations. (23) Base load channel filtering of alkaline electrolyzer unit: The voltage and current data of the bus and the unit, which characterize the slow response characteristics of the alkaline electrolyzer unit, are filtered by moving average with a large time window to characterize the physical hysteresis inertia caused by the heat capacity of alkaline solution and bubble effect of alkaline electrolyzer unit. (24) Z-Score standardization: The mean-variance normalization formula is used to convert the feature set and label set of the decoupled dual channels into a normal distribution.

4. The data-driven modeling method for hybrid electrolyzers according to claim 1, characterized in that, In step (3), the training of the independent expert neural network group adopts the following strategy: four independent feedforward neural networks are constructed to predict voltage and current respectively; the input layer of each independent expert neural network is decoupled from the corresponding frequency domain bus voltage and bus current; Bayesian regularization algorithm is used for training, and no validation set is divided to maximize the use of training data; by increasing the upper limit of the Marquardt parameter and combining it with the weight decay mechanism, the weights of neurons with fitting noise are suppressed, and the global optimal solution of the nonlinear polarization curve is approximated in the long-period iteration process.

5. The hybrid electrolyzer data-driven modeling method according to claim 1, characterized in that, In step (4), the core of the proxy model reconstruction lies in using algebraic hard constraints to ensure 100% energy conservation, including real-time power restoration and physical deduction of equivalent internal resistance. The real-time power restoration is based on the accurate individual voltage and current output by the four expert neural networks, and calculates the actual power consumption of each electrolytic cell according to physical laws. The physical deduction of equivalent internal resistance is combined with the conversion efficiency of the front-end DC-DC power electronic converter to find the total physical power required for the bus, and then dynamically deduces the equivalent internal resistance of the current system, which is fed back to the system power supply as a closed-loop control signal.

6. The data-driven modeling method for hybrid electrolyzers according to claim 5, characterized in that, The equivalent internal resistance physical reverse calculation process also includes singularity point collapse prevention and algebraic loop deadlock prevention mechanisms. The singularity point collapse prevention mechanism sets a power minimum threshold. When the system is in the start-up / shutdown phase or the wind and solar input is extremely small, causing the calculated total physical power demand on the bus to be lower than the threshold, the division-to-zero protection is triggered, and the power is forcibly assigned to the preset maximum impedance value. The algebraic loop deadlock prevention mechanism forcibly inserts a time delay element at the output equivalent feedback internal resistance interface. This delay element is used to cut off the time-difference dead loop in which voltage determines resistance, resistance instantaneously determines current, and current again determines voltage.

7. The data-driven modeling method for hybrid electrolyzers according to claim 1, characterized in that, In step (4), the surrogate model reconstruction also includes the Faraday law hydrogen production reconstruction step: instead of using neural networks to predict the amount of hydrogen produced, the high-precision alkaline electrolyzer unit current and proton exchange membrane electrolyzer unit current predicted by the expert neural network are directly input into the solidified Faraday electrolysis law mechanism equation, and the real-time hydrogen production rate and specific energy consumption of the system are accurately calculated by combining the number of electrolyzer series sections and the Faraday constant.

8. A data-driven modeling system for hybrid electrolyzers, characterized in that, include: Data generation and extraction module: Construct a high-fidelity hybrid electrolyzer mechanism model including alkaline electrolyzer unit and proton exchange membrane electrolyzer unit, perform offline simulation by injecting dynamic input power signal, and extract time series raw data sample set including actual bus voltage, actual bus current, and operating voltage and current of each internal unit; Dual-scale frequency domain decoupling and preprocessing module: connected to the data generation and extraction module, used to physically decouple and separate the original data sample set in the frequency domain to establish high- and low-frequency dual-channel data, taking into account the large inertia response characteristics of the alkaline electrolyzer unit and the fast response characteristics of the proton exchange membrane electrolyzer unit; and to perform Z-Score normalization processing on the decoupled data; Independent expert neural network group module: connected to the dual-scale frequency domain decoupling and preprocessing module, containing four completely decoupled independent expert neural network units, which are trained in parallel using preprocessed dual-channel data to establish nonlinear mapping matrices between bus input features and alkaline electrolyzer unit voltage, alkaline electrolyzer unit current, proton exchange membrane electrolyzer voltage, and proton exchange membrane electrolyzer current, respectively. Physical prior constraints and reconstruction module: Located at the output end of the independent expert neural network group module, it is used to apply physical law constraints outside the network, calculate the actual physical power based on the predicted voltage and current of each individual unit, and dynamically deduce the equivalent feedback internal resistance of the hybrid system by combining the energy conservation equation. Simulation In-situ Replacement and Execution Module: This module encapsulates the physical prior constraints and reconstruction module and the independent expert neural network group module into an independent functional module compatible with the Simulink environment, enabling in-situ replacement of high-fidelity mechanism models in long-cycle system-level simulations.

9. The hybrid electrolyzer data-driven modeling system according to claim 8, characterized in that, The dual-scale frequency domain decoupling and preprocessing module further includes: Abnormal data cleaning unit: used to remove unreasonable non-physical extreme points and dead data frames from the original data sample set; The high-frequency peak-shaving channel unit of the proton exchange membrane electrolyzer unit: adopts a moving average filter with a small time window to eliminate high-frequency switching noise of power electronics, while retaining the physical peak response to the second-level fluctuations of wind and solar power. Low-frequency base charge channel unit of alkaline electrolyzer: A moving average filter with a large time window is used to characterize the physical hysteresis inertia caused by the heat capacity and bubble effect of the alkaline electrolyzer unit by utilizing the delay smoothing effect. Normal distribution transformation unit: The Z-Score formula is used to eliminate the compression effect of extreme abrupt peaks on the dimensions of steady-state data.

10. The hybrid electrolyzer data-driven modeling system according to claim 8, characterized in that, The physical prior constraints and reconstruction module further includes a crash prevention subsystem: Singularity protection unit: It has a minimum power threshold. When the calculated total physical power demand is lower than the threshold, the equivalent internal resistance of the feedback is forcibly assigned to the preset high impedance circuit breaking value. Algebraic loop breaking unit: A discrete time delay element or a first-order low-pass filter element is rigidly connected in series on the signal path of the output equivalent feedback internal resistance.

Citation Information

Patent Citations

  • Method and device for establishing electrolytic cell model in water electrolysis hydrogen production system

    CN114880941A

  • Modeling method, system, medium and equipment for unified operation model of mixed electrolytic cell

    CN121302706A