Programming Assignment Three

Your work should be presented in the form of a typed report using clear and properly punctuated English. Where appropriate include full program listings and output. If you choose to work in a group of two, please turn in independently prepared reports.


\def\R{{\bf R}}
\def\Z{{\bf Z}}
\item{1a.}  Consider Burgers equation
$$u_t+2u u_x=0\quad \hbox{where $x\in[0,2\pi]$ and $t\ge 0$}$$
with initial condition 
$u(x,0)=u_0(x)$ and periodic boundary
conditions $u(0,t)=u(2\pi,t)$.
Non-zero solutions to this equation develop shock discontinuities
in finite time at which point they become non-unique.
A physically relevant solution may
be obtained as the limit of 
solutions to the viscous Burgers 
equation $$u_t-\nu u_{xx}+2u u_x=0$$
as $\nu\to 0$.  
Solve the viscous Burgers equation with
$u_0(x)=2+3\sin x$
for $\nu=0.5$, $0.25$ and $0.125$.
Compare the graphs of $u(x,1)$ for each of these
values of $\nu$. Do these graphs converge?
Can you compute a solution for $\nu=0.01$?  
What about for $\nu=0.001$?


\item{1b.}
Consider the semi-discrete upwind method
$$
	{d u_j\over dt}=-{2 u_j\over{\Delta x}}
	\cases{ u_j - u_{j-1} & for $u_j\ge 0$\cr
			u_{j+1}-u_j & for $u_j<0$.\cr}
$$
Write a program using Euler's explicit method to
solve these equations.
Compare the solutions obtained by this method to
the solutions found in part a.
Draw graphs of
$u(x,1/8)$, $u(x,1/4)$, $u(x,1/2)$ and $u(x,1)$.
What is the speed of propagation of the shock?
Does the speed of propagation
obey the Rankine--Hugoniot condition?


\item{1c.}
Write Burgers equation in the form of a hyperbolic
conservation law
$$
	u_t + \partial_x  f(u) =0
$$
and show for a smooth solution that
$$
	\int_0^{2\pi} u(x,t) dx
	=\int_0^{2\pi} u(x,0) dx.
$$
The discrete analog of this is
$$
	\sum_{j=1}^{n} u^{m}_j = \sum_{j=1}^n u^0_j.
$$
A numerical method for which the above property holds
for all $m$ is called conservative.
Is the numerical scheme in part b conservative?


\item{1d.}
Define the averages
$$
	\tilde f^m_{j+1/2}={1\over \Delta t}\int_{t_m}^{t_{m+1}}
		f\big(u(x_{j+1/2},t)\big)d t$$
and
$$
	\tilde u^m_j={1\over \Delta x}
		\int_{x_{j-1/2}}^{x_{j+1/2}} u(x,t_m) dx.
$$
Derive the exact mathematical identity
$$
	\tilde u_j^{m+1}=\tilde u_j^{m}-{\Delta t\over \Delta x}
		\big(\tilde f^m_{j+1/2}-\tilde f^m_{j-1/2}\big)
$$
by integrating the hyperbolic conservation law 
$u_t+\partial_x f(u)=0$ 
over the intervals $[t_m,t_{m+1}]$ and $[x_{j-1/2},x_{j+1/2}]$ 
in time and space.


\item{1e.}
The Lax--Wendroff method is obtained by making the approximation
$$
	\tilde f^m_{j+1/2}=f\Big(
		{u^m_j+u^m_{j+1}\over 2}
		+{\Delta t\over 2\Delta x}
		\big\{ f\big(u^m_j)-f(u^m_{j+1})\big\}\Big).
$$
Write a program to solve Burgers equation using the
Lax--Wendroff method.
Compare the graphs of $u(x,1/8)$, $u(x,1/4)$, $u(x,1/2)$
and $u(x,1)$ to those found in part a.
Do these solutions obey the Rankine--Hugoniot condition?
Is this method conservative?


\item{1f.}
The Engquist--Osher method is obtained by making the approximation
$$%\eqalign{
    \tilde f^m_{j+1/2}=
\cases{ f(u^m_{j+1})&
$f'(u^m_{j})\le 0$,
$f'(u^m_{j+1})<0$\cr
        f(\xi)&
$f'(u^m_{j})\le 0$,
$f'(u^m_{j+1})\ge 0$\cr
        f(u^m_{j})+f(u^m_{j+1})-f(\xi)&
$f'(u^m_{j})>0$,
$f'(u^m_{j+1})<0$\cr
        f(u^m_{j})&
$f'(u^m_{j})>0$,
$f'(u^m_{j+1})\ge 0$\cr
}
$$
where $\xi$ in the second and third cases is
the number between $u^m_{j}$ and $u^m_{j+1}$ such
that $f'(\xi)=0$.
Write a program to solve Burgers equation using
the Engquist--Osher method.
Compare the graphs of $u(x,1/8)$, $u(x,1/4)$, $u(x,1/2)$
and $u(x,1)$ to those found in part e.
Which method resolves the shocks better?
Are there spurious oscillations?


Last Updated: Sun Apr 27 02:31:28 PDT 2003