# A Comparative Study of the Explicit Finite Difference Method and Physics-Informed Neural Networks for Solving the Burgers’ Equation

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. The Burgers’ Equation

_{0}(x) is a given sufficiently smooth function. Burgers’ Equation (1) can describe the behavior of fluid flow and can be used to model various physical phenomena, such as shock waves and turbulence. Then, in Equation (1), ν is a kinematic viscosity parameter and the term $\partial u(x,t)/\partial t$ represents the time derivative of the velocity, which describes how the velocity of the fluid changes with time. The term $u\partial u(x,t)/\partial x$ represents the non-linear advection of the velocity field, which describes how the fluid carries its own velocity along with it as it flows. The term $v{\partial}^{2}u(x,t)/\partial {x}^{2}$ represents the diffusion of the velocity field due to the viscosity of the fluid. It describes how the velocity field spreads out over time and space due to the internal friction of the fluid. Therefore, Burgers’ equation describes the balance between the advection of the velocity field and the diffusion of the velocity field due to viscosity. When ν approaches zero, Equation (1) becomes an inviscid Burgers’ equation, which is a model for nonlinear wave propagation.

## 3. Explicit Finite Difference Method

^{2}). The truncation error can be decreased using small enough values of ∆t and ∆x until the accuracy attained is within the error tolerance.

## 4. Physics-Informed Neural Networks

#### 4.1. The Basic Concept of Physics-Informed Neural Networks in Solving PDEs

_{b}are the numbers of the mentioned collocation points of the computational domain, initial, and boundary conditions, respectively. The residual network, a non-trainable component of the PINN model, calculates these residuals. PINN needs derivatives of the outputs with respect to the inputs x and t to calculate the residual ${L}_{r}$. Such a calculation is performed through automated differentiation, which relies on the fact that combining derivatives of the constituent operations by the chain rule produces the derivative of the entire composition. This technique is a key enabler for the development of PINNs and is the main element that differentiates PINNs from comparable efforts in the early 1990’s, which relied on the manual derivation of back-propagation rules. Nowadays, automatic differentiation capabilities are well-implemented in most deep learning frameworks, such as TensorFlow and PyTorch, avoiding tedious derivations or numerical discretization while computing derivatives of all orders in space–time.

#### 4.2. Implementation of PINN in Solving the Burgers’ Equation

^{−3}. In the second phase, after a “global” search is completed, the Limited Memory Broyden–Fletcher–Goldfarb–Shanno algorithm (L-BFGS) acts to get closer to the optimal solution according to [18]. The whole training process takes approximately 50 s on an nVidia Tesla T4 GPU accelerator. Practically speaking, it is very likely that using various hyper-parameters, such as various activation functions, training techniques, and varying PINN topologies, will result in better solutions. However, since finding hyper-parameters is a tedious and time-consuming process and is outside the scope of our study, we selected the hyper-parameter values that were most prevalent in the Burgers’ problem literature.

## 5. Results and Discussion

**Test problem 1:**Consider the Burgers’ equation:

**Test problem 2:**Consider the Burgers’ equation:

**Test problem 3:**Consider the Burgers’ equation:

## 6. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Korshunova, A.A.; Rozanova, O.S. The Riemann Problem for the Stochastically Perturbed Non-Viscous Burgers Equation and the Pressureless Gas Dynamics Model. In Proceedings of the International Conference Days on Diffraction 2009, St. Petersburg, Russia, 26–29 May 2009. [Google Scholar]
- Hills, R.G. Model Validation: Model Parameter and Measurement Uncertainty. J. Heat Transf.
**2005**, 128, 339–351. [Google Scholar] [CrossRef] - Sugimoto, N.; Kakutani, T. ‘Generalized Burgers’ Equation’ for Nonlinear Viscoelastic Waves. Wave Motion
**1985**, 7, 447–458. [Google Scholar] [CrossRef] - Yonti Madie, C.; Kamga Togue, F.; Woafo, P. Numerical Solution of the Burgers’ Equation Associated with the Phenomena of Longitudinal Dispersion Depending on Time. Heliyon
**2022**, 8, e09776. [Google Scholar] [CrossRef] [PubMed] - Rodin, E.Y. On Some Approximate and Exact Solutions of Boundary Value Problems for Burgers’ Equation. J. Math. Anal. Appl.
**1970**, 30, 401–414. [Google Scholar] [CrossRef] - Benton, E.R.; Platzman, G.W. A Table of Solutions of the One-Dimensional Burgers Equation. Q. Appl. Math.
**1972**, 30, 195–212. [Google Scholar] [CrossRef] - Wolf, K.B.; Hlavatý, L.; Steinberg, S. Nonlinear Differential Equations as Invariants under Group Action on Coset Bundles: Burgers and Korteweg-de Vries Equation Families. J. Math. Anal. Appl.
**1986**, 114, 340–359. [Google Scholar] [CrossRef] - Nerney, S.; Schmahl, E.J.; Musielak, Z.E. Limits to Extensions of Burgers’ Equation. Q. Appl. Math.
**1996**, 54, 385–393. [Google Scholar] [CrossRef] - Kudryavtsev, A.G.; Sapozhnikov, O.A. Determination of the Exact Solutions to the Inhomogeneous Burgers Equation with the Use of the Darboux Transformation. Acoust. Phys.
**2011**, 57, 311–319. [Google Scholar] [CrossRef] - Kutluay, S.; Bahadir, A.R.; Özdeş, A. Numerical Solution of One-Dimensional Burgers Equation: Explicit and Exact-Explicit Finite Difference Methods. J. Comput. Appl. Math.
**1999**, 103, 251–261. [Google Scholar] [CrossRef] - Hassanien, I.A.; Salama, A.A.; Hosham, H.A. Fourth-Order Finite Difference Method for Solving Burgers’ Equation. Appl. Math. Comput.
**2005**, 170, 781–800. [Google Scholar] [CrossRef] - Bahadır, A.R. A Fully Implicit Finite-Difference Scheme for Two-Dimensional Burgers’ Equations. Appl. Math. Comput.
**2003**, 137, 131–137. [Google Scholar] [CrossRef] - Kadalbajoo, M.K.; Sharma, K.K.; Awasthi, A. A Parameter-Uniform Implicit Difference Scheme for Solving Time-Dependent Burgers’ Equations. Appl. Math. Comput.
**2005**, 170, 1365–1393. [Google Scholar] [CrossRef] - Mukundan, V.; Awasthi, A. Linearized Implicit Numerical Method for Burgers’ Equation. Nonlinear Eng.
**2016**, 5, 219–234. [Google Scholar] [CrossRef] - Raissi, M.; Perdikaris, P.; Karniadakis, G.E. Physics-Informed Neural Networks: A Deep Learning Framework for Solving Forward and Inverse Problems Involving Nonlinear Partial Differential Equations. J. Comput. Phys.
**2019**, 378, 686–707. [Google Scholar] [CrossRef] - Raissi, M.; Perdikaris, P.; Karniadakis, G.E. Physics Informed Deep Learning (Part I): Data-Driven Solutions of Nonlinear Partial Differential Equations. arXiv
**2017**, arXiv:1711.10561. [Google Scholar] - Lu, L.; Meng, X.; Mao, Z.; Karniadakis, G.E. DeepXDE: A Deep Learning Library for Solving Differential Equations. SIAM Rev.
**2021**, 63, 208–228. [Google Scholar] [CrossRef] - Markidis, S. The Old and the New: Can Physics-Informed Deep-Learning Replace Traditional Linear Solvers? Front. Big Data
**2021**, 4, 669097. [Google Scholar] [CrossRef] - Cole, J.D. On a Quasi-Linear Parabolic Equation Occurring in Aerodynamics. Q. Appl. Math.
**1951**, 9, 225–236. [Google Scholar] [CrossRef] - Wood, W.L. An Exact Solution for Burger’s Equation. Commun. Numer. Methods Eng.
**2006**, 22, 797–798. [Google Scholar] [CrossRef] - Winnicki, I.; Jasinski, J.; Pietrek, S. New approach to the Lax-Wendroff modified differential equation for linear and nonlinear advection. Numer. Methods Partial. Differ. Equ.
**2019**, 35, 2275–2304. [Google Scholar] [CrossRef] - Savović, S.; Drljača, B.; Djordjevich, A. A comparative study of two different finite difference methods for solving advection–diffusion reaction equation for modeling exponential traveling wave. Ric. Mat.
**2022**, 71, 245–252. [Google Scholar] [CrossRef] - Yang, X.; Ralescu, D.A. A Dufort–Frankel scheme for one-dimensional uncertain heat equation. Math. Comput. Simul.
**2021**, 181, 98–112. [Google Scholar] [CrossRef] - Nagy, Á.; Omle, I.; Kareem, H.; Kovács, E.; Barna, I.F.; Bognar, G. Stable, Explicit, Leapfrog-Hopscotch Algorithms for the Diffusion Equation. Computation
**2021**, 9, 92. [Google Scholar] [CrossRef] - Bakodah, H.O.; Al-Zaid, N.A.; Mirzazadeh, M.; Zhou, Q. Decomposition method for Solving Burgers’ Equation with Dirichlet and Neumann boundary conditions. Optik
**2017**, 130, 1339–1346. [Google Scholar] [CrossRef]

**Figure 1.**The architecture of a PINN and the standard training loop of a PINN constructed for solving a simple partial differential equation, where PDE and Cond denote governing equations, while R and I represent their residuals. The approximator network is subjected to a training process and provides an approximate solution. The residual network is a non-trainable part of PINN capable of computing derivatives of the approximator network outputs with respect to the inputs, resulting in the composite loss function, denoted by MSE.

**Figure 2.**EFD and PINN solutions (open symbols) compared to analytical solutions (solid lines) of Test problem 1 at different times T = 0.02, 0.05, and 0.1 for ν = 0.5.

**Figure 3.**EFD and PINN solutions (open symbols) compared to analytical solutions (solid lines) of Test problem 1 at different times T = 0.5, 0.7, and 0.9 for ν = 0.05.

**Figure 5.**EFD and PINN solutions (open symbols) compared to analytical solutions (solid lines) of Test problem 2 at different times T = 0.05, 0.25, and 0.5 for ν = 0.5.

**Figure 6.**EFD and PINN solutions (open symbols) compared to analytical solutions (solid lines) of Test problem 2 at different times T = 0.3, 0.5, and 0.7 for ν = 0.1.

**Figure 8.**EFD and PINN solutions (open symbols) compared to analytical solutions (solid lines) of Test problem 3 at different times T = 0.2, 0.4, and 0.8 for ν = 0.5.

**Figure 9.**EFD and PINN solutions (open symbols) compared to analytical solutions (solid lines) of Test problem 3 at different times T = 0.5, 1, and 2 for ν = 0.02.

T | Error (EFDM) | Error (PINN) | |
---|---|---|---|

ν = 0.5 | 0.02 | 5.14 × 10^{−7} | 2.56 × 10^{−5} |

0.05 | 5.07 × 10^{−7} | 4.96 × 10^{−5} | |

0.1 | 5.43 × 10^{−5} | 9.51 × 10^{−5} | |

ν = 0.05 | 0.5 | 4.43 × 10^{−7} | 7.09 × 10^{−6} |

0.7 | 2.38 × 10^{−7} | 1.46 × 10^{−6} | |

0.9 | 7.03 × 10^{−8} | 1.02 × 10^{−6} |

T | Error (EFDM) | Error (PINN) | |
---|---|---|---|

ν = 0.5 | 0.05 | 5.36 × 10^{−8} | 2.16 × 10^{−4} |

0.25 | 2.37 × 10^{−7} | 2.27 × 10^{−6} | |

0.5 | 1.14 × 10^{−7} | 1.57 × 10^{−4} | |

ν = 0.1 | 0.3 | 3.80 × 10^{−9} | 9.09 × 10^{−7} |

0.5 | 6.19 × 10^{−7} | 1.65 × 10^{−4} | |

0.7 | 4.34 × 10^{−7} | 4.79 × 10^{−5} |

T | Error (EFDM) | Error (PINN) | |
---|---|---|---|

ν = 0.5 | 0.2 | 6.05 × 10^{−5} | 9.72 × 10^{−4} |

0.4 | 6.07 × 10^{−5} | 7.56 × 10^{−4} | |

0.8 | 1.24 × 10^{−5} | 2.32 × 10^{−4} | |

ν = 0.02 | 0.5 | 3.85 × 10^{−6} | 2.15 × 10^{−5} |

1 | 7.45 × 10^{−6} | 2.33 × 10^{−5} | |

2 | 1.12 × 10^{−5} | 3.27 × 10^{−4} |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Savović, S.; Ivanović, M.; Min, R.
A Comparative Study of the Explicit Finite Difference Method and Physics-Informed Neural Networks for Solving the Burgers’ Equation. *Axioms* **2023**, *12*, 982.
https://doi.org/10.3390/axioms12100982

**AMA Style**

Savović S, Ivanović M, Min R.
A Comparative Study of the Explicit Finite Difference Method and Physics-Informed Neural Networks for Solving the Burgers’ Equation. *Axioms*. 2023; 12(10):982.
https://doi.org/10.3390/axioms12100982

**Chicago/Turabian Style**

Savović, Svetislav, Miloš Ivanović, and Rui Min.
2023. "A Comparative Study of the Explicit Finite Difference Method and Physics-Informed Neural Networks for Solving the Burgers’ Equation" *Axioms* 12, no. 10: 982.
https://doi.org/10.3390/axioms12100982