NM Unit 1
NM Unit 1
Methods
Chapter 1
1.6 Comparison of the methods (Bracketing vs open- 2.1.4 Factorization methods (Do-Little’s method and Crout’s
ended methods and rates of convergence) method)
2.2 Iterative methods
1.7 Solution of system of non-linear equations
2.2.1 Jacobi’s method
1.7.1 Direct approach
2.2.2 Gauss-Seidal method
1.7.2 Newton Raphson method
2.3 Determination of largest and smallest Eigen values
and corresponding vectors using the power method
6
Er. Ganesh Ram Dhonju
11/22/202
Characteristics of Numerical Methods
1. The solution procedure is iterative, with the accuracy of the solution
improving with each iteration.
2. The solution procedure provides only an approximation to the true,
but unknown, solution.
3. An initial estimate of the solution may be required.
4. The algorithm is simple and can be easily programmed.
5. The solution procedure may occasionally diverge from rather than
converge to the true solution.
– In a number with a decimal point, trailing zeros are significant. For this reason,
it is important to give consideration to when a decimal point is used and to keep
the trailing zeros to indicate the actual number of significant figures
– 400. has three significant figures
– 5.00 has three significant figures
– 0.050 has two significant figures
Approximate error
a = 100%
Approximation
If f ( x ) = 7e 0.5 x
and h = 0.3
a) Find the approximate value of f ' (2)
b) True value of f ' (2)
c) True error for part (a)
0.3
= 9.5140
22.107 − 19.028
= True error is calculated as
0.3
Et = True Value – Approximate Value
= 10.263 = 9.5140 −10.263 = −0.722
0.0006
er = = 0.4 10−4
15.9994
• Why?
2
−𝑏 ∓ 𝑏2 − 4𝑎𝑐
𝑎𝑥 + 𝑏𝑥 + 𝑐 = 0 ⇒ 𝑥=
2𝑎
• But
𝑎𝑥 5 + 𝑏𝑥 4 + 𝑐𝑥 3 + 𝑑𝑥 2 + 𝑒𝑥 + 𝑓 = 0 ⇒ 𝑥 =?
sin 𝑥 + 𝑥 = 0 ⇒ 𝑥 =?
All Iterative
a) If f(xl)f(xm) < 0, then the root lies between xl and xm; then xl = xl ; xu = xm.
b) If f(xl)f(xm) > 0, then the root lies between xm and xu; then xl = xm; xu = xu.
c) If f(xl)f(xm) = 0; then the root is x m. Stop the algorithm if this is true.
4. Find the new estimate of the root 𝑥𝑚 = (𝑥𝑙 + 𝑥𝑢 )/2
x xm
x
where
xu 𝑛𝑒𝑤 − 𝑥 𝑜𝑙𝑑
𝑥𝑚 𝑚 𝑜𝑙𝑑 = previous estimate of root
5. Compare s with a ∈𝑎 = × 100 𝑥𝑚
𝑛𝑒𝑤
𝑥𝑚
𝑛𝑒𝑤 = current estimate of root
𝑥𝑚
Pros Cons x
If f(xr)=0 then you have found the root and need go no further!
4. See if the new xl and xu are close enough for convergence to be declared. If they are
not go back to step 2.
Rearranging,
Solve for
0 = f(xi ) + f (xi )( xi +1 − xi )
f(xi-1)
f ( xi )
xi +1 = xi − Newton-Raphson formula
f ( xi ) xi+2 xi+1 xi X
f(x)
𝐴𝐵
f(xi) B tan( 𝛼) =
𝐴𝐶
𝑓(𝑥𝑖 )
𝑓′(𝑥𝑖) =
𝑥𝑖 − 𝑥𝑖+1
C A X 𝑓(𝑥𝑖 )
𝑥𝑖+1 = 𝑥𝑖 −
xi+1 xi 𝑓 ′ (𝑥𝑖 )
Iteration ∈𝑎 %
𝑥𝑖 𝑓 𝑥𝑖 4
Number
–1.0000
3
0 3.00 3
4. Root Jumping
In some cases where the function 𝑓 𝑥 is oscillating and has a number
of roots, one may choose an initial guess close to a root. However, the
guesses may jump and converge to some other root.
1.5
f(x)
For example 1
𝑓 𝑥 = sin 𝑥 = 0 0.5
x
Choose -2
0
0 2 4 6 8 10
-1.5
f ( xi )( xi − xi −1 )
xi +1 = xi −
f(xi-1) C f ( xi ) − f ( xi −1 )
E D A X
xi+1 xi-1 xi