Docsity

Numerical Computing: LU Factorization, Nonlinear Systems, Integrals, Interpolation for Tes, Exams of Mathematics

Toggle sidebar
bg1
Numerical Computing F’05 A. Kapila
Sample problems for Test II
1. (a) Write out the LU factorization of the following matrix (show both the Land Umatrices
explicitly):
2−1 0
−1 2 −1
0−1 2
.
(b) Consider the system
1
1 1 x1
x2=1
2.
i. Solve this system by Gaussian elimination without pivoting. Show all steps. (Only carry
out the minimum number of operations; do not simplify. For example, if your answer is a
quotient involving the quantity 1/ in the numerator and the denominator, do not simplify
by multiplying throughout with . )
ii. Suppose that = 10−8and that you are computing on a normalized decimal machine with
6-digit precision. What answers will the machine give for x1and x2?
iii. Repeat parts (i) and (ii) above, but now use pivoting.
iv. Determine the exact solution for = 10−8.Find the relative errors in the computation of
x1and x2for each of the two cases above. What conclusion do you draw about the merit
of pivoting?
2. Consider the nonlinear system of algebraic equations:
x+y+z= 3,
x2+y2+z2= 5,
ex+xy −xz = 1.
(a) Explain how the solution to such a system is found by using Newton’s method.
(b) Starting with the initial guess x= 1, y = 0, z = 0,find the next iterate by using Newton’s
method.
(c) Would x= 0, y = 1, z = 1 have been a good guess? If not, then why not?
3. (a) Write down the functional form of the natural cubic spline interpolant for the data points
(−1,1),(0,2),(1,−1).
Also write down the equations whose solution will determine the unknown coefficients appearing
in the interpolant, but do not solve these equations.
(b) Suppose one seeks a spline of degree 4 to interpolate ndata points.
i. How many coefficients does the spline have?
ii. What continuity conditions must one apply at the knots (internal data points)?
iii. How many extra conditions are needed at the end points for a unique determination of the
spline?
(c) Use the Newton basis to find the polynomial interpolant for the data in part (a) above. Repeat
the computation if an additional data point (2,3) is supplied. Explain why the Newton approach
is preferable to the Lagrange approach in this situation.
4. (a) Consider the integral I=Rb
af(x)dx.
i. Under what conditions is Ilikely to be sensitive to small perturbations in f(x)?
ii. Under what conditions is Ilikely to be sensitive to small perturbations in b?
pf3

Partial preview of the text

Download Numerical Computing: LU Factorization, Nonlinear Systems, Integrals, Interpolation for Tes and more Exams Mathematics in PDF only on Docsity!

Numerical Computing F’05 A. Kapila Sample problems for Test II

  1. (a) Write out the LU factorization of the following matrix (show both the L and U matrices explicitly): (^) 

(b) Consider the system (^) [  1 1 1

] [

x 1 x 2

]

[

]

i. Solve this system by Gaussian elimination without pivoting. Show all steps. (Only carry out the minimum number of operations; do not simplify. For example, if your answer is a quotient involving the quantity 1/ in the numerator and the denominator, do not simplify by multiplying throughout with . ) ii. Suppose that  = 10−^8 and that you are computing on a normalized decimal machine with 6-digit precision. What answers will the machine give for x 1 and x 2? iii. Repeat parts (i) and (ii) above, but now use pivoting. iv. Determine the exact solution for  = 10−^8. Find the relative errors in the computation of x 1 and x 2 for each of the two cases above. What conclusion do you draw about the merit of pivoting?

  1. Consider the nonlinear system of algebraic equations:

x + y + z = 3 , x^2 + y^2 + z^2 = 5 , ex^ + xy − xz = 1.

(a) Explain how the solution to such a system is found by using Newton’s method. (b) Starting with the initial guess x = 1, y = 0, z = 0, find the next iterate by using Newton’s method. (c) Would x = 0, y = 1, z = 1 have been a good guess? If not, then why not?

  1. (a) Write down the functional form of the natural cubic spline interpolant for the data points

(− 1 , 1), (0, 2), (1, −1).

Also write down the equations whose solution will determine the unknown coefficients appearing in the interpolant, but do not solve these equations. (b) Suppose one seeks a spline of degree 4 to interpolate n data points. i. How many coefficients does the spline have? ii. What continuity conditions must one apply at the knots (internal data points)? iii. How many extra conditions are needed at the end points for a unique determination of the spline? (c) Use the Newton basis to find the polynomial interpolant for the data in part (a) above. Repeat the computation if an additional data point (2, 3) is supplied. Explain why the Newton approach is preferable to the Lagrange approach in this situation.

  1. (a) Consider the integral I =

∫ (^) b a f^ (x)^ dx. i. Under what conditions is I likely to be sensitive to small perturbations in f (x)? ii. Under what conditions is I likely to be sensitive to small perturbations in b?

(b) Would you expect a 10-point Newton-Cotes quadrature rule to work well for approximating the integral (^) ∫ 1

− 1

1 + 25x^2

dx?

Explain your answer. (c) Estimate the error incurred in approximating the integral ∫ (^1) / 2

0

xe−x^ dx

by the trapezoidal rule, QT. You are given that

I − QT = −

h^3 12

f ′′(ξ), h = b − a, a < ξ < b.

  1. (a) Given a set of data points, what is the difference between interpolation and fitting? Under what circumstances will you prefer one over the other? (b) Find the function y = aex^ + bx^3 that best fits the points (− 1 , 0), (0, 1) and (1, 3). Explain your approach and show all steps. (c) Explain in detail why Chebyshev points are preferred over equally-spaced nodes in polynomial interpolation of a function.
  2. (a) Find the three Lagrange polynomials of degree 2 for interpolation over the points x 1 = 0, x 2 = 1 , x 3 = 2. (b) Use the result of part (a) to find the quadratic interpolant to f (x) = 6/(x + 1) on the interval [0, 2]. (c) What advantage does Lagrange interpolation have over monomial interpolation and Newton in- terpolation? (d) In interpolating a smooth function over a large number of nodes, what is the advantage of piecewise polynomial interpolation over interpolation by a single polynomial? Explain. (e) Give a short description of interpolation by cubic splines.
  3. Suppose a table is to be prepared for the function f (x) = ex, 0 ≤ x ≤ 1. Assume that each entry is given to an accuracy of more than 6 decimal places. Let the difference between adjacent x values, or step size, be h. What should h be to ensure that if the table is used with linear interpolation, the error is no larger than 10 −^6? You are given that if F (x) is the linear interpolant to f (x) on the interval xi ≤ x ≤ xi+1, then the error of interpolation is

|f (x) − F (x)| =

f ′′(ξ) 2

(x − xi)(x − xi+1)

  1. The n -point formula for a numerical approximation to the integral

I =

− 1

f (x) dx

takes the form Qn =

∑^ n

i=

cif (xi),

where the xi are the nodes and the ci the corresponding weights. The nodes lie in the interval [− 1 , 1], and obey − 1 ≤ x 1 < x 2 < · · · < xn− 1 < xn ≤ 1.