Unformatted text preview:

MATH 5620 NUMERICAL ANALYSIS II HOMEWORK 4 DUE FRIDAY MARCH 19 2010 Problem 1 Consider the Poisson s equation u f x y for x 0 1 and y 0 1 u x y 0 if x 0 or x 1 or y 0 or y 1 With f x y sin x sin 2 y the true solution is u x y f x y 5 2 Use the finite difference method with xi ih i 0 n 1 and yj jh j 0 n 1 for the values n 10 50 100 and h 1 n 1 Compute the maximum absolute error in your approximation and produce a log log plot with h in the abscissa and the error in the ordinate Is this plot consistent with the expected O h2 convergence rate Notes You may find it easier to write the discretization matrix with Matlab s kron in Octave replace by spkron See class notes http www math utah edu fguevara math5620 s10 na006 pdf You may use Matlab s backslash to solve the system Your system matrix should be n2 n2 Think of using matrix operations to put values in lexicographic ordering x linspace 0 1 n 2 y linspace 0 1 n 2 X Y meshgrid x y u x y some f u n c t i o n U u X Y Then the matrix U is such that U i j u x j y i Since the vector U contains the columns of U concatenated it corresponds to ordering the nodes by x and then by y as in the following 3 3 example 3 6 9 y 2 5 8 1 4 7 x where the arrows indicate the direction of increasing values of the corresponding variables 1 2 MATH 5620 NUMERICAL ANALYSIS II HOMEWORK 4 DUE FRIDAY MARCH 19 2010 Problem 2 Consider the parabolic PDE heat equation ut uxx for t 0 and x 0 1 u x 0 x for x 0 1 u 0 t u 1 t 0 for t 0 Use the Crank Nicholson method with the space discretization xi ih i 0 n 1 h 1 n 1 n 100 and time discretization k 1 1000 to approximate the solution for the initial conditions a x sin x b x sin x sin 10 x Please include snapshots of both solutions at times t 2k and t 5k Notes With these particular boundary conditions the method can be written as U n 1 I k 2 A 1 I k 2 A U n where A is the usual finite difference discretization of the 1D Laplacian You may use Matlab s backslash to solve the systems at each iteration


View Full Document

U of U MATH 5620 - NUMERICAL ANALYSIS II HOMEWORK 4

Download NUMERICAL ANALYSIS II HOMEWORK 4
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view NUMERICAL ANALYSIS II HOMEWORK 4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view NUMERICAL ANALYSIS II HOMEWORK 4 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?