Math578 - Alexiades
                  LAB 8:   1-D Advection
Consider a (1-dimensional) advection process, for some concentration u(x,t), 
whose initial profile is u(x,0) = u0(x), driven by a given (constant) velocity field V, 
in an (appropriately chosen) interval a ≤ x ≤ b  whose ends are impermeable, 
during some time  0 <= t <= tmax.

1. State precisely the (full) mathematical problem modeling this process.

2. Show that the exact solution of the Initial Value Problem is u(x,t) = u0(x−Vt),
   assuming u0(x) is differentiable.

Take as initial profile the "square bump":  u0(x) = 5 for 1 ≤ x ≤ 2,  u0(x) = 0 otherwise.

3. Describe what you expect to happen qualitatively and sketch this initial profile u0(x) 
   and the expected profile at time t=4 if V=1 and if V=5.  How far does the pulse travel ?

4. Implement the explicit upwind scheme for this problem,
   and derive the CFL stability condition.

In your code, use:  Dtexpl = Dx/V , Dt = factor*Dtexpl, so factor can be changed easily 
(make it an input parameter along with V, a, b).

Assume constant velocity  V>0,  and use: MM = 32, tmax=4.0, dtout=2.0,  
a=0, and  b  big enough so that the entire action happens inside [a,b] (from 3.).
Every dtout (starting at time=0.), your code should output the time, number of time-steps, 
maximum U-value, and also the entire profile of U  (including at time tmax) for plotting. 

For each of the cases listed bellow, do the following:
  • plot the initial and final profiles on one plot ( set yrange [0:5.5] in gnuplot to see the top clearly).
  • on the plot, mark the parameter values that generated it, mark which curve is at what time, and make comments/observations as to what you think is happening, how it compares with other cases and why (annotations can be by hand on the plot printouts).
  • look at the {time,Umax} pairs you generated, comment on what you observe. 5. Here are the cases to examine. (a) V = 1., factor = 1.0 (b) V = 5., factor = 1.0 (c) V = 5., factor = 1.05 (d) V = 5., factor = 0.9 (e) V = 5., factor = 0.5