A method for predicting hydrogen mass flow rate of hydrogen valve

By applying a combined model of convolutional neural network and gray wolf optimization algorithm on hydrogen valves, the problem of low flow prediction accuracy of hydrogen valves in hydrogen medium is solved, and high-precision hydrogen mass flow prediction is achieved.

CN118822348BActive Publication Date: 2025-04-04DIFFRACTION MASCH TECH RES (DALIAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410826037.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-04-04
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the flow rate of hydrogen valves under hydrogen medium, especially under different temperature and pressure conditions, resulting in low measurement accuracy.

Method used

A neural network model, especially a convolutional neural network (CNN), combined with the Gray Wolf Optimization Algorithm (GWO), is used to establish a model for predicting the mass flow of hydrogen through data acquisition and normalization under air media.

Benefits of technology

High-precision prediction of hydrogen valve flow was achieved, and the relative error was maintained within 0.0035%, with MAE and RMSE being 6.988×10-9 and 9.948×10-9 respectively, which significantly improved the measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118822348B_ABST
    Figure CN118822348B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for predicting the hydrogen mass flow of a hydrogen valve, and belongs to the technical field of hydrogen valve flow prediction. The technical key points are that, according to the set inlet pressure, outlet pressure, temperature, and hydrogen valve angle, the air mass flow is collected to estimate the hydrogen mass flow under the set conditions. A convolutional neural network (CNN) model is established to extract local information of the above features. In view of the problem that the model parameters are difficult to determine, the Grey Wolf Optimization Algorithm (GWO) is introduced to optimize the CNN model hyperparameters, and a GWO‑CNN model is built to map the nonlinear relationship between the air mass flow characteristic information and the hydrogen mass flow. By establishing the above estimation model, the problems of high hydrogen cost and difficulty in measuring valve flow can be effectively solved, and the estimation accuracy of hydrogen valve flow can be effectively improved, and the cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of hydrogen valve flow prediction, and in particular to a method for predicting the hydrogen mass flow of a hydrogen valve. Background Art

[0002] In recent years, with the continuous development of power technology, hydrogen has shined in the transportation field with its advantages of "zero pollution and zero emissions". As the global demand for clean energy grows, hydrogen energy, as an efficient, clean and renewable energy form, is gradually becoming a key factor in promoting industrial transformation. Hydrogen energy can not only serve as an energy substitute to reduce dependence on traditional fossil energy, but also promote the optimization and upgrading of energy structure and promote the development of the industry in a greener, low-carbon and efficient direction.

[0003] For its hydrogen flow valve, improving the measurement accuracy of hydrogen flow has always been its key focus. In the prior art, when measuring hydrogen flow, a direct measurement method is used. That is, during the initial calibration, hydrogen is directly introduced to obtain the hydrogen mass flow under different conditions (inlet pressure, outlet pressure, temperature, valve opening) for initial calibration.

[0004] The above process has the following shortcomings: Since a large amount of hydrogen is used in the calibration of valves, it is impossible to calibrate every valve before it leaves the factory. That is, a certain number of valves are sampled from a batch of valves leaving the factory for calibration. During the production process of valves, there must be a certain degree of discreteness in the size between different products, resulting in the calibration result not being completely consistent with the actual valve result.

[0005] Since air is less expensive, if air can be used instead of hydrogen to calibrate hydrogen valves, in this case the manufacturing company can calibrate each hydrogen valve leaving the factory, which can greatly improve the factory measurement accuracy of the hydrogen valves.

[0006] However, hydrogen flow and air flow do not belong to the same air medium after all, and their air performance at different temperatures and pressures is different.

[0007] In summary, based on the results of measuring the hydrogen valve flow rate under air medium, how to use the results to predict the flow rate of the hydrogen valve flow rate under hydrogen medium becomes a difficult problem. Summary of the invention

[0008] The object of the present invention is to provide a method for predicting the hydrogen mass flow rate of a hydrogen valve in view of the above-mentioned deficiencies in the prior art.

[0009] A method for predicting the mass flow rate of hydrogen in a hydrogen valve comprises the following steps:

[0010] Step a, obtain known conditions: V进口气压j , V 出口气压j , T j , β j , X j ; Among them, V 进口气压j , V 出口气压j , T j , β j , X j Indicates the valve inlet pressure, valve outlet pressure, gas temperature, valve opening, and air mass flow rate when air medium is passed through;

[0011] Step b, V 进口气压j , V 出口气压j , T j , β j , X j Normalized to get V 进口气压j-归一 , V 出口气压j-归一 , T j-归一 , β j-归一 , X j-归一 ;

[0012] Step c, V 进口气压j-归一 , V 出口气压j-归一 , T j-归一 , β j-归一 , X j-归一 Input into the trained neural network, the neural network outputs the result Y j-归一 ;

[0013] Step d, Y obtained in step c j-归一 Convert to Y j ;

[0014] Among them, Y j Indicates that the valve inlet pressure when hydrogen medium is introduced is V 进口气压j , the valve outlet pressure is V 出口气压j , gas temperature is T j , valve opening is β j The hydrogen mass flow rate at .

[0015] A method for predicting the mass flow rate of hydrogen gas in a hydrogen valve comprises the following steps:

[0016] Step a, obtaining a data set of a hydrogen valve measured under air medium;

[0017] The data set is: (V 进口气压1 , V 出口气压1 , T1, β1, X1), (V 进口气压2 , V 出口气压2 , T2, β2, X2)……(V 进口气压i , V 出口气压i , T i, β i , X i )……(V 进口气压n , V 出口气压n , T n , β n , X n );

[0018] Among them, V 进口气压i 、V 出口气压 , T i , β i , X i The valve inlet pressure, valve outlet pressure, gas temperature, valve opening, and air mass flow rate of the i-th group of air mass flow test results;

[0019] Where n represents the total number of air mass flow tests included in the data set;

[0020] Step b, normalizing the data set obtained in step a;

[0021] Step c: Input the normalized data set obtained in step b into the neural network. The neural network outputs: Y 1-归一 , Y 2-归一 ...Y i-归一 ...Y n-归一 ;

[0022] Step d, Y obtained in step c 1-归一 , Y 2-归一 ...Y i-归一 ...Y n-归一 Converted to Y1, Y2, ... Y i ...Y n ;

[0023] Among them, Y i Indicates that the inlet pressure of the valve is V 进口气压i , the valve outlet pressure is V 出口气压i , gas temperature is T i , valve opening is β i The hydrogen mass flow rate at .

[0024] Furthermore, the neural network is a convolutional neural network, comprising: an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer;

[0025] The input layer, convolution layer, pooling layer, fully connected layer, and output layer are connected in sequence;

[0026] The convolution layer is used for feature extraction, and the convolution layer uses 50 convolution kernels; the convolution kernel is a 1×3 matrix;

[0027] The pooling layer is used to further extract feature data, and the convolution kernel of the pooling layer is a 1×2 matrix;.

[0028] Furthermore, the method for determining the parameters of the neural network comprises the following steps:

[0029] S100, data collection;

[0030] S200, dividing the data set obtained in S100 into a training set and a test set;

[0031] S300, normalizing the data of S100;

[0032] S400, initializing the convolutional neural network parameters;

[0033] S500, using the GWO model to optimize the convolutional neural network parameters;

[0034] S600: Train the convolutional neural network model and test the model using the test set data.

[0035] Further, S100, data collection includes: setting the value ranges of the inlet pressure, outlet pressure, temperature, and valve angle of the hydrogen valve to [5 bar, 10 bar], [10 bar, 20 bar], [5° C., 20° C.], and [0 deg, 360 deg] respectively;

[0036] At different inlet pressures, outlet pressures and temperatures, the mass flow rates of air and hydrogen are collected by changing the valve angle to obtain several sets of data: (V 进口气压1 , V 出口气压1 , T1, β1, X1, Z1), (V 进口气压2 , V 出口气压2 , T2, β2, X2, Z2)……(V 进口气压i , V 出口气压i , T i , β i , X i , Z i )……(V 进口气压n , V 出口气压n , T n , β n , X n , Z m ), where V 进口气压i 、V 出口气压 , T i , β i , X i , Z i They respectively represent the inlet pressure of the valve of the i-th group, the outlet pressure of the valve, the gas temperature, the valve opening, the measured air mass flow rate, and the measured hydrogen mass flow rate.

[0037] Further, S200, data division includes: setting the valve opening angle as the basis for dividing the model training set and the test set, dividing 0deg to 251deg as the training set to train the model, and 252deg to 360deg as the test set.

[0038] Further, S300, data normalization processing is performed to obtain the following data set: (V 进口气压1-归一 , V 出口气压1-归一 , T 1-归一 , β 1-归一 , X 1-归一 , Z 1-归一 )、(V 进口气压2-归一 , V 出口气压2-归一 , T 2-归一 , β 2-归一 , X 2-归一 , Z 2-归一 )……(V 进口气压i-归一 , V 出口气压i-归一 , T i-归一 , β i-归一 , X i-归一 , Z i-归一 )……(V 进口气压m-归一 , V 出口气压m-归一 , T m-归一 , β m-归一 , X m-归一 , Z m-归一 );

[0039] The normalization method for inlet pressure is:

[0040] V 进口气压i-归一 =(V 进口气压i -5) / (10-5)

[0041] The normalization method of outlet pressure is:

[0042] V 出口气压i-归一 =(V 出口气压i -10) / (20-10)

[0043] The temperature is normalized to:

[0044] T i-归一 =(T i -5) / (20-5)

[0045] The normalization of the valve angle is:

[0046] β i-归一 =β i / 360

[0047] The normalization of air mass flow is:

[0048] Xi-归一 =X i / S

[0049] The normalization of hydrogen mass flow rate is:

[0050] Z i-归一 =Z i / S

[0051] Where S is the maximum value of the hydrogen valve range and is a known value.

[0052] Further, step S500 includes the following steps:

[0053] S501, Grey Wolf optimization algorithm parameter setting;

[0054] S502, model hyperparameter selection: after completing the initialization of the gray wolf optimization algorithm parameters, the gray wolf optimization algorithm is used to implement population iterative update optimization of the neural network model parameters;

[0055] S503, model training: Obtain parameters from S502 to establish a neural network model, input the training set into the neural network model, and learn the network weights and bias parameters through the gradient descent algorithm and iteration of the training set until the maximum number of training iterations is reached;

[0056] S504, model parameter selection and evaluation: when the model training is completed, the validation set is input into the trained model to output the capacity prediction value, and the fitness value is calculated between the prediction value and the true value; steps S502 to S504 are repeated to calculate the fitness value of each population until the gray wolf optimization algorithm reaches the maximum number of iterations.

[0057] Furthermore, the convolutional neural network training method adopted includes the following steps:

[0058] S100, Data Collection

[0059] Set the value ranges of the hydrogen valve's inlet pressure, outlet pressure, temperature, and valve angle to [5bar, 10bar], [10bar, 20bar], [5℃, 20℃], and [0deg, 360deg] respectively;

[0060] At different inlet pressures, outlet pressures, and temperatures, the mass flow rates of air and hydrogen were collected by changing the valve angle, and several sets of data were obtained:

[0061] (V 进口气压1 , V 出口气压1 , T1, β1, X1, Z1), (V 进口气压2 , V 出口气压2 , T2, β2, X2, Z2)……(V 进口气压i , V 出口气压i, T i , β i , X i , Z i )……(V 进口气压n , V 出口气压n , T n , β n , X n , Z m );

[0062] Among them, V 进口气压i 、V 出口气压 , T i , β i , X i , Z i They represent the inlet pressure of the valve of the i-th group, the outlet pressure of the valve, the gas temperature, the valve opening, the measured air mass flow rate, and the measured hydrogen mass flow rate respectively;

[0063] S200, data division: setting the valve opening angle as the basis for dividing the model training set and the test set, dividing 0deg to 251deg as the training set to train the model, and 252deg to 360deg as the test set;

[0064] S300, data normalization processing:

[0065] In order to ensure that the data is limited to the same range and avoid gradient deviation caused by features in different value ranges, which affects the efficiency of model training, the Max-min normalization method is used, and the resulting data set is:

[0066] (V 进口气压1-归一 , V 出口气压1-归一 , T 1-归一 , β 1-归一 , X 1-归一 , Z 1-归一 )、(V 进口气压2-归一 , V 出口气压2-归一 , T 2-归一 , β 2-归一 , X 2-归一 , Z 2-归一 )……(V 进口气压i-归一 , V 出口气压i-归一 , T i-归一 , β i-归一 , X i-归一 , Z i-归一 )……(V 进口气压m-归一 , V 出口气压m-归一 , T m-归一 , β m-归一 , X m-归一 , Z m-归一 );

[0067] The normalization method for inlet pressure is:

[0068] V 进口气压i-归一 =(V 进口气压i -5) / (10-5)

[0069] The normalization method of outlet pressure is:

[0070] V 出口气压i-归一 =(V 出口气压i -10) / (20-10)

[0071] The temperature is normalized to:

[0072] T i-归一 =(T i -5) / (20-5)

[0073] The normalization of the valve angle is:

[0074] β i-归一 =β i / 360

[0075] The normalization of air mass flow is:

[0076] X i-归一 =X i / S

[0077] The normalization of hydrogen mass flow rate is:

[0078] Z i-归一 =Z i / S

[0079] Where S is the maximum value of the hydrogen valve range, which is a known value;

[0080] S400, convolutional neural network parameter initialization;

[0081] S500, using the GWO model to optimize the convolutional neural network parameters;

[0082] S501, initializing the population;

[0083] S502, initialization parameters: set the number of gray wolves N to 30, the maximum number of iterations t max is 30, the dimension is 3, and the lower bounds of each parameter are [10 -4 , 10, 16], the upper bound of the parameter [10 -3 , 80, 64], the iteration number t is 1;

[0084] S503, calculate the fitness value of the individual:

[0085] The fitness function is:

[0086] The root mean square error (RMSM) between the true hydrogen mass flow rate values ​​and the estimated hydrogen mass flow rate values ​​of the test set is used to establish:

[0087]

[0088] Where: m represents the total number of samples collected; V real (i) represents the true value of the hydrogen mass flow rate collected for the i-th time; V ext (i) Represents and V real (i) The corresponding estimated value of hydrogen mass flow rate;

[0089] S504, obtain three optimal solutions, namely Alpha Wolf X α 、Beta Wolf X β 、Gamma Wolf X γ Convolutional neural network parameters corresponding to individuals in the three populations;

[0090] S505, if t is less than t max , repeat steps S5051-S5054; otherwise, execute step S600;

[0091] S5051, update GW0 parameters and convolutional neural network model parameters;

[0092] S5052, calculate the fitness value of the individual;

[0093] S5053, obtain three optimal solutions X α , X β , X γ ;

[0094] S5054, t is assigned the value of t+1;

[0095] S600, train the convolutional neural network model and test the model using the test set data.

[0096] Compared with the prior art, the above technical solution has the following advantages:

[0097] First, the basic concept of this application: the traditional hydrogen valve flow test method uses hydrogen for measurement, which is costly. Therefore, air is used to lift hydrogen for testing. Then the measurement results of the air medium are converted into the measurement results of the hydrogen medium. That is, according to the set inlet pressure, outlet pressure, temperature, and hydrogen valve angle, the air mass flow rate is collected to estimate the hydrogen mass flow rate under the set conditions.

[0098] Second, the key point of the present invention is the hydrogen valve mass flow estimation method based on the GWO-CNN model. According to the set inlet pressure, outlet pressure, temperature, and hydrogen valve angle, the air mass flow is collected to estimate the hydrogen mass flow under the set conditions. A convolutional neural network (CNN) model is established to extract local information from the above characteristics. In view of the difficulty in determining the model parameters, the Grey Wolf Optimization Algorithm (GWO) is introduced to optimize the CNN model hyperparameters, and a GWO-CNN model is built to map the nonlinear relationship between the air mass flow characteristic information and the hydrogen mass flow. By establishing the above estimation model, the problems of high hydrogen cost and difficult valve flow measurement can be effectively solved. The estimation accuracy is high, and the relative error is kept within 0.0035%. The MAE (mean absolute error) and RMSE (root mean square error) are 6.988×10 -9 ,9.948×10 -9 , the model has good prediction accuracy and prediction robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0099] The present invention will be further described in detail below in conjunction with the embodiments in the accompanying drawings, but this does not constitute any limitation to the present invention.

[0100] Figure 1 This is a nonlinear relationship diagram of the mass flow rate of air and hydrogen at different valve openings.

[0101] Figure 2 This is a structural diagram of the convolutional neural network model of this application.

[0102] Figure 3 A flow chart of a method for determining parameters of a convolutional neural network model of the present application.

[0103] Figure 4 This is a diagram of the hydrogen neural network flow estimation results of the present invention.

[0104] Figure 5 This is a relative error diagram of hydrogen flow estimation according to the present invention. DETAILED DESCRIPTION

[0105] The present invention will now be described in further detail with reference to the accompanying drawings.

[0106] [1. Basic concept and technical solution]

[0107] Due to the high cost of hydrogen, it cannot be applied to the flow calibration of every hydrogen valve. To solve this problem, the basic concept of this application is:

[0108] A method for predicting the mass flow rate of hydrogen gas in a hydrogen valve comprises the following steps:

[0109] Step a, obtaining a data set of a hydrogen valve measured under air medium;

[0110] The data set is: (V 进口气压1 , V 出口气压1 , T1, β1, X1), (V 进口气压2 , V 出口气压2 , T2, β2, X2)……(V 进口气压i , V 出口气压i , T i , β i , X i )……(V 进口气压n , V 出口气压n , T n , β n , X n );

[0111] Among them, V 进口气压i 、V 出口气压 , T i , β i , X i The valve inlet pressure, valve outlet pressure, gas temperature, valve opening, and air mass flow rate of the i-th group of air mass flow test results;

[0112] Where n represents the total number of air mass flow tests included in the data set;

[0113] Step b: Input the data set obtained in step a into the neural network, and the neural network outputs: Y1, Y2...Y i ...Y n ; Among them, Y i Indicates that the inlet pressure of the valve is V 进口气压i , the valve outlet pressure is V 出口气压i , gas temperature is T i , valve opening is β i The hydrogen mass flow rate at .

[0114] The hydrogen valve is calibrated using the above method.

[0115] [2. Difficulties in R&D]

[0116] The air medium is completely different from the hydrogen medium. Figure 1 Shown: X i ~Y i The relationship between i ~Y i The relationship between them will change with the changes of inlet pressure, outlet pressure and temperature).

[0117] To solve this problem, convolutional neural network is used. Figure 2 The flowchart of the present invention using a convolutional neural network to estimate the hydrogen mass flow rate of a valve is illustrated.

[0118] like Figure 2 As shown, the CNN used in this application is composed of an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer.

[0119] The convolution layer is mainly used for feature extraction. Each convolution kernel in the layer slides in sequence, performs matrix multiplication and accumulation, completes the convolution operation and extracts the hidden features of the corresponding local areas. Finally, the operation information of multiple convolution kernels is spliced ​​and reorganized to extract the output features of the convolution layer.

[0120] The calculation process is shown in the following formula:

[0121]

[0122] Where: x n-1 is the output of the n-1th layer; i is the i-th convolution kernel; is the weight parameter of the i-th convolution kernel in the n-th layer; is the corresponding bias parameter; * is the convolution operation; y n is the output of the nth layer.

[0123] The pooling layer is placed after the convolution layer, and the output of the convolution layer is used as the input of the pooling layer for the next data processing. The pooling layer can shrink the feature data passed by the convolution layer, reduce the dimension of the feature data, and prevent overfitting.

[0124] The processing operator is called a pooling kernel, which scans the feature matrix output by the convolutional layer in a traversal manner. Common pooling layer calculation methods include maximum pooling and average pooling. This paper uses maximum pooling because it can obtain feature values ​​that have no relative position relationship with the input features, enhancing robustness. The calculation formula is as follows:

[0125]

[0126] Where: S i is the output feature of the pooling layer; N is the size of the pooling window; i is the i-th pooling window; a is the input feature; and n is the n-th value in the input feature.

[0127] The input feature vector is a 3D environmental feature, and the output is the hydrogen mass flow rate in this measurement environment. The weights and biases between layers are optimized through the error feedback algorithm, the Tanh function is used as the activation function, and Adam is used as the adaptive optimizer to minimize the objective function. The learning rate is set to 0.0001, the first-order momentum decay coefficient is 0.9, the second-order momentum decay coefficient is 0.999, the minimum batch is 30, and the number of experimental iterations is set to 100.

[0128] [3. Determination of parameters of convolutional neural network]

[0129] In order to solve the problem that the parameters of convolutional neural network model are difficult to determine, the Grey Wolf Optimization (GWO) algorithm is introduced to optimize the hyperparameters of CNN model, and a GWO-CNN model is built to map the nonlinear relationship between the characteristic information of air mass flow and hydrogen mass flow.

[0130] like Figure 3 As shown, the convolutional neural network training method used in this application includes the following steps:

[0131] S100, Data Collection

[0132] Set the value ranges of the hydrogen valve's inlet pressure, outlet pressure, temperature, and valve angle to [5bar, 10bar], [10bar, 20bar], [5℃, 20℃], and [0deg, 360deg] respectively;

[0133] At different inlet pressures, outlet pressures, and temperatures, the mass flow rates of air and hydrogen were collected by changing the valve angle, and several sets of data were obtained:

[0134] (V 进口气压1 , V 出口气压1 , T1, β1, X1, Z1), (V 进口气压2 , V 出口气压2 , T2, β2, X2, Z2)……(V 进口气压i , V 出口气压i , T i , β i , X i , Z i )……(V 进口气压n , V 出口气压n , T n , β n , X n , Z m ).

[0135] Among them, V 进口气压i 、V 出口气压 , T i , β i , X i , Z i They respectively represent the inlet pressure of the valve of the i-th group, the outlet pressure of the valve, the gas temperature, the valve opening, the measured air mass flow rate, and the measured hydrogen mass flow rate.

[0136] S200, data division: setting the valve opening angle as the basis for dividing the model training set and test set, dividing 0deg to 251deg as the training set to train the model, and 252deg to 360deg as the test set.

[0137] S300, data normalization processing:

[0138] To ensure that the data is limited to the same range and avoid gradient deviation caused by features with different value ranges, which affects the efficiency of model training, the Max-min normalization method is used, and the resulting data set is:

[0139] (V 进口气压1-归一 , V 出口气压1-归一 , T 1-归一 , β 1-归一 , X 1-归一 , Z 1-归一 )、(V 进口气压2-归一 , V 出口气压2-归一 , T 2-归一 , β 2-归一 , X 2-归一 , Z 2-归一 )……(V 进口气压i-归一 , V 出口气压i-归一 , T i-归一 , β i-归一 , X i-归一 , Z i-归一 )……(V 进口气压m-归一 , V 出口气压m-归一 , T m-归一 , β m-归一 , X m-归一 , Z m-归一 ).

[0140] The normalization method for inlet pressure is:

[0141] V 进口气压i-归一 =(V 进口气压i -5) / (10-5)

[0142] The normalization method of outlet pressure is:

[0143] V 出口气压i-归一 =(V 出口气压i -10) / (20-10)

[0144] The temperature is normalized to:

[0145] T i-归一 =(T i -5) / (20-5)

[0146] The normalization of the valve angle is:

[0147] β i-归一 =β i / 360

[0148] The normalization of air mass flow is:

[0149] X i-归一 =X i / S

[0150] The normalization of hydrogen mass flow rate is:

[0151] Z i-归一 =Z i / S

[0152] Where S is the maximum value of the hydrogen valve range, which is a known value;

[0153] S400, convolutional neural network parameter initialization;

[0154] S500, using the GWO model to optimize the convolutional neural network parameters;

[0155] S501, initializing the population;

[0156] S502, initialization parameters: set the number of gray wolves N to 30, the maximum number of iterations t max is 30, the dimension is 3, and the lower bounds of each parameter are [10 -4 , 10, 16], the upper bound of the parameter [10 -3 , 80, 64], the iteration number t is 1;

[0157] S503, calculate the fitness value of the individual:

[0158] The fitness function is:

[0159] The root mean square error (RMSE) between the true hydrogen mass flow rate value and the estimated hydrogen mass flow rate value of the test set is used to establish:

[0160]

[0161] Where: m represents the total number of samples collected; V real (i) represents the true value of the hydrogen mass flow rate collected for the i-th time; V ext (i) Represents and V real (i) The corresponding estimated value of hydrogen mass flow rate;

[0162] S504, obtain three optimal solutions, namely Alpha Wolf X α 、Beta Wolf X β 、Gamma Wolf X γ Convolutional neural network parameters corresponding to individuals in the three populations;

[0163] S505, if t is less than t max , repeat steps S5051-S5054; otherwise, execute step S600;

[0164] S5051, update GW0 parameters and convolutional neural network model parameters;

[0165] S5052, calculate the fitness value of the individual;

[0166] S5053, obtain three optimal solutions X α , X β , X γ ;

[0167] S5054, t is assigned the value of t+1;

[0168] S600, train the convolutional neural network model and test the model using the test set data.

[0169] In this application, the Pytorch library is used to implement the establishment and training of convolutional neural networks and to verify them. The model parameters determined by the GWO algorithm are used to build the network structure, that is, the learning rate, batch size, and expansion dimension are set to 0.0001, 30, and 64 respectively. Through the error back propagation algorithm and the iteration of the training data set, the learning of network weights and bias parameters is realized until the objective function meets the requirements.

[0170] [4. Test results]

[0171] The estimated results of hydrogen mass flow rate are as follows: Figure 4 As shown: the solid line curve represents the actual hydrogen mass flow value, and the double-dotted line represents the estimated hydrogen mass flow value.

[0172] like Figure 5 As shown, the estimated relative error of the model of the present application is kept within 0.0035%, proving that the model has good prediction accuracy and prediction robustness.

[0173] The preferred embodiments of the present invention have been described in detail above, but it should be understood that after reading the above teachings of the present invention, those skilled in the art may make various changes or modifications to the present invention. These equivalent forms also fall within the scope of protection of the claims attached to this application.

Claims

1. A method for predicting the mass flow rate of hydrogen in a hydrogen valve, characterized in that: The steps include: Step a, obtain known conditions: V 进口气压j , V 出口气压j , T j , β j , X j ; Among them, V 进口气压j , V 出口气压j , T j , β j , X j Indicates the valve inlet pressure, valve outlet pressure, gas temperature, valve opening, and air mass flow rate when air medium is passed through; Step b, V 进口气压j , V 出口气压j , T j , β j , X j Normalized to get V 进口气压j-归一 , V 出口气压j-归一 , T j-归一 , β j-归一 , X j-归一 ; Step c, V 进口气压j-归一 , V 出口气压j-归一 , T j-归一 , β j-归一 , X j-归一 Input into the trained neural network, the neural network outputs the result Y j-归一 ; The neural network is a convolutional neural network, including: an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer; the input layer, the convolution layer, the pooling layer, the fully connected layer and the output layer are connected in sequence; the convolution layer is used for feature extraction, and the convolution layer uses 50 convolution kernels; the convolution kernel is a 1×3 matrix; the pooling layer is used to further extract feature data, and the convolution kernel of the pooling layer is a 1×2 matrix; The convolutional neural network training method used includes the following steps: S100, data collection: Set the value ranges of the hydrogen valve's inlet pressure, outlet pressure, temperature, and valve angle to [5bar, 10bar], [10bar, 20bar], [5℃, 20℃], and [0deg, 360deg] respectively; At different inlet pressures, outlet pressures, and temperatures, the mass flow rates of air and hydrogen were collected by changing the valve angle, and several sets of data were obtained: (V 进口气压1 ,V 出口气压1 ,T1,β1,X1,Z1)、(V 进口气压2 ,V 出口气压2 ,T2,β2,X2,Z2)……(V 进口气压i ,V 出口气压i ,T i ,β i ,X i ,Z i )……(V 进口气压n ,V 出口气压n ,T n ,β n ,X n ,Z m ); Among them, V 进口气压i 、V 出口气压 , T i , β i , X i , Z i They represent the inlet pressure of the valve of the i-th group, the outlet pressure of the valve, the gas temperature, the valve opening, the measured air mass flow rate, and the measured hydrogen mass flow rate respectively; S200, data division: setting the valve opening angle as the basis for dividing the model training set and the test set, dividing 0deg to 251deg as the training set to train the model, and 252deg to 360deg as the test set; S300, data normalization processing: In order to ensure that the data is limited to the same range and avoid gradient deviation caused by features in different value ranges, which affects the efficiency of model training, the Max-min normalization method is used, and the resulting data set is: (V 进口气压1-归一 ,V 出口气压1-归一 ,T 1-归一 ,β 1-归一 ,X 1-归一 ,Z 1-归一 )、(V 进口气压2-归一 ,V 出口气压2-归一 ,T 2-归一 ,β 2-归一 ,X 2-归一 ,Z 2-归一 )……(V 进口气压i-归一 ,V 出口气压i-归一 ,T i-归一 ,β i-归一 ,X i-归一 ,Z i-归一 )……(V 进口气压m-归一 ,V 出口气压m-归一 ,T m-归一 ,β m-归一 ,X m-归一 ,Z m-归一 ); The normalization method for inlet pressure is: V 进口气压i-归一 =(V 进口气压i -5) / (10-5) The normalization method of outlet pressure is: V 出口气压i-归一 =(V 出口气压i -10) / (20-10) The temperature is normalized to: T i-归一 =(T i -5) / (20-5) The normalization of the valve angle is: β i-归一 =β i / 360 The normalization of air mass flow is: X i-归一 =X i / S The normalization of hydrogen mass flow rate is: Z i-归一 =Z i / S Where S is the maximum value of the hydrogen valve range, which is a known value; S400, convolutional neural network parameter initialization; S500, using the GWO model to optimize the convolutional neural network parameters; S501, initializing the population; S502, initialization parameters: set the number of gray wolves N to 30, the maximum number of iterations t max is 30, the dimension is 3, and the lower bounds of each parameter are [10 -4 , 10, 16], the upper bound of the parameter [10 -3 , 80, 64], the iteration number t is 1; S503, calculate the fitness value of the individual: The fitness function is: The root mean square error (RMSM) between the true hydrogen mass flow rate values ​​and the estimated hydrogen mass flow rate values ​​of the test set is used to establish: Where: m represents the total number of samples collected; V real (i) represents the true value of the hydrogen mass flow rate collected for the i-th time; V ext (i) Represents and V real (i) The corresponding estimated value of hydrogen mass flow rate; S504, obtain three optimal solutions, namely Alpha Wolf X α 、Beta Wolf X β 、Gamma Wolf X γ Convolutional neural network parameters corresponding to individuals in the three populations; S505, if t is less than t max , repeat steps S5051-S5054; otherwise, execute step S600; S5051, update GW0 parameters and convolutional neural network model parameters; S5052, calculate the fitness value of the individual; S5053, obtain three optimal solutions X α , X β , X γ ; S5054, t is assigned the value of t+1; S600, training the convolutional neural network model and testing the model with the test set data; Step d: Y obtained in step c j-归一 Convert to Y j ; Among them, Y j Indicates that the valve inlet pressure when hydrogen medium is introduced is V 进口气压j , the valve outlet pressure is V 出口气压j , gas temperature is T j , valve opening is β j The hydrogen mass flow rate at .

2. A method for predicting the mass flow rate of hydrogen in a hydrogen valve, characterized in that: It includes the following steps: Step a, obtaining a data set of a hydrogen valve measured under air medium; The data set is: (V 进口气压1 , V 出口气压1 , T1, β1, X1), (V 进口气压2 , V 出口气压2 , T2, β2, X2)……(V 进口气压i , V 出口气压i , T i , β i , X i )……(V 进口气压n , V 出口气压n , T n , β n , X n ); Among them, V 进口气压i 、V 出口气压 、T i , β i , X i The valve inlet pressure, valve outlet pressure, gas temperature, valve opening, and air mass flow rate of the i-th group of air mass flow test results; Where n represents the total number of air mass flow tests included in the data set; Step b, normalizing the data set obtained in step a; Step c: Input the normalized data set obtained in step b into the neural network. The neural network outputs: Y 1-归一 , Y 2-归一 ...Y i-归一 ...Y n-归一 ; The neural network is a convolutional neural network, including: an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer; the input layer, the convolution layer, the pooling layer, the fully connected layer and the output layer are connected in sequence; the convolution layer is used for feature extraction, and the convolution layer uses 50 convolution kernels; the convolution kernel is a 1×3 matrix; the pooling layer is used to further extract feature data, and the convolution kernel of the pooling layer is a 1×2 matrix; The convolutional neural network training method used includes the following steps: S100, data collection: Set the value ranges of the hydrogen valve's inlet pressure, outlet pressure, temperature, and valve angle to [5bar, 10bar], [10bar, 20bar], [5℃, 20℃], and [0deg, 360deg] respectively; At different inlet pressures, outlet pressures, and temperatures, the mass flow rates of air and hydrogen were collected by changing the valve angle, and several sets of data were obtained: (V 进口气压1 ,V 出口气压1 ,T1,β1,X1,Z1)、(V 进口气压2 ,V 出口气压2 ,T2,β2,X2,Z2)……(V 进口气压i ,V 出口气压i ,T i ,β i ,X i ,Z i )……(V 进口气压n ,V 出口气压n ,T n ,β n ,X n ,Z m ); Among them, V 进口气压i 、V 出口气压 , T i , β i , X i , Z i They represent the inlet pressure of the valve of the i-th group, the outlet pressure of the valve, the gas temperature, the valve opening, the measured air mass flow rate, and the measured hydrogen mass flow rate respectively; S200, data division: setting the valve opening angle as the basis for dividing the model training set and the test set, dividing 0deg to 251deg as the training set to train the model, and 252deg to 360deg as the test set; S300, data normalization processing: In order to ensure that the data is limited to the same range and avoid gradient deviation caused by features in different value ranges, which affects the efficiency of model training, the Max-min normalization method is used, and the resulting data set is: (V 进口气压1-归一 ,V 出口气压1-归一 ,T 1-归一 ,β 1-归一 ,X 1-归一 ,Z 1-归一 )、(V 进口气压2-归一 ,V 出口气压2-归一 ,T 2-归一 ,β 2-归一 ,X 2-归一 ,Z 2-归一 )……(V 进口气压i-归一 ,V 出口气压i-归一 ,T i-归一 ,β i-归一 ,X i-归一 ,Z i-归一 )……(V 进口气压m-归一 ,V 出口气压m-归一 ,T m-归一 ,β m-归一 ,X m-归一 ,Z m-归一 ); The normalization method for inlet pressure is: V 进口气压i-归一 =(V 进口气压i -5) / (10-5) The normalization method of outlet pressure is: V 出口气压i-归一 =(V 出口气压i -10) / (20-10) The temperature is normalized to: T i-归一 =(T i -5) / (20-5) The normalization of the valve angle is: β i-归一 =β i / 360 The normalization of air mass flow is: X i-归一 =X i / S The normalization of hydrogen mass flow rate is: Z i-归一 =Z i / S Where S is the maximum value of the hydrogen valve range, which is a known value; S400, convolutional neural network parameter initialization; S500, using the GWO model to optimize the convolutional neural network parameters; S501, initializing the population; S502, initialization parameters: set the number of gray wolves N to 30, the maximum number of iterations t max is 30, the dimension is 3, and the lower bounds of each parameter are [10 -4 , 10, 16], the upper bound of the parameter [10 -3 , 80, 64], the iteration number t is 1; S503, calculate the fitness value of the individual: The fitness function is: The root mean square error (RMSM) between the true hydrogen mass flow rate value and the estimated hydrogen mass flow rate value of the test set is used to establish: Where: m represents the total number of samples collected; V real (i) represents the true value of the hydrogen mass flow rate collected for the i-th time; V ext (i) Represents and V real (i) The corresponding estimated value of hydrogen mass flow rate; S504, obtain three optimal solutions, namely Alpha Wolf X α 、Beta Wolf X β 、Gamma Wolf X γ Convolutional neural network parameters corresponding to individuals in the three populations; S505, if t is less than t max , repeat steps S5051-S5054; otherwise, execute step S600; S5051, update GW0 parameters and convolutional neural network model parameters; S5052, calculate the fitness value of the individual; S5053, obtain three optimal solutions X α , X β , X γ ; S5054, t is assigned the value of t+1; S600, training the convolutional neural network model and testing the model with the test set data; Step d: Y obtained in step c 1-归一 , Y 2-归一 ...Y i-归一 ...Y n-归一 Converted to Y1, Y2, ... Y i ...Y n ; Among them, Y i Indicates that the inlet pressure of the valve is V 进口气压i , the valve outlet pressure is V 出口气压i , gas temperature is T i , valve opening is β i The hydrogen mass flow rate at .

Citation Information

Patent Citations

  • Crystal face quality evaluation method for tumbling mill orientation device

    CN111985825A

  • Communication base station traffic prediction method for optimizing support vector machine regression machine based on improved grey wolf algorithm

    CN113993152A