Method, system and storage medium for obtaining thermal properties of working fluid based on reinforcement learning
By using methods based on reinforcement learning, combined with neural networks and physical models, the problem of accuracy and real-time performance in predicting the thermal physical properties of working fluids under high temperatures and high pressures is solved, and efficient acquisition of physical property parameters of working fluids under high temperatures and high pressures is achieved, reducing the reduces measurement cost and complexity.
Patent Information
- Application Number
- CN202210305859.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-25
AI Technical Summary
Under high temperature, high pressure and supercritical conditions, it is difficult for existing technology to accurately predict the thermal physical parameters of the working fluid, and it is difficult to install sensors and experimental measurements, resulting in inaccurate and poor real-time prediction of the physical properties of the working fluid.
Using a method based on reinforcement learning, the neural network model and the physical model are combined, and the optimal thermal physical property parameters are obtained by inputting the inlet temperature into the neural network model, and the outlet temperature is predicted through the physical model, and the neural network model parameters are corrected according to the prediction results until convergence. Achieve efficient acquisition of thermal and physical properties parameters of the working fluid.
It reduces the manpower and material resources required to measure the physical properties of the working fluid. It only needs to measure the flow rate, inlet temperature and outlet temperature of the working fluid to accurately predict the physical properties of the working fluid under high temperature and high pressure, solving the prediction problem under supercritical conditions.
Smart Images

Figure CN114648115B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of heat exchangers, and in particular to a method, system and storage medium based on reinforcement learning. Background Art
[0002] Thermal systems are indispensable and ubiquitous in the industrial and civil fields. Trying to improve and enhance the operating performance of thermal systems is an effective way to further improve the efficiency of existing energy utilization, which has important economic and social significance. However, the accuracy of thermal system analysis and optimization depends to a large extent on the accuracy of the values of local thermophysical parameters (for example, specific heat capacity and local heat transfer coefficient, etc.), as well as the accuracy of the prediction of the trend of local physical parameters at different temperatures and pressures (especially in the supercritical state, where sensor installation is extremely difficult). Therefore, it is very important to accurately and effectively identify these thermophysical parameters, which has become a common concern in the civil / industrial fields.
[0003] In the study of the convective heat transfer process of thermal systems, most of the experimental measurements are done on the distribution of the thermophysical parameters of the fluid. Under different temperature and pressure environments, multiple thermocouples are arranged in the flow direction of the hot fluid to measure the temperature distribution along the flow direction, and ultrasonic velocimeters are arranged to measure the velocity distribution along the flow direction. Combined with the physical model of the heat exchange scene, the thermophysical parameters of the fluid at each measurement point are reversely calculated. On the one hand, this method consumes a lot of financial, material and human resources to obtain the change curve of the thermophysical parameters of the fluid under different temperatures and pressures; on the other hand, this method is difficult or even impossible to carry out related experiments under high temperature and high pressure environments, especially when the working fluid enters a supercritical state, and real-time measurement of these thermal parameters is often not feasible.
[0004] With the development of artificial intelligence, research based on machine learning algorithms has also emerged in the field of prediction of working fluid thermal properties. These studies are actually fitting of previously collected experimental data and lack physical modeling. In addition, unlike the above studies, prediction can only be achieved after the model is established and trained; therefore, the amount of data required is much larger, and the results may not be directly extended to other situations. Limited by this, the current calculation of working fluid properties under supercritical conditions is mainly focused on the estimation of lumped parameters, and the average properties of the working fluid in a larger pressure range / temperature range are estimated through experimental methods. The prediction of these working fluid properties not only uses a lot of sensors, but also the prediction of working fluid properties is not accurate and effective enough. Summary of the invention
[0005] Based on this, it is necessary to provide a method, system, computer equipment and storage medium for obtaining the thermal properties of working fluids based on reinforcement learning, which can solve the problem of predicting the properties of working fluids under high temperature, high pressure and even supercritical conditions, in response to the above technical problems.
[0006] On the one hand, a method for obtaining thermal properties of a working fluid based on reinforcement learning is provided, the method comprising:
[0007] Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model;
[0008] Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model;
[0009] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0010] The network parameters of the neural network model are modified according to the reward until the neural network model converges.
[0011] In one embodiment, obtaining the optimal thermophysical property parameters through the neural network model specifically includes:
[0012] Outputting the mean and variance of the thermophysical property parameters through the neural network model;
[0013] Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter;
[0014] Random sampling is performed from the Gaussian distribution as the optimal thermophysical property parameter.
[0015] In one embodiment, before using the physical model as the valuation network for reinforcement learning, the process further includes constructing the physical model, wherein the constructing the physical model specifically includes:
[0016] The physical model of the working fluid thermophysical property invariance of the heat exchanger is established by the logarithmic mean temperature difference method;
[0017] The heat exchange area of the heat exchanger is divided into N sections at equal intervals along the flow direction of the working medium to obtain N heat exchange units;
[0018] Each of the heat exchange units is simulated and calculated according to the physical model of the working medium with constant thermal properties, so as to obtain the heat exchange capacity of each of the heat exchange units;
[0019] The sum of the heat exchange amounts of the N heat exchange units is calculated to obtain the total heat exchange amount of the heat exchanger.
[0020] In one embodiment, it also includes:
[0021] Establishing a heat transfer equation group according to the heat exchange amount, and solving the heat transfer equation group to obtain a predicted outlet temperature of the heat exchanger;
[0022] Wherein, the calculation formula of the heat exchange amount is:
[0023]
[0024] Q=m l c p,l (T l,out -T l,in );
[0025] Q=m h c p,h (T h,in -T h,out );
[0026] Where, ΔT max =T h,in -T l,in , ΔT min =T h,out -T l,out ;
[0027] T h,in is the inlet temperature of the hot fluid; T h,out is the outlet temperature of the hot fluid; T l,in is the inlet temperature of the cold fluid; T l,out is the outlet temperature of the cold fluid; m and c p are the mass flow rate and specific heat capacity of the working fluid respectively; Q is the heat transfer capacity of the heat exchanger; K and A are the heat transfer coefficient and heat transfer area of the heat exchanger respectively; the subscripts h and l represent the hot fluid and the cold fluid respectively.
[0028] In one embodiment, obtaining a reinforcement learning reward according to the predicted outlet temperature specifically includes:
[0029] Obtain the test outlet temperature of the heat exchanger;
[0030] Calculate the deviation between the predicted outlet temperature and the tested outlet temperature;
[0031] The reward is obtained according to the deviation value.
[0032] In one embodiment, it further includes constructing a reinforcement learning algorithm, wherein constructing the reinforcement learning algorithm specifically includes:
[0033] Using the heat exchange area of the heat exchange unit and the inlet temperature of the fluid as the state of the reinforcement learning;
[0034] Using the thermal physical property parameters of the heat exchange unit as the reinforcement learning action;
[0035] The deviation between the predicted outlet temperature and the experimental temperature is used as a reward for the reinforcement learning;
[0036] The reinforcement learning algorithm is constructed through the states, actions and rewards.
[0037] In one embodiment, the calculation formula for obtaining the reward is:
[0038]
[0039] Among them, T out,predict is the predicted outlet temperature obtained by solving the physical model;
[0040] T out,exprienment is the test outlet temperature obtained in the actual test; reward is the reward of the reinforcement learning; x is the probability that the decision network outputs the mean value of the thermophysical property parameter at the current temperature; γ is the working fluid experience coefficient.
[0041] On the other hand, a system for acquiring thermal properties of a working fluid based on reinforcement learning is provided, the system comprising:
[0042] Model building module, used to build neural network models, physical models and reinforcement learning models;
[0043] The decision network module is used to make decisions on the thermophysical property parameters of the reinforcement learning algorithm through a neural network;
[0044] The valuation network module is used to evaluate the rewards of the reinforcement learning algorithm through a physical model.
[0045] In one embodiment, the system comprises:
[0046] Model building module, used to build neural network models, physical models and reinforcement learning models;
[0047] The decision network module is used to make decisions on the thermophysical property parameters of the reinforcement learning algorithm through a neural network;
[0048] The valuation network module is used to evaluate the rewards of the reinforcement learning algorithm through a physical model.
[0049] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0050] Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model;
[0051] Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model;
[0052] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0053] The network parameters of the neural network model are modified according to the reward until the neural network model converges.
[0054] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a processor, the processor performs the following steps:
[0055] Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model;
[0056] Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model;
[0057] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0058] The network parameters of the neural network model are modified according to the reward until the neural network model converges.
[0059] The above technical solution of the present invention has the following advantages compared with the prior art:
[0060] The above-mentioned method, system, computer equipment and storage medium for obtaining the thermal properties of working fluids based on reinforcement learning, through the present invention, only needs to measure the working fluid flow rate, inlet temperature and outlet temperature, so as to solve the problem of predicting the working fluid properties under high temperature, high pressure and even supercritical conditions, and reduce the manpower and material resources for measuring the working fluid properties under normal temperature and pressure conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 is a first method flow chart of the method for obtaining the thermal physical properties of a working fluid based on reinforcement learning of the present invention;
[0063] Figure 2 is a second method flow chart of the method for obtaining the thermal physical properties of working fluid based on reinforcement learning of the present invention;
[0064] Figure 3 It is a system structure diagram of the working fluid thermal property acquisition system of the present invention;
[0065] Figure 4 It is a device structure diagram of the computer device of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] Reinforcement learning is a process of learning as trial and error evaluation. The agent selects an action for the environment. The state of the environment changes after accepting the action, and a reinforcement signal (reward or punishment) is generated and fed back to the agent. The agent selects the next action based on the reinforcement signal and the current state of the environment. The principle of selection is to increase the probability of receiving positive reinforcement (reward). The selected action not only affects the immediate reinforcement value, but also affects the state of the environment at the next moment and the final reinforcement value. The method for obtaining the working fluid properties of the heat exchanger in the thermal system of the present invention is to realize the working fluid properties of the heat exchanger in the thermal system through a reinforcement learning algorithm.
[0068] Embodiment 1:
[0069] The method for obtaining the thermal properties of working fluid based on reinforcement learning in this embodiment is as follows: Figure 1-2 As shown, Figure 1 This is a flow chart of the first method of the method for obtaining the thermal physical properties of a working fluid based on reinforcement learning of the present invention; Figure 2 It is a second method flow chart of the method for acquiring thermal physical properties of working fluid based on reinforcement learning of the present invention.
[0070] The method comprises the following steps:
[0071] Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model;
[0072] In the process of reinforcement learning, the intelligent body will select the corresponding action, which corresponds to the method for obtaining the thermophysical property parameters of the working fluid based on reinforcement learning of the present invention. The action is the mean and variance of the output thermophysical property parameters, and the action plays a decision-making role in the mean and variance of the thermophysical property parameters. In the method for obtaining the thermophysical property parameters of the working fluid based on reinforcement learning of the present invention, a neural network model is used as the decision network of reinforcement learning, that is, the inlet temperature of the heat exchanger is used as the input of the decision network in the reinforcement learning algorithm, that is, the input of the neural network model. The inlet temperature of the heat exchanger is input into the neural network model, and the decision is made through the neural network model to determine the value of the thermophysical property parameters obtained by the neural network model. Among them, in the method for obtaining the thermophysical property of the working fluid based on reinforcement learning of the present invention, the inlet temperature of the heat exchanger is used as the input of the decision network in the reinforcement learning algorithm, and then the optimal thermophysical property parameters are obtained through the decision network. Further, in the application scenario of the present invention, the thermophysical property parameter is a specific heat capacity parameter.
[0073] Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model;
[0074] After obtaining the optimal thermophysical property parameters through the neural network model, that is, through the decision network, the optimal thermophysical property parameters are input into the physical model, and then the predicted outlet temperature of the heat exchanger is obtained through the physical model. In the method for obtaining the thermophysical properties of the working fluid of the present invention, the physical model acts as the valuation network of the reinforcement learning algorithm, and the reward obtained through the outlet temperature is used to evaluate the thermophysical property parameters obtained through the decision network.
[0075] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0076] After the predicted outlet temperature is obtained through the physical model, rewards can be obtained by performing relevant calculations based on the predicted outlet temperature. The rewards reflect the accuracy of the predicted outlet temperature and the accuracy of the thermophysical property parameters obtained through the decision network.
[0077] The network parameters of the neural network model are modified according to the reward until the neural network model converges.
[0078] The reward reflects the accuracy of the thermophysical parameters and predicted outlet temperature obtained through the decision network. A preset value of the reward will be set in the reinforcement learning algorithm. The reward value adopts the gradient descent method during the training process, and the trend of the reward value is gradually decreasing. When the reward drops to the preset value after multiple trainings, it means that the decision network has been trained, and the model of the entire reinforcement learning algorithm has been built. Through the trained reinforcement learning algorithm, we can get the function of the change of the thermophysical properties of the working fluid with temperature, that is, the function of the change of the thermophysical parameters with temperature, and the function of the change of specific heat capacity with temperature, and then we can get the specific heat capacity of the working fluid at a specified temperature.
[0079] In one embodiment, obtaining the optimal thermophysical property parameters through the neural network model specifically includes:
[0080] Outputting the mean and variance of the thermophysical property parameters through the neural network model;
[0081] The neural network model, that is, the decision network of reinforcement learning, inputs the inlet temperature into the decision network, and the decision network outputs the mean and variance of the thermophysical property parameters, that is, the mean and variance of the specific heat capacity, so as to establish a Gaussian distribution of the specific heat capacity.
[0082] Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter;
[0083] After obtaining the mean and variance of the thermophysical property parameters through the decision network, the Gaussian distribution of the thermophysical property parameters is established through the mean and variance of the thermophysical property parameters, so as to sample from the Gaussian distribution to obtain the optimal thermal parameter value, that is, the specific heat capacity value.
[0084] Random sampling is performed from the Gaussian distribution as the optimal thermophysical property parameter.
[0085] Gaussian distribution has a single peak. After the decision network training converges, one of the characteristics is that the standard deviation value output by the decision network is very small. At this time, the confidence interval of the thermophysical parameter value output by the decision network is very high. Therefore, when predicting, the mean and variance of the decision network output form a Gaussian distribution. Random sampling in this Gaussian distribution is used as the optimal thermophysical parameter, which is the specific heat capacity value. Random sampling is to use random data to train the decision network in order to obtain a well-trained decision network.
[0086] In one embodiment, before using the physical model as the valuation network for reinforcement learning, the process further includes constructing the physical model, wherein the constructing the physical model specifically includes:
[0087] The physical model of the working fluid thermophysical property invariance of the heat exchanger is established by the logarithmic mean temperature difference method;
[0088] When the thermal properties of the working fluid do not change with its temperature, the general thermal physical model of the heat exchanger is the model established by the logarithmic mean temperature difference method. Therefore, the physical model of the working fluid thermal properties of the heat exchanger is established by the logarithmic mean temperature difference method. At this time, the inlet temperature of the fluid, the heat exchange area of the heat exchanger, the specific heat capacity of the fluid and the heat transfer coefficient of the heat exchanger are known. Through the heat transfer equations and the energy conservation equation of the fluid, the heat transfer amount of the heat exchange process and the outlet temperatures of the cold and hot fluids can be obtained. This model is the physical model of the working fluid thermal properties of the heat exchanger established by the logarithmic mean temperature difference method. In the application scenario of the heat exchanger, there are two types of fluids, hot fluid and cold fluid, and only the working fluid properties of one fluid are learned each time.
[0089] Dividing the heat exchange area of the heat exchanger into N sections at equal intervals along the flow direction of the working medium to obtain N heat exchange units;
[0090] Since the thermal properties of the working fluid change with its temperature, the idea of microelementization is adopted to divide the heat exchange area of the heat exchanger into N sections at equal intervals along the flow direction of the working fluid, and obtain N heat exchange units. When N is large enough, the thermal properties of the working fluid in each heat exchange unit can be approximately considered not to change with its temperature, that is, the thermal properties of the working fluid can be approximately constant. Therefore, each heat exchange unit can be simulated and calculated according to the physical model of the constant thermal properties of the working fluid.
[0091] Each of the heat exchange units is simulated and calculated according to the physical model of the working medium with constant thermal properties, so as to obtain the heat exchange capacity of each of the heat exchange units;
[0092] Starting from the heat exchange unit with label n=1, the outlet temperature of the fluid in the heat exchange unit and the heat transfer capacity of the heat exchange unit are calculated according to the physical model of the constant thermal properties of the working medium. The outlet temperature of the fluid in the previous heat exchange unit is used as the inlet temperature of the fluid in the next heat exchange unit, and so on, until the heat transfer capacity calculation of label n=N is completed. Where n is one of 1 to N.
[0093] The sum of the heat exchange amounts of the N heat exchange units is calculated to obtain the total heat exchange amount of the heat exchanger.
[0094] After the calculation of the heat exchange amounts of the N heat exchange units is completed, the total heat exchange amount of the N heat exchange units is calculated to obtain the total heat exchange amount of the entire heat exchanger.
[0095] In one embodiment, it also includes:
[0096] Establishing a heat transfer equation group according to the heat exchange amount, and solving the heat transfer equation group to obtain a predicted outlet temperature of the heat exchanger;
[0097] Wherein, the calculation formula of the heat exchange amount is:
[0098]
[0099] Q=m l c p,l (T l,out -T l,in )
[0100] Q=m h c p,h (T h,in -T h,out );
[0101] Where, ΔT max =T h,in -T l,in , ΔT min =T h,out -T l,out ;
[0102] T h,in is the inlet temperature of the hot fluid; T h,out is the outlet temperature of the hot fluid; T l,in is the inlet temperature of the cold fluid; T l,out is the outlet temperature of the cold fluid; m and c p are the mass flow rate and specific heat capacity of the working fluid respectively; Q is the heat transfer capacity of the heat exchanger; K and A are the heat transfer coefficient and heat transfer area of the heat exchanger respectively; the subscripts h and l represent the hot fluid and the cold fluid respectively.
[0103] A heat transfer equation group of heat exchange is established. The heat exchange amount, the outlet temperature of the hot fluid and the inlet temperature of the cold fluid are three unknown variables. The three equations can be solved jointly to obtain the predicted outlet temperature of one of the fluids, so as to get rewards by predicting the outlet temperature.
[0104] In one embodiment, obtaining a reinforcement learning reward according to the predicted outlet temperature specifically includes:
[0105] Obtain the test outlet temperature of the heat exchanger;
[0106] In order to obtain rewards, we must first obtain the test outlet temperature of the heat exchanger, which can be directly measured by sensors such as thermocouples. Then, we obtain rewards by performing corresponding calculations between the predicted outlet temperature and the test outlet temperature to evaluate the degree of training of the decision network.
[0107] Calculate the deviation between the predicted outlet temperature and the tested outlet temperature;
[0108] After obtaining the predicted outlet temperature and the test outlet temperature, first make a difference between the predicted outlet temperature and the test outlet temperature, and then perform absolute value processing to obtain the deviation value between the predicted outlet temperature and the test outlet temperature, so as to obtain a reward through the deviation value to evaluate the training degree of the decision network.
[0109] The reward is obtained according to the deviation value.
[0110] After obtaining the deviation value, the reward can be obtained by substituting the deviation value into the reward calculation formula. The reward is used to evaluate the training degree of the decision network. The gradient descent method is used in the training process. The parameters of the decision network are continuously corrected through rewards so that the reward drops to the preset value and the network training is completed. The training process of the entire network is to repeatedly solve the physical model and the gradient descent optimization calculation of the reward, which reduces the amount of calculation.
[0111] In one embodiment, it further includes constructing a reinforcement learning algorithm, wherein constructing the reinforcement learning algorithm specifically includes:
[0112] Using the heat exchange area of the heat exchange unit and the inlet temperature of the fluid as the state of the reinforcement learning;
[0113] Using the thermal physical property parameters of the heat exchange unit as the reinforcement learning action;
[0114] The deviation between the predicted outlet temperature and the experimental temperature is used as a reward for the reinforcement learning;
[0115] The reinforcement learning algorithm is constructed through the states, actions and rewards.
[0116] In order to construct a reinforcement learning algorithm and apply it to the heat exchanger scenario of a thermal system, the characteristics of the heat exchanger must correspond to the elements of the reinforcement learning algorithm. The heat exchange area of the current heat exchange unit and the inlet temperature of the fluid are used as the state of the reinforcement learning algorithm; the thermal physical parameters of the current heat exchange unit are used as the action of the reinforcement learning algorithm; and the minimum deviation between the predicted outlet temperature and the experimental temperature is used as the reward of reinforcement learning. The above state, action, and reward form a triplet that acts on the reinforcement learning algorithm, and the thermal physical parameters are obtained through the reinforcement learning algorithm.
[0117] In one embodiment, the calculation formula of the reward is:
[0118]
[0119] Among them, T out,predict is the predicted outlet temperature obtained by solving the physical model;
[0120] T out,exprienment is the test outlet temperature obtained in the actual test; n is one of 1 to N;
[0121] Reward is the reward for the reinforcement learning, which is used to evaluate the decision network;
[0122] x is the probability that the decision network outputs the mean value of the thermophysical property parameters at the current inlet temperature, that is, the probability that the mean value of the corresponding sampled thermophysical property parameters at the current inlet temperature satisfies the Gaussian distribution; the role of this probability is to increase the probability of the scenario where the gap between the predicted outlet temperature and the tested outlet temperature is relatively smaller; in addition, this probability product has a penalty function. If the performance of the decision network is good, but the sampled points happen to deviate too far from the mean, the parameter value of the decision network cannot be corrected too much at this time, so a penalty should be imposed on the reward value obtained through the probability of this situation.
[0123] γ is the working fluid experience coefficient. Different working fluids have different working fluid experience coefficients, which are determined based on experience.
[0124] The design significance of setting N sum items in reward is that according to the operation mode of the valuation network, the decision network needs to be called N times to obtain the deviation between the predicted outlet temperature and the test outlet temperature of the heat exchanger, and there is a sparse reward problem. Therefore, N sum items are used to solve the sparse reward problem. The present invention makes the training process more stable by virtualizing the rewards of the first N-1 heat exchange units. The value is the absolute value of the difference between the predicted outlet temperature and the test outlet temperature of the heat exchanger multiplied by the probability that the decision network outputs the mean value of the specific heat capacity at the current inlet temperature, and then multiplied by the exponential decay according to the deviation of the current heat exchange unit from the outlet heat exchange unit number, and the reward is reshaped by weighted penalty. Reward reshaping means that when the outlet temperature is predicted by the physical model, the later the heat exchange unit is, the greater the impact on the prediction of the outlet temperature. Therefore, the exponential decay of the deviation of the current heat exchange unit from the outlet heat exchange unit number is added to the reward calculation.
[0125] Embodiment 2:
[0126] Reference Figure 2 As shown, Figure 2 This is a flow chart of the second method of the method for acquiring thermal properties of working fluid based on reinforcement learning of the present invention.
[0127] Establish a neural network model and use it as a decision network for reinforcement learning;
[0128] In the reinforcement learning algorithm of the present invention, a neural network model is used as the decision network of reinforcement learning to determine the mean and variance of the thermal physical parameters output after a given inlet temperature. Therefore, a neural network model must be established first, and a fully connected neural network model is used. The number of decision network layers and the number of nodes in each layer need to be determined by the complexity of the optimization task, and can be determined by hyperparameter optimization. That is: the values of the number of decision network layers, the number of nodes in each layer of the network, etc. are set artificially, and can be 10 layers with 100 nodes per layer, or 15 layers with 10 nodes per layer; however, different configurations obtain different learning results, and users can set the number of network layers and the number of nodes based on personal experience; multiple groups of configurations can also be set by traversal, and then the best set of parameter settings are finally selected, that is, the optimal network parameters are set by hyperparameter optimization. In addition, the importance sampling method is used in the decision network to improve the stability of the training process and accelerate the training speed of the entire model.
[0129] Taking the inlet temperature as the input of the neural network model, the mean and variance of the thermophysical property parameters are outputted through the neural network model;
[0130] The inlet temperature of the heat exchanger is used as the input of the decision network in the reinforcement learning algorithm, that is, the input of the neural network model. The inlet temperature of the heat exchanger is input into the neural network model, and the decision is made through the neural network model. The decision network will output the mean and variance of the thermophysical parameters, that is, the mean and variance of the specific heat capacity, so as to establish the Gaussian distribution of the specific heat capacity.
[0131] Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter;
[0132] The mean and variance of the thermophysical property parameters are obtained through the decision network, and the Gaussian distribution of the thermophysical property parameters is established through the mean and variance of the thermophysical property parameters, so as to sample from the Gaussian distribution to obtain the optimal thermal parameter value, that is, the specific heat capacity value.
[0133] Randomly sampling from the Gaussian distribution as the optimal thermophysical property parameter;
[0134] The Gaussian distribution has a unimodal property. After the decision network training converges, one characteristic is that the standard deviation value output by the decision network is very small. At this time, the confidence interval of the thermophysical parameter value output by the decision network is very high. Therefore, when predicting, the mean and variance of the decision network output form a Gaussian distribution, and random sampling in the Gaussian distribution is used as the optimal thermophysical parameter, which is the specific heat capacity value.
[0135] Build a physical model and use it as a valuation network for reinforcement learning;
[0136] Firstly, a physical model of the invariant thermal properties of the working fluid of the heat exchanger is established by the logarithmic mean temperature difference method; secondly, the heat exchange area of the heat exchanger is divided into N sections at equal intervals along the flow direction of the working fluid to obtain N heat exchange units; then each of the heat exchange units is simulated and calculated according to the physical model of the invariant thermal properties of the working fluid to obtain the heat exchange capacity of each heat exchange unit; finally, the sum of the heat exchange capacities of the N heat exchange units is calculated to obtain the total heat exchange capacity of the heat exchanger, thus completing the establishment of the physical model, and the physical model is used as the valuation network for reinforcement learning.
[0137] Inputting the optimal thermophysical property parameters into the physical model;
[0138] After obtaining the optimal thermophysical property parameters through the neural network model, that is, through the decision network, the optimal thermophysical property parameters are input into the physical model so as to obtain the predicted outlet temperature of the heat exchanger through the physical model.
[0139] Obtaining a predicted outlet temperature through the physical model;
[0140] After the optimal thermophysical property parameters are input into the physical model, the physical model performs relevant iterative operations and finally obtains the predicted outlet temperature, so as to obtain rewards by predicting the outlet temperature.
[0141] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0142] After the predicted outlet temperature is obtained through the physical model, rewards can be obtained by performing relevant calculations based on the predicted outlet temperature. The rewards reflect the accuracy of the predicted outlet temperature and the accuracy of the thermophysical property parameters obtained through the decision network.
[0143] Modifying network parameters of the neural network model according to the reward until the neural network model converges;
[0144] The reward reflects the accuracy of the thermophysical parameters and predicted outlet temperature obtained through the decision network. A preset value of the reward will be set in the reinforcement learning algorithm. The trend of the reward value during the training process is gradually decreasing. When the reward drops to the preset value after multiple trainings, it means that the decision network has been trained and the model of the entire reinforcement learning algorithm has been built. Through the trained reinforcement learning algorithm, we can obtain the function of the change of the thermophysical properties of the working fluid with temperature, that is, the function of the change of the thermophysical parameters with temperature, and the function of the change of specific heat capacity with temperature, and then we can get the specific heat capacity of the working fluid at a specified temperature.
[0145] Get the reinforcement learning model of the heat exchanger.
[0146] After the decision network converges, the reinforcement learning model is finally determined. Given an inlet temperature, the reinforcement learning model can be used to obtain an optimal thermophysical parameter value corresponding to the inlet temperature, that is, the specific heat capacity value; given a temperature range, a curve of the specific heat capacity changing with the temperature range can be obtained.
[0147] It should be understood that although Figures 1-2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1-2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0148] Embodiment three:
[0149] Reference Figure 3 As shown, Figure 3 This is a system structure diagram of the system for acquiring thermal properties of working fluids based on reinforcement learning of the present invention.
[0150] The working fluid thermal property acquisition system based on reinforcement learning in this embodiment includes:
[0151] Model building module, used to build neural network models, physical models and reinforcement learning models;
[0152] Through the model building module, neural network models, physical models and reinforcement learning models can be established, so that the neural network model can be used as the decision network of the reinforcement learning algorithm; the physical model can be used as the valuation network of the reinforcement learning algorithm, thereby realizing the prediction of the thermal physical properties of the working fluid.
[0153] The decision network module is used to make decisions on the thermophysical property parameters of the reinforcement learning algorithm through a neural network;
[0154] The inlet temperature of the heat exchanger is input into the neural network model, and a decision is made through the decision network module to determine the values of the thermophysical property parameters obtained through the neural network model.
[0155] The valuation network module is used to evaluate the rewards of the reinforcement learning algorithm through a physical model.
[0156] After obtaining the optimal thermophysical property parameters through the neural network model, that is, through the decision network, the optimal thermophysical property parameters are input into the physical model, and then the predicted outlet temperature of the heat exchanger is obtained through the physical model. In the method for obtaining thermophysical properties of working fluids based on reinforcement learning of the present invention, the physical model acts as an evaluation network of the reinforcement learning algorithm, that is, acts as an evaluation network module, which is used to evaluate the thermophysical property parameters obtained through the decision network module.
[0157] In one embodiment, the system further comprises:
[0158] Network training module, used to implement decision network training;
[0159] In the reinforcement learning algorithm of the present invention, a neural network model is used as the decision network of reinforcement learning to determine the mean and variance of the thermophysical property parameters output after a given inlet temperature. Therefore, it is necessary to first establish a neural network model and train the neural network model, that is, to train the decision network through a network training module to determine parameters such as the number of decision network layers and the number of nodes in each layer.
[0160] The heat exchange unit calculation module is used to call the decision network module to obtain thermal physical property parameters.
[0161] During the calculation process of the physical model, each heat exchange unit will be calculated through the heat exchange unit calculation module to obtain the heat exchange amount and then the final reward value.
[0162] For the specific definition of the working fluid thermal property acquisition system based on reinforcement learning, please refer to the definition of the method above, which will not be repeated here. Each module in the above-mentioned working fluid thermal property acquisition system based on reinforcement learning can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0163] Embodiment 4:
[0164] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a method for acquiring thermal properties of a working fluid based on reinforcement learning when executing the computer program.
[0165] The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for obtaining the physical properties of the working fluid is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0166] Those skilled in the art should understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0167] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0168] Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model;
[0169] Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model;
[0170] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0171] The network parameters of the neural network model are modified according to the reward until the neural network model converges.
[0172] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0173] Outputting the mean and variance of the thermophysical property parameters through the neural network model;
[0174] Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter;
[0175] Random sampling is performed from the Gaussian distribution as the optimal thermophysical property parameter.
[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0177] The physical model of the working fluid thermophysical property invariance of the heat exchanger is established by the logarithmic mean temperature difference method;
[0178] The heat exchange area of the heat exchanger is divided into N sections at equal intervals along the flow direction of the working medium to obtain N heat exchange units;
[0179] Each of the heat exchange units is simulated and calculated according to the physical model of the working medium with constant thermal properties, so as to obtain the heat exchange capacity of each of the heat exchange units;
[0180] The sum of the heat exchange amounts of the N heat exchange units is calculated to obtain the total heat exchange amount of the heat exchanger.
[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0182] A heat transfer equation group is established according to the heat exchange amount, and the heat transfer equation group is solved to obtain the predicted outlet temperature of the heat exchanger.
[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0184] Obtain the test outlet temperature of the heat exchanger;
[0185] Calculate the deviation between the predicted outlet temperature and the tested outlet temperature;
[0186] The reward is obtained according to the deviation value.
[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0188] Using the heat exchange area of the heat exchange unit and the inlet temperature of the fluid as the state of the reinforcement learning;
[0189] Using the thermal physical property parameters of the heat exchange unit as the reinforcement learning action;
[0190] The deviation between the predicted outlet temperature and the experimental temperature is used as a reward for the reinforcement learning;
[0191] The reinforcement learning algorithm is constructed through the states, actions and rewards.
[0192] Embodiment five:
[0193] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0194] Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model;
[0195] Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model;
[0196] Obtaining a reinforcement learning reward according to the predicted outlet temperature;
[0197] The network parameters of the neural network model are modified according to the reward until the neural network model converges.
[0198] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0199] Outputting the mean and variance of the thermophysical property parameters through the neural network model;
[0200] Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter;
[0201] Random sampling is performed from the Gaussian distribution as the optimal thermophysical property parameter.
[0202] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0203] The physical model of the working fluid thermophysical property invariance of the heat exchanger is established by the logarithmic mean temperature difference method;
[0204] The heat exchange area of the heat exchanger is divided into N sections at equal intervals along the flow direction of the working medium to obtain N heat exchange units;
[0205] Each of the heat exchange units is simulated and calculated according to the physical model of the working medium with constant thermal properties, so as to obtain the heat exchange capacity of each of the heat exchange units;
[0206] The sum of the heat exchange amounts of the N heat exchange units is calculated to obtain the total heat exchange amount of the heat exchanger.
[0207] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0208] A heat transfer equation group is established according to the heat exchange amount, and the heat transfer equation group is solved to obtain the predicted outlet temperature of the heat exchanger.
[0209] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0210] Obtain the test outlet temperature of the heat exchanger;
[0211] Calculate the deviation between the predicted outlet temperature and the tested outlet temperature;
[0212] The reward is obtained according to the deviation value.
[0213] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0214] Using the heat exchange area of the heat exchange unit and the inlet temperature of the fluid as the state of the reinforcement learning;
[0215] Using the thermal physical property parameters of the heat exchange unit as the reinforcement learning action;
[0216] The deviation between the predicted outlet temperature and the experimental temperature is used as a reward for the reinforcement learning;
[0217] The reinforcement learning algorithm is constructed by the state, action and reward. It can be understood by a person of ordinary skill in the art that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0218] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0219] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for obtaining thermal properties of working fluid based on reinforcement learning, characterized in that: The method comprises: Using the neural network model as a decision network for reinforcement learning, using the inlet temperature as an input of the neural network model, and obtaining optimal thermophysical property parameters through the neural network model; Using the physical model as a valuation network for reinforcement learning, inputting the optimal thermophysical property parameters into the physical model, and obtaining a predicted outlet temperature through the physical model; Obtaining a reinforcement learning reward according to the predicted outlet temperature; Modifying the network parameters of the neural network model according to the reward until the neural network model converges, and obtaining the optimal thermophysical property parameters through the neural network model specifically includes: Outputting the mean and variance of the thermophysical property parameters through the neural network model; Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter; Randomly sampling from the Gaussian distribution as the optimal thermophysical property parameter; The calculation formula for obtaining the above reward is: Among them, T out,predict is the predicted outlet temperature obtained by solving the physical model; T out,exprienment is the test outlet temperature obtained in the actual test; reward is the reward of the reinforcement learning; x is the probability that the decision network outputs the mean value of the thermophysical property parameter at the current temperature; γ is the working fluid experience coefficient; n is one of 1 to N.
2. The method for obtaining thermal properties of working fluid based on reinforcement learning according to claim 1, characterized in that: Before using the physical model as the valuation network for reinforcement learning, the physical model may be constructed. The construction of the physical model may include: The physical model of the working fluid thermophysical property invariance of the heat exchanger is established by the logarithmic mean temperature difference method; The heat exchange area of the heat exchanger is divided into N sections at equal intervals along the flow direction of the working medium to obtain N heat exchange units; each of the heat exchange units is simulated and calculated according to the physical model of the working medium with constant thermal properties to obtain the heat exchange capacity of each of the heat exchange units; The sum of the heat exchange amounts of the N heat exchange units is calculated to obtain the total heat exchange amount of the heat exchanger.
3. The method for obtaining thermal properties of working fluid based on reinforcement learning according to claim 2, characterized in that: Also includes: Establishing a heat transfer equation group according to the heat exchange amount, and solving the heat transfer equation group to obtain a predicted outlet temperature of the heat exchanger; Wherein, the calculation formula of the heat exchange amount is: Q=m i c p,l (T l,out -T l,in ) Q=m h c p,h (T h,in -T h,out ); where, ΔT max = T h,in - T l,in , ΔT min = T h,out - T l,out ; T h,in is the inlet temperature of the hot fluid; T h,out is the outlet temperature of the hot fluid; T l,in is the inlet temperature of the cold fluid; T l,out is the outlet temperature of the cold fluid; m and c p are the mass flow rate and specific heat capacity of the working fluid respectively; Q is the heat transfer capacity of the heat exchanger; K and A are the heat transfer coefficient and heat transfer area of the heat exchanger respectively; the subscripts h and l represent the hot fluid and the cold fluid respectively.
4. The method for obtaining thermal properties of working fluid based on reinforcement learning according to claim 1, characterized in that: The step of obtaining a reinforcement learning reward according to the predicted outlet temperature specifically includes: Obtain the test outlet temperature of the heat exchanger; Calculate the deviation between the predicted outlet temperature and the tested outlet temperature; The reward is obtained according to the deviation value.
5. The method for obtaining thermal properties of working fluid based on reinforcement learning according to claim 2, characterized in that: It also includes constructing a reinforcement learning algorithm, wherein the construction of the reinforcement learning algorithm specifically includes: Using the heat exchange area of the heat exchange unit and the inlet temperature of the fluid as the state of the reinforcement learning; Using the thermal physical property parameters of the heat exchange unit as the reinforcement learning action; The deviation between the predicted outlet temperature and the experimental temperature is used as a reward for the reinforcement learning; The reinforcement learning algorithm is constructed through the states, actions and rewards.
6. A system for acquiring thermal properties of working fluid based on reinforcement learning, characterized in that: The system comprises: Model building module, used to build neural network models, physical models and reinforcement learning models; The decision network module is used to make decisions on the thermophysical property parameters of the reinforcement learning algorithm through a neural network; The valuation network module is used to evaluate the rewards of the reinforcement learning algorithm through a physical model; The obtaining of the optimal thermophysical property parameters through the neural network model specifically includes: Outputting the mean and variance of the thermophysical property parameters through the neural network model; Constructing a Gaussian distribution according to the mean and variance of the thermophysical property parameter; Randomly sampling from the Gaussian distribution as the optimal thermophysical property parameter; The calculation formula for obtaining the above reward is: Among them, T out,predict is the predicted outlet temperature obtained by solving the physical model; T out,exprienment is the test outlet temperature obtained in the actual test; reward is the reward of the reinforcement learning; x is the probability that the decision network outputs the mean value of the thermophysical property parameter at the current temperature; γ is the working fluid experience coefficient; n is one of 1 to N.
7. The system for acquiring thermal properties of working fluids based on reinforcement learning according to claim 6, characterized in that: The system further comprises: Network training module, used to implement decision network training; The heat exchange unit calculation module is used to call the decision network module to obtain thermal physical property parameters.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed by a processor, the processor is caused to execute the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Soil thermophysical property parameter distinguishing method
CN109521051A
Method and system for acquiring thermophysical parameters of supercritical fluid working medium
CN114036875A
