## 3 Results
### One-Dimensional Allen-Cahn Equation  
The Allen-Cahn equation, a prominent mathematical model in the realm of material science and physics, captures the evolution of phase boundaries in various materials [39]. This PDE delineates the gradual transition between different phases within a material. The 1D AC equation is commonly used to study phase transition problems in linear structures, such as the movement of interfaces and the propagation of phase transitions [40]. The 1D AC equation case in this subsection is set up as follows:  
\[u_{t}-0.0001u_{xx}+5u^{3}-5u=0 \tag{11}\]The boundary conditions and initial conditions are set as follows:  
\[ \begin{split} u(x,0)=x^{2}cos(\pi x)\\ u(-1,t)=u(1,t)\\ u_{x}(-1,t)=u_{x}(1,t)\end{split}  \tag{12}\]  
The diffusion term \(\epsilon^{2}\
abla^{2}\) is set to 0.0001, where \(x\in[-1,\ 1]\) and \(t\in[0,\ 1]\). The 1D \(AC\) equation case is a PDE with periodic boundary conditions. Hard constraints are implemented by adding a hard constraint function to the physics-informed part of the network architecture, which is set as follows:  
\[u_{h}(x,t)=x^{2}cos(\pi x)+t\cdot u(x,t), \tag{13}\]  
where \(u_{h}(x,t)\) denotes the hard-constraint function, and \(u(x,t)\) is the output of the approximator neural network (in Figure 1). The hard-constraint function mandatorily constrains the output of the neural network in terms of boundary and initial conditions, making it linearly smoother and closer to the exact solution of the PDE. In the case of the 1D AC equation, we designed a series of experiments to verify the performance of the HWPINN proposed in this paper. There were four neural network architectures used in the numerical experiments: HWPINN, hard-constraint PINN (HPINN), traditional PINN with soft constraint (SPINN), and a wide-body soft-constraint PINN (SWPINN). As shown in Table 1, for the parameter settings of the neural network part, both HWPINN and SWPINN used the wide-body model of the neural network architecture. The neural network part was set to 8 layers and 32 neurons in the hidden layers; the wide-body network part was set to 8 layers and 32 neurons. For HPINN and SPINN, the parameters in the neural network were set to 8 layers of 64 neurons in the hidden layers, and the maximum training number was set to 10,000. To verify that the wide-body model was not simply widening the network itself, the total number of settings for the number of neurons in the hidden layers for all four PINN models was 64. Benefiting from the properties of PINN in solving forward problems in PDEs, no specific dataset is required for training, and PINN discretely collects training points randomly as training data within the space-time of the computational domain. In this case, the density of the collection points is set to \(N_{c}=31\), and the density of the collection points on the boundary was similarly set to \(N_{IC/BC}=31\). These collection points contain only spatial coordinate information \(x\), and discrete temporal information \(t\). From the training loss curves shown in Figure 3, it can be concluded that the HWPINN and HPINN models converge quickly under the set conditions, and due to the very low density of the collection points, the training loss curves of the SWPINN and SPINN models show overfitting, which needs to be solved by changing the training parameters. A comparison of the training loss curves showed that HWPINN can extract abstract features from the solution space of PDEs faster than other models and is more effective in solving high-dimensional problems [30]. Figure 4 illustrates the FDM solution of the 1D AC equation (Equation (11)). The results predicted by the four neural network architectures are presented in Figure 5. The results in Figure 5 show that HPINN and HWPINN outperform SPINN and SWPINN for a small number of iterations (maximum number of iterations = 10,000).