# Optimizing Physics-Informed Neural Network in Dynamic System Simulation and Learning of Parameters
## 5 Computational Simulations of Dynamical Systems
### Brusselator Model
```
1: Construct PINN  Specify the input: \(t_{n},n=1,\ldots,X\)  Initialize PINN parameter: \(\omega\)  Output layer: \(u_{NN}(t_{n})\) and \(v_{NN}(t_{n}),n=1,\ldots,X\)
2: Construct neural network: \(a\)  Specify the input: \(t_{n},n=1,\ldots,X\)  Initialize PINN parameter: \(\Phi\)  Output layer: \(a(t_{n}),n=1,\ldots,X\)
3: Construct neural network: \(b\)  Specify the input: \(t_{n},n=1,\ldots,X\)  Initialize PINN parameter: \(\Phi\)  Output layer: \(b(t_{n}),n=1,\ldots,X\)
4: Specify the training set \(k=k_{r}\cup k_{b}\) of the NN
5: Train the neural network  Specify a loss function \[\zeta(\omega;\kappa) =\zeta_{t}(\omega;\kappa_{t})+\zeta_{r}(\omega;\kappa_{r})\] \[r_{1}(t) =\frac{du_{NN}(t_{n};\omega)}{dt}-\left(a(t_{n};\Phi)-(b(t_{n}; \Phi)+1)u_{NN}(t_{n};\omega)+\right.\] \[\left.u_{NN}(t_{n};\omega)^{2}v_{NN}(t_{n};\omega)\right)\] \[r_{2}(t) =\frac{dv_{NN}(t_{n};\omega)}{dt}-\left(b(t_{n};\Phi)u_{NN}(t_{n}; \omega)-u_{NN}(t_{n};\omega)^{2}v_{NN}(t_{n};\omega)\right)\] Minimize \(min_{\kappa}\zeta(\omega;\kappa)\) using Adam Optimizer. 6: Return PINN solution \(u_{NN}(t_{n};\omega)\) and \(v_{NN}(t_{n};\omega),n=1,\ldots,X\)
7: Return Parameter a: \(a(t_{n};\Phi),n=1,\ldots,X\)
8: Return Parameter b: \(b(t_{n};\Phi),n=1,\ldots,X\)
```  
**Algorithm 2** PINN algorithm for learning the parameters of the Brusselator model  
Figure 8: The Brusselator model solution of the actual output of species u,v against \(t_{data}\) and the predicted output of species u,v against \(t_{data}\). Furthermore, we conducted a comparison between the results obtained using physics-informed neural networks (PINN) and those obtained through deep neural networks (DNN), as detailed in Tables 7 and 8. This comparative analysis was carried out under the specific setup of 50,000 epochs, three hidden layers containing 64 neurons, and employing the tanh activation function. Processing time, measured in seconds, was also considered in this comparison. The study revealed that PINN not only achieved faster processing times than DNN but also showed that the optimal parameters learned through PINN were closer to the optimal parameters. \begin{table}
\begin{tabular}{c c c} \hline \hline  & \(a\) & \(b\) \\ \hline True Values & 1.0 & 2.5 \\ Approach 2 & 1.0000001 & 2.5 \\ Error of Approach 2 & 0.0000001 & 0.0000 \\ \hline  & u & v \\ \hline MAE of Approach 2 & 1.5247 \(\times\)\(10^{-6}\) & 1.7520 \(\times\)\(10^{-6}\) \\ MSE of Approach 2 & 6.5662 \(\times\)\(10^{-12}\) & 9.5430 \(\times\)\(10^{-12}\) \\ RMSE of Approach 2 & 2.5625 \(\times\)\(10^{-6}\) & 3.0892 \(\times\)\(10^{-6}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The optimal parameter estimation and the error metrics using PINN. Figure 10: The learned time-varying parameter values of the Brusselator model. (**a**) Time-varying parameter \(a\). (**b**) Time-varying parameter \(b\). Figure 9: The phase space plot of the actual output of species u against species v and the predicted output of species u against species v.  
to the actual values than those determined by DNN. This emphasizes the efficiency and accuracy advantages of PINN in this particular application. In addition, the model's accuracy is further illustrated in Figure 11, where the absolute error between the target and predictions made by physics-informed neural networks (PINN) and deep neural networks (DNN) is presented. The comparative analysis demonstrates that the error was significantly reduced when PINN was utilized instead of DNN. This discrepancy highlights the difference in accuracy between the two techniques employed in the modeling process. Furthermore, the results demonstrate that PINN matches but often exceeds DNN regarding parameter estimation accuracy. Finally, faster computation times make PINN an especially efficient choice for solving and pinpointing parameters in dynamical systems.