Homework 10 for 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-32t
koofers-user-32t 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATH 417: Numerical Analysis
Instructors: Prof. Wolfgang Bangerth, Prof. Guido Kanschat
Teaching Assistants: Seungil Kim, Yan Li
Homework assignment 10 due 11/16/06 and
11/20/06
Problem 1 (Finite difference approximation of the derivative). Take
the function defined by
f(x) = 1
2x3+x2for x < 0
x3for x0.
Compute a finite difference approximation to f0(x0) at x0= 1 with both the
one-sided and the symmetric two-sided formula. Use step sizes h= 1,1
2,1
4, . . . , 1
64 .
Determine experimentally the convergence orders you observe as h0.
Repeat these computations for x0= 0. What convergence orders do you
observe? Why? (4 points)
Problem 2 (Numerical integration.) Consider the problem of finding the
numerical value of the integral
Z1
0
arctan x dx.
The exact value of this expression is π
4ln 2
2= 0.43882 . . ..
Evaluate above integral by writing programs that use
(a) the trapezoidal rule,
(b) the Simpson rule.
Split up the integration interval [0,1] into successively smaller sub-intervals of
length h= 1,1
2,1
4, . . . , 1
128 and apply the two quadrature rules above to each
subinterval. Compute the approximated value of the integral and the error.
Determine the convergence order from this data. (4 points)
1
pf2

Partial preview of the text

Download Homework 10 for Numerical Methods | MATH 417 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATH 417: Numerical Analysis

Instructors: Prof. Wolfgang Bangerth, Prof. Guido Kanschat [email protected], [email protected] Teaching Assistants: Seungil Kim, Yan Li [email protected], [email protected]

Homework assignment 10 – due 11/16/06 and

Problem 1 (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 2 (Numerical integration.) Consider the problem of finding the numerical value of the integral

∫ (^1)

0

arctan x dx.

The exact value of this expression is π 4 − ln 2 2 = 0. 43882.. .. Evaluate above integral by writing programs that use

(a) the trapezoidal rule,

(b) the Simpson rule.

Split up the integration interval [0, 1] into successively smaller sub-intervals of length h = 1, 12 , 14 ,... , 1281 and apply the two quadrature rules above to each subinterval. Compute the approximated value of the integral and the error. Determine the convergence order from this data. (4 points)

Problem 3 (Derivatives of an implicit function). Let f (x) be defined implicitly 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. (5 points)

Problem 4 (Integration of an implicit function). Let f (x) be defined as in Problem 3. Compute

∫ (^10)

0

f (x) dx

using the trapezoidal rule for step sizes h = 1, 12 , 14 , 18 ,... , 321. Determine the order of convergence.

(4 points)