# Application of Physics-Informed Neural Networks to River Sifting Simulation
## 2 Materials and Methods
### Neural Networks Based on Physics
The choice of activation functions in the hidden layers plays a critical role in capturing the relationship between the input and output variables. In this case, the tanh activation function was selected, as it effectively represents a specific range of predicted river flooding levels. PINN's output layer provides the desired outcome, which serves as a solution to partial differential equations. The neural network NN(x, \(\theta\)) must meet two requirements: on the one hand, considering a dataset of observations, the network must be capable of reproducing those observations when x is used as input data, and on the other hand, it must conform to the physics underlying the partial differential equation. Automatic differentiation is employed in constructing the neural network. In this case, the Euler equation was used to measure pressure. In addition to these standard PINN layers, a loss function is applied, which serves as a measure of the mismatch between the predicted output and the true solution. All input parameters are continually optimized during the training phase until the value of the loss function is minimized. In our study, we will consider the problem of modeling the hydrodynamics of a shock wave. The Euler equation is considered as a mathematical model. Consider one-dimensional compressible Euler equations in characteristic form, where \(\Omega\subset\mathrm{R}\)  
\[\frac{\mathbf{d}\mathbf{U}}{\mathbf{dt}}+\mathbf{A}\frac{\mathbf{d}\mathbf{U}}{\mathbf{dx}}=0, \tag{1}\]  
Figure 1: Concept implementation scheme PINN. where,  
\[\mathbf{U}=(\mathbf{\rho},\mathbf{u},\mathbf{p})^{\mathbf{T}},\mathbf{A}= \begin{pmatrix}\mathbf{u}&\mathbf{\rho}&0 \\ 0&\mathbf{u}&\frac{1}{\rho}\\ 0&\mathbf{\rho}\mathbf{a}^{2}&\mathbf{u}\end{pmatrix}  \tag{2}\]  
where \(\mathbf{a}=\sqrt{\frac{\mathbf{\gamma}\mathbf{p}}{\rho}}\) is the speed of sound, \(\mathbf{\rho}\) is the density, \(\mathbf{u}\) is the velocity, \(\mathbf{p}\) is the pressure, and \(\mathbf{\gamma}\) is the heat capacity coefficient. Usually, for a standard hydrodynamic problem about a shock tube, the initial condition has the form:  
\[\mathbf{U}(\mathbf{x},0)=\mathbf{U}_{0}= \begin{cases}\mathbf{u}_{L},\mathbf{x}<\mathbf{x}\\ \mathbf{u}_{\mathbf{R}}>\mathbf{x}\end{cases} ,\mathbf{u}_{L}= \begin{bmatrix}\mathbf{\rho}_{L},\bm {u}_{L},\mathbf{p}_{L}\end{bmatrix} ,\mathbf{u}_{\mathbf{R}}= \begin{bmatrix}\mathbf{\rho}_{R}, \mathbf{u}_{R},\mathbf{p}_{R_{x}}\end{bmatrix}  \tag{3}\]  
with the Dirichlet boundary conditions taking on as boundaries the values of the initial condition. Before modeling, we consider what the spatial domain \(\Omega\) of the problem means. We increase \(\Omega\) so that if \(\mathbf{u}_{L}>\mathbf{u}_{\mathbf{R}}\), \(\Omega\) expands such that the initial state leans to the left of the newly expanded spatial domain \(\mathbf{\Omega}_{\mathbf{e}}\). Figure 2 shows an example of expanding the subject area in the inverse Soda problem. The modification we make for PINN is to introduce weights into the loss function. To solve the Euler equations with PINN, we build a deep neural network, \(\mathbf{U}(\mathbf{x},\mathbf{t},0)\) where \((\mathbf{x},\mathbf{t})\) are the inputs to the network and \(\mathbf{U}=[\mathbf{\rho},\mathbf{u},\mathbf{p}]\) are the outputs. Similarly, the standard loss is determined by the formula:  
\[ \begin{split} G(\mathbf{\theta})=\frac{1}{N_{f}}\bigg{\|}\frac{ \partial\mathbf{U}}{\partial\mathbf{t}}(\mathbf{x},\mathbf{t},\mathbf{\theta})+\widetilde{\mathbf{A} }\frac{\partial\mathbf{U}}{\partial\mathbf{t}}(\mathbf{x},\mathbf{t},\mathbf{\theta})\bigg{\|}_{ \Omega\times(0,\mathbf{T}),\mathbf{v}_{1}}^{2}+\frac{1}{N_{IC}}\bigg{\|}\widetilde{ \mathbf{U}}(\mathbf{x},0,\mathbf{\theta})+\mathbf{U}(\mathbf{x},0)\bigg{\|}_{\Omega,\mathbf{v}_{2}}^ {2}\\ +\frac{1}{N_{BC}}\bigg{\|}\widetilde{\mathbf{U}}(\mathbf{x},\mathbf{t},\mathbf{ \theta})+\mathbf{U}(\mathbf{x},\mathbf{t})\bigg{\|}_{\partial\Omega\times(0,\mathbf{T}),\mathbf{v }_{3}}^{2}\end{split}