Me Module 7
Me Module 7
4232 4232
ME / CE : Engineering Mathematics
Numerical Methods
MODULE 3
INDEX
Page
Contents Topics
No.
Numerical Solutions of Linear Algebraic Equations
1.1 Gauss Elimination Method 1
1.2 Gauss Siedel Method 2
1.3 Triangularization Method 3
Numerical Solutions of Non-linear Algebraic Equations
1.4 Bisection Method 6
1.5 Method of False Position (Regula Falsi Method) 7
1.6 Secant Method 7
1.7 Newton Raphson Method 8
Numerical Integration
Notes 1.8 Trapezoidal Rule 11
1.9 Simpson's Rule 11
Numerical Solutions of Differential Equations
1.10 Euler's Method 14
1.11 Runge Kutta Method 15
1.12 Taylor's Series Method 16
1.13 Picard’s Method 16
Interpolation Polynomials and Numerical Differentiation
1.14 Lagrange's Interpolation Polynomial 23
1.15 Newton's Interpolation Polynomial 23
List of Formulae 29
Assignment 1 32
Assignments Assignment 2 35
Assignment 3 38
Test Paper Test Paper 1 41
Answer Key 44
Assignments
Model Solutions 45
Answer Key 60
Test Paper
Model Solutions 61
Numerical Methods
In scientific and engineering work, a frequently occurring problem is to find the roots of
equation of the form f(x) = 0. If f(x) is a quadratic, cubic or a biquadratic expression, then
algebraic formulae are available for expressing the roots in terms of the coefficients. On
the other hand when f(x) is a polynomial of higher degree on an expression involving
transcendental functions.
i.e. 1 + cos x 5x,
x tan x = cos hx,
ex sin x etc.
Algebraic roots are not available and recourse must be taken to find the root by
approximate methods.
1
Vidyalankar : GATE – Engineering Mathematics
This method is also called forward elimination method. Solution of the equation is
obtained from the transformed matrix.
2
Notes on Numerical Methods
= L (B UX )
(k + 1) 1 (k)
X
The iterations are performed till the solution is obtained with desired accuracy.
3
Vidyalankar : GATE – Engineering Mathematics
The matrix multiplication is performed and by comparing the elements of the resulting
matrix with the corresponding elements in A, a system of equations in unknowns ij uij is
obtained. To get a unique solution, it is convenient to choose all the diagonal elements of
either L or u as 1.
x If the diagonal elements of L are chosen as 1, it is called the Doolittle's Method.
x If the diagonal elements of u are chosen as 1, it is called the Crout's Method.
Once the matrices L and U are obtained, the matrix equation AX = B is written as
LUX = B which is solved as UX = Z and LZ = B
First Z can be determined by forward substitution and then X by backward substitution.
Solved Example 1 : ª 1 0 0º ª0 2 3 º
Gauss-Seidel method is used to solve the L = ««2 3 0 »» U = ««0 0 1»»
following equations (as per the given ¬«3 2 1»¼ ¬«0 0 0 »¼
order): [ME 2016] ª 3 0 0º
1«
x1 + 2x2 + 3x3 = 5 L = « 2 1 0 »»
1
3
2x1 + 3x2 + x3 = 1 «¬ 5 2 3 »¼
ª 1 2 3 º ª x1 º ª5 º ª0 º
«2 3 1»« x » = « 1»
= ««0 »»
(1)
« » « 2» « » Here X
«¬3 2 1»¼ «¬ x 3 »¼ «¬3 »¼ «¬0 »¼
AX = B ? X
(2+)
= L1B L1 UX
(1)
Gauss-Siedel method,
ª5º
A=L+U = «« 3 »»
(2)
gives X
where «¬ 6 »¼
4
Notes on Numerical Methods
3a + 5b + 3c = 4 Crout's Method.
Solution : x 1 + x2 + x 3 = 1
ª 1 1 1 º ªa º ª 1º Solution :
«4 3 1»«b » ««6 »» The equations can be written in matrix
« »« »
«¬3 5 3 »¼ «¬ c »¼ «¬4 »¼ form as
which is of the form AX = B ª 1 1 1 º ª x1 º ª 1º
«4 3 1»« x » ««6 »»
Augmented matrix : « » « 2»
«¬3 5 3 »¼ «¬ x 3 »¼ «¬4 »¼
ª 1 1 1 1º
[A : B] = ««4 3 1 6 »» which is of the form AX = B
«¬3 5 3 4 »¼ ª1 1 1 º
The co-efficient matrix A = ««4 3 1»»
R2 moR2 4R1 , R3 moR3 3R1
¬«3 5 3 »¼
ª 1 1 1 1º
«0 1 5 2 » Factorizing A as product of L and U and
« »
«¬0 2 0 1»¼ taking diagonal elements of U as 1.
(Crout's Method)
R3 moR3 2R2
ª 11 0 0 º ª 1 u12 u13 º ª 1 1 1 º
ª1 1 1 1º ?«« 21 22 0 »»««0 1 u23 »» ««4 3 1»»
«0 1 5 2 »
« » «¬ 31 32
»«
33 ¼ ¬ 0 0 1 »¼ «¬3 5 3 »¼
«¬0 0 10 5 »¼
ª 11 u
11 12 u
11 13 º
So we have a+b+c=1 ? « u »
« 21 21 12 22 21u13 22 u23 »
b 5c = 2 «¬ 31 31u12 32
»
31u13 32 u23 33 ¼
10c = 5
ª1 1 1 º
The third equation gives c = 1/2 ««4 3 1»»
Substituting c = 1/2 in second equation «¬3 5 3 »¼
gives b = 1/2
Finally, from the first equation, we get a = 1
5
Vidyalankar : GATE – Engineering Mathematics
(forward substitution)
u 1
11 13 ? u13 = 1
Further, UX = Z gives
u
21 12 22 3 ? 22 1
ª 1 1 1º ª x1 º ª 1 º
u
31 12 32 5 ? 22 2 «0 1 5 »« x » «« 2 »»
« » « 2»
u u 1 ? u23 = 5 «¬0 0 1»¼ «¬ x 3 »¼ «¬ 1 2 »¼
21 13 22 23
(backward substitution)
ª1 0 0 º
? L = ««4 1 0 »» ? The solution is
«¬3 2 10 »¼ >x1 x2 x3 @ >1 1 2 1 2@
ª 1 1 1º
and U = ««0 1 5 »»
«¬0 0 1»¼
Consider LZ = B
If f(x0) = 0, then x0 is the root. Otherwise depending on the sign of f(a) f(x 0), the interval
[a, b] is replaced by [a, x0] or [x0, b].
The new interval is again bisected to obtain x 1. Again if f(x1) = 0, then x1 is the root,
otherwise the interval will be further replaced by a new interval.
This is repeated till the root is obtained.
6
Notes on Numerical Methods
a x1 x2
o D b x
A [a, f(a)]
In this method, the curve AB is replaced by chord AB and the intersection of chord AB
with X axis gives the approximate root.
(b a)f(a) af(b)bf(a)
x1 a
f(b) f(a) f(b)f(a)
If f(b) and f(x1) are of opposite signs, then the root lies between x 1 and b and so a is
replaced by x1.
The process is repeated till the root is obtained with the desired accuracy.
7
Vidyalankar : GATE – Engineering Mathematics
In general,
In this method, when going for the next iteration, xn1 is replaced by xn and xn is replaced
by xn+1.
If x1 meets the desired accuracy, then x 1 is the root, otherwise the next approximation of
the root is obtained as
f(x1)
x2 = x1
f c(x1)
In general,
f(xn )
xn 1 xn
f c(xn )
This is repeated till the root is obtained with the desired accuracy.
8
Notes on Numerical Methods
? a = 0.64, b = 1
9
Vidyalankar : GATE – Engineering Mathematics
' f(1.048) and f (11) have opposite sign, f(x1) x1 log10 x1 1.2
x2 = x1 x1
the root lies between 1.048 and 11 f c(x1) log10 x1 0.4343
1.1726 1.2
Solved Example 6 : = = 2.74
0.4314 0.4343
Find the real root of x log10 x 1.2 = 0, The fourth approximation is
correct to three decimal places.
f(x 3 ) 0.4343x 3 1.2
x4 = x3 =
Solution : f c(x 3 ) log10 x 3 0.4343
f(x) = x log 10 x 1.2
= 0.4343 u 2.74 1.2
f(1) = log101 1.2 = 0 1.2 = 1.2 log10 2.74 0.4343
real root of f(x) = 0 lies between 2 and 3. [0, 1] using Bisection Method.
Also f(3)< f(2) numerically, we take the first Solution :
3
approximation x1 = 3 f(x) = x + x 1
f(x) = x log10 x 1.2 f(0) = 1 < 0 f(1) = 1 > 0
10
Notes on Numerical Methods
11
Vidyalankar : GATE – Engineering Mathematics
Assignment 1
Duration : 45 Min. Max. Marks : 30
32
Assignment on Numerical Methods
3
7. Solve the equation x = 10 cos(x) using 9. The root of the function f(x) = x + x - 1
the Newton-Raphson method. The obtained after first iteration on
initial guess is x = S/4. The value of the application of Newton-Raphson
predicted root after the first iteration, scheme using an initial guess of x0 =1
up to second decimal, is ________. is [ME 2016]
[ME 2016] (A) 0.682 (B) 0.686
8. Numerical integration using trapezoidal (C) 0.750 (D) 1.000
rule gives the best result for a single
variable function, which is [ME 2016]
(A) linear (B) parabolic
(C) logarithmic (D) hyperbolic
x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0
f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00
3
The value of ³0 f(x)dx computed using the trapezoidal rule is [CS 2013]
³0 e
x
13. The value of dx using the
11. Using the trapezoidal rule, and dividing
the interval of integration into three trapezoidal rule with four equal
equal subintervals, the definite integral subintervals is [CE 2021]
(A) 1.718 (B) 1.727
1
³ | x | dx is _______.
1
[ME 2014] (C) 2.192 (D) 2.718
33
Vidyalankar : GATE – Engineering Mathematics
34
Test Paper on Numerical Methods
Test Paper 1
Duration : 30 Min. Max. Marks : 25
41
Vidyalankar : GATE – Engineering Mathematics
42
Test Paper on Numerical Methods
Using Trapezoidal rule, the area of the 11. The truncation error in the Simpson’s
rd
crosssection of the river is 1/3 rule is
approximately (b a)h4 iv (b a)h4 iv
(A) | fav | (B) fav
(A) 666 (B) 667 90 180
(C) 662 (D) 664 (b a)3 h3 iv
(C) fav (D) None of these
180
iv
where fav is the average value of the
th
4 derivative of f on [a, b].
will be approximately
(A) 10.48092 (B) 9.48092 (C) 11.88092 (D) 11.48092
S/ 2
13. Let I = ³0 sinx dx . Using Simpson’s 15. Consider the differential equation
dy
th 2t y, with y(0) = 3. Take the
3/8 rule and h = S/6, the approximate dt
value of I is equal to step size h = 0.1. Using Euler's method
(A) 1.86104 (B) 1.76104 y(0.2) will be approximately equal to
(C) 1.66104 (D) None of these (A) 3.100 (B) 3.610
14. Consider the initial value problem: (C) 2.999 (D) None of these
dy
1 xy; y(0) 1. Take h = 0.2.
dx
Using RungeKutta fourth order method,
y(0.2) will be approximately equal to
(A) 1.17755 (B) 0.82245
(C) 1.10755 (D) None of these
43