CSM-521 Lab2
CSM-521 Lab2
1. Write a computer program in C/MATLAB that uses the upstream differencing and
Lax methods to approximate the solution to the initial- boundary value problem
ut ux 0 x 0, t 0
u ( x,0) 2 x x0
u (0, t ) 2 t t 0
At t = 0.5, for 0 x 1 , compare numerical result with the exact solution, u 2 x t .
2. Write a computer program in C/MATLAB that uses the linear Lax Wendroff method to
approximate the solution to the initial- boundary value problem
ut (u 2 / 2) x 0 x 0, t 0
u ( x,0) x x0
u (0, t ) 0 t 0
At t = 1, for 0 x 1 , compare numerical result with the exact solution, u x / (1 t ) .
3. Write a computer program in C/MATLAB for the problem 1, using the following
schemes
(i) McCormack Method
(ii) Leap Frog Method