Discussion of Lab Assignment #1


The assignment consists of running a MATLAB code for a simple time advance method for 10 time steps for the wave equation using 51 points in x

Problem 1) uses two types of space differences
a) 2nd order central a=-0.5, b=0, c=0.5
b) 1st order backward a=-1, b=1, c=0
at a CFL=1.0 and then asks for plots of the results at n = 5 and n=10

The initial condition is a spike (postscipt:ps) (pdf format) at j=25. The exact solution should be just translation of the spike to the right at a speed of 1 grid point per time step.

For Problem 1a, the result at n=5 (ps) (pdf)shows growth and spread of the spike but it seems to be centralized about the initial j=25 location.
For Problem 1a, the result at n=10 (ps) (pdf)shows even greater growth and spread of the spike.
Obviously, the solution is unstable and inaccurate for this choice of method.
For Problem 1b, the result at n=5 (ps) (pdf) shows that the spike has moved over 5 points.
For Problem 1b, the result at n=10 (ps) (pdf)shows that the spike has moved over 10 points.
Obviously, the solution is stable and accurate for this choice of method.

Problem 2) uses 1st order backward a=-1, b=1, c=0
a) for CFL=0.7
a) for CFL=1.4
and then asks for plots of the results at n = 5 and n=10

For Problem 2a, we actually show the solution at all n which shows that the spike travels to the right but decays as it goes.
Note the data in u was shifted in the figure to seperate the plots for clarity.
For Problem 2b, the result at n=5 shows that the spike has grown and spread similar to Problem 1a, but that it also seems to be moving to the right.
For Problem 2b, the result at n=10 shows that the spike has grown rapidly, looks very bad and is still moving.
Obviously, the solution is unstable and inaccurate for this choice of method.


In general, you should have observed that some type of differencing can cause instabilities and errors. Why does the spike grow and spread, or decay and move? What are the characteristics of the differencing methods that give these types of behavior? The goal of the course is to develop tools to understand and avoid such problems.