Mid - Sem Soln
Mid - Sem Soln
September 19, 2019 Venue: L17-20 Max marks: 100 Duration: 135 min
NOTE: 1. There are FOUR composite questions, each comprising of 3-4 problems. Marks for each
problem are shown in parenthesis in bold. You need to show how you arrived at a number using the
algorithm. Only showing the final numbers will be interpreted as being copied from a neighbour and
no marks will be awarded.
2. No credit will be given for solving by any other method than asked. If you think a method is not
specified, make necessary assumptions and state them appropriately.
3. Only one scientific calculator is allowed. Programmable calculators are NOT allowed. If a
programmable calculator is found in your possession, you will get F grade in the course and the
matter will be reported to SUGC.
4. Report numbers upto 4 significant digits (significance defined as per floating point representation)
for all results and intermediate steps with rounding. However, actual computations can be performed
using infinite precision.
Q1) (a) In Newton-Raphson Method, determine the condition for the switching of roots in
terms of function 𝑓(𝑥) and its derivative 𝑓′(𝑥) at points 𝑥𝑘 and 𝑥𝑘+1 as shown in the figure
below (4)
Sol:
0.5
0.5
1+1
For
calculations
and final
answer
𝑥 2
(b) Find a root of 𝑓 (𝑥 ) = ( ) − sin(𝑥). For this, first use Bisection method and
2
perform 3 iterations. Next, use Secant method with the latest available estimates of x to
find the root of f(x) to an approximate error of 𝜀𝑎 ≤ 0.01 %. Take starting values 1.5
and 2 for the Bisection method and show all steps including errors. (4+6)
Problem 1b .
True Value 1.93375496
1.934 0.006383 (correct final Ans to four sig digits with error) 2 marks
(c) If α is a root of multiplicity m, derive the following relationship for the Newton-Raphson
method taking 𝑓(𝑥) = (𝑥 − 𝛼)𝑚 𝑔(𝑥); 𝑔(𝛼) ≠ 0 and assuming lim 𝑥𝑛 = 𝛼
𝑛→∝
|𝜀𝑛+1 | 1
lim =1− (6)
𝑛→∞ |𝜀𝑛 | 𝑚
1 for subtracting α on
both sides
0.5
n n
0.5
(d) What is the percentage error if 625.483 is approximated to 3 significant digits? (1)
1 mark if shown the ratio calculation in numbers and arrived at the final answer with 4 sig digits
Q2) (a) Perform LU decomposition of the following matrix by using the CROUT algorithm.
Perform operations by using four significant digits with rounding. (7)
9 3 −2
𝐵=[ 3 6 1 ]
−2 1 9
0.5 marks
= 0.3333
0.5 + 1 + 1
67
marks
222
333
0.5+1+1
marks
3 2
0.25 marks penalty for each number, if only fractions are reported; with a minimum of 0.5 marks
on the total if only one such instance is noted.
(b) Using L and U matrices determined in (a), estimate 𝐵−1 . (10)
1 marks
67
111
1.5 marks
0.04167
1 marks
0.5 marks
0.3333 -0.2222
0.3333
0.04167
-0.04167 1 mark
0.1250
-0.08056
+1
+1
marks
OR by solving by
0.04167 algebraic
-0.08056 manipulation
-0.04167
-0.08056
0.1250
-0.04167
0.04167
Final answers have to be shown to 4 sig digits; Penalty of 2 overall, if someone only
reports in fractions, even if the fractions are correct as it violates instruction and is
unfair to students who did follow the instruction
(c) For an unknown matrix A, Compute x + 𝐴−1 y, without computing A/A-1/A-2/A2 explicitly,
when the LU factorization of 𝐴 (= 𝐿𝑈) and vectors x and y are given as : (7)
1 0 0 1 0 1 1 −1
𝐿 = [1 1 0], 𝑈 = [0 1 1], 𝑥 = [0], 𝑦=[ 1 ]
0 1 1 0 0 1 1 1
(d) Justify or refute the following statement with proper reasoning: LU decomposition is
efficient for Banded and Sparse Matrices. (1)
This statement is false as banded and sparse matrices have significant zero elements which
makes LU decomposition a computationally and memory-intensive exercise. Thomas
algorithm for banded and Iterative methods for sparse matrices are preferred.
(1 mark only if correct justification is provided, NO marks without justification)
Q3) (a) The sufficient condition of convergence for any two-equation system, say
𝑢(𝑥, 𝑦) = 0 and 𝑣(𝑥, 𝑦) = 0
𝜕𝑢 𝜕𝑢 𝜕𝑣 𝜕𝑣
following a fixed-point iteration scheme is | | + | | < 1 and | | + | | < 1.
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦
For the following set of equations, if Jacobi formulation is treated as a fixed-point scheme, show that the sufficient
condition of convergence reduces to the diagonal dominance condition (i.e. |𝑎11 | > |𝑎12 | and |𝑎22 | > |𝑎21 |). (5)
𝑎11 𝑥 + 𝑎12 𝑦 = 𝑏1
𝑎21 𝑥 + 𝑎22 𝑦 = 𝑏2
b) Certain experiment is performed to estimate the force balance at the two junctions of a large
structure due to external loads. The final system of equations is as given below.
−3 6 𝑥1 35
[ ] [𝑥 ] = [ ]
2 5 2 49
Solve this equation using Gauss Elimination. Determine the maximum value of norm of error
in the solution vector 𝑥 if the errors in measurement of the external loads are, 𝛿𝑏 = [0.1 0.1]𝑇
0.04 0
and the error in the coefficient matrix is 𝛿𝐴 = [ ]. Use 𝐿1 matrix and vector norms
0 0.07
for this problem and Gauss Jordan method for calculating A-1.Report all the steps. (7)
72.33
72.33
8.037
4.407
4.407
8.037
0.07407
0.07407
Using L1 norm which is: (i) column-sum norm for a matrix ; (ii) sum of absolute values for a
vector (need to take the same norm for matrix and vector to be consistent for C(A)
calculation)
12.44
2 marks
0.5 marks each for A and A-1 norms
Rest 0.25 marks each
c) Solve the following system of equations using Gauss-Seidel iterative scheme. Perform
maximum 4 iterations or until the maximum error is < 0.1% (using max norm of the error vector).
Report errors at each iteration. Perform calculations with infinite precision at every step and report your
results with four significant digit accuracy. Start with an initial guess 𝑥0 = 𝑦0 = 2 and 𝑧0 = 3. (12)
−3𝑥 + 𝑦 + 12𝑧 = 50
6𝑥 − 𝑦 − 𝑧 = 3
6𝑥 + 9𝑦 + 𝑧 = 40
The student has to realize that
the original matrix is NOT
diagonally dominant. Pivoting is
REQUIRED. Solution will not
converge unless pivoting is done
‖𝑒𝑟𝑟𝑜𝑟%‖∞ = 50 29.10
2.813
1.697
‖𝑒𝑟𝑟𝑜𝑟%‖∞ = 2.68
Accept variation in answer in
the last decimal place
S ( L D) 1U c ( L D) 1 b
Q4) (a)(i) Formulate the characteristic polynomial of the following matrix A using Faddeev-
Leverrier method. (7)
2 1 1
A 1 5 1
1 1 5
0.5 marks
0.5+0.5
0.5
0.5
0.5
(ii) Using the characteristic equation, solve for any one of the eigenvalues using
Muller’s method. Choose 0, 1.24 and 3.25 as the initial guesses and show your
calculations until error is < 5%. (6)
(b) A function of the form y = a + b x + c logx has to be fitted to the following data.
x 1 2 3 4
y 1.000 10.00 20.00 37.00
(i) Starting with the generalized form of function approximation in terms of the basis
functions for discrete data, derive a set of normal equations in terms of data pairs
using least squares approximation. (5)
OR, the proof discussed in class for continuous case modified to
discrete data
1
1
1
(ii) Specify whether the system – is over-determined, has a unique solution or is under-
determined and why? (1)
(iii) Determine all the coefficients of the design matrix for this system but DO NOT
SOLVE for the coefficients. (6)
Perform calculations using infinite precision but report your intermediate and final calculations
upto 4 significant digits with rounding.
Identify basis
functions here: 1
Reproducing eqs
from part A; no
additional mark
0.5
0.5
0.5
0.5
4.442
0.5
0.5
0.5
0.5
1 mark for
determining rest of
the coefficients due
4.442 to symmetry of
34.83
inner product
4.442
Following algorithms are given which may/ may not be useful:
2𝑐
Algorithm 1 p(x) = a(x - xk)2 + b(x - xk) + c; 𝑥𝑘+1 = 𝑥𝑘 −
𝑏±√𝑏2 −4𝑎𝑐
where, c = f(xk); b = f[xk, xk-1] + (xk - xk-1)f[xk, xk-1, xk-2]; a = f[xk, xk-1, xk-2]
Algorithm 3
i 1 n
bi aij x (jk 1) aij x (jk )
j 1 j i 1
xi( k 1) , i 1, 2, n
aii
𝑗−1
𝑎𝑖𝑗 −∑𝑘=1 𝑙𝑖𝑘 𝑢𝑘𝑗
Algorithm 4: 𝑢𝑖𝑗 = 𝑎𝑖𝑗 − ∑𝑖−1
𝑘=1 𝑙𝑖𝑘 𝑢𝑘𝑗 ; 𝑙𝑖𝑗 =
𝑢𝑗𝑗
𝑖−1
𝑗−1 𝑎𝑖𝑗 −∑𝑘=1 𝑙𝑖𝑘 𝑢𝑘𝑗
Algorithm 5: 𝑙𝑖𝑗 = 𝑎𝑖𝑗 − ∑𝑘=1 𝑙𝑖𝑘 𝑢𝑘𝑗 ; 𝑢𝑖𝑗 =
𝑙𝑖𝑖
trace(𝑨𝑖 )
Algorithm 6 𝑨𝑛−1 = 𝑨; 𝑎𝑛−1 = trace(𝑨𝑛−1 ); 𝑨𝑖 = 𝑨(𝑨𝑖+1 − 𝑎𝑖+1 𝑰); 𝑎𝑖 =
𝑛−𝑖