Flow field prediction method and system based on multi-agent symbolic regression algorithm
By combining multi-agent symbolic regression algorithm and physical information neural network, the problem of reconstructing high-dimensional partial differential equation data is solved, and efficient and accurate prediction of flow field data is achieved, which is suitable for the reconstruction and prediction of complex flow fields.
Patent Information
- Application Number
- CN202411088393.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-05-11
- Filing Date
- 2024-08-09
- Publication Date
- 2025-11-11
AI Technical Summary
Existing symbolic regression algorithms struggle to reconstruct the correct partial differential equation expression from high-dimensional partial differential equation data, and physical information neural networks lack predictive ability under unknown flow field data.
A multi-agent symbolic regression algorithm is adopted, which generates a preorder traversal sequence of symbolic expression trees through multiple agents. The agent parameters are updated by combining the reward function and the risk-based policy gradient seeking method. Partial differential equations are constructed as constraints, and a physical information neural network is trained to predict the flow field.
It achieves efficient and accurate prediction of arbitrary flow field data, can restore complex expressions, shortens the time to solve complex problems, and ensures that the prediction results follow the physical laws of partial differential equations.
Smart Images

Figure CN120930522A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flow field prediction technology, and more specifically to a flow field prediction method and system based on a multi-agent symbolic regression algorithm. Background Technology
[0002] Currently, flow field prediction is a highly specialized computational fluid dynamics (CFD) problem, aiming to predict the flow patterns and characteristics of fluids (such as gases or liquids) under given conditions through space (which may be around a solid surface or inside a pipe, etc.). It involves using mathematical models and computational methods, such as deep learning or other numerical simulation techniques, to predict the distribution of parameters such as fluid velocity, pressure, and temperature. Flow field prediction is crucial for aircraft design, automotive aerodynamics optimization, weather forecasting, environmental engineering, and a variety of industrial applications.
[0003] Physics-Informed Neural Networks (PINNs) are an innovative framework at the intersection of machine learning and physics. By allowing neural networks to learn from data while adhering to fundamental physical laws described by differential equations, they improve the predictive power of neural networks in situations where data is scarce or expensive to acquire. They are commonly used for flow field prediction and reconstruction. Due to the structural characteristics of PINNs, the specific expressions of the partial differential equations followed by the dataset are usually required during training to design the corresponding loss function.
[0004] Symbolic regression is a machine learning technique that aims to identify a latent mathematical expression describing the relationships between a set of datasets. Traditional symbolic regression methods often utilize evolutionary algorithms, which, while effective, are difficult to scale to more complex problems and are highly sensitive to hyperparameters.
[0005] Deep Symbolic Regression (DSR) is a symbolic regression algorithm based on reinforcement learning that trains an agent to generate latent mathematical expressions for a dataset by seeking policy gradients through risk. It excels at "mining" latent function expressions from a dataset.
[0006] However, symbolic regression algorithms based on single-agent reinforcement learning structures often require more time to find expressions describing the relationships between variables in the dataset, and it is difficult to reconstruct the correct partial differential equation expressions from high-dimensional partial differential equation data. Consequently, purely physical information neural networks cannot extract features and make flow field predictions for any flow field dataset from an unknown source.
[0007] Therefore, how to perform efficient and accurate flow field prediction based on the reconstructed expression is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0008] In view of this, the present invention provides a flow field prediction method and system based on a multi-agent symbolic regression algorithm. The multi-agent algorithm is applied to the symbolic regression task to obtain the partial differential equations followed by the flow field dataset. The loss function is constructed based on the equation as a constraint term and the physical information neural network is trained. The trained physical information neural network is used for flow field prediction, realizing efficient and accurate prediction of arbitrary flow field data.
[0009] To achieve the above objectives, the present invention adopts the following technical solution:
[0010] A flow field prediction method based on a multi-agent symbolic regression algorithm includes:
[0011] Acquire known flow field data and set a predetermined number of intelligent agents;
[0012] The known flow field data is input into the agent to obtain the preorder traversal sequence of the symbolic expression tree;
[0013] The partial differential equation is obtained based on the aforementioned preorder traversal sequence;
[0014] The parameters of the agent are updated based on the reward function and the risk-based policy gradient method until the calculation error of the partial differential equation meets the requirements, thus obtaining the updated agent.
[0015] The flow field data to be measured is acquired and input into the updating agent to obtain the optimal partial differential equation as the constraint term;
[0016] Based on the aforementioned constraints, a loss function is constructed and the physical information neural network is trained to obtain a trained physical information neural network.
[0017] The flow field data to be measured is input into the trained physical information neural network to obtain the flow field prediction result.
[0018] Preferably, the method for obtaining the preorder traversal sequence is as follows:
[0019] Based on the blank marker node input by the agent, the root node of the current expression tree is obtained;
[0020] Repeatedly input the parent node and sibling node of the current prediction node into the agent; if the current prediction node has no sibling node, input a blank marker.
[0021] This continues until the complete preorder traversal sequence of the symbolic expression tree is obtained.
[0022] Preferably, each of the intelligent agents can independently and randomly generate a complete set of preorder traversal sequences of the symbolic expression tree;
[0023] Each of the aforementioned agents is configured with a category attribute, which is used to employ a single variable.
[0024] Preferably, obtaining partial differential equations based on the preorder traversal sequence specifically includes:
[0025] The complete expression tree is obtained by merging the aforementioned preorder traversal sequences.
[0026] Based on the complete expression tree, multiple function sub-items and their corresponding coefficients are obtained;
[0027] The partial differential equation is obtained based on the function sub-terms and the coefficients.
[0028] Preferably, all the preorder traversal sequences are merged into the complete expression tree by adding an addition operator to the beginning of the preorder traversal sequence.
[0029] Preferably, the complete expression tree is split based on the addition operation to obtain multiple function sub-items;
[0030] The coefficients of the function sub-terms are obtained by processing the function sub-terms using the STRidge algorithm.
[0031] Preferably, the reward function is as follows:
[0032] R(τ,i)=R global (τ)+R local (i)
[0033] R global (τ)=1 / (1+RMSE)
[0034]
[0035] Where R(τ, i) represents the reward function, R global (τ) represents the global reward, R local (i) represents the local reward, RMSE represents the root mean square error, α1 and α2 represent the first weight and the second weight, respectively, and satisfy α1 + α2 = 1, len(A i ) represents the sequence A i Find the length, D KL (|) indicates the KL divergence calculation, A i Let A represent the probability distribution sequence of the sub-expression sampled by the i-th agent. jLet represent the probability distribution sequence of the sub-expression sampled by the j-th agent, where k represents the k-th probability distribution in the expression probability distribution sequence, and 0 represents the first action in the action sequence.
[0036] Preferably, the root mean square error (RMSE) is as follows:
[0037]
[0038] Where N1 represents the number of input and output datasets, y i Let X represent the i-th output variable. i Let represent the i-th input variable, and g represent the candidate expression. The derivative of the i-th output variable with respect to time t.
[0039] Preferably, the agent's parameters are updated based on a reward function and a risk-based policy gradient seeking method, specifically including:
[0040] The gradient calculation formula is derived based on the reward function and the risk-based strategy gradient method.
[0041]
[0042] Where, λ pg R(τ) represents the importance of the reward, N2 represents the total number of samples in the mini-batch, and R(τ) represents the importance of the reward. (j) i) represents the reward function. This represents the first ε rewards of all rewards in the current round. This means that when the reward function is greater than The value is 1 in the case of time, and 0 in other cases. This represents the gradient of the logarithmic entropy of the probabilistic expression of the current expression with respect to the parameters of the current neural network.
[0043] Based on the gradient calculation formula Update the parameters of the agent:
[0044]
[0045] Where, θ new θ represents the updated agent parameters. old This represents the agent parameters before the update.
[0046] A flow field prediction system based on a multi-agent symbolic regression algorithm includes: a data acquisition module, an equation acquisition module, an update module, a constraint acquisition module, a network training module, and a result output module;
[0047] The data acquisition module is used to acquire known flow field data and set a predetermined number of intelligent agents;
[0048] The equation acquisition module is used to input the known flow field data into the agent to obtain the preorder traversal sequence of the symbolic expression tree; and to obtain the partial differential equation based on the preorder traversal sequence.
[0049] The update module is used to update the parameters of the agent based on the reward function and the risk-based policy gradient method until the calculation error of the partial differential equation meets the requirements, thus obtaining the updated agent.
[0050] The constraint term acquisition module is used to acquire the flow field data to be measured and input it into the updating agent to obtain the optimal partial differential equation as the constraint term.
[0051] The network training module is used to construct a loss function based on the constraint terms and train the physical information neural network to obtain a trained physical information neural network.
[0052] The result output module is used to input the flow field data to be measured into a trained physical information neural network to obtain the flow field prediction result.
[0053] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a flow field prediction method and system based on a multi-agent symbolic regression algorithm. It applies multiple agents to the symbolic regression task, regresses to obtain the partial differential equations followed by the flow field dataset, constructs a loss function based on this equation as a constraint term, and trains a physical information neural network. The trained physical information neural network then performs flow field prediction, which has the following beneficial effects:
[0054] 1. This invention employs multiple agents, and thanks to the emergent nature of multiple agents, it is able to reconstruct more complex expressions.
[0055] 2. By restricting the variables in the expressions generated by the agents and adding local reward functions, the solution space of each agent is limited to a certain extent, which can efficiently restore the symbolic expression of the composite dataset.
[0056] 3. Describing the expression tree as a series of node values or "tags" through preorder traversal facilitates the sequential construction of the expression tree and ensures a direct correspondence between the tree structure and its traversal order.
[0057] 4. All generated symbolic expressions are evaluated through a reward function to encourage each agent to achieve the best results; all agents update their parameters by seeking policy gradients through risk to achieve optimal results; the solution time for complex problems is short and it can solve high-dimensional problems.
[0058] 5. By training the physical information neural network with a loss function that includes constraints of partial differential equations, it is ensured that the solution learned by the network not only matches the training data, but also follows the physical laws of partial differential equations. This can, to some extent, make up for the inability of existing physical information neural networks to fit data in the case of unknown controlled partial differential equations.
[0059] 6. The method of this invention is of great significance for the reconstruction and prediction of flow fields such as ocean flow fields and air flow fields, and provides support for design work in fields such as shipbuilding and aerospace. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0061] Figure 1 The flowchart of a flow field prediction method based on a multi-agent symbolic regression algorithm provided by the present invention is shown.
[0062] Figure 2 This is a schematic diagram illustrating the preorder traversal sequence generation process provided by the present invention.
[0063] Figure 3 The flowchart of the method for obtaining partial differential equations based on preorder traversal sequence provided by the present invention is shown.
[0064] Figure 4 This invention provides a schematic diagram of a flow field prediction system based on a multi-agent symbolic regression algorithm. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] Example 1
[0067] Deep symbolic regression (DSR) is a symbolic regression algorithm based on reinforcement learning. It trains an agent to generate latent mathematical expressions for a dataset by seeking policy gradients through risk. However, symbolic regression algorithms based on single-agent reinforcement learning structures often require more time to find expressions describing the relationships between variables in the dataset, and they struggle to reconstruct correct partial differential equation expressions from high-dimensional partial differential equation data.
[0068] Physics-Informed Neural Networks (PINNs) are an innovative framework at the intersection of machine learning and physics. By allowing neural networks to learn from data while adhering to fundamental physical laws described by differential equations, they improve the predictive power of neural networks in situations where data is scarce or expensive to acquire. They are commonly used for flow field prediction and reconstruction. However, for complex physical systems or when dealing with highly nonlinear differential equations, formulating and optimizing their loss functions is challenging.
[0069] Based on the aforementioned problems: existing symbolic regression algorithms struggle to reconstruct the correct partial differential equation expression from high-dimensional partial differential equation data; and the formulation and optimization of the loss function for physical information neural networks present challenges.
[0070] like Figure 1 As shown in the figure, this invention discloses a flow field prediction method based on a multi-agent symbolic regression algorithm, including:
[0071] Acquire known flow field data and set a predetermined number of intelligent agents;
[0072] The known flow field data is input into the agent to obtain the preorder traversal sequence of the symbolic expression tree;
[0073] Partial differential equations are derived from the preorder traversal sequence;
[0074] The agent's parameters are updated using a policy gradient-seeking method based on the reward function and risk until the computational error of the partial differential equation meets the requirements, thus obtaining the updated agent.
[0075] The flow field data to be measured is acquired and input into the updating agent to obtain the optimal partial differential equation as the constraint term;
[0076] A loss function is constructed based on the constraint terms, and the physical information neural network is trained to obtain a trained physical information neural network.
[0077] The flow field data to be measured is input into a trained physical information neural network to obtain the flow field prediction results.
[0078] Example 2
[0079] This invention discloses a preferred flow field prediction method based on a multi-agent symbolic regression algorithm, comprising:
[0080] Acquire known flow field data and set a predetermined number of intelligent agents.
[0081] Preferably, in this embodiment, the known flow field data is predefined symbol library data; the agent is a recurrent neural network with structure awareness capability. A recurrent neural network with structure awareness capability is a recurrent neural network that can input the labels of the parent and sibling nodes of the predicted node and output the labels of the predicted node.
[0082] Preferably, since most partial differential equations in nature do not have overlapping terms with multiple variables, such as: u xy This method assigns a category attribute to each agent to handle complex high-dimensional problems. Each agent has a category attribute to use a single variable, meaning the number of agents is the same as the number of variable categories. For example, in a binary problem, the expression is x^2 + y. The number of agents is set to 2. One agent is set to category x, meaning it can only generate the preorder traversal sequence of the symbolic expression tree with variable x, i.e., the expression it generates is x^2. The other agent is set to category y, which generates the expression y.
[0083] Preferably, the present invention employs multiple agents, which, thanks to the emergent nature of multiple agents, enables the reconstruction of more complex expressions.
[0084] The known flow field data is input into the agent to obtain the preorder traversal sequence of the symbolic expression tree.
[0085] Preferably, the process of each agent generating an expression can be viewed as constructing a symbolic expression tree. By employing preorder traversal, the expression tree can be described as a sequence of "tags," where each tag is determined from a predefined set of available tags, such as the tag set {+, sin, x, cos}. Since the "tag" sequence uses preorder traversal, the parent and sibling nodes of the node corresponding to the i-th tag in the sequence are already in the sequence; therefore, the tag of that node can be predicted based on the tags of its parent and sibling nodes.
[0086] The preferred method for obtaining the preorder traversal sequence is as follows:
[0087] Based on the blank marker node input by the agent, the root node of the current expression tree is obtained;
[0088] Repeatedly input the parent node and sibling node of the current prediction node into the agent; if the current prediction node has no sibling node, input a blank marker.
[0089] Obtaining the complete preorder traversal sequence of the symbolic expression tree facilitates the sequential construction of the expression tree, ensuring a direct correspondence between the tree structure and its traversal order.
[0090] Preferred, such as Figure 2 As shown, taking the expression x×x+y as an example, the preorder traversal sequence generation process is as follows:
[0091] During the generation process, since the root node has no parent or sibling nodes, two blank labeled nodes are first input into the recurrent neural network to determine the label of the root node of the current expression tree, i.e., +.
[0092] Then, the parent and sibling nodes of the current prediction node are repeatedly input into the recurrent neural network until a complete expression tree is built. If the current prediction node has no sibling nodes, a blank token is passed in.
[0093] In the diagram, the blue dashed box represents the parent node label of the currently predicted node, and the red dashed box represents the sibling node label.
[0094] Preferably, the expression tree is described as a series of node values or "tags" using the preorder traversal method. For example, the expression sin(x) + cos(y) can be represented as the preorder traversal sequence: +, sin, x, cos, x. This facilitates the sequential construction of the expression tree and ensures a direct correspondence between the tree structure and its traversal order. Each expression is described by the preorder traversal sequence of its respective expression tree. For example, the expression sin(x) + cos(y) can be represented as: +, sin, x, cos, y, where x and y are its leaf nodes.
[0095] Preferably, mathematical expressions can be represented using symbolic expression trees, which are a form of tree structure that encodes mathematical operations. Internal nodes represent operators, and leaf nodes represent input variables or constants. Operators can be unary, involving a single parameter, such as a sine function, or binary, requiring two parameters, such as multiplication.
[0096] Preferably, each agent can independently and randomly generate a complete set of preorder traversal sequences of symbolic expression trees.
[0097] Preferably, since the subtraction operation can be represented by the positive or negative value of the coefficient, the subtraction operation sign is not sampled during the sampling process of each agent.
[0098] Partial differential equations are derived from the preorder traversal sequence.
[0099] Preferred, such as Figure 3 As shown, partial differential equations are obtained based on the preorder traversal sequence, specifically including:
[0100] The complete expression tree is obtained by merging the preorder traversal sequences;
[0101] Processing based on the complete expression tree yields multiple function sub-items and their corresponding coefficients;
[0102] Partial differential equations are derived from function terms and coefficients.
[0103] Preferably, all preorder traversal sequences are merged into a complete expression tree by adding an addition operator to the beginning of the preorder traversal sequence.
[0104] Preferably, the complete expression tree is split based on the addition operation to obtain multiple function sub-items, representing each sub-item in the complete expression tree;
[0105] The function sub-terms are processed using the STRidge algorithm to obtain the coefficients corresponding to the function sub-terms.
[0106] Preferably, STRidge is a special type of Ridge algorithm. By setting a threshold range, based on the coefficients of each function term participating in the regression, the algorithm removes function terms whose coefficients are not within the threshold range and continues the regression until all the coefficients obtained from the regression are within the threshold range.
[0107] For example: the regression objective is x^2+x=y, the threshold interval is [1, 10], and the regression terms are: x^2, x, x^3, with each coefficient being: 2, 1, 10000; therefore, the x^3 term is removed, and the remaining terms continue to regress, resulting in x^2+x.
[0108] Preferably, STRidge is a commonly used method in sparse regression, which can effectively identify important expression terms and derive concise equations through linear fitting of observations; it can be used to calculate the coefficient of each expression term in the generated symbolic expression; its parameters quantify the significance of the regularization term, and by establishing a threshold, function terms with coefficients below a certain value can be discarded.
[0109] Preferably, the fundamental difference between partial differential equations (PDEs) and ordinary functions lies in the complexity of their structure and applications. Ordinary functions typically define explicit relationships between single variables, such as y = ff(x), where x and y are real variables, and the function's direct output depends on the input variables. In contrast, PDEs involve complex relationships between one or more multivariable functions and their partial derivatives, and are typically used to simulate the dynamic changes of various continuous phenomena in the physical world, such as fluid dynamics, heat transfer, and electromagnetism. This form of equation is particularly crucial when describing phenomena involving multidimensional variables in time and space; they usually do not directly provide the specific form of the function, but rather solve the functional model through mathematical analysis or numerical methods.
[0110] The agent's parameters are updated using a policy gradient-seeking method based on the reward function and risk, until the computational error of the partial differential equation meets the requirements, thus obtaining the updated agent.
[0111] Preferably, the reward function is as follows:
[0112] R(τ,i)=R global (τ)+R local (i)
[0113] R global (τ)=1 / (1+RMSE)
[0114]
[0115] Where R(τ, i) represents the reward function, R global (τ) represents the global reward, R local (i) represents the local reward, RMSE represents the root mean square error, α1 and α2 represent the first weight and the second weight, respectively, and satisfy α1 + α2 = 1, len(A i ) represents the sequence A i Find the length, D KL (|) indicates the KL divergence calculation, A i Let A represent the probability distribution sequence of the sub-expression sampled by the i-th agent. j Let represent the probability distribution sequence of the sub-expression sampled by the j-th agent, where k represents the k-th probability distribution in the expression probability distribution sequence, and 0 represents the first action in the action sequence (index 0).
[0116] Preferably, the root mean square error (RMSE) is as follows:
[0117]
[0118] Where N1 represents the number of input and output datasets, y iLet X represent the i-th output variable. i Let represent the i-th input variable, and g represent the candidate expression. The derivative of the i-th output variable with respect to time t.
[0119] Preferably, the global reward is mainly calculated by using the root mean square error (RMSE) to measure the difference between the result of the input variable after being calculated by the generated expression and the actual result, thus evaluating the degree of convergence between the generated expression and the actual expression; the local reward aims to accelerate the convergence of each agent.
[0120] Preferably, the KL divergence is a measure of the relationship between different distributions, expressed as... Here, P and Q are two different distributions of the same random variable. Typically, in most symbolic expressions, there is significant diversity among the subterms of the expression, such as xsin(x)+x 3 .
[0121] In each agent's sampling action, special attention should be paid to the probability distribution of the first action (because the first action is generated under the condition of empty symbols, and other actions depend on the first action to some extent). This method designs a local reward function based on KL divergence, which calculates the average KL divergence of the action probability distribution of each agent relative to other agents throughout the sampling process, and takes into account the influence of the first action in the process, and selects the maximum value calculated from this as the agent's local reward.
[0122] Preferably, the value of the local reward function for each agent is determined as the maximum value among the results calculated based on the formula for that agent relative to all other agents.
[0123] Preferably, the agent's parameters are updated based on a policy gradient seeking method using the reward function and risk, specifically including:
[0124] The gradient calculation formula is derived from the policy gradient seeking method based on the reward function and risk.
[0125]
[0126] Where, λ pg R(τ) represents the importance of the reward, N2 represents the total number of samples in the mini-batch, and R(τ) represents the importance of the reward. (j) i) represents the reward function. This represents the first ε rewards of all rewards in the current round. This means that when the reward function is greater than The value is 1 in the case of time, and 0 in other cases. This represents the gradient of the logarithmic entropy of the probabilistic expression of the current expression with respect to the parameters of the current neural network.
[0127] Based on gradient calculation formula Update the agent's parameters:
[0128]
[0129] Where, θ new θ represents the updated agent parameters. old This represents the agent parameters before the update.
[0130] Preferably, the Risk-seeking Policy Gradient Method (RSP) is a method used in reinforcement learning to train agents, particularly when dealing with tasks that require optimizing rare but high-reward decisions. Compared to traditional policy gradient methods (such as REINFORCE or Actor-Critic methods), this approach places greater emphasis on achieving a balance between high risk and high reward in the agent's behavioral choices.
[0131] Preferred, The first ε rewards of all rewards in the current round are used as the baseline reward and will fluctuate with the samples in each iteration. During each update, the mean of all reward functions is not selected to update the agent's neural network. Instead, the reward function that is greater than the baseline reward is used to update the agent's neural network.
[0132] Preferably, by restricting the variables in the expressions generated by the agents and adding local reward functions, the solution space of each agent is limited to a certain extent, which can efficiently restore the symbolic expression of the composite dataset.
[0133] Preferably, the calculation error of the partial differential equation is satisfied until it meets the requirement, specifically, until the calculation error of the partial differential equation is less than a set threshold. Under ideal conditions, the predicted partial differential equation with an error less than the set threshold corresponds one-to-one with the function terms and coefficients of the correct partial differential equation that actually reflects the changes in the flow field data.
[0134] The flow field data to be measured is acquired and input into the updating agent to obtain the optimal partial differential equation as the constraint term.
[0135] A loss function is constructed based on the constraint terms, and the physical information neural network is trained to obtain a trained physical information neural network.
[0136] Preferably, the difference between a physical information neural network and a regular neural network lies in the fact that it introduces a constraint term of a partial differential equation in the loss function. This constraint term is actually the calculation expression of the corresponding partial differential equation. The output of the neural network is substituted into this equation to determine whether it satisfies the equation. That is, the accuracy of the physical information neural network in measuring the prediction data depends not only on the difference between the predicted value and the actual value, but also on the degree to which the predicted value satisfies the partial differential equation.
[0137] The training process of a physical information neural network involves constructing a deep neural network that takes spatial and temporal coordinates as input and outputs approximate solutions to partial differential equations. The network architecture is designed to accommodate the flexibility and complexity required to solve specific partial differential equations, employing multiple fully connected layers. A key aspect of the training process is defining a loss function that includes constraints related to the partial differential equations. This function measures not only the error between the network's predictions and known data points (such as boundaries and initial conditions), but also includes a constraint term: substituting the network output into an expression obtained from a symbolic regression algorithm and calculating the resulting residual. This ensures that the solutions learned by the network not only match the training data but also adhere to the physical laws governing the partial differential equations.
[0138] Preferably, training the physical information neural network with a loss function that includes constraints of partial differential equations ensures that the solutions learned by the network not only match the training data but also follow the physical laws of partial differential equations. This can, to some extent, compensate for the inability of existing physical information neural networks to fit data in the case of unknown controlled partial differential equations.
[0139] The flow field data to be measured is input into a trained physical information neural network to obtain the flow field prediction results.
[0140] Preferably, a well-trained physical information neural network (PEN) can accept new spatial and temporal coordinates as input and output the flow field properties at the corresponding points. This process highlights the potential of PSNs in handling complex physical and engineering problems, especially when traditional numerical methods are difficult to apply or computationally too expensive. The accurate representation of partial differential equations is crucial to ensuring that PSNs can learn and predict effectively. This not only demonstrates the application of deep learning in scientific computing but also emphasizes the core role of physical laws in guiding the training of these models.
[0141] Example 3
[0142] Step 1: This invention uses the Tensorflow framework to write code for the sampling, computation, and training of agents, and uses the agents to process and obtain the preorder traversal sequence of the symbolic expression tree.
[0143] Preferably, Tensorflow is a widely recognized deep learning framework in the industry. Compared with other deep learning frameworks, it increases the training and inference speed of algorithms by predefining the computation graph. Using this framework to write algorithms can significantly shorten the running time of the algorithms and provide users with faster services.
[0144] Step 2: By writing code to construct a symbolic expression tree, the preorder traversal sequence of the symbolic expression tree obtained in Step 1 is concatenated to construct a complete expression tree structure and stored.
[0145] Step 3: Perform full regression using the regression algorithm defined in the NumPy package. The NumPy package is a widely recognized scientific computing package that includes a variety of computation functions and some machine learning algorithms.
[0146] Step 4: Write code based on the formulas and content mentioned above, and use the Adam optimizer (a widely recognized optimizer in the industry) to update the agent network parameters.
[0147] Step 5: This method uses an automated script to construct the training architecture of the physical information neural network and train the model based on the expression obtained in Step 4.
[0148] Example 4
[0149] This invention was tested on several different datasets of common differential equations to verify the effectiveness of the proposed method in mining the potential differential equation descriptions of the datasets.
[0150] The dataset of differential equations used in the experiment is shown in Table 1:
[0151] Table 1. Formulaic Expression of Equations
[0152]
[0153]
[0154] The experimental results obtained based on the method of this invention are shown in Table 2:
[0155] Table 2. Expressions obtained by this method
[0156] Equation name The result obtained by this method Kdv <![CDATA[u t =-1.0002uu x -0.0025u xxx ]]> Burgers <![CDATA[u t =-1.0042uu x +0.0984u xx ]]> Chafee-Infante <![CDATA[u t =1.0002u xx -1.0004u+1.0007u 3 ]]> PDE-divide <![CDATA[u t =-0.99790u x / x+0.24980u xx ]]> diffusion(2d) <![CDATA[u t =0.19989u xx +0.19989u yy ]]> CDE(2d) <![CDATA[u t =-0.15044u x -0.15044u y +0.20075u xx +0.20075u yy ]]>
[0157] A comparison of the two tables above shows that this invention can accurately uncover the potential differential equations in a dataset.
[0158] Comparison of the time required for this invention and the benchmark method to learn the best results:
[0159] Discover is the first algorithm to apply symbolic regression to a reinforcement learning-based algorithm model for discovering partial differential equations. Table 3 shows a comparison of the time required for this invention to achieve the best results with the benchmark method Discover.
[0160] Table 3 Time Comparison of the Invention and the Benchmark Method
[0161] Equation name Discover This method Kdv 47.28s 32.71s Burgers 60.24s 27.51s Chafee-Infante 104.43s 97.21s PDE-divide 82.45s 12.72s diffusion(2d) 287.92s 28.02s CDE(2d) >1000.0s 99.94s
[0162] The experimental results show that this method can achieve the desired results in a shorter time.
[0163] Based on the two-dimensional data in Table 2, the physical information neural network corresponding to the constraint terms of the partial differential equations mined from the concentration diffusion liquid flow field (Diffusion) and the convection diffusion liquid flow field (CDE) is shown in Table 4.
[0164] Table 4. Prediction results of the corresponding physical information neural network
[0165] Equation name MSE Diffusion <![CDATA[5.86×10 -3 <!-- 10 -->]]> CDE <![CDATA[5.91×10 -3 ]]>
[0166] The MSE of the calculation results obtained by the traditional numerical method (finite element method) is 1×10⁻⁶. -2 Up to 1×10 -3 The results show that the method of this invention predicts relatively accurate values. MSE, or Mean Squared Error, is an indicator that measures the difference between the model's predicted value and the actual value, and is calculated by averaging the squares of the differences between the predicted and actual values.
[0167] This invention demonstrates that the method can, to some extent, compensate for the limitations of existing physical information neural networks in fitting data to unknown controlled partial differential equations. Experimental results show that, compared to similar algorithms, this method has a more significant speed advantage and higher fitting accuracy.
[0168] Example 5
[0169] like Figure 4 As shown, a flow field prediction system based on a multi-agent symbolic regression algorithm includes: a data acquisition module, an equation acquisition module, an update module, a constraint acquisition module, a network training module, and a result output module.
[0170] The data acquisition module is used to acquire known flow field data and set a predetermined number of intelligent agents;
[0171] The equation acquisition module is used to input known flow field data into the agent and obtain the preorder traversal sequence of the symbolic expression tree; based on the preorder traversal sequence, the partial differential equation is obtained.
[0172] The update module is used to update the parameters of the agent based on the reward function and the risk-based policy gradient method until the calculation error of the partial differential equation meets the requirements, thus obtaining the updated agent.
[0173] The constraint acquisition module is used to acquire the flow field data to be measured and input it into the updating agent to obtain the optimal partial differential equation as the constraint term;
[0174] The network training module is used to construct a loss function based on the constraint terms and train the physical information neural network to obtain a trained physical information neural network.
[0175] The result output module is used to input the flow field data to be measured into the trained physical information neural network to obtain the flow field prediction result.
[0176] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a flow field prediction method and system based on a multi-agent symbolic regression algorithm. It applies multiple agents to the symbolic regression task, regresses to obtain the partial differential equations followed by the flow field dataset, constructs a loss function based on this equation as a constraint term, and trains a physical information neural network. The trained physical information neural network then performs flow field prediction, which has the following beneficial effects:
[0177] 1. This invention employs multiple agents, and thanks to the emergent nature of multiple agents, it is able to reconstruct more complex expressions.
[0178] 2. By restricting the variables in the expressions generated by the agents and adding local reward functions, the solution space of each agent is limited to a certain extent, which can efficiently restore the symbolic expression of the composite dataset.
[0179] 3. Describing the expression tree as a series of node values or "tags" through preorder traversal facilitates the sequential construction of the expression tree and ensures a direct correspondence between the tree structure and its traversal order.
[0180] 4. All generated symbolic expressions are evaluated through a reward function to encourage each agent to achieve the best results; all agents update their parameters by seeking policy gradients through risk to achieve optimal results; the solution time for complex problems is short and it can solve high-dimensional problems.
[0181] 5. By training the physical information neural network with a loss function that includes constraints of partial differential equations, it is ensured that the solution learned by the network not only matches the training data, but also follows the physical laws of partial differential equations. This can, to some extent, make up for the inability of existing physical information neural networks to fit data in the case of unknown controlled partial differential equations.
[0182] 6. The method of this invention is of great significance for the reconstruction and prediction of flow fields such as ocean flow fields and air flow fields, and provides support for design work in fields such as shipbuilding and aerospace.
[0183] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0184] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A flow field prediction method based on a multi-agent symbolic regression algorithm, characterized in that, include: Acquire known flow field data and set a predetermined number of intelligent agents; The known flow field data is input into the agent to obtain the preorder traversal sequence of the symbolic expression tree; The partial differential equation is obtained based on the aforementioned preorder traversal sequence; The parameters of the agent are updated based on the reward function and the risk-based policy gradient method until the calculation error of the partial differential equation meets the requirements, thus obtaining the updated agent. The flow field data to be measured is acquired and input into the updating agent to obtain the optimal partial differential equation as the constraint term; Based on the aforementioned constraints, a loss function is constructed and the physical information neural network is trained to obtain a trained physical information neural network. The flow field data to be measured is input into the trained physical information neural network to obtain the flow field prediction result.
2. The flow field prediction method based on multi-agent symbolic regression algorithm according to claim 1, characterized in that, The method for obtaining the preorder traversal sequence is as follows: Based on the blank marker node input by the agent, the root node of the current expression tree is obtained; Repeatedly input the parent node and sibling node of the current prediction node into the agent; if the current prediction node has no sibling node, input a blank marker. This continues until the complete preorder traversal sequence of the symbolic expression tree is obtained.
3. The flow field prediction method based on a multi-agent symbolic regression algorithm according to claim 1, characterized in that, Each of the aforementioned agents can independently and randomly generate a complete set of preorder traversal sequences of the symbolic expression tree; Each of the aforementioned agents is configured with a category attribute, which is used to employ a single variable.
4. The flow field prediction method based on multi-agent symbolic regression algorithm according to claim 1, characterized in that, The partial differential equations derived from the aforementioned preorder traversal sequence specifically include: The complete expression tree is obtained by merging the aforementioned preorder traversal sequences. Based on the complete expression tree, multiple function sub-items and their corresponding coefficients are obtained; The partial differential equation is obtained based on the function sub-terms and the coefficients.
5. The flow field prediction method based on multi-agent symbolic regression algorithm according to claim 4, characterized in that, By adding an addition operator to the beginning of the preorder traversal sequence, all the preorder traversal sequences are merged into the complete expression tree.
6. The flow field prediction method based on multi-agent symbolic regression algorithm according to claim 4, characterized in that, The complete expression tree is split based on the addition operation to obtain multiple function sub-items; The coefficients of the function sub-terms are obtained by processing the function sub-terms using the STRidge algorithm.
7. The flow field prediction method based on multi-agent symbolic regression algorithm according to claim 1, characterized in that, The reward function is specifically as follows: R(τ,i)=RR global (t)+R local (i) R globcal (τ)=1 / (1+RMSE) Where R(τ,i) represents the reward function, R global (τ) represents the global reward, R local (i) represents the local reward, RMSE represents the root mean square error, α1 and α2 represent the first weight and the second weight, respectively, and satisfy α1 + α2 = 1, len(A i ) represents the sequence A i Find the length, D KL (|) indicates the KL divergence calculation, A i Let A represent the probability distribution sequence of the sub-expression sampled by the i-th agent. j Let represent the probability distribution sequence of the sub-expression sampled by the j-th agent, where k represents the k-th probability distribution in the expression probability distribution sequence, and 0 represents the first action in the action sequence.
8. The flow field prediction method based on multi-agent symbolic regression algorithm according to claim 7, characterized in that, The root mean square error (RMSE) is as follows: Where N1 represents the number of input and output datasets, y i Let X represent the i-th output variable. i Let represent the i-th input variable, and g represent the candidate expression. The derivative of the i-th output variable with respect to time t.
9. A flow field prediction method based on a multi-agent symbolic regression algorithm according to claim 8, characterized in that, The agent's parameters are updated based on a policy gradient seeking method using a reward function and risk, specifically including: The gradient calculation formula is derived based on the reward function and the risk-based strategy gradient method. Where, λ pg R(τ) represents the importance of the reward, N2 represents the total number of samples in the mini-batch, and R(τ) represents the importance of the reward. (j) (i) represents the reward function. This represents the first ε rewards of all rewards in the current round. This means that when the reward function is greater than The value is 1 in the case of time, and 0 in other cases. This represents the gradient of the logarithmic entropy of the probabilistic expression of the current expression with respect to the parameters of the current neural network. Based on the gradient calculation formula Update the parameters of the agent: Where, θ new θ represents the updated agent parameters. old This represents the agent parameters before the update.
10. A flow field prediction system based on a multi-agent symbolic regression algorithm, characterized in that, include: The system includes a data acquisition module, an equation acquisition module, an update module, a constraint term acquisition module, a network training module, and a result output module. The data acquisition module is used to acquire known flow field data and set a predetermined number of intelligent agents; The equation acquisition module is used to input the known flow field data into the agent to obtain the preorder traversal sequence of the symbolic expression tree; and to obtain the partial differential equation based on the preorder traversal sequence. The update module is used to update the parameters of the agent based on the reward function and the risk-based policy gradient method until the calculation error of the partial differential equation meets the requirements, thus obtaining the updated agent. The constraint term acquisition module is used to acquire the flow field data to be measured and input it into the updating agent to obtain the optimal partial differential equation as the constraint term. The network training module is used to construct a loss function based on the constraint terms and train the physical information neural network to obtain a trained physical information neural network. The result output module is used to input the flow field data to be measured into a trained physical information neural network to obtain the flow field prediction result.