# Optimizing Physics-Informed Neural Network in Dynamic System Simulation and Learning of Parameters
## 5 Computational Simulations of Dynamical Systems
### Brusselator Model
We define the residual loss \(\zeta_{r}(\omega;\kappa_{r})\) and training loss \(\zeta_{t}(\omega;\kappa_{t})\) which was minimized as follows:  
\[\zeta_{r}(\omega;\kappa_{r})=\frac{1}{\kappa_{r}}\sum_{i=1}^{2}\sum_{n=1}^{ \kappa_{r}}|r_{i}(t_{n})|^{2}. \tag{13}\]  
where  
\[ \begin{split} r_{1}(t)&=\frac{du_{NN}(t_{n};\omega )}{dt}-\bigg{(}a(t_{n};\Phi)-(b(t_{n};\Phi)+1)u_{NN}(t_{n};\omega)+u_{NN}(t_{n} ;\omega)^{2}v_{NN}(t_{n};\omega)\bigg{)}\\ r_{2}(t)&=\frac{dv_{NN}(t)}{dt}-\bigg{(}b(t_{n}; \Phi)u_{NN}(t_{n};\omega)-u_{NN}(t_{n};\omega)^{2}v_{NN}(t_{n};\omega)\bigg{)} \end{split}  \tag{14}\]  
and  
\[\zeta_{t}(\omega;\kappa_{t})=\frac{1}{\kappa_{t}}\bigg{(}\sum_{n=1}^{\kappa_ {t}}||u_{NN}(t_{n};\omega)-u(t_{n})||_{2}^{2}+\sum_{n=1}^{k_{t}}||v_{NN}(t_{n} ;\omega)-v(t_{n})||_{2}^{2}\bigg{)}. \tag{15}\]  
The time-varying parameters of the Brusselator model were obtained after using PINN and the approach of Scenario 2 with three hidden layers, 64 neurons per layer, 50,000 epochs, the tanh activation function was used, and the learning rate was \(10^{-3}\). The PINN Algorithm 2 is an excellent choice for learning the optimal parameters of the Brusselator model. The maximum parameter value \(a\) was solved at \(t^{*}=6.37\) and parameter \(b\) at \(t^{*}=13.76\). Figure 8 shows the obtained solution of the actual and predicted output of the Brusselator model after the parameters were learned with the same initial condition used to generate the data. The phase space plot of the actual output of species \(u(t)\) against species \(v(t)\) and the predicted output of species \(u_{NN}(t)\) against species \(v_{NN}(t)\) is shown in Figure 9.  
Figure 10 shows the learned time-varying parameter values of \(a(t)\) and \(b(t)\) of the Brusselator model. The \(a(t)\) curve appears to oscillate with an overall decreasing trend. A potential functional form for this curve is:  
\[a(t)=e^{-\alpha\beta(t)} \tag{16}\]  
\[b(t)=e^{\alpha\beta(t)}. \tag{17}\]  
where \(\alpha\) is the constant coefficient, its value will determine the growth or decay rate. Since \(\alpha\) is negative in (16), the function represents decay, and if positive, the function represents growth. The magnitude of \(\alpha\) will determine how fast this growth or decay occurs. The \(b(t)\) curve also appears to oscillate with an overall increasing trend. Since \(\alpha\) is positive in (17), the function represents growth, and if negative, the function represents decay. \(\beta(t)\) is a time-dependent function that appears as the exponent of the exponential term. It plays a crucial role in determining the behavior of the curve over time. Table 6 shows the parameters and error metrics obtained through the approaches described in Scenario 2. The results showed that the PINN algorithm successfully learned the parameters of the Brusselator model. The obtained parameter values were close to the true values used to generate the synthetic data. The accuracy of the predictions was evaluated using various error metrics, such as mean absolute error (MAE), mean squared error (MSE), and root mean squared error (RMSE). The error metrics indicated a high level of accuracy in the predictions, with very small errors.