Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MATH256 Individual Project 2023

1.  In the chapter on polynomial interpolation, we investigated the construction of cubic splines to

interpolate the data set

{(x0 , y0 ),  (x1 , y1 ),  . . . ,  (xn , yn )} .                                               ()

In this question, we use simpler quadratic splines of the form

Qj (x) = αj (x xj )2 + βj (x xj ) + γj ,    xj  xj+1,    j = 0, 1, . . . , n 1.

The function Q(x) is formed from the union of the individual splines, and the notation hj  = xj+1−xj is used throughout.

(a)   (i)  Given that Q(x) has a continuous first derivative, how many equations are available to

determine the coefficients αj , βj  and γj ? How many coefficients will be left undetermined when these have been applied? Justify your answers.

(ii)  Determine γj , and show that

2αj hj  + βj  = βj+1      and   βj+1  = 2y[xj , xj+1] βj .

(iii)  In view of the above results, what is the main advantage of quadratic splines over cubic splines?

(b)  Calculate the magnitude of the discontinuity in the curvature of Q(x) at x = xj . Simplify your answer as far as possible.

(c) To use quadratic splines, we must choose a value for the coefficient β0 .  Here we try to determine a good choice by using the Newton polynomial through the three points (x0 , y0 ) , (x1 , y1 ) and (x2 , y2 ), which we denote by P (x) .

(i) Show that setting Q(x0 ) = P\ (x0 ) yields β0  = y[x0 , x1] − y[x1 , x2] + y[x0 , x2] .

(ii)  By considering the roots of the difference d(x) = P (x) − Q0 (x), prove that, with this choice for β0 , P (x) and Q0 (x) are representations of the same function.

(iii) Verify algebraically that d(x) = 0 for all x (still with β0  defined as in part (i)). Hint:  write α0  as a second divided difference.

2. The Om  quadrature rule for [ −1, 1] has nodes

tq  = 1 + ,    q = 1, 2, . . . , m,

where m is a positive integer.

(a) Write down the node locations for the Om  rule in the cases m = 2 , 3, 4 and 5 . Why do you think the rule is designed to place half-sized spaces between −1 and t1  and between tm  and 1?

(b) Suppose now that the O5  rule is applied to the integral

I = \ab f(x) dx,

using N subintervals, each of width ∆x .

(i)  Find exact values for the weights w1 , . . . , w5 .

(ii) Write down the O5  quadrature formula for a subinterval of width ∆x .

(iii)  Calculate the first nonzero coefficient Sp , and hence find the leading-order error for the O5  rule on a single subinterval of width ∆x .

(c)   (i)  Make a fair comparison between the O5   rule and the five-point Newton– Cotes rule considered in the lecture notes.  Which method do you expect to perform better in general, and by what (approximate) factor will the errors differ?

(ii) What effect do you expect doubling the number of subintervals to have on the errors for

the whole interval? Justify your answer.

(d)   (i) Write a Maple procedure that takes as its arguments a function f, real numbers a and b, and N , the number of subintervals. The procedure should return the approximate value of the integral I, computed using the O5  rule, as its result.

(ii) Apply the O5  quadrature rule to the integral

I1  = \  dx

using 10 subintervals (don’t forget to apply evalf to obtain a numerical value for π). Recalculate the integral using the five-point Newton– Cotes rule, with the number of subintervals adjusted to ensure a fair comparison, and obtain numerical values for the absolute errors in these approximations. Confirm that the ratio of the errors in the two rules is in agreement with your analysis in part (c). Repeat this calculation for a second, arbitrarily chosen integral (don’t use a polynomial, but make sure there is no possibility of division by zero, etc.).

The numerical methods package provides a five point Newton– Cotes procedure; you can also download the procedure code from Canvas (five_pt_NC .mw).