A posteriori error estimation method for finite element numerical simulation based on artificial neural network
The posterior error estimation model for finite element numerical simulation of electrostatic field Poisson equations is constructed by a method based on artificial neural network, which solves the complexity problem caused by grid type differences in the existing technology, and achieves efficient error estimation and accuracy improvement.
Patent Information
- Application Number
- CN202210987591.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-08-17
AI Technical Summary
The existing posterior error estimation method for finite element numerical solution of Poisson equations requires different method design for different finite element grid types, resulting in high algorithm and program complexity.
Using an artificial neural network-based method, a neural network model is constructed through the pytorch software package, and the neural network model is trained to estimate the posterior error of finite element numerical solutions under different grids. The neural network model is used to complete the error estimation, avoiding the retraining process.
It simplifies the error estimation process, saves calculation amount, and is suitable for different types of finite element grids, improves the accuracy and efficiency of Poisson equations to solve the electrostatic field, and supports the application of grid adaptive algorithms.
Smart Images

Figure CN115270581B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a posterior error estimation method for a finite element numerical solution, and in particular to a posterior error estimation method for a finite element numerical simulation of an electrostatic field Poisson equation based on an artificial neural network. Background Art
[0002] The finite element method (FEM) is a key approach in current numerical simulation technology, playing a crucial role in the numerical solution of partial differential equations in physics and engineering. The basic idea of the FEM is to mesh the computational domain, construct a piecewise function (polynomial) on each grid, and then, combined with the variational principle, obtain an approximate solution to the mathematical model of the physical problem (usually represented by a set of partial differential equations and initial and boundary value conditions). In essence, the FEM uses discrete solutions in a finite-dimensional space to approximate continuous solutions in an infinite-dimensional space. Because the FEM is essentially an approximate solution to a physical model, the approximate solution inevitably contains certain errors (there are certain differences from the true solution of the mathematical model). The magnitude of this error determines the reliability and application value of the FEM numerical solution. For electrostatic field problems, when the FEM is used to solve the Poisson equation, the accuracy of the numerical solution obtained has a significant impact on the analysis of the problem. Finite element a posteriori error estimation methods can quantitatively evaluate the accuracy of finite element numerical solutions to the Poisson equation, thereby providing support for the correctness of the analysis results of electrostatic field problems.
[0003] With the continuous development of finite element method theory, a posteriori error estimation theory for finite element methods has been gradually established, and a variety of a posteriori error estimation methods have emerged, including residual estimation, local problem-assisted estimation, hierarchical estimation, and reconstruction estimation. Finite element a posteriori error estimation methods can provide a quantitative estimate of the error in the finite element numerical solution, and thus can be used to quantitatively evaluate the accuracy of the numerical solution. However, these a posteriori error estimation methods require different methodological designs for different finite element mesh types, which are relatively complex from both the algorithmic and procedural perspectives. Summary of the Invention
[0004] The purpose of the present invention is to solve the shortcomings of the existing a posteriori error estimation method for the finite element numerical solution of the Poisson equation in the electrostatic field, which requires different method designs for different finite element grid types, resulting in high complexity of the algorithm and program, and to provide a posteriori error estimation method for finite element numerical simulation based on artificial neural network.
[0005] In order to solve the deficiencies of the above-mentioned prior art, the present invention provides the following technical solutions:
[0006] A posterior error estimation method for finite element numerical simulation based on an artificial neural network is characterized in that it includes the following steps:
[0007] Step 1, calculate the finite element numerical solution in the analysis area Ω of the electrostatic field;
[0008] Step 1.1. Determine the electrostatic field analysis area Ω and measure it, then determine the charge density in the analysis area and the potential value at the boundary of the analysis area; establish the electrostatic field Poisson equation
[0009] Step 1.2: Use the finite element method to solve the Poisson equation for the electrostatic field;
[0010] The analysis area Ω of the electrostatic field Poisson equation is divided into the calculation area Ω to obtain the set T of grid units K h ,definition It represents the set T h The polynomial function space of degree not exceeding K on any unit K in the function space V h There is a finite element numerical solution u h , so that u h Satisfy the equation in
[0011] Where u is the unknown potential function, v is the polynomial function, L 2 (Ω) is the function space composed of all square-integrable functions in Ω, is the Sobolev space, represents the charge density, ε0=8.854×10 -12 F / m represents the dielectric constant, (·,·) represents the inner product of the function;
[0012] Step 2: Build a neural network model;
[0013] Take points inside and on the boundary of the calculation area Ω determined in step 1, and record them as in d represents the dimension of the region Ω; N is the number of points taken;
[0014] The pytorch software package is used to build a neural network model. The first layer of the neural network model is the input layer, and the input data of the input layer is The dimension of the input layer is d; the last layer of the neural network model is the output layer, and the dimension of the output layer is d; there are L hidden layers between the input layer and the output layer, and each hidden layer has m l neurons, l = 1, 2, ..., L;
[0015] Calculate the neuron output of each hidden layer based on the connection weights between neurons in each hidden layer and the activation level of each neuron;
[0016] Step 3: Define the loss function of the neural network model based on the Poisson equation and its finite element numerical solution, and train the neural network model using the stochastic gradient descent algorithm through the pytorch software package;
[0017] Step 4: Calculate the posterior error of the finite element numerical solution of the Poisson equation in the region Ω using the neural network model obtained in step 3.
[0018] Furthermore, in step 2, the neuron output of the lth hidden layer of the neural network model is:
[0019] When l=1,
[0020] in, is the output of the kth neuron in the first hidden layer, is the connection weight from the i2th input of the input layer to the kth neuron of the first hidden layer, is the activation level of the kth neuron in the first hidden layer, m1 is the number of neurons in the first hidden layer; neuron activation function
[0021] When l=2,…,L,
[0022] in, is the kth neuron output of the lth hidden layer, is the output of the i2th neuron in the l-1th hidden layer, is the connection weight from the output of the o2th neuron in the l-1th hidden layer to the kth neuron in the lth hidden layer, is the activation level of the kth neuron in the lth hidden layer, m l is the number of neurons in the lth hidden layer;
[0023] The output of the neurons in the output layer is:
[0024]
[0025] in, is the connection weight from the output of the i2th neuron in the Lth hidden layer to the kth neuron in the output layer, is the activation level of the kth neuron in the output layer.
[0026] Furthermore, in step 3, the loss function of the neural network model is:
[0027]
[0028] Among them, β1 and β2 are two weight coefficients; Net(X) is the neural network model; uh represents the finite element numerical solution; is the gradient of the finite element numerical solution; f(X) represents the right-hand side of the Poisson equation; yes The divergence of
[0029] Furthermore, the step 4 is specifically as follows:
[0030]
[0031]
[0032] Among them, ∈ K is the local error of the finite element numerical solution on each grid, ∈ is the a posteriori error of the finite element numerical solution on the region Ω;
[0033] Finite element numerical solution u h The energy error of the unknown true solution u is as follows:
[0034]
[0035] is the gradient of the unknown true solution u.
[0036] Furthermore, in step 2, the point selection rule can be random point selection, or the area Ω can be gridded to obtain structured grid or unstructured grid nodes to ensure that the selected nodes are representative of the interior and boundary of the area Ω.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] (1) The present invention provides a posterior error estimation method for finite element numerical simulation based on an artificial neural network. The neural network model is constructed using the pytorch software package based on the Poisson equation of the electrostatic field. After the neural network model is trained, it can be used to estimate the posterior error of the finite element numerical solution under different grids without retraining the neural network. In particular, when the posterior error is only used in the grid adaptive algorithm, compared with the classical posterior error estimation method, the present invention saves computational effort by eliminating the process of constructing the posterior error.
[0039] According to the a posteriori error results given by the present invention, combined with the acceptable error limit, it can be determined whether it is necessary to further encrypt the grid and re-perform the finite element analysis calculation process of the electrostatic field Poisson equation, thereby improving the solution accuracy of the electrostatic field Poisson equation; in addition, the a posteriori error results given by the present invention can be used as the grid indicator in the grid adaptive algorithm in the finite element adaptive analysis of the electrostatic field Poisson equation.
[0040] (2) The present invention provides a posterior error estimation method for finite element numerical simulation based on artificial neural network. It is a meshless method that has no requirements for finite element meshes and is applicable to commonly used meshes such as two-dimensional triangles / quadrilaterals and three-dimensional tetrahedrons / hexahedrons. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Schematic diagram of a process flow of a posterior error estimation method for finite element numerical simulation based on artificial neural network according to the present invention;
[0042] Figure 2 This is a schematic diagram of taking points in the calculation area Ω in step 1 of the present invention;
[0043] Figure 3 This is a schematic diagram of the structure of the neural network model constructed in step 2 of the present invention;
[0044] Figure 4 This is a surface diagram of the analytical solution of the Poisson equation in Example 1;
[0045] Figure 5 A grid used for calculating numerical solutions for Example 1 and Example 4;
[0046] Figure 6 This is a surface diagram of the numerical solution of the Poisson equation in Example 1;
[0047] Figure 7 This is the convergence of the loss function after 20,000 steps of neural network training in step 3 of Example 1;
[0048] Figure 8 The true error ∈ * Distribution map of
[0049] Figure 9 is the distribution diagram of the posterior error ∈ of Example 1;
[0050] Figure 10 is the true error ∈ of Example 2 * Distribution map of
[0051] Figure 11 is the distribution diagram of the posterior error ∈ of Example 2;
[0052] Figure 12 is the true error ∈ of Example 3 * Distribution map of
[0053] Figure 13 is the distribution diagram of the posterior error ∈ of Example 3;
[0054] Figure 14 This is a surface diagram of the analytical solution of the Poisson equation in Example 4;
[0055] Figure 15is a surface diagram of the numerical solution of the Poisson equation in Example 4;
[0056] Figure 16 This is the convergence of the loss function after 20,000 steps of neural network training in step 3 of Example 4;
[0057] Figure 17 The true error ∈ of Example 4 * Distribution map of
[0058] Figure 18 is the distribution diagram of the posterior error ∈ of Example 4;
[0059] Figure 19 is the true error ∈ of Example 5 * Distribution map of
[0060] Figure 20 is the distribution diagram of the posterior error ∈ of Example 5;
[0061] Figure 21 The true error ∈ of Example 6 * Distribution map of
[0062] Figure 22 This is the distribution diagram of the posterior error ∈ in Example 6. DETAILED DESCRIPTION
[0063] The present invention will be further described below with reference to the accompanying drawings and exemplary embodiments.
[0064] Example 1
[0065] Reference Figure 1 , a posterior error estimation method for finite element numerical simulation based on artificial neural network technology, comprising the following steps:
[0066] Step 1, calculate the finite element numerical solution in the analysis area Ω of the electrostatic field;
[0067] Step 1.1, determine the analysis area Ω of the electrostatic field and measure it, then determine the charge density in the analysis area and the potential value at the boundary of the analysis area;
[0068] In this embodiment, the analysis area is Ω = [0, 1] × [0, 1], the potential value at the boundary of the analysis area is 0, and the charge density of the analysis area is (coulomb / square meter);
[0069] Establish the Poisson equation for the electrostatic field:
[0070] -Δu=8π 2 sin(2πx)sin(2πy)
[0071] u| Γ =0
[0072] The analytical solution u=sin(2πx)sin(2πy) is obtained, as Figure 4 As shown;
[0073] Step 1.2: Based on the analytical solution u, use the finite element method to solve the Poisson equation for the electrostatic field:
[0074] The analysis area Ω of the electrostatic field Poisson equation is divided into the calculation area Ω to obtain the set T of grid units K h ,definition P k (K) represents the set T h The polynomial function space of degree not exceeding K on any unit K in the function space V h There is a finite element numerical solution u h , so that u h Satisfy the equation in
[0075] Where u is the unknown potential function, v is the polynomial function, L 2 (Ω) is the function space composed of all square-integrable functions in Ω, L 2 (Ω) is the function space composed of all square-integrable functions in Ω, is a Sobolev space, ε0=8.854×10 -12 F / m represents the dielectric constant;
[0076] According to the analytical solution u, the finite element method is used to calculate the finite element numerical solution u h ; Figure 5 is to calculate the numerical solution u h The grid used,the number of grids is 224; Figure 6 is the numerical solution of Poisson's equation u h Surface plot of ;
[0077] Step 2: Use the pytorch software package to build a neural network model;
[0078] Reference Figure 2 , take points inside and on the boundary of the computational region Ω determined in step 1, and record them as in d represents the dimension of the region Ω; N is the number of points taken;
[0079] The rule for selecting points can be random points, or gridding the area Ω to obtain nodes of a structured grid or an unstructured grid, so as to ensure that the selected nodes are representative of both the interior and the boundary of the area Ω;
[0080] Reference Figure 3, the first layer of the neural network model is the input layer, and the input data of the input layer is The dimension of the input layer is d; the last layer of the neural network model is the output layer, and the dimension of the output layer is d; there are L hidden layers between the input layer and the output layer, and each hidden layer has m l neurons, l = 1, 2, ..., L;
[0081] Calculate the neuron output of each hidden layer based on the connection weights between neurons in each hidden layer and the activation level of each neuron;
[0082] The neuron output of the lth hidden layer of the neural network model is:
[0083] When l=1,
[0084] in, is the output of the kth neuron in the first hidden layer, is the connection weight from the i2th input of the input layer to the kth neuron of the first hidden layer, is the activation level of the kth neuron in the first hidden layer, m1 is the number of neurons in the first hidden layer; neuron activation function
[0085] The vector form is:
[0086]
[0087] in, is the kth neuron output of the lth hidden layer, is the output of the i2th neuron in the l-1th hidden layer, is the connection weight from the output of the i2th neuron in the l-1th hidden layer to the kth neuron in the lth hidden layer, is the activation level of the kth neuron in the lth hidden layer, m l is the number of neurons in the lth hidden layer;
[0088] The output of the neurons in the output layer is:
[0089]
[0090] The vector form is:
[0091]
[0092] in, is the connection weight from the output of the i2th neuron in the Lth hidden layer to the kth neuron in the output layer, is the activation level of the kth neuron in the output layer;
[0093] Step 3: Define the loss function of the neural network model based on the Poisson equation and its finite element numerical solution, and train the neural network model using the stochastic gradient descent algorithm through the pytorch software package;
[0094] The loss function of the neural network model is:
[0095]
[0096] Among them, β1 and β2 are two weight coefficients; Net(X) is the neural network model; u h represents the finite element numerical solution; is the gradient of the finite element numerical solution; f(X) represents the right-hand side of the Poisson equation; yes The divergence of
[0097] Calculated using numerical integration method
[0098] Figure 7 This is the convergence of the loss function after 20,000 steps of neural network training in this embodiment;
[0099] Step 4
[0100]
[0101]
[0102] Among them, ∈ K is the local error of the finite element numerical solution on each grid, ∈ is the a posteriori error of the finite element numerical solution on the region Ω;
[0103] Finite element numerical solution u h The energy error of the unknown true solution u is as follows:
[0104]
[0105] is the gradient of the unknown true solution u.
[0106] Figure 8 is the true error ∈ * The distribution map of Figure 9 This is the distribution diagram of the posterior error ∈ obtained in this embodiment. It can be seen that the present invention accurately estimates the distribution diagram of the true error.
[0107] Example 2
[0108] This embodiment uses the same Poisson equation example as in the first embodiment to calculate the numerical solution u hThe number of grids used is 56, the neural network is not retrained, and the remaining settings are the same as those in Example 1.
[0109] Figure 10 is the true error ∈ * The distribution map of Figure 11 This is a distribution diagram of the posterior error ∈ obtained in this embodiment.
[0110] Example 3
[0111] This embodiment uses the same Poisson equation example as in the first embodiment to calculate the numerical solution u h The number of grids used is 896, the neural network is not retrained, and the remaining settings are the same as those in Example 1.
[0112] Figure 12 is the true error ∈ * The distribution map of Figure 13 This is a distribution diagram of the posterior error ∈ obtained in this embodiment.
[0113] Table 1 shows the true error ∈ of Examples 1 to 3 * Compared with the a posteriori error ∈, the results show that the present invention can be used to estimate the true error of the numerical solution.
[0114] Table 1
[0115] Example Number of grids True error Posterior Error Whether to train the network one 224 1.064 1.105 yes two 56 2.089 2.109 no three 896 0.536 0.615 no
[0116] Example 4
[0117] Reference Figure 1 , a posterior error estimation method for finite element numerical simulation based on artificial neural network technology, comprising the following steps:
[0118] Step 1, calculate the finite element numerical solution in the analysis area Ω of the electrostatic field;
[0119] Step 1.1, determine the analysis area Ω of the electrostatic field and measure it, then determine the charge density in the analysis area and the potential value at the boundary of the analysis area;
[0120] Establish the Poisson equation for the electrostatic field:
[0121] -Δu=f(x,y)
[0122] u| Γ =0
[0123] f(x,y)=-Δg(x,y)
[0124] g(x,y)=15xy(x-1)(y-1)exp(-40((x-0.5) 2 +(y-0.5) 2 ))
[0125] The analytical solution u is:
[0126] u=15xy(x-1)(y-1)exp(-40((x-0.5) 2 +(y-0.5) 2 ))
[0127] Step 1.2: Based on the analytical solution u, use the finite element method to solve the Poisson equation for the electrostatic field:
[0128] The analysis area Ω of the electrostatic field Poisson equation is divided into the calculation area Ω to obtain the set T of grid units K h ,definition P k (K) represents the set T h The polynomial function space of degree not exceeding K on any unit K in the function space V h There is a finite element numerical solution u h , so that u h Satisfy the equation in
[0129] Where u is the unknown potential function, v is the polynomial function, L 2 (Ω) is the function space composed of all square-integrable functions in Ω, is the Sobolev space, represents the charge density, ε0=8.854×10 -12 F / m represents the dielectric constant;
[0130] Figure 5 is to calculate the finite element numerical solution u h The grid used,the number of grids is 224; Figure 14 is the surface plot of the analytical solution u; Figure 15 is the finite element numerical solution u h Surface plot of ;
[0131] Steps 2 to 4 of this embodiment are the same as those of Example 1;
[0132] Figure 16 This is the convergence of the loss function after 20,000 steps of neural network training in this embodiment; Figure 17 is the true error ∈ * The distribution map of Figure 18 This is a distribution diagram of the posterior error ∈ obtained in this embodiment.
[0133] Example 5
[0134] This embodiment uses the same Poisson equation example as in the fourth embodiment to calculate the finite element numerical solution uh The number of grids used is 56, the neural network is not retrained, and the rest of the settings are the same as those in Example 4.
[0135] Figure 19 is the true error ∈ * The distribution map of Figure 20 This is a distribution diagram of the posterior error ∈ obtained in this embodiment.
[0136] Example 6
[0137] This embodiment uses the same Poisson equation example as in the fourth embodiment to calculate the finite element numerical solution u h The number of grids used is 896, the neural network is not retrained, and the rest of the settings are the same as those in Example 4.
[0138] Figure 21 is the true error ∈ * The distribution map of Figure 22 This is a distribution diagram of the posterior error ∈ obtained in this embodiment.
[0139] Table 2 shows the true error ∈ of Examples 1 to 3 * Compared with the posterior error ∈, the results show that the present invention can be used to estimate the true error of the numerical solution. It can be seen that the present invention can still accurately estimate the true error distribution.
[0140] Table 2
[0141] Example Number of grids True error Posterior Error Whether to train the network Four 224 0.8085 0.8092 yes five 56 0.5101 0.5125 no six 896 0.2609 0.2659 no
[0142] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. For ordinary professional and technical personnel in this field, the specific technical solutions recorded in the above embodiments can be modified, or some of the technical features therein can be replaced by equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions protected by the present invention.
Claims
1. A posterior error estimation method for finite element numerical simulation based on artificial neural network, characterized in that: The steps include: Step 1, calculate the finite element numerical solution in the analysis area Ω of the electrostatic field; Step 1.
1. Determine the electrostatic field analysis area Ω and measure it, then determine the charge density in the analysis area and the potential value at the boundary of the analysis area; establish the electrostatic field Poisson equation Step 1.2: Use the finite element method to solve the Poisson equation for the electrostatic field; The analysis area Ω of the electrostatic field Poisson equation is divided into the calculation area Ω to obtain the set T of grid units K h ,definition It represents the set T h The polynomial function space of degree not exceeding K on any unit K in the function space V h There is a finite element numerical solution u h , so that u h Satisfy the equation in Where u is the unknown potential function, v is the polynomial function, L 2 (Ω) is the function space composed of all square-integrable functions in Ω, is the Sobolev space, represents the charge density, ε0=8.854×10 -12 F / m represents the dielectric constant, (·,·) represents the inner product of the function; Step 2: Build a neural network model; Take points inside and on the boundary of the calculation area Ω determined in step 1, and record them as in d represents the dimension of the region Ω; N is the number of points taken; The pytorch software package is used to build a neural network model. The first layer of the neural network model is the input layer, and the input data of the input layer is The dimension of the input layer is d; the last layer of the neural network model is the output layer, and the dimension of the output layer is d; there are L hidden layers between the input layer and the output layer, and each hidden layer has m l neurons, l = 1, 2, ..., L; Calculate the neuron output of each hidden layer based on the connection weights between neurons in each hidden layer and the activation level of each neuron; Step 3: Define the loss function of the neural network model based on the Poisson equation and its finite element numerical solution, and train the neural network model using the stochastic gradient descent algorithm through the pytorch software package; Step 4: Calculate the posterior error of the finite element numerical solution of the Poisson equation in the region Ω using the neural network model obtained in step 3.
2. The method for posterior error estimation of finite element numerical simulation based on artificial neural network according to claim 1, characterized in that: In step 2, the neuron output of the lth hidden layer of the neural network model is: When l=1, in, is the output of the kth neuron in the first hidden layer, is the connection weight from the i2th input of the input layer to the kth neuron of the first hidden layer, is the activation level of the kth neuron in the first hidden layer, m1 is the number of neurons in the first hidden layer; neuron activation function When l=2,…,L, in, is the kth neuron output of the lth hidden layer, is the output of the i2th neuron in the l-1th hidden layer, is the connection weight from the output of the i2th neuron in the l-1th hidden layer to the kth neuron in the lth hidden layer, is the activation level of the kth neuron in the lth hidden layer, m l is the number of neurons in the lth hidden layer; The output of the neurons in the output layer is: in, is the connection weight from the output of the i2th neuron in the Lth hidden layer to the kth neuron in the output layer, is the activation level of the kth neuron in the output layer.
3. The method for posterior error estimation of finite element numerical simulation based on artificial neural network according to claim 2, characterized in that: In step 3, the loss function of the neural network model is: Among them, β1 and β2 are two weight coefficients; Net(X) is the neural network model; u h represents the finite element numerical solution; is the gradient of the finite element numerical solution; f(X) represents the right-hand side of the Poisson equation; yes The divergence of 4. The method for posterior error estimation of finite element numerical simulation based on artificial neural network according to claim 3, characterized in that: The step 4 is specifically as follows: Among them, ∈ K is the local error of the finite element numerical solution on each grid, ∈ is the a posteriori error of the finite element numerical solution on the region Ω; Finite element numerical solution u h The energy error of the unknown true solution u is as follows: is the gradient of the unknown true solution u.
5. The method for posterior error estimation of finite element numerical simulation based on artificial neural network according to any one of claims 1 to 4, characterized in that: In step 2, the rule for selecting points may be random selection, or the rule may be to perform grid division on the region Ω to obtain nodes of a structured grid or an unstructured grid.
Citation Information
Patent Citations
Electric potential finite element solution algorithm applied to PIC electrostatic model
CN108280309A
Non-algorithmically implemented artificial neural networks and components thereof
US5845271A