## 2 Materials and Methods
### Pinn  
Machine learning is able to act as a surrogate model, discovering the potential relations between the input and output, classifying various images, and predicting system responses under different conditions [33]. Most methods that are based on machine learning for solving PDEs are data driven and do not consider any physical constraints [27]. Hence, a great amount of data is often required to train the model. Preparing training data in advance is undoubtedly an arduous process. On the contrary, PINN introduces physical constraints and reformulates solving equations as an optimization problem, which reduces the amount of required data, alleviates overfitting issues, and therefore improves the robustness of the trained model [34]. The following describes the formulation of PINN for solving general PDEs. Considering the following PDE with a boundary condition  
\[Lu(x)=f(x),x\in\Omega, \tag{2}\]  
\[u(x_{0})|_{\Gamma}=B(x_{0}),\Gamma\subset\partial\Omega. \tag{3}\]  
where \(u(x)\) denotes the solution to this PDE, \(L(\cdot)\) is a differential operator, \(f(x)\) is a forcing function, and \(\Omega\) represents the domain of interest, \(\partial\Omega\) is a symbol of all boundaries. \(\Gamma\) denotes specific boundary where the boundary condition is imposed. As mentioned previously, we can approximate the solution of PDEs by DNNs. The essence of PINN is to use the PDE as a loss function for the optimization. All NN training requires an optimization process. Figure 2 graphically introduces the structure of PINN. The input data \(x\) is a set of randomly sampled points from the domain and boundaries. After obtaining the loss function value, we will judge both the loss value and the iteration value to determine whether to enter the next step. \(\epsilon\) denotes the cut-off threshold of loss value, and \(it\) refers to the maximal iteration number. Once the loss value is less than the threshold \(\epsilon\), or the iteration is greater than the maximal number \(it\), then the training will end. With the help of PyTorch's automatic differentiation module, we can obtain the output's partial derivatives of any order. Consequently, it simplifies converting the network output into a governing equation format. We let \(\mathbf{\Theta}=\{\mathbf{W}^{1},\mathbf{W}^{2},\dots,\mathbf{b}^{1},\mathbf{b }^{2},\dots\}\in V\) be a set of trainable parameters, i.e., all the layers' weights \(\mathbf{W}^{k}\) and biases \(\mathbf{b}^{k}\) (\(1\leq k\leq L\)), where \(V\) denotes the parameter space. We also let \(u(x;\mathbf{\Theta})\) denote the output function of PINN. The loss function \(J(\mathbf{\Theta})\) can be defined as [16]. \[J(\mathbf{\Theta})=MSE_{F}+MSE_{B}, \tag{4}\]  
\[MSE_{F}=\frac{1}{N_{f}}\sum_{i=1}^{N_{f}}|Lu(x_{f}^{i};\mathbf{\Theta})^{2}, \tag{5}\]  
\[MSE_{B}=\frac{1}{N_{B}}\sum_{i=1}^{N_{B}}|u^{i}-u(x_{B}^{i};\mathbf{\Theta})|^ {2}. \tag{6}\]  
Equation (5) denotes the governing equation constraint, and Equation (6) is the boundary condition constraints, where \(N_{f}\) and \(N_{B}\) are the number of domain samples and boundary samples, respectively. \(x_{f}^{i}\) denotes the sampling points in the domain, \(u^{i}\) denotes the target outputs, and \(x_{B}^{i}\) denotes the sampling points on the boundaries. Unless the value of \(J(\mathbf{\Theta})\) converges to zero, we end up with an approximation of the PDE's solution. By adjusting the training parameters \(\mathbf{\Theta}\) to minimize the loss function, we seek to find the optimal parameters \(\mathbf{\Theta}^{*}\) that satisfy the following condition. \[\mathbf{\Theta}^{*}=\operatorname*{arg\,min}_{\mathbf{\Theta}\in V}J(\mathbf{ \Theta}). \tag{7}\]The optimization of the loss function depends on the backpropagation and optimizer. Common optimizers include SGD, Adam, and L-BFGS. Furthermore, to satisfy the boundary conditions, there currently are two methods, namely the \"soft\" and the \"hard\" boundary conditions.