ROUGH DRAFT authorea.com/85626

# Numerical methods for conservation laws, HW 1

#### 1. Modify the upwinding, Lax-Friedrichs, Lax-Wendroﬀ subroutines given in class (or obtained/written by yourself) to solve

$\left\{ \begin{array}{ll} u_{t} + au_{x} = 0 \\ u(x, 0) = u_{0}(x)\\ u(0, t) = u(1, t) \end{array} \right.$

on $$(x, t) \in [0, 1] \times [0, 5]$$

• Your code should take spatial stepsize ∆x, a, $$\lambda = a \Delta t$$, and $$u_0(x)$$ as input.

• The output is a video showing the solution as time t goes from 0 to 5.

Solves Burgers equation using naive upwind scheme. For video run Matlab code attached.

Solves Burgers equation using Lax-Frierichs. For video run Matlab code attached.

Solves Burgers equation using Lax Wendroff. For video run Matlab code attached.

#### 2. Mimic the derivation of conservation law in class to prove its 2D version:

$\vec{u}_{t} + f(\vec{u})_{x} + g(\vec{u})_{y} = 0.$

This conservation law is always hyperbolic if $$u$$ is scalar. If u is a vector, ,then the equation is called hyperbolic conservation law if, for any real $$\varepsilon = (\varepsilon _{1}, \varepsilon_{2})$$ the linear combination of the Jacoians $$\varepsilon _{1} f'(u) + \varepsilon _{2}g'(u)$$ has only eigenvalues and complete set of eigenvectors.

Euler equations of compressible gas dynamics.

\[u + f(u)_{x} + g(u)_{y} = 0