# Optimizing Physics-Informed Neural Network in Dynamic System Simulation and Learning of Parameters
## 5 Computational Simulations of Dynamical Systems
### SIR Model  
The SIR model is a widely used mathematical model in epidemiology to understand the spread of infectious diseases within a population. It divides the population into three compartments: susceptible (S), infected (I), and recovered (R). In this model, individuals can transition between these compartments by interacting with infected others [2; 34]. The SIR model assumes that the population size is constant, meaning no births, deaths, or migrations occur during the disease outbreak. Additionally, it assumes that individuals in the population mix randomly, and there is a homogeneous mixing pattern. A set of ordinary differential equations can describe the dynamics of the SIR model. Let us denote the number of susceptible individuals as \(S(t)\), the number of infected individuals as \(I(t)\), and the number of recovered individuals as \(R(t)\). The following equations give the rates of change of these compartments over time:  
\[ \begin{split}\frac{dS}{dt}&=\frac{-\beta(t)S(t)I(t )}{N}\\ \frac{dI}{dt}&=\frac{\beta(t)S(t)I(t)}{N}-\gamma(t)I( t)\\ \frac{dR}{dt}&=\gamma(t)I(t).\end{split}  \tag{28}\]  
where variable \(S(t)\), \(I(t)\), \(R(t)\), N, \(\beta(t)\) and \(\gamma(t)\) represents  
\[ \begin{split} S(t)&:\text{the numbers of susceptible individuals at time t}\\ I(t)&:\text{the numbers of infected individuals at time t}\\ R(t)&:\text{the numbers of individuals recovered at time t}\\ N&:\text{the total population size.}\\ \beta(t)&:\text{the transmission rate per time}\\ \gamma(t)&:\text{the recovery rate per time.}\end{split} \] \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **True Values** & **PINN** & **DNN**[33] & **Epochs** \\ \hline \(a\) & 1.0 & 0.999876 & 0.9931 & \\  & & & 50,000 \\ \(b\) & 2.0 & 1.999771 & 1.9860 & \\ \(c\) & 1.0 & 0.999869 & 0.9946 & \\ \(d\) & 0.3 & 0.300004 & 0.2984 & \\ \hline \hline \end{tabular}
\end{table} 
Table 16: Comparison of the obtained results using PINN vs. those reported in the literature using DNN for the Lotka-Volterra model. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **P** & **Q** \\ \hline MAE & 2.3452 \(\,\times\,10^{-4}\) & 2.4140 \(\,\times\,10^{-4}\) \\ MSE & 8.5244 \(\,\times\,10^{-8}\) & 1.0660 \(\,\times\,10^{-7}\) \\ RMSE & 2.9197 \(\,\times\,10^{-4}\) & 3.2649 \(\,\times\,10^{-4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 15: The error metrics of the Lotka-Volterra model. The continuity equation is given by  
\[N=S(t)+I(t)+R(t),\ t\geq t_{0}\]  
where the initial conditions are denoted by \(S(t_{0})=S_{0}\), \(I(t_{0})=I_{0}\) and \(R(t_{0})=R_{0}\), where \(t\geq t_{0}\) represents time in days and \(t_{0}\) is the start date of the pandemic in the model. The SIR model provides insights into the dynamics of an infectious disease outbreak, such as the peak number of infected individuals, the duration of the epidemic, and the overall fraction of the infected population. These quantities depend on the model parameters \(\beta\) and \(\gamma\) values. It is important to note that the SIR model makes several simplifying assumptions. For instance, it assumes that the population is well-mixed, which may be false. We aim to learn the time-varying parameter \(\beta(t)\) and \(\gamma(t)\) of the SIR model from real-life data (COVID-19) using PINN. Following the same procedure as in the previous application, we present PINN Algorithm 5 with three networks to do this. The first network outputs are \(S_{NN}(t_{n};\omega)\), \(I_{NN}(t_{n};\omega)\) and \(R_{NN}(t_{n};\omega)\), which admits \(t\) as the input data. The second and third networks learn the parameters \(\beta(t_{n};\Phi)\) and \(\gamma(t_{n};\Phi)\) from the data, where \(\omega\) and \(\Phi\) represent the biases and weights of the network that minimize the loss function.