# 1-D inviscid, unsteady Burgers' equation

1-D unsteady, viscous, Burgers' equation in conservative form is presented in the previous sub-section, using Dirichlet and periodic boundary conditions. In this sub-section, the inviscid Burgers' equation is discussed, employing the same boundary conditions:
$$\frac{\partial u}{\partial t} + \frac{1}{2} \frac{\partial (u^2)}{\partial x} = 0,$$ where $u$ is velocity.

# Exact solution

The exact solution of the unsteady, inviscid Burgers' equation can be written as:
$$u = \frac{1}{2 \pi t^*} \sin \left[2 \pi (x - ut) \right],$$ The equation is solved in an interval of $[0,1]$, with $t^* = 0.1$.

# Numerical solution

Burgers' equation is to be solved with Dirichlet and also periodic boundary conditions on $u$. For discretisation, the Lax-Friedrichs scheme is employed, since the PDE is hyperbolic:
$$u_i^{n+1} = \frac{1}{2}(u_{i+1}^n + u_{i-1}^n) - a\frac{\Delta t}{2\,\Delta x}(u_{i+1}^n - u_{i-1}^n).$$ The numerical results together with the respective exact solution is plotted in Fig. d.7.

Fig. d.7: Exact vs. numerical solution for 1-D unsteady, inviscid Burgers' equation.