4
MTH-851 Numerical Analysis Sources of Errors, Root Finding, Interpolation, Assignment No. 1 & 2 Due Date: 20 April 2015 Before 1400hrs 1 Assignment-1 1. Explain how many significant digits are there in 0.0002025, 0.00202570, 0.2025000. 2. Let f (x)= e x -e -x x . (a) Find lim x0 f (x). (b) Use four-digit rounding arithmetic to evaluate f (0.1). (c) Replace each trigonometric function with its third Maclaurin polynomial, and repeat part (b). (d) The actual value is f (0.1) = 2.003335000. Find the relative error for the values obtained in parts (b) and (c). item Show that for any positive integer k, the sequence defined by p n =1/n k converges linearly to p = 0. 3. Show that the sequence p n = 10 -n k does not converge to 0 quadratically, regardless of the size of the exponent k> 1. 4. Construct a sequence that converges to 0 of order 3. 5. Determine expression for cubic root of a, where a R + , using Newton-Raphson’s Formula. Compute cubic root of 9. Also find percentage relative and percentage approximated errors. 6. Use suitable guesses to find the root of the the following (i) f 1 (x) = sin x + cos(1 + x 2 ) - 1 (ii) f 2 (x)= x 2 - e x (iii) f 3 = tan x - 0.5x Using Newton-Raphson’s method. 7. Repeat above question for f 1 using Secant Method. 8. Repeat above question for f 2 using Method of False Position. 9. Repeat above question for f 1 ,f 3 using Bisection Method with 10 -2 accuracy (take suitable interval). E-mail address: [email protected] (Dr. Yasir Ali), NUST-College of Electrical and Mechanical Engineering. Page 1 of 4

Assignment MS 79 (EE)

Embed Size (px)

DESCRIPTION

NA

Citation preview

Page 1: Assignment MS 79 (EE)

MTH-851 Numerical AnalysisSources of Errors, Root Finding, Interpolation,

Assignment No. 1 & 2

Due Date: 20 April 2015 Before 1400hrs

1 Assignment-1

1. Explain how many significant digits are there in 0.0002025, 0.00202570, 0.2025000.

2. Let f(x) = ex−e−x

x .

(a) Find limx→0 f(x).

(b) Use four-digit rounding arithmetic to evaluate f(0.1).

(c) Replace each trigonometric function with its third Maclaurin polynomial, and repeatpart (b).

(d) The actual value is f(0.1) = 2.003335000. Find the relative error for the values obtainedin parts (b) and (c).

item Show that for any positive integer k, the sequence defined by pn = 1/nk convergeslinearly to p = 0.

3. Show that the sequence pn = 10−nkdoes not converge to 0 quadratically, regardless of the

size of the exponent k > 1.

4. Construct a sequence that converges to 0 of order 3.

5. Determine expression for cubic root of a, where a ∈ R+, using Newton-Raphson’s Formula.Compute cubic root of 9. Also find percentage relative and percentage approximated errors.

6. Use suitable guesses to find the root of the the following

(i) f1(x) = sinx+ cos(1 + x2)− 1

(ii) f2(x) = x2 − ex

(iii) f3 = tanx− 0.5x

Using Newton-Raphson’s method.

7. Repeat above question for f1 using Secant Method.

8. Repeat above question for f2 using Method of False Position.

9. Repeat above question for f1, f3 using Bisection Method with 10−2 accuracy (take suitableinterval).

E-mail address: [email protected] (Dr. Yasir Ali),

NUST-College of Electrical and Mechanical Engineering.

Page 1 of 4

Page 2: Assignment MS 79 (EE)

10. Find root for the function f(x) = x4 − 6x3 + 12x2 − 10x+ 3 with x0 = 0, using:

(a) Newton-Raphson’s Method

(b) Fixed-point Iteration Method.

Find the intersection of

(a) y = x2 and y = sin2x+ 5 in between 0 to π.

(b) y = x3 and y = lnx in suitable region.

11. Use a fixed-point iteration method to find an approximation to 3√

25 that is accurate towithin 10−4. Compare your result and the number of iterations required with the answerobtained in Bisection Method.

2 Assignment-2

1. Consider the following data:

x 0.20 0.25 0.30 0.35 0.40 0.45

f(x) -1.60944 -1.38629 -1.20397 -1.04892 -0.91629 -0.79851

There is a misprint in f(x3) where x3 = 0.35. Determine the correct value of f(x3) if it isknown that the true value of 44f1 = −0.00268. Construct a correct difference table andcalculate an estimate of f(0.27) by Newton’s forward difference interpolation formula withx0 = 0.25.

2. Let f(x) = sin (0.5√

x)(1+x2)

. Take the values of f at the points 2, 2.6, 3, 3.4, 4, 4.5 and 5 to findall the second degree Lagrange polynomials that interpolate f at the point 2.75. Also findf(2.75).

3. For the given functions f(x), let x0 = 1, x1 = 1.25, and x2 = 1.6. Construct Lagrangeinterpolation polynomials of degree at most one and at most two to approximate f(1.4), andfind the absolute error.

(a) sinπx (b) log10(3x− 1) (c) 3√x− 1 (d) e2x − x

4. Construct the clamped cubic spline S(x) for the following data:(1,0), (1.5, 0.4055), (2, 0.6931), (2.5, 0.9163)with the clamped boundary conditions: S′(1) = 1, S′(2.5) = 0.4000.

5. clamped cubic spline S(x) for a function f is defined on [1, 3] by

S(x) =

{S0(x) = 3(x− 1) + 2(x− 1)2 − (x− 1)3, if 1 ≤ x ≤ 2;S1(x) = a+ b(x− 2) + c(x− 2)2 + d(x− 2)3, if 2 ≤ x ≤ 3.

Given f ′(1) = f ′(3), find a, b, c, and d.

Page 2 of 4

Page 3: Assignment MS 79 (EE)

6. The upper portion of this beast is to be approximated using clamped cubic spline interpolates.The curve is drawn on a grid from which the table is constructed. Construct the three clampedcubic splines.

7. Use appropriate Lagrange interpolating polynomials of degrees one, two, and three to ap-proximate each of the following:

(a): f (0.43) if f (0) = 1, f (0.25) = 1.64872, f (0.5) = 2.71828, f (0.75) = 4.48169

(b): f (0) if f (-0.5) = 1.93750, f (-0.25) = 1.33203, f (0.25) = 0.800781, f (0.5) = 0.687500

8. Use the error formula to find a bound for the error in (a), (b), and compare the bound tothe actual error for the cases n = 1 and n = 2.

(a): f(x) = e2x

(b): f(x) = x4 − x3 + x2 − x+ 1

Page 3 of 4

Page 4: Assignment MS 79 (EE)

Instructions

1. Solve each question on the sperate sheet.

2. Write formula used in each question.

3. Draw tables where they are necessary.

4. Submit one soft and one hard copy of the solution.

5. Assignment submitted late by one day and two days will result in reduction of marks by 20%and 40%. After that no rewards will be given.

Page 4 of 4