7 Problems for Assignment 9 - Numerical Methods | MATH 417, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Material Type: Assignment; Class: NUMERICAL METHODS; Subject: MATHEMATICS; University: Texas A&M University; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 02/10/2009

koofers-user-08x
koofers-user-08x 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATH 417: Numerical Analysis
Instructor: Prof. Wolfgang Bangerth
Teaching Assistants: Dukjin Nam
Homework assignment 9 due 4/19/2007
Problem 1 (Lagrange interpolation, repeated). The polynomial p4(x) cal-
culated in Problem 3 of last week’s homework by construction interpolates the
function f(x) = log x. Compute an upper bound for the error on the interval [1,2],
using the theorem that states how large |f(x)p4(x)|can at most be.
(3 points)
Problem 2 (Lagrange interpolation). For the data set xi={1,2,3,4,5},
yi={1,1
2,1
3,1
4,1
5}, compute the Lagrange interpolation polynomial. Plot this
polynomial in the interval 5x10 together with the function f(x) = 1
x
and describe, in words, where the interpolating polynomial is a reasonable approx-
imation of f(x).
(3 points)
Problem 3 (Lagrange interpolation of higher order). For each of the values
N= 1,2,4,6,8,12,20, compute the polynomial p2N(x) of order 2Nsuch that
p2N(0) = 1,
p2N(±j
N) = 0 for j= 1, . . . , N.
Plot these polynomials in the interval 1x1 (for better visibility, restrict the
y-range to 10 . . . 10). What happens as Nbecomes larger? (Hint: You will want to
compute the polynomials with a computer algebra system or a self-written program,
since computing polynomials of degree 40 on paper becomes tedious. You can make
your life a lot easier by only computing those polynomials that you actually need.)
(6 points)
Problem 4 (Non-equidistant Lagrange interpolation). Modify your pro-
gram for Problem 3 to solve the interpolation problem
p2N(0) = 1,
p2Nsin ±πj
2N= 0 for j= 1, . . . , N
for all values of Nin problem 2. Note that the interpolation points sin ±πj
2Nare
between 1 and 1 as before, but are now no longer equidistantly spaced.
(3 points)
1
pf2

Partial preview of the text

Download 7 Problems for Assignment 9 - Numerical Methods | MATH 417 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATH 417: Numerical Analysis

Instructor: Prof. Wolfgang Bangerth [email protected] Teaching Assistants: Dukjin Nam [email protected]

Homework assignment 9 – due 4/19/

Problem 1 (Lagrange interpolation, repeated). The polynomial p 4 (x) cal- culated in Problem 3 of last week’s homework by construction interpolates the function f (x) = log x. Compute an upper bound for the error on the interval [1, 2], using the theorem that states how large |f (x) − p 4 (x)| can at most be. (3 points)

Problem 2 (Lagrange interpolation). For the data set xi = { 1 , 2 , 3 , 4 , 5 }, yi = { 1 , 12 , 13 , 14 , 15 }, compute the Lagrange interpolation polynomial. Plot this polynomial in the interval − 5 ≤ x ≤ 10 together with the function f (x) = (^1) x and describe, in words, where the interpolating polynomial is a reasonable approx- imation of f (x). (3 points)

Problem 3 (Lagrange interpolation of higher order). For each of the values N = 1, 2 , 4 , 6 , 8 , 12 , 20, compute the polynomial p 2 N (x) of order 2N such that

  • p 2 N (0) = 1,
  • p 2 N (± (^) Nj ) = 0 for j = 1,... , N.

Plot these polynomials in the interval − 1 ≤ x ≤ 1 (for better visibility, restrict the y-range to − 10... 10). What happens as N becomes larger? (Hint: You will want to compute the polynomials with a computer algebra system or a self-written program, since computing polynomials of degree 40 on paper becomes tedious. You can make your life a lot easier by only computing those polynomials that you actually need.) (6 points)

Problem 4 (Non-equidistant Lagrange interpolation). Modify your pro- gram for Problem 3 to solve the interpolation problem

  • p 2 N (0) = 1,
  • p 2 N

sin

± 2 πjN

= 0 for j = 1,... , N

for all values of N in problem 2. Note that the interpolation points sin

± 2 πjN

are between −1 and 1 as before, but are now no longer equidistantly spaced. (3 points)

Problem 5 (Numerical differentiation). In class, the symmetric second dif- ference quotient

f ′′(x) ≈

f (x − h) − 2 f (x) + f (x + h) h^2

was introduced. Here, we want to study its properties.

(a) Compute the quadratic Lagrange interpolation polynomial p 2 (x) that inter- polates f in the points x − h, x and x + h and show that the formula is the second derivative p′′ 2 (x 0 ) of this polynomial.

(b) Show that the formula is exact for all polynomials of degree at most 3 (Hint: show this for the monomials xk, k = 0, 1 , 2 , 3 and explain why this is sufficient).

(c) Use the Taylor polynomial of degree 3 for f around the point x and its re- mainder term to show that

f ′′(x) −

f (x − h) − 2 f (x) + f (x + h) h^2

h^2 12

f (4)(ξ)

for some ξ ∈ (x − h, x + h). (6 points)

Problem 6 (Finite difference approximation of the derivative). Take the function defined by

f (x) =

2 x

(^3) + x (^2) for x < 0 x^3 for x ≥ 0.

Compute a finite difference approximation to f ′(x 0 ) at x 0 = 1 with both the one-sided and the symmetric two-sided formula. Use step sizes h = 1, 12 , 14 ,... , 641. Determine experimentally the convergence orders you observe as h → 0. Repeat these computations for x 0 = 0. What convergence orders do you observe? Why? (4 points)

Problem 7 (Derivatives of an implicit function). Let f (x) be defined im- plicitly as follows: for every x > 0, f (x) is that value y for which

yey^ = x. (1)

In other words, every time one wants to evaluate f (x) for a particular value x, one has to solve equation (1) for y. This can be done using Newton’s method, for example, or any of the other root finding algorithms we had in class applied to the function g(y) = yey^ − x. As a sidenote, the function f (x) is called Lambert’s W function.

(a) Write a computer routine that, given x, computes f (x) = y using above definition of y.

(b) Plot f (x) in the interval 0 ≤ x ≤ 10 using points spaced at most 0.1 apart.

(c) Compute an approximation to f ′(2). Use different values for the step length h until that you think the result is accurate with an error of at most 0.001.

Hint: you are allowed to use program parts of previous homework. (7 points)