\documentclass[12pt]{article}

%\topmargin=0.0in
%\textheight=8.5in

\begin{document}

{\bf Math 269B, Hw \#1} 

Due on: Friday, January 20

\bigbreak

{\bf [1]} ({\it computational assignment}) 
For $x\in [-1,3]$ and $t\in [0, 2.4]$, solve the one-way wave equation 
$$u_t+u_x=0,$$
with the initial data 
$$u(0,x)=\left\{
\begin{array}{ll}
\cos^2{\pi x} & \mbox{ if } |x|\leq \frac{1}{2},\\
0 & \mbox{ otherwise },
\end{array}
\right.
$$
and the boundary data $u(t,-1)=0$. 

Use the Lax-Friedrichs scheme with $\lambda=0.8$ and $\lambda=1.6$ and 
$h=1/10$, $h=1/20$. At the right boundary use the condition $v_{M}^{n+1}=v_{M-1}^{n+1}$, where $x_M=3$. 

The Lax-Friedrichs scheme for $u_t+au_x=0$ is 
$$\frac{v_{m}^{n+1}-\frac{1}{2}(v_{m+1}^n+v_{m-1}^n)}{k}+a\frac{v_{m+1}^n-v_{m-1}^n}{2h}=0.$$

Graph or plot solutions at the last time they were computed. What can you say 
about the behavior of the numerical solutions as a function of $h$ or $\lambda$
? 

You should turn in the code in the language of your choice, the plots and your 
interpretation of the tests performed. 

\bigbreak

{\bf [2]} Show that the forward-time central-space scheme is consistent with 
the equation $u_t+au_x=0$. 

\bigbreak 

{\bf [3]} Show that the following scheme is consistent with the equation 

$u_t+cu_{tx}+au_x=f$ 
$$\frac{v_m^{n+1}-v_m^n}{k}+c\frac{v_{m+1}^{n+1}-v_{m-1}^{n+1}-v_{m+1}^n+v_{m-1}^n}{2kh}+a\frac{v_{m+1}^n-v_{m-1}^n}{2h}=f^n_m.$$


\bigbreak

{\bf [4]} Show that schemes of the form 
$$v_m^{n+1}=\alpha v_{m+1}^n+\beta v_{m-1}^n$$ 
are stable if $|\alpha|+|\beta|\leq1$. Conclude that the Lax-Friedrichs scheme 
is stable if $|a\lambda|\leq1$. 

\end{document}
