Uploaded by cfk27909

COS2633 Oct-Nov2020 Exam EQP.cleaned

advertisement
UNIVERSITY EXAMINATIONS
UNIVERSITEITSEKSAMENS
October/November 2020
NUMERICAL METHODS I
COS2633
Duration: 2 hours
Examiners:
First:
DR L MASINGA
Second:
DR Z ALI
100 Marks
PROF H JAFARI
This is a closed book examination.
This examination paper remains the property of the University of South Africa, and may not be shared or
distributed in any format.
This is an online examination, which you have to write within 2 hours and submit online using the
eAssessment Tool through the link: https://myexams.unisa.ac.za/portal
Late submissions beyond the allocated time will not be accepted.
SPECIFIC INSTRUCTIONS:
1. ANSWER ALL FOUR QUESTIONS.
2. A non-programmable calculator can be used for computations.
3. Start each question on a new page. Keep parts of a question together.
4. Show all essential work and formulas used in the computations.
5. Useful formulae are given on the last page
[TURN OVER]
Open Rubric
2
COS2633
October/November 2020
QUESTION 1
The solution of the nonlinear equation e−x = x in [0, 1] is to be approximated numerically
(a) Perform three iterations of the method of false position (Regula falsi) to approximate the solution, using (10)
x0 = 0, x1 = 1 and five decimal digit arithmetic with rounding.
(b) Use Newton’s method with x0 = 0.5 to compute an approximate solution that is correct to 10−4 .
(10)
(c) How many iterations of the Bisection method will yield a solution of the same accuracy as the Newton’s (5)
approximation in (b) above; i.e. correct to 10−4 ?
[25]
QUESTION 2
In the data below, y is the speed (in m/sec) at which an object slides through a device x seconds after it is released.
x(secs)
y(m)
4.5
2.1
5.5
1.7
6.5
1.2
7.5
0.9
(a) What is the least degree interpolating polynomial that interpolates all the data points? Explain your (3)
answer.
(b) Use the Lagrange form of the interpolating polynomial that interpolates all the points, to approximate (12)
the speed at which the object slides 6 seconds after it is released.
(c) Use the composite Trapezoidal rule to approximate the total distance travelled by the object during the (5)
slide in the given interval of measurement.
(d) Approximate the total distance travelled by the object using Simpson’s
3
8
(5)
[25]
rule.
QUESTION 3
Consider the experimental data below for a certain function, f (x):
xi
f (xi )
0
1.0
0.15
1.004
0.31
1.031
0.5
1.117
0.6
1.223
0.75
1.422
(a) Write down explicitly the system of normal equations to be solved when using the least-squares polynomial (13)
of the form P (x) = a0 + a1 x + a2 x2 to approximate f (x) from the given data.
(b) Write the system in (a) above in matrix form.
(2)
(c) Use LU -factorisation (decomposition) to solve the system in (b) above, given that the lower triangular (10)
matrix L is given by


2.4495
0
0
0 
L =  0.9431 0.6338
0.5271 0.4716 0.1340
and the upper triangular matrix U = LT . Hence deduce the second degree least-squares polynomial for
the given data.Use 4 decimal place precision in your computations.
[25]
[TURN OVER]
3
COS2633
October/November 2020
QUESTION 4
(a)
(i) Use Gaussian elimination to find the exact inverse of the matrix

6
A= 2
1
1
4
2
(12)

1
0 .
6
(ii) Use the inverse obtained in (i) above to compute the solution of

6
 2
1
1
4
2
(3)

 

1
x
5
0   y  =  −6 
6
z
3
(b) Consider the data
(10)
f (0.1)
=
−0.6205,
f (0.4)
=
0.2484
f (0.2) = −0.2839,
f (0.3) = 0.0066
Construct the divided difference table for the data and find an approximation of f (0.35) using Newton’s
backward-difference polynomial that interpolates all the points.
[25]
[TURN OVER]
4
COS2633
October/November 2020
Useful Formulas
• Nonlinear equations
xk+1 = xk −
f (xk )
f 0 (xk )
xk+1 = xk −
f (xk )(xk − xk−1 )
f (xk ) − f (xk−1 )
x(k+1) = x(k) − J −1 (x(k) )F(x(k) )
• Interpolation and Curve fitting
Li (x) =
(x − x0 )(x − x2 ) . . . (x − xi−1 )(x − xi+1 . . . (x − xn ))
(xi − x0 )(xi − x2 ) . . . (xi − xi−1 )(xi − xi+1 . . . (xi − xn ))
f [xi , xi+1 , . . . , xi+k−1 , xi+k ] =
f [x0 , x1 , . . . , xk ] =
f [xi+1 , xi+2 . . . xi+k ] − f [xi , xi+1 . . . xi+k−1 ]
xi+k − xi
1
∆k f (x0 )
k!hk
f [xn , xn−1 , . . . , xn−k ] =
1
∇k f (x0 )
k!hk
Sj (xj ) = aj + bj (x − xj ) + cj (x − xj )2 + dj (x − xj )3 , j = 0, 1, 2, . . . , n − 1]
Pn
Pn
Pn n
Pn

aP
= P 1 yi
0

1 1 + a1P 1 xi + · · · + anP 1 xi

n

 a0 n1 xi + a1 n1 x2i + · · · + an n1 xn+1
=
i
1 xi yi
..
..

.
=
.


P
P
P
P

n
n+1
n
n n
a0 1 xni + a1 1 x2i + · · · + an 1 x2n
=
i
1 xi yi
• Numerical integration
R xi+1
xi
R xi+2
xi
R xi+3
xi
Rb
a
f (x) dx ≈
h3
h
[f (xi ) + f (xi+1 )] − f 00 (ξ),
2
12
f (x) dx ≈
h
h5
[f (xi ) + 4f (xi+1 ) + f (xi+2 )] − f 00 (ξ),
3
90
f (x) dx ≈
3h5 00
3h
[f (xi ) + 3f (xi+1 ) + 3f (xi+2 ) + f (xi+3 )] −
f (ξ),
8
80
f (x) dx ≈
Pn
i=1 ci f (xi )
=
R1
−1
g(t) dt,
x=
xi < ξ < xi+1
xi < ξ < xi+2
xi < ξ < xi+3
1
[(b − a)t + a + b]
2
TOTAL MARKS: [100]
c
UNISA 2020
Download