


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



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
u(x) =
0
e|x−t| 2
f (t)dt + αex^ + βe−x
satisfies the ODE u′′^ − u = f.
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.
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.
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 )
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.
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.
(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?
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.