Starting from:

$35

Numerical Analysis Homework 9 Solved


I.       Simpson’s rule.

(a)   Show that on [−1,1] Simpson’s rule can be obtained as follows

 ,

where y ∈ C4[−1,1] and p3(y;−1,0,0,1;t) is the interpolation polynomial of y with interpolation conditions p3(−1) = y(−1), p3(0) = y(0),

 (0), and p3(1) = y(1).

(b)   Derive ES(y).

(c)   Using (a), (b) and a change of variable, derivethe composite Simpson’s rule and prove the theorem on its error estimation.

II.      Estimate the number of subintervals required to ap-proximate to 6 correct decimal places, i.e. the absolute error is no greater than 0.5 × 10−6,

(a)   by the composite trapezoidal rule,(b) by the composite Simpson’s rule.

III.    Gauss-Laguerre quadrature formula.

(a)   Construct a polynomial π2(t) = t2 + at + b that is orthogonal to P1 with respect to the weight function ρ(t) = e−t, i.e.

                     ∀p ∈ P1,            .

(hint:  

(b)   (10 points) Derive the two-point Gauss-Laguerrequadrature formula

 

and express E2(f) in terms of f(4)(τ) for some τ 0.

x
0.0
0.5
1.0
1.5
2.0
2.5
3.0
y
2.9
2.7
4.8
5.3
7.1
7.6
7.7
x
3.5
4.0
4.5
5.0
5.5
6.0
6.5
y
7.6
9.4
9.0
9.6
10.0
10.2
9.7
x
7.0
7.5
8.0
8.5
9.0
9.5
10.0
y
8.3
8.4
9.0
8.3
6.6
6.7
4.1
(c)    Apply the formula in (b) to approximate

Use the remainder to estimate the error and compare your estimate with the true error. With the true error, identify the unknown quantity τ contained in E2(f).

(hint: use the exact value I = 0.596347361···)

The above four problems weigh 15, 10, and 20 points, respectively.

2        C++ programming
Write a C++ function to perform discrete least square via QR factorization. Your algorithm should take as input the maximum degree of the fitting polynomial, three or more data pairs (xi,yi), and output coefficients of the fitted polynomial.

Run your subroutine on the following data.

In the notes, the condition number of a matrix A is defined as condA (x) = kAkkA−1k.

Report the condition number based on the 2-norm of the matrix G in the normal-equation approach (reuse results of your previous homework!) and that of the matrix R1 in the QR-factorization approach, verifying that the former is much larger than the latter.


More products