# Solving Partial Differential Equations Using Deep Learning and Physical Constraints
## 3 Experiments and Results
### Wave Equation  
This section presents an experimental study of the wave equation using the physics-informed neural network. The wave equation is a typical hyperbolic partial differential equation and it contains second-order partial derivatives about the independent variable. In physics, the wave equation describes the path of a wave propagating through a medium and is used to study the various types of wave propagation phenomena. It appears in many fields of science, such as acoustic wave propagations, radio communications, and seismic wave propagation [51; 52; 53]. The study of wave equations is of great importance, as they are widely used in many fields. In this study, we choose a one-dimensional wave equation [54] for our experiments. In mathematical form, this wave equation is defined, as follows:  
\[u_{tt}-cu_{xx}=0,\quad x\in[0,1],\quad t\in[0,1] \tag{9}\]  
where \(u\) is a function of the spatial variables \(x\) and time \(t\). In the equation, the value of \(c\) represents the wave propagation velocity, which is given as 1 in this study. Besides, for this wave equation, its initial conditions and the homogeneous Dirichlet boundary conditions are given, as follows:  
\[ \begin{array}{l}u(0,x)=\frac{1}{2}\sin(\pi x)\\ u_{t}(0,x)=\pi\sin(3\pi x)\\ u(t,0)=u(t,1)=0\end{array}  \tag{10}\]  
The true solution of the above equation is \(u(t,x)=\frac{1}{2}\sin(\pi x)\cos(\pi t)+\frac{1}{3}\sin(3\pi x)\sin(3\pi t)\), which we use to generate the data. The initial conditions, boundary conditions, and some random data  
Figure 2: The schematic of physics-informed neural network (PINN) for solving partial differential equations. in the space-time domain are used as training data to train the neural network model. In order to test the performance of the training model, we use the neural network model to make multiple predictions and compare it with the true solution of the partial differential equation. The specific experimental setup and procedure are as follows. First, a neural network is designed for approximating the solutions of partial differential equations, denoted as \(\hat{u}(t,x)\). For the architecture of the neural network, it contains six hidden layers, each with 100 neurons, and a hyperbolic tangent tanh is chosen as the activation function. Besides, a physics-informed neural network \(f(t,x)\) is constructed for introducing control information of the equation. In our experiments, we use TensorFlow to construct the neural network. As a widely used deep learning framework, it has sophisticated automatic differentiation, so it is easy to introduce information about the equations. Specifically, the definition of a physical information neural network \(f(t,x)\) is given by  
\[f(t,x):=u_{tt}-u_{xx} \tag{11}\]  
The next main task is to train the parameters of the neural network \(\hat{u}(t,x)\) and \(f(t,x)\). We continuously optimize the parameters by minimizing the mean square error loss to obtain the optimal parameters. \[J(\theta)=MSE_{u}+MSE_{f} \tag{12}\]  
where  
\[MSE_{u}=\frac{1}{N_{u}}\sum_{i=1}^{N_{u}}\left|u\left(t_{\mu}^{i},x_{u}^{i} \right)-u^{i}\right|^{2} \tag{13}\]  
\[MSE_{f}=\frac{1}{N_{f}}\sum_{i=1}^{N_{f}}\left|f\left(t_{f}^{i},x_{f}^{i} \right)\right|^{2} \tag{14}\]  
where \(MSE_{u}\) is a loss function constructed using observations of initial and boundary conditions. \(MSE_{f}\) is a loss function that is based on partial differential equations for introducing physical information. Specifically, \(\left\{t_{\mu}^{i},x_{u}^{i},u^{i}\right\}_{i=1}^{N_{u}}\) corresponds to the initial and boundary training data of \(u(t,x)\), and \(N_{u}\) is the number of data provided. In addition, \(u(t_{f},x_{f})\) and \(\left\{t_{f}^{i},x_{f}^{i}\right\}_{i=1}^{N_{f}}\) corresponds to the training data of the spatio-temporal domain, and \(N_{f}\) is the corresponding number of training data. In this work, to fully consider the physical information embedded in the equations, we select the data in the spatio-temporal domain to train the neural network.