Docsity

Numerical Differentiation and Integration - Study Questions | MATH 661, Study notes of Mathematics

Toggle sidebar
bg1
Numerical Differentiation and Integration
I. Determine the coefficients C−1,C0, and C1, such that the following integration formula has the highest
possible order.
Z2h
−2h
f(x)dx =C−1·f(−h) + C0·f(0) + C1·f(h)
Also, write out the leading error term.
II. Integral Equation Method:
For the ODE two point boundary value problem
u00(x)−u(x) = f(x) 0 < x < 1
u(0) = a, u(1) = b
1. Verify that
u(x) = Z1
0
e|x−t|
2f(t)dt +αex+βe−x
satisfies the ODE u00 −u=f.
2. Derive the linear equation for αand βin order to satisfy the boundary conditions u(0) = aand u(1) = b.
3. Using trapeziodal rule, write out the convolution ˜u(x) = R1
0
e|x−t|
2f(t)dt as a matrix vector product
~
˜u=A(n+1)×(n+1) ·~
f. Please give explicitly the entries ai,j in the matrix A.
4. Clearly, direct matrix vector product requires O(n2) work. Design an algorithm which only requires O(n)
work, and write the pseudocode.
III. Let 0 = x0< x1<···< xN= 1 be evenly spaced points, h= 1/N and xn=nh. Assume fand f0are
given at each point. Let pnbe the third order polynomial that interpolates fand f0at xnand xn+1.
1. Show that f((n+1
2)h)−pn((n+1
2)h) = O(h4)
2. Show that f0((n+1
2)h)−p0
n((n+1
2)h) = O(h4)
3. Find the equation for p0
n((n+1
2)h) in terms of f(xn), f 0(xn), f(xn+1), f 0(xn+1)
4. If you use this interpolation to construct a single interval integration scheme, show that the resulting
global integration scheme is fourth order.
5. Write down the composite scheme as a sum of f(xn) and f0(xn).
IV.Consider dividing the interval [0,1] into mintervals, with points
0 = x0< x1<··· < xm= 1
For a function fdefined on [0,1] we want to approximate the integrals
Ij=Zxj+1
xj
f(x)dx
for j= 0, . . . , m−1. Consider approximating the function on the whole interval with a single polynomial that
interpolates fat the points x0, . . . , xm. Then integrate this approximation on each interval to approximate
I= (Ij)
1
pf3
pf4

Partial preview of the text

Download Numerical Differentiation and Integration - Study Questions | MATH 661 and more Study notes Mathematics in PDF only on Docsity!

Numerical Differentiation and Integration

I. Determine the coefficients C− 1 , C 0 , and C 1 , such that the following integration formula has the highest possible order. ∫ (^2) h

− 2 h

f (x)dx = C− 1 · f (−h) + C 0 · f (0) + C 1 · f (h)

Also, write out the leading error term.

II. Integral Equation Method: For the ODE two point boundary value problem

u′′(x) − u(x) = f (x) 0 < x < 1 u(0) = a, u(1) = b

  1. Verify that

u(x) =

0

e|x−t| 2

f (t)dt + αex^ + βe−x

satisfies the ODE u′′^ − u = f.

  1. Derive the linear equation for α and β in order to satisfy the boundary conditions u(0) = a and u(1) = b.
  2. Using trapeziodal rule, write out the convolution ˜u(x) =

0

e|x−t| 2 f^ (t)dt^ as a matrix vector product ~u˜ = A(n+1)×(n+1) · f~. Please give explicitly the entries ai,j in the matrix A.

  1. Clearly, direct matrix vector product requires O(n^2 ) work. Design an algorithm which only requires O(n) work, and write the pseudocode.

III. Let 0 = x 0 < x 1 < · · · < xN = 1 be evenly spaced points, h = 1/N and xn = nh. Assume f and f ′^ are given at each point. Let pn be the third order polynomial that interpolates f and f ′^ at xn and xn+1.

  1. Show that f ((n + 12 )h) − pn((n + 12 )h) = O(h^4 )
  2. Show that f ′((n + 12 )h) − p′ n((n + 12 )h) = O(h^4 )
  3. Find the equation for p′ n((n + 12 )h) in terms of f (xn), f ′(xn), f (xn+1), f ′(xn+1)
  4. If you use this interpolation to construct a single interval integration scheme, show that the resulting global integration scheme is fourth order.
  5. Write down the composite scheme as a sum of f (xn) and f ′(xn).

IV.Consider dividing the interval [0, 1] into m intervals, with points

0 = x 0 < x 1 < · · · < xm = 1

For a function f defined on [0, 1] we want to approximate the integrals

Ij =

∫ (^) xj+

xj

f (x)dx

for j = 0,... , m−1. Consider approximating the function on the whole interval with a single polynomial that interpolates f at the points x 0 ,... , xm. Then integrate this approximation on each interval to approximate I = (Ij )

  1. This approximation can be written as a matrix vector action

I = Af

where f = [f (x 0 ),... , f (xm)]T^ and A is a matrix. The matrix A can be computed by splitting the action. The first part is the polynomial interpolation

[p 0 ,... , pm]T^ = P f

where the interpolation polynomial is given by

p(x) = p 0 + p 1 x + · · · + pmxm.

The second part is the piecewise integration of the polynomial. Integrate the above polynomial on each interval to approximate Ij. This is a linear action on the polynomials and can be written in matrix form as I˜ = V [p 0 ,... , pm]T^. Set up the matrix A by showing how to compute P and V. Compute the entries when feasible, only leave elementary matrix operations left to be evaluated. What are the sizes of these matrices.

  1. What are the two main numerical problems with this approach.
  2. Consider the error vector I − I˜ ∈ Rm. If the points x 1 ,... , xm− 1 are chosen to be the Chebyshev points, compute a bound for the standard two norm of the error vector. The bound should only depend on the function f and on the size m.
  3. Instead of using a single polynomial, use a low order polynomial to approximate each entry. For each interval [xi, xi+1], approximate f (x) by interpolating f at xi− 1 ,... , xi+2. (with obvious changes for the end intervals). Integrate this polynomial to get an approximation for Ij. The resulting action can again be written as a matrix operation Bf Compute the entries in B. Compute a bound for the error I − Bf.

V. Let u(x) be a smooth real valued function.

(1) Show that u(x+h) 2 −hu (x−h)− u′(x) = ch^2 + O(h^4 ). Give c explicitly. (2) Notice that you can also develop a similar second order finite difference approximation using u(x + 2h) and u(x − 2 h). Write out the formula, and find the leading order error. (3) Using (1) and (2), and the idea of Richardson extrapolation, develop an approximation scheme to approximate u′(x) using u(x − 2 h), u(x − h), u(x + h), and u(x + 2h). Write out the leading order error.

VI.

(1) Show that the evenly spaced composite trapezoidal rule is always exact for the integral I =

∫ (^2) π 0 f^ (x)dx where

f (x) =

∑^ n

k=

(ak cos(kx) + bk sin(kx))

if using N grid points with N > n. Here x ∈ [0, 2 π]. (2) Is this true for N < n? For example, N = 2? Explain why.

VII. For a function f (x), x ∈ [0, 1], consider the composite midpoint rule for computing

I(f ) =

0

f (x)dx ≈ h

∑^ n

i=

f ((i −

)h) = Q(f, n)

c.) Show that the order of accuracy increases when x 2 = (x 1 + x 3 )/2.

d.) Suppose now that f (x) is continuous on [x 1 , x 3 ], is smooth on [x 1 , x 2 ) and (x 2 , x 3 ], but f ′(x) has a jump discontinuity at x = x 2. Are there new values of c 1 , c 2 , and c 3 , which yield a more accurate approximation of

∫ (^) x 3 x 1 f^ (y)dy^ than those in part a.)?

XII. This problem involves a numerical scheme to find a solution to

uxx(x) = f (x)

on [0, 1] with the boundary conditions ux(0) = ux(1) = 1. Suppose u and f are discretized on a evenly spaced grid xi = hi, i = 0,... , n, where h = 1/n.

a.) Write down the centered difference approximation to uxx at all points except for i = 0 and i = n.

b.) Write down a second order accurate stencil for ux = 1 at the points x 0 and xn.

c.) Write a linear system for finding u(xi) from these approximations. Show that the matrix is singular, and describe what restriction must be placed on f so that a solution exists?

XII.

a. Describe a procedure for creating the highest order general integration stencil on an interval [0, h], given the restriction that you need to use the end points 0 and h and two points somewhere inside (0, h).

b. When applied to a function f that is smooth enough, write down an approximation of the error in the leading order of h. The error term has to be in the form of a derivate value times some known power of h. You can ignore higher order terms.

c. Given a function on a relatively large interval, suppose one divides the interval into N uniform subin- tervals and uses the above quadrature on each subinterval to approximate the overall integral. How will the overall error behave as a function of N.