## 3 Experiments and Results
### The Comparison between FEM and PINN  
The trained PINN could be viewed as an analytical approximation of the latent solution; hence, for further exploration, such as the derivatives of state variables such as the gradient manipulation, the PINN can do this analytically and easily [1]. This advantage makes post-processing operations convenient. In addition, PINN does not need to be retrained to solve the solution and its gradient at the new sampling points. Hence, we can obtain a smooth derivative distribution. However, for FEM, the differential equations can only be solved at discrete points; when utilizing the first-order FEM to compute the state variables' gradients, such as the field strength, the value inside the element is constant and discontinuous at the elements' interfaces. Therefore, for FEM, the solution state variables' gradients are less accurate.  
To compare the accuracy and the continuity of the gradient field calculated by FEM and by PINN, respectively, we choose an equation, which has an analytical solution. The research domain is a square of \([0,1]\times[0,1]\)\(m^{2}\), and the PDE is given by  
\[-\
abla^{2}u=2\pi^{2}\sin\pi x\sin\pi y, \tag{24}\]  
\[u|_{\partial\Omega}=0. \tag{25}\]  
the analytical solution is  
\[u(x,y)=\sin\pi x\sin\pi y. \tag{26}\]  
We first discretize the model, acquire the solutions of the scalar potential on the nodes by first-order FEM, and then calculate the gradient inside every element. The mesh diagram is shown in Figure 7(a), where the number of grid nodes is 983. In order to facilitate the comparison and the illustration, we compute the gradient module value on the line \(y=0.2\) as illustrated by the horizontal solid line in the picture. Figure 7(b) shows the gradient modulus comparison between the first-order FEM and the analytical solution. It can be seen that for the FEM, the gradient modulus distribution of the scalar potential is discontinuous along the line; this is because the gradient modulus obtained by the first-order FEM is constant per element.  
Secondly, we utilize PINN to solve the equation. After tuning the deep learning parameters, we choose the number of sample points to be 1000, the number of layers to be 2, and for there to be 60 neurons for each hidden layer. The activation function and optimization function we select are the same as in the previous section, while the learning rate is \(lr=5\times 10^{-3}\). We set the maximum number of epochs as \(20,000\) and the cut-off threshold for the loss function as \(1\times 10^{-3}\). Finally, the training time is 78 s, the training takes 1166 epochs, and the lowest loss value is \(9.98\times 10^{-4}\). After training the model, we resample points on the \(y=0.2\) line and calculate their solution, gradients, and the corresponding gradient modulus. Figure 9 illustrates the gradient modulus comparison  
Figure 7: The absolute error between the PINN result and the FEM results: (**a**) the electric potential (V); (**b**) the temperature (K).  
between the PINN and the analytical solution. It can be seen that the result of PINN is in good agreement with the analytical solution, given by a smooth distribution curve.  
However, FEM solves this problem with a mesh of \(983\) points with a computational time of merely \(0.12\) s. Compared with FEM, the large computational time is still a limitation of PINN for now.