Homework: Numerical Differentiation


Homework: Numerical Differentiation1
Instructor: Prof. Hector D. Ceniceros
1. Let f(x) = e
x
.
(a) Compute the centered difference approximation of f
0
(1/2), i.e. D0
h
f(1/2), for
h = 0.1/2
n
, n = 0, 1, . . . , 10, and verify its quadratic rate of convergence.
(b) Determine approximately the optimal value h0 which gives the minimum total
error (the sum of the discretization error plus the round-off error) and verify
this numerically.
(c) Construct and compute a fourth order approximation to f
0
(1/2) by applying
Richardson extrapolation to D0
h
f(1/2). Verify the rate of convergence numerically.
What is the optimal h0 in this case?
(d) As seen in class, we can use Cauchy’s integral formula to express f
0
(x0) as
f
0
(x0) = 1
2πr Z 2π
0
f(x0 + reiθ)e
iθdθ. (1)
Use the composite trapezoidal rule applied to (1) to approximate f
0
(1/2) to
machine precision. You can choose r freely in this problem.
2. Use Taylor series expansions to derive the error term of the sided difference approximation
to f
0
(x0):
Dhf(x0) = f(x0 + 2h) + 4f(x0 + h) 3f(x0)
2h
. (2)
3. Consider the data points (x0, f0),(x1, f1), . . . ,(xn, fn), where the points x0, x1, . . . , xn
are distinct but otherwise arbitrary (they could be for example the Chebyshev
nodes). Then the derivative of the interpolating polynomial of these data is
(x)fj
, (3)
where the lj
’s are the elementary Lagrange polynomials:
lj (x) = 1
αj
Yn
k=0
k6=j
(x xk), αj =
Yn
k=0
k6=j
(xj xk). (4)
We can evaluate (3) at each of the nodes x0, x1, . . . , xn, which will give us an
approximation to the derivative of f at those points, i.e. f
0
(xi) ≈ P
0
n
(xi). We can
write this as
f
0 ≈ Dnf, (5)
where f = [f0 f1 . . . fn]
T
, f
0 = [f
0
(x0) f
0
(x1). . . f0
(xn)]T and Dn is the Differentiation
Matrix, (Dn)ij = l
(xi).
1All course materials (class lectures and discussions, handouts, homework assignments, examinations,
web materials) and the intellectual content of the course itself are protected by United States Federal
Copyright Law, the California Civil Code. The UC Policy 102.23 expressly prohibits students (and all
other persons) from recording lectures or discussions and from distributing or selling lectures notes and
all other course materials without the prior written permission of the instructor.
(a) Prove that
l
0
j
(x) = lj (x)
Xn
k=0
k6=j
1
x xk
, (6)
Hint: differentiate log lj (x).
(b) Using (6) prove that
(Dn)ij =
, i 6= j, (7)
(Dn)ii =
Xn
k=0
k6=i
1
xi xk
. (8)
(c) Prove that
Xn
j=0
(Dn)ij = 0 for all i = 0, 1, . . . , n. (9)
(d) Obtain D2 for the Chebyshev points x0 = 1, x1 = 0, x2 = 1.

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:[email protected] 

微信:codinghelp

猜你喜欢

转载自www.cnblogs.com/java2223/p/10321350.html
今日推荐