0% found this document useful (0 votes)
27 views19 pages

Final Solution

The document outlines the final examination for the B.Sc. Engineering program at the Islamic University of Technology, focusing on Numerical Methods. It includes various mathematical problems and solutions related to engineering problem-solving, numerical methods like Newton-Raphson and Secant methods, and the Taylor series. The exam consists of six questions, requiring students to demonstrate their understanding and application of these concepts.

Uploaded by

ekramulalam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views19 pages

Final Solution

The document outlines the final examination for the B.Sc. Engineering program at the Islamic University of Technology, focusing on Numerical Methods. It includes various mathematical problems and solutions related to engineering problem-solving, numerical methods like Newton-Raphson and Secant methods, and the Taylor series. The exam consists of six questions, requiring students to demonstrate their understanding and application of these concepts.

Uploaded by

ekramulalam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

B.Sc. Engg.

SWE 5th Semester 23 December 2023 (Morning)

ISLAMIC UNIVERSITY OF TECHNOLOGY (IUT)


ORGANISATION OF ISLAMIC COOPERATION (OIC)
Department of Computer Science and Engineering (CSE)
SEMESTER FINAL EXAMINATION WINTER SEMESTER, 2022-2023
DURATION: 3 HOURS FULL MARKS: 150

Math 4543: Numerical Methods


Programmable calculators are not allowed. Do not write anything on the question paper.
Answer all 6 (six) questions. Figures in the right margin indicate full marks of questions whereas
corresponding CO and PO are written within parentheses.

1. a) What are the steps of problem-solving in engineering? With a suitable example, briefly ex- 2+1
plain how numerical methods are used to solve an engineering problem. (CO2)
(PO1)
Solution:
The steps of problem-solving in engineering are —

1. Describing or formulating the problem.

2. Using a mathematical model to represent the problem.

3. Solving the mathematical model.

4. Using the solution of the mathematical model to solve the original problem.

e.g. Let’s consider a kinematics problem. Given the initial velocity u and the height h
of a falling body, we can calculate the time t it needs to reach the ground by finding the
1
positive root of the equation ut + gt2 − h = 0 using a root-finding algorithm.
2

Math 4543 Page 1 of 19


b) i. Suppose, R and k are arbitrary numbers such that R > 0 and k ̸= 0. Prove that the 5
Newton-Raphson
√ formula for finding the kth root of R, which is mathematically de- (CO2)
noted as R, is as shown in Equation-1.
k
(PO1)
 
1 R
xi+1 = (k − 1)xi + k−1 (1)
k xi

Solution:
We know, the Newton-Raphson method formula for solving f (x) = 0 is,
f (xi )
xi+1 = xi − ′
f (xi )
Suppose,
√k
x= R
⇒ xk = R
⇒ xk − R = 0
We take f (x) = xk − R and so f ′ (x) = kxk−1 .
Thus,
xk − R
xi+1 = xi − i k−1
kxi
kx − xki + R
k
= i k−1
kxi
(k − 1)xki + R
=
kxk−1
i
1 (k − 1)xki + R
 
=
k xik−1
 
1 R
= (k − 1)xi + k−1 □ Q.E.D.
k xi

Math 4543 Page 2 of 19


ii. Draw a rough sketch of the graph of two functions f1 (x) and f2 (x) given that — 2+2
• For f1 (x), False Position method performs better than the Bisection method. (CO3)
• For f2 (x), Bisection method performs better than the False Position method. (PO2)
Here, “performs better” means that it takes a lesser number of iterations to converge to
the root. You have the liberty to choose the initial guesses ⟨xl , xu ⟩ as well.

Solution:
f1 (x) may look something like,

1.5 y

0.5

xl xroot xu x
3.5 4 4.5 5 5.5 6 6.5

−0.5

Figure 1: Graph of f1 (x).

f2 (x) may look something like,

0.6 y

0.4

0.2
xl xroot xu x
0.2 0.4 0.6 0.8 1 1.2
−0.2

−0.4

Figure 2: Graph of f2 (x).

Math 4543 Page 3 of 19


iii. Derive the formula for the Secant method geometrically. 4
(CO4)
Solution: (PO1)

Figure 3: Geometrical representation of the Secant method.

Here, ABE and DCE are similar triangles.


Hence,
AB DC
=
AE DE
f (xi ) f (xi−1 )
=
xi − xi+1 xi−1 − xi+1
⇒ f (xi )(xi−1 − xi+1 ) = f (xi−1 )(xi − xi+1 )
⇒ f (xi )xi−1 − xi+1 f (xi ) = xi f (xi−1 ) − xi+1 f (xi−1 )
⇒ xi+1 f (xi−1 ) − xi+1 f (xi ) = f (xi−1 )xi − f (xi )xi−1
xi f (xi−1 ) − f (xi )xi−1
⇒ xi+1 = + xi − xi
f (xi−1 ) − f (xi )
xi f (xi−1 ) − f (xi )xi−1 − xi f (xi−1 ) + xi f (xi )
⇒ xi+1 = xi +
f (xi−1 ) − f (xi )
−f (xi )(−xi−1 + xi )
⇒ xi+1 = xi +
f (xi−1 ) − f (xi )
f (xi )(xi − xi−1 )
⇒ xi+1 = xi −
f (xi ) − f (xi−1 )
Hence, we get the formula for the Secant method,
f (xi )(xi − xi−1 )
xi+1 = xi −
f (xi ) − f (xi−1 )

Math 4543 Page 4 of 19


c) The Bronze Ratio, often denoted by the Greek letter β (beta), is the ratio of two quantities
3a + b a
a and b, such that a > b > 0, if it satisfies the equality = . The constant β is equal
a b
to the positive root of a particular function f (x). The numerical value of that root is,

3 + 13
x+
root = β = = 3.302775638 . . .
2
i. From the given scenario, formulate the function f (x). 3
(CO1)
Solution: (PO2)
According to the given condition,
3a + b a
= =β
a b
3a b a 1
⇒ + − =0 ⇒ 3+ −β =0 ⇒ 3β + 1 − β 2 = 0
a a b β
2
⇒ β − 3β − 1 = 0
⇒ x2 − 3x − 1 = 0

So, the function is f (x) = x2 − 3x − 1.

ii. Apply the Secant method to estimate the value of the bronze ratio β. The initial guesses 11
are x−1 = 1.5 and x0 = 2. Demonstrating the step-by-step mathematical procedure, (CO2)
conduct 4 iterations, and find the relative approximate error (|ϵa |%) and the number of (PO1)
significant digits that are at least correct (m) at the end of each iteration. Draw Table 1
on your answer script and fill it out after performing the necessary calculations.

Table 1: The relevant values obtained in the answer of Question 1.c)

Iteration xi−1 xi xi+1 |ϵa |% m f (xi+1 )


1 1.5 2
2
3
4

Solution:
After performing the series of calculations, we end up with the following table.
Iteration xi−1 xi xi+1 |ϵa |% m f (xi+1 )
1 1.5 2 8 75 0 39
2 2 8 2.428 229.41 0 −2.387
3 8 2.428 2.75 11.69 0 −1.687
4 2.428 2.75 3.524 21.98 0 0.849

Math 4543 Page 5 of 19


2. a) “The magnitude of the true error and the magnitude of the approximate error do not neces- 4
sarily reflect how bad the error is.” — Do you agree? Justify your answer. (CO3)
(PO1)
Solution:
Yes, I agree with the given statement.
Let’s consider an arbitrary function f1 (x). Suppose we get a true error value of Et = p,
where p is a small number, while computing the value of f1′ (2) with h = 0.3. Now, if
we try to do the same thing for another function f2 (x), where f2 (x) = 10−6 × f1 (x), we
will get an even more minuscule true error value of Et = p × 10−6 . Even though the
problems are the same in essence, we are getting a smaller true error value in the 2nd
case, which is giving us an improper interpretability or a false impression of the goodness
of the approximation. The same argument holds true for the approximate error as well.

b) The Taylor series for a function f (x) is — 15


h h2 h3 h4 h5 (CO2)
f (x + h) = f (x) + f ′ (x) + f ′′ (x) + f ′′′ (x) + f ′′′′ (x) + f ′′′′′ (x) + . . . (PO1)
1! 2! 3! 4! 5!
Using the Taylor series (with at least the first 5 terms), derive the Maclaurin series of
f (x) = cosec(x)

Solution:
The Maclaurin series of a transcendental function is simply a Taylor series around the
point x = 0.
We know, dx d
(cosec(x)) = − cosec(x) cot(x), and cosec(0) = undefined. So we will get
undefined values for f (0) and f i (0).
1
Instead let’s consider, f (x) = cosec(x) = , and find the Maclaurin series of the
sin(x)
denominator g(x) = sin(x). Let’s calculate its derivatives at the point x = 0.
g(x) = sin(x), g(0) = 0
g ′ (x) = cos(x), g ′ (0) = 1
g ′′ (x) = − sin(x), g ′′ (0) = 0
g ′′′ (x) = − cos(x), g ′′′ (0) = −1
g ′′′′ (x) = sin(x), g ′′′′ (0) = 0

Using the first 5 terms of the Taylor series,


h h2 h3 h4
f (x + h) = f (x) + f ′ (x) + f ′′ (x) + f ′′′ (x) + f ′′′′ (x) + . . .
1! 2! 3! 4!
For x = 0,
h h2 h3 h4
g(0 + h) = g(0) + g ′ (0) + g ′′ (0) + g ′′′ (0) + g ′′′′ (0) + . . .
1! 2! 3! 4!
h h3
⇒ g(h) = 0 + + 0 − + 0 + ...
1! 3!
x x3 x x3 x3
⇒ g(x) = − + · · · ⇒ sin(x) = − + ··· = x − + ...
1! 3! 1! 3! 6
Now, for the original function f (x) = cosec(x),
1
cosec(x) = 3
x − x6 + . . .

Math 4543 Page 6 of 19


Performing algebraic long division, we get,
1
x
+ x6 + . . .
x3
x− 6
+ . . .) 1 + 0
2
1 − x6 + . . .
x2
6
+...
x2
6
+...
0+...
..
.
Hence, we can write,
1 x
⇒ cosec(x) = + + . . . [Quotient of the above algebraic long division.]
x 6
π  π 
c) We know, sin = 1 and cos = 0. Using this information and the Taylor series (with 8
2 2
at least the first 5 terms) approximate the value of sin(2). (CO2)
Note: The unit of angular measure that has been used here is radians (rad). (PO1)

Solution:
π π
Let, x = and x + h = 2. This implies, h = 2 − x = 2 − = 0.4292.
2 2
π
Let’s calculate its derivatives at the point x = .
2π 
f (x) = sin(x), f =1
2
π 
f ′ (x) = cos(x), f ′ =0
2 
π
f ′′ (x) = − sin(x), f ′′ = −1
2
π 
f ′′′ (x) = − cos(x), f ′′′ =0
π 2
f ′′′′ (x) = sin(x), f ′′′′ =1
2
Using the first 5 terms of the Taylor series,
h h2 h3 h4
f (x + h) = f (x) + f ′ (x) + f ′′ (x) + f ′′′ (x) + f ′′′′ (x) + . . .
1! 2! 3! 4!
π
For x = ,
2
π π    2   3   4
′ π
 h
′′ π h ′′′ π h ′′′′ π h

f +h =f +f +f +f +f + ...
2 2 2 1! 2 2! 2 3! 2 4!
π  (0.4292)2 (0.4292)4
⇒f + 0.4292 = 1 + 0 − +0+ + ...
2 2! 4!
= 1 + 0 − 0.092106 + 0 + 0.00141393 + . . .
≈ 0.90931

Math 4543 Page 7 of 19


3. a) Prove that a polynomial of degree n or less that passes through n + 1 data points is unique. 6
(CO4)
Solution: (PO1)

Figure 4: Interpolating polynomials through three points.

Proof: Let us use proof by contradiction. If the polynomial is not unique, then at least
two polynomials of order n or less pass through the n + 1 data points.
Assume two polynomials Pn (x) and Qn (x) go through n + 1 data points (x0 , y0 ), (x1 , y1 ),
. . . , (xn , yn ). Then,
Rn (x) = Pn (x) − Qn (x)
Since Pn (x) and Qn (x) pass through all the n + 1 data points, we can say,
Pn (xi ) = Qn (xi ) ∀i ∈ {0, . . . , n}
Hence
Rn (xi ) = Pn (xi ) − Qn (xi ) ∀i ∈ {0, . . . , n}
⇒Rn (xi ) = 0
The nth order polynomial Rn (x) has n + 1 zeros. A polynomial of order n can have n + 1
zeros only if it is identical to a zero polynomial, that is,
Rn (x) ≡ 0
⇒Pn (x) ≡ Qn (x)
So, Pn (x) and Qn (x) must be the same unique polynomial, which contradicts our initial
assumption. □ Q.E.D.

Math 4543 Page 8 of 19


b) Compare and contrast the following methods of interpolation — Direct method, Newton’s 4
Divided Difference method, and Lagrangian method. (CO3)
(PO1)
Solution:
Any 2 valid comparisons will suffice. Some comparisons can be—
Newton’s Divided
Criteria Direct Lagrangian
Difference
Interpolant fn (x) = fn (x) =
fn (x) = a0 + a1 x +
Polynomial b0 + b1 (x − x0 ) + · · · + bn (x − Q 
a2 x2 + · · · + an xn x−xj
Pn n
Representation x0 )(x − x1 ) . . . (x − xn−1 ) i=0 j=0,j̸=i xi −xj f (xi )
Depends on the
The naïve
algorithm used to solve
Using memoized dynamic implementation is
Computational the equations. It may be
programming, we get a O(n2 ), but it can
Complexity O(n3 ),
complexity of O(n2 ). optimized further
O(n log(∥A∥ + ∥b∥)), or
3
down to O(n log2 (n)).
O((n + 1)!).
The polynomial is a
Each term has a weighted sum of the
coefficient ai and these Each term has a coefficient given functional values
Property of the coefficients are obtained bi and each of these f (xi ), and each term is
terms by solving all the coefficients can be obtained a product of the
equations by solving one equation. Lagrangian weight
simultaneously. function Li (x) and the
functional value f (xi ).
Vulnerable to
the Runge Yes Yes Yes
Phenomenon?

Math 4543 Page 9 of 19


c) A thermistor, also known as thermal resistor, is a semiconductor type of resistor whose resis- 8
tance is strongly dependent on temperature. To measure temperature using a thermistor, the (CO2)
manufacturers provide users with a Temperature (T ) vs. Resistance (R) calibration curve. (PO1)
If we measure the resistance of the thermistor using an Ohmmeter, then we can refer to the
aforementioned curve and determine the corresponding temperature value. Table 2 portrays
multiple recorded observations involving a thermistor.

Table 2: Temperature T of a thermistor as a function of its resistance R for Question-3.c)

Resistance, R Temperature, T
(Ω) (°C)
1101 25.113
911.3 30.131
636 40.12
451.1 50.128

Determine the value of the temperature T when the thermistor resistance is R = 754.8Ω
using the Newton’s Divided Difference method of interpolation and a second order polyno-
mial.

Solution:
The 2nd order NDD interpolant is —
T (R) = b0 + b1 (R − R0 ) + b2 (R − R0 )(R − R1 )
Given, R = 754.8Ω, and the 3 nearest data points that bracket it are, R0 = 911.3, R1 =
636, and R2 = 451.1. The corresponding T values are T (R0 ) = 30.131, T (R1 ) = 40.12,
and T (R2 ) = 50.128 respectively.
Now, let’s calculate the coefficients.
b0 = T (R0 ) = 30.131
T (R1 ) − T (R0 ) 40.12 − 30.131
b1 = = = −0.0362
R1 − R0 636 − 911.3
T (R2 ) − T (R1 ) T (R1 ) − T (R0 ) 50.128 − 40.12 40.12 − 30.131
− −
R2 − R1 R1 − R0
b2 = = 451.1 − 636 636 − 911.3 = 3.877 × 10−5
R2 − R0 451.1 − 911.3
Hence,
T (R) = b0 + b1 (R − R0 ) + b2 (R − R0 )(R − R1 )
= 30.131 − 0.0362(R − 911.3) + 3.877 × 10−5 (R − 911.3)(R − 636); 451.1 ≤ R ≤ 911.3
Now that we have the NDD interpolant, we can obtain the value of T (754.8).
T (754.8) = 30.131 − 0.0362(754.8 − 911.3) + 3.877 × 10−5 (754.8 − 911.3)(754.8 − 636)
≈ 35.075°C

Math 4543 Page 10 of 19


4. a) The general linear regression model for predicting the response for a given set of n data 6+6
points (x1 , y1 ), (x2 , y2 ), . . . , (xn , yn ) is (CO4)
y = a0 + a1 x (PO1)

where a0 and a1 are the two parameters of the regression model.


i. Derive the formulae for finding the optimal values of a0 and a1 .

Solution:
The residual error for each given data point is,
E i = y i − a0 − a1 x i
So the sum of the square of the residual errors is,
Xn Xn
2
Sr = Ei = (yi − a0 − a1 xi )2
i=1 i=1
To find the optimal a0 and a1 , we look for the values of a0 and a1 for which Sr is
the absolute minimum. At first, let’s do the first derivative test. Taking the partial
derivatives of Sr with respect to a0 and a1 and set them to zero.
n
∂Sr X
=2 (yi − a0 − a1 xi )(−1) = 0
∂a0 i=1
n
∂Sr X
=2 (yi − a0 − a1 xi )(−xi ) = 0
∂a1 i=1
Dividing both sides by 2 and expanding the summations in the aforementioned
equations,
n n n P P
i yi xi
X X X X X
− yi + a0 + a1 x i = 0 ⇒ − yi + na0 + a1 x i = 0 ⇒ a0 = − a1 i
i=1 i=1 i=1 i i
n n
For the 2nd equation, we perform substitution
n n n P P X
i yi xi
X X X X X
2
− yi xi + a0 x i + a1 x i = 0 ⇒ xi y i − − a1 i x i − a1 x2i = 0
i=1 i=1 i=1 i
n n i i
X P yi 2
P
X ( x
i i ) X
⇒ xi y i − xi i + a1 − a1 x2i = 0
n n
i !2
i
 i

X X X

 x i  xi yi
 i X  i i
X
⇒ − x2i  = − xi y i

 n i
 n i
 

X X X X
n xi y i − xi yi xi yi − nx̄ȳ
i i i i
⇒ a1 = !2 = X
X X x2i − nx̄2
n x2i − xi i
i i
Plugging in this expression for a1 to the previous equation,
X X X X
x2i yi − xi xi y i
i i i i
a0 = !2
X X
n x2i − xi
i i

Math 4543 Page 11 of 19


ii. Prove that the values of a0 and a1 obtained using the formulae derived in Question-
4.a)(i) correspond to the absolute minimum of the optimization criterion used.

Solution:
Let’s invoke the second derivative for this.
From the 1st-order partial derivatives in the last question, we get,
∂ 2 Sr X
= −2 −1 = 2n > 0; [2nd condition satisfied.]
∂a20 i
∂ 2 Sr X
=2 x2i > 0; [2nd condition satisfied.]
∂a21 i
2
∂ Sr X
=2 xi
∂a0 ∂a1 i
Now, let’s test the 1st condition of the second derivative test.
2 ! !2
∂ 2 Sr ∂ 2 Sr
 2
∂ Sr X
2
X
− = (2n) 2 xi − 2 xi
∂a20 ∂a21 ∂a0 ∂a1 i i
 !2 
X X
= 4 n x2i − xi  > 0; [1st condition satisfied.]
i i

So, the critical point (a0 , a1 ) obtained using the formulae corresponds to the absolute
minimum value of Sr .

b) Suppose you are given a set of n data points (x1 , y1 ), (x2 , y2 ), . . . , (xn , yn ) and you want to 5
regress the data to an mth order Polynomial model, where m < n. How would you choose (CO3)
a suitable value of m? (PO1)

Solution:
In order to choose a suitable value of m, we need to maintain a Bias-Variance tradeoff. If
the value of m is too high, the polynomial model will overfit the given n data points and
result in high variance. On the other hand, if the value of m is too small, the polynomial
model will underfit the given n data points and result in high bias.

c) Sodium borohydride (NaBH4 ) is an inorganic compound that can be used as fuel for fuel 8
cells. The Overpotential (η) vs Current (I) data depicted in Table 3 was obtained during a (CO2)
study conducted to assess its electrochemical kinetics. (PO1)

Table 3: Electrochemical Kinetics data of NaBH4 for Question-4.c)

Overpotential, η Current, I
(V ) (A)
−0.29563 0.00226
−0.24346 0.00212
−0.19012 0.00206
−0.18772 0.00202
−0.13407 0.00199
−0.0861 0.00195

The relationship that exists between the overpotential (η) and current (I) can be represented

Math 4543 Page 12 of 19


using the Logarithmic model (also known as the Tafel equation) —
η = a + b ln I
where a is an electrochemical kinetics parameter of borohydride on the electrode and b is
the experimental Tafel slope parameter. Determine the value of a and b using the data points
provided in Table 3. You are allowed to apply data transformation/linearization.

Solution:
Suppose, x = ln I and y = η. Then we can express the Tafel equation as a straight line
y = a + bx. We can now obtain the value of the parameters a and b using the linear
regression formulae,
X X X
n xi yi − xi yi
i i i
b= !2
X X
n x2i − xi
i i
a = ȳ − bx̄
Using
X the ln I and ηX values in the calculator,
X we find the following
X values,
2
xi = −37.0979, yi = −1.1371, xi = 229.3896, xi yi = 7.0116.
i i i i
Let’s plug these values into the formulae.
6 × 7.0116 − (−37.0979) × (−1.1371)
b= = −1.3601
6 × 229.3896 − (−37.0979)2
−1.1371 −37.0979
a= − (−1.3601) × = −8.5992
6 6
Plugging these values into the given Logarithmic model equation, we get,
η = −8.5992 − 1.3601 × ln I

5. a) i. Using the method of coefficients, derive the formula for the Single-segment Trapezoidal 7+6
rule. (CO3)
(PO1)
Solution:
Let’s consider the integral to be a weighted sum of the functional values at the two
limits a and b.
Z b
f (x)dx ≈ c1 f (a) + c2 f (b)
a
This weighted sum is exactly equal to the integral of the straight line
f1 (x) = a0 + a1 x = 0.
Z b b
x2
 2
b − a2
 
(a0 + a1 x)dx = a0 x + a1 = a0 (b − a) + a1
a 2 a 2
We know that the straight line passes through the points (a, f (a)) and (b, f (b)). So
we can express the functional values as,
f (a) = a0 + a1 a
f (b) = a0 + a1 b
Then we can write the weighted sum as,
c1 (a0 + a1 a) + c2 (a0 + a1 b) =c1 a0 + c1 a1 a + c2 a0 + c2 a1 b
=a0 (c1 + c2 ) + a1 (c1 a + c2 b)

Math 4543 Page 13 of 19


Equating the coefficients, we get,
c1 + c2 = b − a
b 2 − a2
c1 a + c2 b =
2
Solving them, we get,
b−a
c1 = c2 =
2
Therefore,
Z b
f (x)dx ≈ c1 f (a) + c2 f (b)
a
b−a b−a
= f (a) + f (b)
2 2

ii. Applying the formula from Question-5.a)(i), derive the formula for the Multi-segment
Trapezoidal rule.

Solution:
b−a
Taking a step size of h = , we break down the integral I into n integrals in the
n
following manner,
Z b
I= f (x)dx
a
Z a+h Z a+2h Z a+(n−1)h Z a+nh=b
= f (x)dx + f (x)dx + · · · + f (x)dx + f (x)dx
a a+h a+(n−2)h a+(n−1)h
   
f (a) + f (a + h) f (a + (n − 1)h) + f (b)
= [(a + h) − a] + · · · + [b − (a + (n − 1)h)]
2 2
 
f (a) + 2f (a + h) + · · · + 2f (a + (n − 1)h) + f (b)
=h
2
" ( n−1 ) #
h X
= f (a) + 2 f (a + ih) + f (b)
2 i=1
" ( n−1 ) #
b−a X
= f (a) + 2 f (a + ih) + f (b)
2n i=1

Math 4543 Page 14 of 19


b) The velocity v of a body is given by 5+4
(CO2)
(
2t; if 1 ≤ t ≤ 5
v(t) = (PO1)
5t2 + 3; if 5 < t ≤ 14
where the time t is given in seconds (s), and v is given in meters per second (m s−1 ).
i. Using 2-segment Simpson’s 1/3 rule, approximate the distance (S) in meters covered by
the body from t = 2s to t = 9s.

Solution:
The multiple-segment equation for Simpson’s 1/3 rule is
 
Z b n−1 n−2
b−a X X
f (x)dx ≈ f (x0 ) + 4 f (xi ) + 2 f (xi ) + f (xn )

a 3n i=1, i=2,
i=odd i=even
b−a 9−2
We have, a = 2, b = 9, n = 2, h = = = 3.5. We also know that the
n 2
distance function S(t) is the integration of the velocity function v(t). The distance
covered by the body is, therefore,
 
Z 9 2−1 2−2
9−2 X X
S= v(t)dt ≈ v(t ) + 4 v(t ) + 2 v(ti ) + v(tn )

 0 i
2 3 × 2 i=1, i=2,
i=odd i=even
9−2
= × [v(t0 ) + 4v(t1 ) + v(t2 )]
3×2
= 1.1667 × [2 × 2 + 4 × 5 × 5.52 + 3 + 5 × 92 + 3]
= 1.1667 × [4 + 4 × 154.25 + 408]
= 1200.5 m

ii. Analytically determine the exact value of the covered distance (Sexact ) and use it to cal-
culate the true error (Et ) and the absolute relative true error (|ϵt |%).

Solution:
The exact value of the covered distance is,
Z 5 Z 9
Sexact = 2tdt + (5t2 + 3)dt
2 5
 2 5  3 9
2t 5t
= + + 3t
2 2 3 5
= 1039.6667 m
The true error is,
Et = True Value − Approx. Value = 1039.6667 m −1200.5 m = −160.8333 m
The absolute relative true error is,
True Value − Approx. Value
|ϵt | = × 100% = 15.469%
True Value

Math 4543 Page 15 of 19


c) Define Eigenvector and Eigenvalue. 3
(CO3)
Solution: (PO1)
The vectors ⃗v of a vector space that do not get knocked off their own spans upon under-
going linear transformation by a matrix A, but are just stretched or squished by a certain
factor λ, are called the eigenvectors of the linear transformation done by A.
Mathematically,
A⃗v = λ⃗v
Here, the corresponding eigenvalue is the factor by which an eigenvector is stretched or
squished. If the eigenvalue is negative, the eigenvector’s direction is reversed.

6. a) Compare and contrast the following numerical algorithms for solving 1st-order ordinary 4
differential equations — Euler’s method, Runge-Kutta 2nd order method, and Runge-Kutta (CO3)
4th order method. (PO1)

Solution:
Any 2 valid comparisons will suffice. Some comparisons can be—
Criteria Euler Runge-Kutta 2nd Order Runge-Kutta 4th Order
yi+1 = yi +(a1 k1 +a2 k2 )h, k1 =
yi+1 = yi+1 = yi + (a1 k1 +
Formula f (xi , yi ), k2 =
yi + f (xi , yi )h a2 k2 + a3 k3 + a4 k4 )h
f (xi + ph, yi + qk1 h)
Terms of the
First 2 terms. First 3 terms. First 5 terms.
Taylor series
1st order — which
4th order — which is why
Order of the is why it’s also 2nd order — which is why it’s
it’s also called the
Taylor called the called the Runge-Kutta 2nd
Runge-Kutta 4th order
polynomial Runge-Kutta 1st order method.
method.
order method.
Local
Truncation O(h2 ) O(h3 ) O(h5 )
Error
Global
Truncation O(h) O(h2 ) O(h4 )
Error
Has 3 different versions – Has 2 different versions –
Variant
None. Heun’s method, Midpoint Runge’s approach and
Approaches
method, and Ralston’s method Kutta’s approach.

Math 4543 Page 16 of 19


b) Determine the approximate value of 6
8 (CO2)
Z
I= 6x3 dx (PO1)
5
using Euler’s method. Use a step size of h = 1.5.

Solution:
Let’s rewrite the given integral as the solution of an ODE –
dy
= 6x3 ; y(5) = 0
dx
where y(8) gives us the value of the integral.
The Euler’s method formula is,
yi+1 = yi + f (xi , yi )h
In the 1st step, we have x0 = 5, y0 = 0, and given h = 1.5.
x1 = x0 + h = 5 + 1.5 = 6.5
y1 = y0 + f (x0 , y0 )h = 0 + f (5, 0) × 1.5
= 0 + (6 × 53 ) × 1.5 = 1125 ≈ y(6.5)
In the 2nd step, we have x1 = 6.5, y1 = 1125, and as before h = 1.5.
x2 = x1 + h = 6.5 + 1.5 = 8
y2 = y1 + f (x1 , y1 )h = 1125 + f (6.5, 1125) × 1.5
= 1125 + 6 × 6.53 × 1.5 = 3596.625 ≈ y(8)
Hence,
Z 8
6x3 dx = y(8) − y(5) ≈ 3596.625 − 0 = 3596.625
5

c) i. Determine the minimum number of significant digits in each of these numerical values 3+2
(CO4)
(a) 069420 (b) 6.94200 × 105 (c) 0.069420 (PO1)
(d) 69.00420 (e) 69.0 (f) 69420

Solution:
We need to determine the minimum number of significant digits.
(a) 069420 has 4 significant digits, since leading 0’s are not significant and trailing
0’s in an integer may or may not be significant.
(b) 6.94200 × 105 has 6 significant digits, since all digits of the significand/coeffi-
cient of a number’s representation using Scientific Notation are significant.
(c) 0.069420 has 5 significant digits, since leading 0’s are not significant and trail-
ing 0’s in a number with the decimal point are significant.
(d) 69.00420 has 7 significant digits, since 0’s between two significant non-zero
digits are significant and trailing 0’s in a number with the decimal point are
significant.
(e) 69.0 has 3 significant digits, since 0’s to the right of the decimal point are sig-
nificant.
(f) 69420 has 4 significant digits, since trailing 0’s in an integer may or may not
be significant.

Math 4543 Page 17 of 19


ii. Determine the order and degree of each of these higher-order differential equations
3 2
d2 y
 
dy dy
(a) x − +5=0 (b) − 4xy = 3
dx dx2 dx
4 dy
d3 y 2

4d y dy (d) + xy = x2
(c) + x = sin x dx
dx3 dx2 dx

Solution:
The orders and degrees of these higher-order ODEs are,

(a) Order = 2, Degree = 3.

(b) Order = 1, Degree = 2.

(c) Order = 3, Degree = 1.

(d) Order = 1, Degree = 1.

d) i. Determine the LU Decomposition of the 3 × 3 matrix 5+5


(CO2)
 
6 18 3
A = 2 12 1 (PO1)
4 15 3

Solution:
The LU Decomposition can be done as follows,
       
6 18 3 R =− R1 +R 6 18 3 R =− 2R1 +R 6 18 3 R =− R2 +R 6 18 3
2 12 1 −−2−−−− 3 2 3
−−→ 0 6 0 −−−−−− 3 3 3
−−→ 0 6 0 −−−−−− 2 3
−−→ 0 6 0
E21 E31 E32
4 15 3 4 15 3 0 3 1 0 0 1
where,
1 0 0 1 0 0 1 0 0
     

E21 = − 31 1 0 E31 =  0 1 0 E32 = 0 1 0


0 0 1 − 23 0 1 0 − 21 1
So we have,
 
1 0 0 
6 18 3

1
L =  3 1 0 and U = 0 6 0

2 1 0 0 1
3 2
1

Math 4543 Page 18 of 19


ii. Suppose u = u(x, y) is a function of two variables that we only know at discrete grid
points (xi , yj ) given in the matrix
 
5.1 6.5 7.5 8.1 8.4
  5.5 6.8 7.8 8.3 8.9
ui,j = 
5.5 6.9 9.0 8.4 9.1

5.4 9.6 9.1 8.6 9.4


Find the approximate value of the following partial derivatives

(a) ux (x2 , y4 ) (b) uy (x2 , y4 ) (c) uxx (x2 , y4 )


(d) uyy (x2 , y4 ) (e) uxy (x2 , y4 )
using the central difference formula. Consider h = 0.5 and k = 0.2.
Note: Assume 1-based indexing.

Solution:
u3,4 − u1,4 8.4 − 8.1
(a) ux (x2 , y4 ) ≈ = = 0.3.
2h 2 × 0.5
u2,5 − u2,3 8.9 − 7.8
(b) uy (x2 , y4 ) ≈ = = 2.75.
2k 2 × 0.2
u3,4 − 2u2,4 + u1,4 8.4 − 2 × 8.3 + 8.1
(c) uxx (x2 , y4 ) ≈ 2
= = −0.4.
h 0.52
u2,5 − 2u2,4 + u2,3 8.9 − 2 × 8.3 + 7.8
(d) uyy (x2 , y4 ) ≈ 2
= = 2.5.
k 0.22
u3,5 − u3,3 − u1,5 + u1,3 9.1 − 9.0 − 8.4 + 7.5
(e) uxy (x2 , y4 ) ≈ = = −2.
4hk 4 × 0.5 × 0.2

Math 4543 Page 19 of 19

You might also like