matlab *.m files to solve conservation laws.

These programs are for the equation u_t + (f(u))_x = 0.

In-class demo script: February 26.
In-class demo script: March 5.
In-class demo script: March 5.

This code "solves" u_t + u u_x = 0 using explicit upwinding but it doesn't converge to a weak solution because the time-stepper is based on the PDE which is not written in conservation form.

This code implements a conservative scheme on (-pi,pi). It handles the boundary conditions u(-pi,t) = 1 and u(pi,t) = 0 for all time or as well as the boundary conditions u(-pi,t) = -1 and u(pi,t) = 1 for all time. It needs to know the numerical flux that you're using. If you want the numerical flux based on explicit upwind use F_eu.m . If you want the numerical flux based on Lax-Friedrichs use F_lf.m . If you want the numerical flux based on Lax-Wendroff use F_lw.m . The code also needs to know what initial data you're using. For the initial data I used in class_Mar5a.m you want to download shock1.m and shock2.m . The initial data I used in class_Mar5b.m is in ID.m .

The script class_Mar5b.m used extract.m to find the point in space at which the approximate solution is close to 1/2.