This application is based upon and claims priority to Chinese Patent Application No. 202311617642.1, filed on Nov. 30, 2023, the entire contents of which are incorporated herein by reference.
The present disclosure relates to the technical field of soil water movement simulation, in particular to a method and a system for constructing a soil water movement model based on the physical information neural networks.
At present, as a key link in the hydrological process of the basin, on the one hand, interflow directly participates in the formation of runoff, on the other hand, it further dominates the hydrological changes of the basin by affecting the spatial-temporal differences of soil moisture distribution in the basin, and shows high spatial heterogeneity and nonlinearity. How to finely depict the process of interflow movement is the key and difficult point to reveal the mechanism of soil moisture movement and improve the effect of hydrological simulation.
For the Richards equation, the backward Euler scheme is mainly used in the time discretization. An explicit difference scheme based on the forward Euler scheme was proposed by Liu Fengnan et al. The constant coefficient stability term was introduced in the difference scheme, which relaxed the restriction on the time step and improved the stability condition. Mixed finite element method, discontinuous finite element method, characteristic finite element method, finite difference method (FDM), finite element method (FEM) and finite volume method (FVM) are commonly used in spatial discretization. The core of these methods is to reduce the infinite-dimensional operator to a finite-dimensional approximation problem by utilizing some discrete structure, or to introduce new variables to achieve the purpose of simplifying the partial differential equation, or to assume special boundary conditions. However, there are still obvious shortcomings, such as poor generality and difficulty in making a good trade-off between calculation speed and accuracy of results.
In recent years, various deep learning algorithms have performed well in hydrological process simulation, but they have also brought new uncertainties and limitations. For example, generating an accurate surrogate model of a complex mathematical and physical system of hydrological processes usually requires a very large number of data samples, and obtaining such a large number of data from experiments or simulations is often extremely expensive or even infeasible. Physical Informed Neural Networks (PINNs) embed specific prior knowledge into the network model to significantly reduce the complexity of the problem solution space, thus greatly reducing the need for training data (usually only information at the boundary of the spatial-temporal region). Therefore, such a model is constructed to replace the hydrodynamic process modeling governed by PDEs. These physics-embedded “small data” methods essentially provide us with a meshfree algorithm based on automatic differentiation technology. Once these algorithms are trained, given the coordinate information at any resolution in the spatial-temporal region, the algorithm can give quite accurate solution information.
Therefore, how to construct the soil water movement model based on the Physical Informed Neural Networks to solve the poor generality of the calculation method of the Richards equation and balance the calculation speed and result accuracy is an urgent problem to be solved by those skilled in the art.
In view of this, the present disclosure provides a method, a method and a system for constructing a soil water movement model based on the physical information neural networks to solve the problems existing in the background.
In order to achieve the above effects, the present disclosure adopts the following technical solutions.
On the one hand, a method for constructing a soil water movement model based on the physical information neural networks is provided, which includes the following steps:
Optionally, the Richards equation for the one-dimensional soil hydrodynamics model is
Wherein, h is the soil negative pressure, cm; t is the time, min; C (h) is the water capacity when the soil negative pressure is h, cm3·cm−3; K (h) is the corresponding water conductivity, cm/min; the intensity of the upper boundary flux is ε(t), cm/min; S is source-sink term, is water absorption intensity of root system at different spatial nodes, and is a function of the spatial location node and the negative pressure h, cm/min; z represents the depth of the spatial node, z max indicates the maximum buried depth, cm; h0 (z) indicates the initial negative pressure of the soil profile, cm; and hzmax. (t) indicates the negative pressure of the soil profile at the maximum burial depth, cm.
Optionally, the method also includes simplifying the Richards equations of the one-dimensional soil hydrodynamics model into partial differential equations by utilizing the Van Genuchten model.
The Richards equation is simplified by utilizing the Van Genuchten model to only involve partial derivatives of soil negative pressure. The final PINNs form of the Richards equation is expressed as follows:
Wherein, h is the soil negative pressure, cm; t is the time, min; C (h) is the water capacity when the soil negative pressure is h, cm3·cm−3; K (h) is the corresponding water conductivity, cm/min; the intensity of the upper boundary flux is ε(t), cm/min; S is source-sink term, is water absorption intensity of root system at different spatial nodes, and is a function of the spatial location node and the negative pressure h, cm/min; z represents the depth of the spatial node, and λ=[K8, θ8, θT, a, n]T is a parameter vector of the parameterized Richards equation.
Optionally, the Van Genuchten model is expressed as follows:
Wherein, h is the soil negative pressure, cm; θ is the moisture content, cm3·cm−3 θ8 is the saturation volume moisture content, cm3·cm−3; θr is residual moisture content, cm3·cm−3; K is unsaturated hydraulic conductivity, cm/min; K8 is the saturation hydraulic conductivity, cm/min; Se is saturation degree, cm3·cm−3; avg is the shape parameter of the model, which represents the pore size distribution of the soil, cm−1, and n is the soil texture parameter, m=1-1/n.
Optionally, the calculation principle of the automatic differentiation is as follows: decomposing a complex analytic function into a series of elementary operation combinations, performing derivation through symbolic differentiation, substituting related values, storing intermediate results through a computer, and finally obtaining an expected derivative value by utilizing a chain rule.
Optionally, the specific expression of the loss function is constructed by the Richards equation, the boundary conditions and the measured points through the automatic differentiation:
Wherein, u represents the weight of the modified boundary condition loss function;
b represents the weight of the modified main control equation loss function;
i represents the weight of the measured sample point loss functions; B={B1(ŪNN,Z,t), B2 (ŪNN,Z,t), B3 (ŪNN,z,t)};
1 (ŪNN, Z,t)=ŪNN (z, 0)−h(z, 0) is the initial condition of the control equation, and
2 (ŪNN, z,t)=−K(h) ∂h(ŪNN, t)/∂z+K(h)+ε(t) and
3 (ŪNN,Z,t)=ŪNN (zmax, 0)−h (zmax, 0) are the upper and lower flux boundary conditions of the control equation; Nu and Nf represent the set of residual points for training the neural network in the boundary and the calculation area, which can be selected by random sampling, and Ni is the set composed of measured data.
Optionally, the obtained residual network is as follows:
Wherein, x=(x1, x2, . . . , xa) represents the variable of the partial differential equation, UNN is the partial derivative of x, and u(x) satisfies the boundary condition:
(u,x)=0,x∈∂Ω.
On the other hand, a system for constructing a soil water movement model based on the physical information neural networks is provided, which includes the following modules:
According to the technical solutions, compared with the prior art, a method and a system for constructing a soil water movement model based on the physical information neural networks disclosed and provided by the present disclosure adopt automatic differentiation to replace difference operation of grid scale, so that the calculation error caused by equation discretization in the solving process of numerical differentiation is avoided, and the calculation accuracy is improved; and the automatic differentiation mode is mainly carried out aiming at the output of a neural network, so that the numerical value of gradient calculation is more accurate.
In order to more clearly illustrate the embodiments of the present disclosure or technical solutions in the related art, the accompanying drawings used in the embodiments or the related art will now be described briefly. It is obvious that the drawings in the following description are only the embodiment of the disclosure, and that those skilled in the art can obtain other drawings from these drawings without any creative efforts.
In the following, the technical solutions in the embodiments of the present disclosure will be clearly and completely described with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, but not all the embodiments thereof. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without any creative efforts shall fall within the scope of the present disclosure.
On the one hand, the embodiment of the present disclosure discloses a method for constructing a soil water movement model based on the physical information neural networks, as shown in
The schematic diagram of the model construction of the present disclosure is shown in
In a specific embodiment, according to a general definition, in the computational domain Ω⊏d, the partial differential equation with the constraint conditions can be represented by the following form:
Wherein, x=(x1, x2, . . . , xa) and λ=(λ1, λ2, . . . , λa) respectively represent the variable and the parameter of the partial differential equation, and u(x) satisfies the boundary condition:
(u,x)=0,x∈∂Ω
Wherein, (u,x) can be Dirichlet boundary conditions, Neumann boundary conditions, or periodic boundary conditions. u is the solution of the partial differential equation; for problems involving the time variable, the time t can be regarded as a special component of x, the time domain is included in Ω, and the initial condition is regarded as a special type of Dirichlet boundary condition on the spatial-temporal domain.
When solving the PINNs algorithm, an approximate solution UNN (x;θ) of a partial differential equation u(x) is output by using a Feedforward Neural Network (FNN), wherein a parameter θ is a combination of a bias vector and a weight matrix; UNN is the partial derivative of x, which can be solved by built-in automatic differentiation modules such as deep learning framework TensorFlow or PyTorch. Wherein Automatic Differentiation (AD) is a method between symbolic differentiation and numerical differentiation, and its calculation principle is to decompose a complex analytic function into a series of elementary operation combinations, calculate the derivative through symbolic differentiation, then bring in the related values, store the intermediate results through the computer, and finally obtain the expected derivative value by utilizing the chain rule. Therefore, compared with numerical differentiation, automatic differentiation can replace the difference operation of grid scale, avoid the calculation error caused by the equation discretization in the solving process of numerical differentiation, and improve the calculation accuracy, and the way of automatic differentiation is mainly aimed at the output of neural network, which makes the numerical value of gradient calculation more accurate.
In the training process of PINNs network, the determination of the training set T is the most critical, which mainly covers the configuration of two groups of points: one group of data points is taken from the initial boundary Tu={(xu(i), u(xu(i)))}i=1N
In order to evaluate the coincidence degree of UNN (x;θ) with the physical governing equations, boundary conditions and measured points, the mean-square error (MSE) is introduced to characterize the loss function. The loss function consists of three parts, the first part is used to evaluate how well the surrogate model satisfies the known initial boundary conditions, the second part is used to evaluate how well the surrogate model satisfies the physical governing equations in the domain, and the third part is the measured point loss function:
Wherein, u represents the weight of the modified boundary condition loss function;
b represents the weight of the modified main control equation loss function;
i represents the weight of the measured sample point loss functions; ∥·∥2 represents the Euclidean norm, Nu and Nf represent the set of residual points for training the neural network in the boundary and the calculation area, which can be selected by random sampling, Ni is the set composed of measured data, and
i(û,x) represents the simulation result at the boundary.
In a specific embodiment, the Richards equation for the one-dimensional soil hydrodynamics model is:
Wherein, h is the soil negative pressure, cm; t is the time, min; C(h) is the water capacity when the soil negative pressure is h, cm3·cm−3; K(h) is the corresponding water conductivity, cm/min; the intensity of the upper boundary flux is ε(t), cm/min; S is source-sink term, is water absorption intensity of root system at different spatial nodes, and is a function of the spatial location node and the negative pressure h, cm/min; z represents the depth of the spatial node, z max indicates the maximum buried depth, cm; h0(z) indicates the initial negative pressure of the soil profile, cm; and hzmax (t) indicates the negative pressure of the soil profile at the maximum burial depth, cm.
In a specific embodiment, the method also includes simplifying the Richards equations of the one-dimensional soil hydrodynamics model into partial differential equations by utilizing the Van Genuchten model.
In order to make the PINNs algorithm simulate the Richards equation more accurately, C(h) and ∂K/∂h in the Richards equation need to be transformed, and only the partial derivative of the soil negative pressure is retained to adapt to the solution. In the formula, C (h)=∂θ/∂h is called water capacity (or specific water capacity) and represents the change in moisture content per unit change in soil negative pressure. The water capacity was further analyzed by Van Genuchten model.
Wherein, Se is the saturation, Se=(θ−θr)/(σs−θr).
Further decomposition of ∂Se/∂h is:
Similarly, ∂K/∂h in the Richards equation can also be characterized analytically:
Wherein, the analytical method for ∂Se/∂θ=1/(θs−θr) and ∂K/∂Se is calculated as follows:
After treatment, the Richards equation only involves three partial derivatives of soil negative pressure h, namely ∂h/∂z, ∂h/∂t and ∂2h/∂z2, which reflect the spatial gradient of moisture content affected by the spatial variation of parameters. Combined with Van Genuchten model, C(h) and ∂K/∂h can be calculated by analytical method. To sum up, the PINNs form of the Richards equation can be expressed as follows:
Wherein, λ=[Ks, θs, θr, a, n]T is a parameter vector of the parameterized Richards equation, h is the soil negative pressure, cm; t is the time, min; C(h) is the water capacity when the soil negative pressure is h, cm3·cm−3; K (h) is the corresponding water conductivity, cm/min; the intensity of the upper boundary flux is ∈(t), cm/min; S is source-sink term, is water absorption intensity of root system at different spatial nodes, and is a function of the spatial location node and the negative pressure h, cm/min; z represents the depth of the spatial node, and λ=[Ks, θs, θr, a, n]T is a parameter vector of the parameterized Richards equation.
In a specific embodiment, the Van Genuchten model is expressed as follows:
Wherein, h is the soil negative pressure, cm; θ is the moisture content, cm3·cm−3; θs is the saturation volume moisture content, cm3·cm−3; θr is residual moisture content, cm3·cm−3; K is unsaturated hydraulic conductivity, cm/min; Ks is the saturation hydraulic conductivity, cm/min; Se is saturation degree, cm3·cm−3; aVG is the shape parameter of the model, which represents the pore size distribution of the soil, cm−1, and n is the soil texture parameter, m=1−1/n.
In a specific embodiment, the calculation principle of the automatic differentiation is as follows: decomposing a complex analytic function into a series of elementary operation combinations, performing derivation through symbolic differentiation, substituting related values, storing intermediate results through a computer, and finally obtaining an expected derivative value by utilizing a chain rule.
In a specific embodiment, the specific expression of the loss function is constructed by the Richards equation, the boundary conditions and the measured points through automatic differentiation:
Wherein, u represents the weight of the modified boundary condition loss function;
b represents the weight of the modified main control equation loss function;
i represents the weight of the measured sample point loss functions; B={B1 (ŪNN,Z,t), B2 (ŪNN,z,t), B3 (UNN, z,t)};
1 (ŪNN,Z,t)=ŪNN (z, 0)−h(z, 0) is the initial condition of the control equation, and
2 (ŪNN,z,t)=−K(h)∂h(ŪNN, t)/∂z+K (h)+ε(t) and
3 (ŪNN,Z,t)=ŪNN (zmax, 0)−h(zmax, 0) are the upper and lower flux boundary conditions of the control equation; Nu and Nf represent the set of residual points for training the neural network in the boundary and the calculation area, which can be selected by random sampling, and Ni is the set composed of measured data.
In a specific embodiment, In order to verify the reliability of the application of the PINNs algorithm in the simulation of vertical infiltration of water in layered soil in a non-laboratory environment, the present disclosure simulates the water movement process in the vadose zone of deep soil, and compares and verifies the observation data of soil water infiltration recharge in a test station.
The PINNs algorithm was applied to a field layered soil simulation experiment to test the computational accuracy of the PINNs algorithm in simulating the Richards equation with h as the main variable. On the basis of setting the parameters of soil stratification, the loss function constructed by 2047 measured points obtained in the simulation period (from Apr. 12, 2012 to Sep. 30, 2012) is used as the training sample of the model. The parameters of the soil moisture characteristic curve adopted are obtained by the team based on the analysis of the measured data of Luancheng Experimental Station, and the relevant values are shown in Table 1. According to the method, the gradual drying process of the soil after effective precipitation is used as the basis for calibrating the soil water parameters, and the negative pressure and moisture content data of the soil monitored in multiple layers are used for calibrating layer by layer.
The second boundary condition (Neumann condition) is used in the upper boundary of the model simulation, that is, given the flux boundary, the flux is the evaporation of topsoil or the precipitation and irrigation amount. The first boundary condition (Dirichlet condition) is used for the lower boundary, that is, the negative pressure of the water table is used as the lower boundary for the given water head boundary. The PINNs algorithm is written in Python and run in the Pycharm integrated development environment, the weight of the modified loss term is set to 1, and the Adam algorithm and the L-BFGS-B algorithm with a learning rate of 0.001 and an iteration step number of 20000 are used as the optimization algorithm, that is, after the Adam algorithm is used to iterate to the specified step number, then L-BFGS-B is used for optimization, which can improve the calculation accuracy and efficiency. The simulation results and model simulation effects obtained based on the PINNs algorithm are shown in
On the basis of the above grid configuration, in order to verify whether the PINNs have the fast calculation ability to fine-tune the soil layer parameters, the parameter values of the soil water characteristic curve of 2.8 m-3.2 m soil layer are changed (the same parameter values as the upper layer are adopted), and the sampling calculation is carried out again on the basis of the PINNs that have been trained and converged. The average error of the solution compared with the numerical simulation is 2.43%. However, the convergence time of the new calculation is only 10.6 seconds, which shows that PINNs can reach the same level as the numerical simulation method in the simulation of partial differential equations, and is an effective alternative and verification scheme. Its advantages are that it can adapt to the condition assignment of complex non-uniform boundaries and achieve fast convergence when the design conditions are fine-tuned.
When the model is trained, a feedforward neural network FNN (z, t; II) with z and t as input values and ĥ as an output value is firstly constructed, so that an approximate solution of a main control equation can be obtained; then a certain amount of residual points are taken from initial conditions, boundary conditions and the main control equation to construct a loss function, so that the problem is converted into an optimization problem; finally, the gradient optimization algorithm is adopted to minimize the loss function, thus the parameter II* is obtained, and this process is called “training”. A neural network model embedded with Richards equation is trained to describe the process of soil moisture movement from the input 2, 4 to the output  Compared with the traditional numerical methods for solving the Richards equation, such as the finite difference method and the finite element method, the significant advantage of the proposed method is that it does not impose any restrictions on the sampling data points, and the traditional method usually leads to a decrease in the computational time due to the node distribution or mesh quality, especially when solving high-dimensional complex problems. The PINNs method based on automatic differentiation technique avoids this problem.
In a specific example, the reliability of the simulation of PINNs algorithm is discussed by taking the conservation of mass conservation problem and the dry soil infiltration problem which are two classical problems solved by finite difference method as examples.
Due to the strong nonlinear characteristics of the saturated-unsaturated soil moisture movement equation, in the traditional numerical solution, the time derivative term is generally required to be specially treated, and improper treatment will cause quality errors, and the solution process requires iterative calculation, and the computational cost and stability are also a major concern. The following formula describes the water mass conservation relation obtained by expanding the unit volume medium at any point by utilizing the Euler implicit scheme and the Rolle theorem:
Wherein, θ is the moisture content, cm3·cm−3; h is the soil negative pressure, cm; t is the time, min; C(h) is the water capacity when the soil negative pressure is h, cm3·cm−3;∂ is a constant, taking the value 0-1; j is a constant, used to mark the time; o(Δt) is the remainder of the difference.
That is to say, the change of water content (representing the rate of change of unsaturated zone mass) can be expressed by the water head of two time periods, but it is necessary to find the water capacity of a special time (t=tj+a, where a∈(0, 1)) to make the formula valid. However, a is related to the variable hj+1 to be evaluated, and its value cannot be determined before solving the equation. Therefore, a=0 (explicit scheme), 1/2 (leapfrog scheme) or 1 (implicit scheme) are often used instead in numerical calculation, which often leads to the mass conservation problem. Experiments show that the mass error can be eliminated only when the time step is infinitely small. Due to the severe quality error, the time discretization is performed in the following two ways:
θ is the moisture content, cm3·cm−3; h is the soil negative pressure, cm; tis the time, min; C (h) is the water capacity when the soil negative pressure is h, cm3·cm−3; k is the number of iterations; u is the elastic water release coefficient; B is the adjustment coefficient.
The first term of the formula is the water content change rate between adjacent iteration levels, and the second term is the water content change rate between the current time and the previous time. This discrete expression represents the change of water content in time, but it is not absolutely mass conservative, because in the actual model operation, there is an iteration closure error (iteration allowable error), and the greater the closure error, the greater the mass error. The formula uses the secant method to calculate the water capacity, if it converges (hj+1,k+1=hj+1,k), the mass is conserved. This method is more accurate than the former, but it is not easy to form a matrix to solve. Both the first term of the formula and the second term of the equation imply the iterative formula, which indicates that this kind of hybrid iterative model can only be used in the iterative model, and is not applicable to the non-iterative model, so the computational cost and stability are issues that need to be concerned.
The PINNs algorithm, as a mesh-free algorithm with embedded physical knowledge and data-driven, effectively avoids the solution error caused by the spatial-temporal discrete operation. Physical laws (including but not limited to partial differential equations, but also including integral equations, stochastic partial differential equations, energy conservation relations, mass conservation relations, etc.) are embedded in the construction of neural network loss function, and as the network is trained together, we do not need to perform spatial-temporal discretization during the differentiation process. Instead, Back Propagation or Automatic Differentiation can be performed according to the properties of the neural network to analytically and accurately determine the derivatives of each order. Further analysis of the simulation results of the model verification period (from Apr. 12, 2012 to Sep. 30, 2012) obtained by the PINNs algorithm shows that, taking the soil column layer in the 2 m deep root zone as an example, as shown in
Soil is often affected by rainfall and evaporation alternately, so the problem of dry soil infiltration problem is often encountered in the simulation of saturated and unsaturated zones. Many traditional numerical simulation practices show that the model based on water head (such as HYDRUS model) often encounters the phenomenon of non-convergence in the calculation of dry soil infiltration problem due to improper spatial-temporal discretization. Even if the simulation converges, there will be a large simulation error (rounding error and truncation error). Taking the finite difference method as an example, when rainfall occurs (ignoring the evaporation between rains), the discrete formula of the water quantity at the first node on the soil surface is:
Wherein, k is the number of iterations; j is a constant used to mark time; N is the spatial node; h is the soil negative pressure, CN is the soil surface node water capacity; Pp is the rainfall intensity;
is the Darcy flux between the N-1 node and n node (positive downward). When the soil is very dry (k=0),
is negligible because the hydraulic conductivity of the soil surface nodes is small. At the same time, due to the extremely small water capacity, small rainfall can cause a large change in the surface soil water head. After one iteration (k=1), the soil is close to saturation, and the water capacity does not increase significantly due to the bell-shaped curve, but the hydraulic conductivity can increase by 5 orders of magnitude. Therefore, all rainfall can enter the second node, which leads to no significant change in the water head of the first node of the soil layer at the next moment. This iterative calculation makes the water content of topsoil jump repeatedly between the dry pole and the wet pole, which makes it difficult for the model to converge. The iterative process is shown in
In this example, the PINNs algorithm successfully simulated the dry soil infiltration process, and the simulation results are shown in
In a specific embodiment, the method of the present disclosure is verified with a one-dimensional transient unsaturated seepage analytical solution; the effectiveness of the PINNs algorithm for solving the Richards equation is verified by comparing the results of the actual solution with the analytical solution. It is assumed that the thickness of the soil layer is L=10 m, and the soil parameters are set as: a=110-4, θs=0.50, θr=0.11, and Ks=910-5 m/s. The simulation time is 5 H, and the boundary conditions can be expressed as:
h(t,z=0)=h0,t≥0
h(t,z=L)=0,t≥0
Letting h0=−105 m, the analytical solution of this transient unsaturated flow problem is:
As shown in
On the other hand, a system for constructing a soil water movement model based on the physical information neural networks is provided, which includes the following modules:
Various embodiments of the present specification are described in a progressive manner, and each embodiment focuses on the description that is different from the other embodiments, and the same or similar parts between the various embodiments are referred to with each other. For the device disclosed in the embodiment, since ist corresponds to the method disclosed in the embodiment, the description is relatively simple, and the correlation is described with reference to the method part.
The above description of the disclosed embodiments enables those skilled in the art to implement or use the present disclosure. Various amendments to the embodiments will be apparent to those skilled in the art. The general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the disclosure. Therefore, the present disclosure will not be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Number | Date | Country | Kind |
---|---|---|---|
202311617642.1 | Nov 2023 | CN | national |