You are on page 1of 2

Math 620, Numerical Analysis I Fall 2011

Homework 1
due Wednesday, September 14

Read: Section 1.1 (Atkinson)

Turn in: 1. (5 pts) This an exercise to get you started with basic Matlab functionality. At the end you would have learned how to set up and solve a linear system, to write a Matlab function, and to plot results. The Dirichlet problem associated to Poissons equation in one dimension requires you to nd u : [0, 1] R that satises 2 xx u = f , u(0) = u(1) = 0, (1) where f : [0, 1] R is a suciently nice function (L2 (0, 1) is standard, but continuous functions will do). (i) Divide the interval [0, 1] into N equally spaced intervals, and dene the grid 0 = x 0 < x1 < x2 < < x N = 1 , with xi = ih, h = 1/N . Using the nite dierence approximation formula for the second derivative u(x h) 2u(x) + u(h + h) 2 xx u(x) , h2 transform the equation (1) into a linear system AU =F , where U, F RN 1 represent the values of u (f , respectively) at the grid-points. function U = solve poisson(N, f) that takes a function handle f and an integer N as arguments, and returns a solution U to (2). Pick your favorite function on f on [0, 1] (predened, or dene it yourself, e.g., sin, x2 , |x 0.5|), and solve the problem (2) with N = 10, 20, 40. Plot the solutions on the same graph to show convergence. (2)

(ii) Write a Matlab function

Hand in: A brief description of the linear system (2), a printout of your code, and a printout of your graph. 2. (5 pts) Let f (x) = ln(1 + x). Use the integral formula for the Taylor remainder to show that for all x (1, 0) lim Rn (x) = 0 .
n

(Hint: Find an upper bound for the absolute value of the integrant to show that it converges uniformly to 0.) 3. (5 pts) Let f (x) = 3 x and x0 = 8. (i) Find an approximation of u of 3 9 using the Taylor polynomial p3 (x) at x0 . (ii) Estimate (i.e., nd an upper bound for) the error |u 3 9| based on one of the Taylor remainder formulas. Check your estimate against the actual error.

You might also like