SlideShare a Scribd company logo
1 of 34
NUMERICAL METHODS
FDM 2034:
COMPUTATIONAL METHODS
May 2017
1
Introduction to
Numerical Methods
2
What is a Numerical Method (NM)?
 A method of solving complex engineering
problems when analytical methods fail to
provide a solution.
 Opposite of NM is Analytical
Method.
3
Problem:
Solve the equation: x2 - 3x + 2 = 0
Solutions:
a) Analytical Method:
Using the formula
we get
4
a
ac
b
b
x
2
4
2




1
2
2
8
9
3
or
x 



NUMERICAL METHOD
Step 1: Rewrite the equation as x = (x2 + 2)/3
Step 2: Start with some initial solution, say x = 0
Step 3: Using the equation in Step 1, determine x (Here
x = 2/3)
Step 4: Use this value of x to determine the next
approximation.
Step 5: Repeat the process until two successive values
are almost the same.
5
Result:
With the equation x = (x2 + 2)/3 and the initial
value x = 0, the successive solutions computed are
as follows:
0, 0.6667, 0.8148, 0.8880, 0.9295, 0.9547,
0.9705, 0.9806, 0.9872, 0.9915,
0.9944, 0.9963, 0.9975, 0.9983, 0.9989,
0.9993, 0.9995,…..
6
Important issues in NM
7
APPROXIMATION
errors
accuracy
condition
stability
significant
figures
precision
Accuracy vs. Bias
 Accuracy: “…how closely a computed value
agrees with the true value”
 Bias/Inaccuracy : “…a systematic deviation
from the truth”
8
vs.
Accurate Biased/Inaccurate
Precision vs. Uncertainty
 Precision : “…how closely individual computed
values agree with each other”
 Uncertainty/Imprecision : “…magnitude of
scatter”
9
vs
.
Precise Uncertain/Imprecise
Analogy of a target practice
10
accurate & precise
accurate & imprecise
Inaccurate & precise
Increasing accuracy
Increasing
precision
Inaccurate & imprecise
Types of Error
Errors are of two types:
1. Truncation Error
2. Round-off Error
Truncation error is a result of using
approximations to represent exact
mathematical procedures.
Round-off error occurs when only certain
digits and decimal places are used to represent
exact numbers.
11
Example 1:
1. We know that
Suppose we use it to evaluate sin 30°.
x = 30°=/6  0.5236
Our first approximation is
sin 30°  0.5236.
12






!
5
!
3
sin
5
3
x
x
x
x
Second approximation:
sin 30°  0.5236 - 0.52363/6
= 0.499675
Third approximation:
sin 30°  0.499675+0.52365/120
=0.5000029570
The error involved in the approximations here is
truncation error, since terms in the approximating
series are truncated.
13
Example 2:
 Consider the number 3.12746
 If the number is written correct to 3 decimal
places, then it is approximated as 3.127
 If the number is written correct to 4 decimal
places, then it is approximated as 3.1275
 The error involved in this kind of
approximation is called round-off error.
14
Measurement of Errors:
 Precision and accuracy are important criteria
for the assessment of approximate solutions.
 There are formulae to measure these
characteristics.
 When the current solution is compared with
the true solution, the error involved is called
true error.
 When the current solution is compared with
the solution obtained in the previous iteration,
the error involved is called approximate error.
15
1. True Error:
• It is used to measure the lack of
accuracy of an estimate.
• True (absolute) error = Et
= True value – Approximation
• True relative error = Et /True value
16
True percent relative error = t
 Usually this is expressed as an
absolute value (i.e., without any sign)
17
%
100



value
True
ion
approximat
value
True
Approximate Error:
• used to measure the lack of precision of an estimate.
• Approximate (absolute) error
Ea = Current approximation - Previous approximation
• Approximate relative error = Ea/Current app
18
Approximate percent relative error = a
 Usually this is also expressed as an
absolute value (i.e., without any sign)
19
%
100
approx
Current
approx
Previous
approx.
Current



Exercise (HW 1)
The following sequence of estimates was obtained when a
numerical method was applied to solve the equation:
x4 – 5x – 7 = 0.
1.8254 1.9633 2.0121 2.0283 2.0335
2.0351 2.0356 2.0358
Calculate the four errors for these estimates, given that
one of the roots of the equation is 2.0359.
20
Significant Figures
 Usually computation is repeated until the
• approximate percent relative error (|a| ) is
within the pre-specified acceptable level
( denoted by s ) i.e., until |a|< s
• s is usually determined by specifying the
number of significant figures required.
• If the number of significant figures required is at least
n, then s must be
(0.510 2-n)%
21
Example:
 Suppose we wish to get the result of a
computation correct to 3 significant
figures i.e., n = 3
 Here we must fix s as
s = 0.510 2-3 %
= 0.05%
 It means that we must improve our
estimate until |a| becomes less than 0.05
22
 Suppose our first two estimates are
1.23456 and 1.23785.
 Since |a| is more than s , we must
continue the iteration.
23
0.05
0.265783
100
1.23785
1.23456
-
1.23785
|
|




a

Suppose the third estimate is 1.23812.
Error is now estimated as
Now we see that |a| is less than s .
Hence we have got the precision required and we can stop
the iteration.
24
0.05
0.021807
100
1.23812
1.23785
-
1.23812
|
|




a

Problem
The Maclaurin series expansion for sin x is
(i) Starting with the simplest version sin x = x, add terms
one at a time to estimate sin(/4).
(ii) After each term is added, compute the true and
approximate percent relative errors.
(iii) From the calculator, determine the true value. Add
terms until the absolute value of the approximate error
falls below an error conforming to four significant
figures.
25






!
5
!
3
sin
5
3
x
x
x
x
Solution:
/4 = 0.7853
True value of sin (/4) = 0.707107
Estimate a (%) t(%)
0.7853982 - 11.0720735
0.7046527 11.4589099 --------------
0.7071430 ------------- 0.0051286
------------- 0.0051727 0.0000441
0.7071068 0.0000443 0.0000002
26
Problem
The exponential function can be computed using
(i) Starting with the simplest version , add terms one at a
time to estimate
(ii) After each term is added, compute the true and approximate
percent relative errors.
(iii) From the calculator, determine the true value. Add terms
until the absolute value of the approximate error falls below
an error conforming to three significant figures.
27
!
!
3
2
1
3
2
n
x
x
x
x
e
n
x





 
1

x
e
5
.
0
e
Solution:
True value of
28
..
648721
.
1
5
.
0

e
Estimate a (%) t(%)
1 - 39.3
1.5 33.3 9.02
1.625 7.69 1.44
1.645833333 1.27 0.175
1.648437500 0.158 0.0172
1.648697917 0.0158 0.00142
Quick Notes on Taylor Series
 The Taylor expansion about x=a, is given as
 with
 Is called as the remainder or error of the Taylor series
29
If a=0, the Taylor series is
known as Maclaurin series.
30
or
31
Example 3
Solution.
Thus
32
Example 4
 Find the Taylor series of sin(x) about x=0.
 Solution:
33
34
This pattern will repeat. Thus the Taylor series for sin(x)
about x=0 is
Exercise. Find the Taylor series for f(x)=cos(x) about x=0
and x=pi/4.

More Related Content

Similar to Unit One - Solved problems on error analysis .ppt

Section 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docxSection 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docxbagotjesusa
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019Robert Geofroy
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inferenceKemal İnciroğlu
 
Physics 1.2b Errors and Uncertainties
Physics 1.2b Errors and UncertaintiesPhysics 1.2b Errors and Uncertainties
Physics 1.2b Errors and UncertaintiesJohnPaul Kennedy
 
Linear Programming Project
Linear Programming ProjectLinear Programming Project
Linear Programming ProjectChawal Ukesh
 
Error Analysis.pptx
Error Analysis.pptxError Analysis.pptx
Error Analysis.pptxAmitJangra63
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxSALU18
 
lecture01.ppt
lecture01.pptlecture01.ppt
lecture01.pptwafahop
 
Measurements And Calculations
Measurements And  CalculationsMeasurements And  Calculations
Measurements And CalculationsMichael Benton
 
Ch4_Uncertainty Analysis_1(3).pdf
Ch4_Uncertainty Analysis_1(3).pdfCh4_Uncertainty Analysis_1(3).pdf
Ch4_Uncertainty Analysis_1(3).pdfVamshi962726
 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear ProgrammingSukhpalRamanand
 
A few solvers for portfolio selection
A few solvers for portfolio selectionA few solvers for portfolio selection
A few solvers for portfolio selectionBogusz Jelinski
 

Similar to Unit One - Solved problems on error analysis .ppt (20)

Section 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docxSection 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docx
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
Error_Analysis.pdf
Error_Analysis.pdfError_Analysis.pdf
Error_Analysis.pdf
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
 
2 simple regression
2   simple regression2   simple regression
2 simple regression
 
Regression
RegressionRegression
Regression
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inference
 
Physics 1.2b Errors and Uncertainties
Physics 1.2b Errors and UncertaintiesPhysics 1.2b Errors and Uncertainties
Physics 1.2b Errors and Uncertainties
 
Linear Programming Project
Linear Programming ProjectLinear Programming Project
Linear Programming Project
 
Error analysis
Error analysisError analysis
Error analysis
 
5 3 solving trig eqns
5 3 solving trig eqns5 3 solving trig eqns
5 3 solving trig eqns
 
Error Analysis.pptx
Error Analysis.pptxError Analysis.pptx
Error Analysis.pptx
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
 
lecture01.ppt
lecture01.pptlecture01.ppt
lecture01.ppt
 
Measurements And Calculations
Measurements And  CalculationsMeasurements And  Calculations
Measurements And Calculations
 
Ch4_Uncertainty Analysis_1(3).pdf
Ch4_Uncertainty Analysis_1(3).pdfCh4_Uncertainty Analysis_1(3).pdf
Ch4_Uncertainty Analysis_1(3).pdf
 
Regression
Regression  Regression
Regression
 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear Programming
 
A few solvers for portfolio selection
A few solvers for portfolio selectionA few solvers for portfolio selection
A few solvers for portfolio selection
 
Pseudocode By ZAK
Pseudocode By ZAKPseudocode By ZAK
Pseudocode By ZAK
 

Recently uploaded

the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 

Recently uploaded (20)

the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 

Unit One - Solved problems on error analysis .ppt

  • 3. What is a Numerical Method (NM)?  A method of solving complex engineering problems when analytical methods fail to provide a solution.  Opposite of NM is Analytical Method. 3
  • 4. Problem: Solve the equation: x2 - 3x + 2 = 0 Solutions: a) Analytical Method: Using the formula we get 4 a ac b b x 2 4 2     1 2 2 8 9 3 or x    
  • 5. NUMERICAL METHOD Step 1: Rewrite the equation as x = (x2 + 2)/3 Step 2: Start with some initial solution, say x = 0 Step 3: Using the equation in Step 1, determine x (Here x = 2/3) Step 4: Use this value of x to determine the next approximation. Step 5: Repeat the process until two successive values are almost the same. 5
  • 6. Result: With the equation x = (x2 + 2)/3 and the initial value x = 0, the successive solutions computed are as follows: 0, 0.6667, 0.8148, 0.8880, 0.9295, 0.9547, 0.9705, 0.9806, 0.9872, 0.9915, 0.9944, 0.9963, 0.9975, 0.9983, 0.9989, 0.9993, 0.9995,….. 6
  • 7. Important issues in NM 7 APPROXIMATION errors accuracy condition stability significant figures precision
  • 8. Accuracy vs. Bias  Accuracy: “…how closely a computed value agrees with the true value”  Bias/Inaccuracy : “…a systematic deviation from the truth” 8 vs. Accurate Biased/Inaccurate
  • 9. Precision vs. Uncertainty  Precision : “…how closely individual computed values agree with each other”  Uncertainty/Imprecision : “…magnitude of scatter” 9 vs . Precise Uncertain/Imprecise
  • 10. Analogy of a target practice 10 accurate & precise accurate & imprecise Inaccurate & precise Increasing accuracy Increasing precision Inaccurate & imprecise
  • 11. Types of Error Errors are of two types: 1. Truncation Error 2. Round-off Error Truncation error is a result of using approximations to represent exact mathematical procedures. Round-off error occurs when only certain digits and decimal places are used to represent exact numbers. 11
  • 12. Example 1: 1. We know that Suppose we use it to evaluate sin 30°. x = 30°=/6  0.5236 Our first approximation is sin 30°  0.5236. 12       ! 5 ! 3 sin 5 3 x x x x
  • 13. Second approximation: sin 30°  0.5236 - 0.52363/6 = 0.499675 Third approximation: sin 30°  0.499675+0.52365/120 =0.5000029570 The error involved in the approximations here is truncation error, since terms in the approximating series are truncated. 13
  • 14. Example 2:  Consider the number 3.12746  If the number is written correct to 3 decimal places, then it is approximated as 3.127  If the number is written correct to 4 decimal places, then it is approximated as 3.1275  The error involved in this kind of approximation is called round-off error. 14
  • 15. Measurement of Errors:  Precision and accuracy are important criteria for the assessment of approximate solutions.  There are formulae to measure these characteristics.  When the current solution is compared with the true solution, the error involved is called true error.  When the current solution is compared with the solution obtained in the previous iteration, the error involved is called approximate error. 15
  • 16. 1. True Error: • It is used to measure the lack of accuracy of an estimate. • True (absolute) error = Et = True value – Approximation • True relative error = Et /True value 16
  • 17. True percent relative error = t  Usually this is expressed as an absolute value (i.e., without any sign) 17 % 100    value True ion approximat value True
  • 18. Approximate Error: • used to measure the lack of precision of an estimate. • Approximate (absolute) error Ea = Current approximation - Previous approximation • Approximate relative error = Ea/Current app 18
  • 19. Approximate percent relative error = a  Usually this is also expressed as an absolute value (i.e., without any sign) 19 % 100 approx Current approx Previous approx. Current   
  • 20. Exercise (HW 1) The following sequence of estimates was obtained when a numerical method was applied to solve the equation: x4 – 5x – 7 = 0. 1.8254 1.9633 2.0121 2.0283 2.0335 2.0351 2.0356 2.0358 Calculate the four errors for these estimates, given that one of the roots of the equation is 2.0359. 20
  • 21. Significant Figures  Usually computation is repeated until the • approximate percent relative error (|a| ) is within the pre-specified acceptable level ( denoted by s ) i.e., until |a|< s • s is usually determined by specifying the number of significant figures required. • If the number of significant figures required is at least n, then s must be (0.510 2-n)% 21
  • 22. Example:  Suppose we wish to get the result of a computation correct to 3 significant figures i.e., n = 3  Here we must fix s as s = 0.510 2-3 % = 0.05%  It means that we must improve our estimate until |a| becomes less than 0.05 22
  • 23.  Suppose our first two estimates are 1.23456 and 1.23785.  Since |a| is more than s , we must continue the iteration. 23 0.05 0.265783 100 1.23785 1.23456 - 1.23785 | |     a 
  • 24. Suppose the third estimate is 1.23812. Error is now estimated as Now we see that |a| is less than s . Hence we have got the precision required and we can stop the iteration. 24 0.05 0.021807 100 1.23812 1.23785 - 1.23812 | |     a 
  • 25. Problem The Maclaurin series expansion for sin x is (i) Starting with the simplest version sin x = x, add terms one at a time to estimate sin(/4). (ii) After each term is added, compute the true and approximate percent relative errors. (iii) From the calculator, determine the true value. Add terms until the absolute value of the approximate error falls below an error conforming to four significant figures. 25       ! 5 ! 3 sin 5 3 x x x x
  • 26. Solution: /4 = 0.7853 True value of sin (/4) = 0.707107 Estimate a (%) t(%) 0.7853982 - 11.0720735 0.7046527 11.4589099 -------------- 0.7071430 ------------- 0.0051286 ------------- 0.0051727 0.0000441 0.7071068 0.0000443 0.0000002 26
  • 27. Problem The exponential function can be computed using (i) Starting with the simplest version , add terms one at a time to estimate (ii) After each term is added, compute the true and approximate percent relative errors. (iii) From the calculator, determine the true value. Add terms until the absolute value of the approximate error falls below an error conforming to three significant figures. 27 ! ! 3 2 1 3 2 n x x x x e n x        1  x e 5 . 0 e
  • 28. Solution: True value of 28 .. 648721 . 1 5 . 0  e Estimate a (%) t(%) 1 - 39.3 1.5 33.3 9.02 1.625 7.69 1.44 1.645833333 1.27 0.175 1.648437500 0.158 0.0172 1.648697917 0.0158 0.00142
  • 29. Quick Notes on Taylor Series  The Taylor expansion about x=a, is given as  with  Is called as the remainder or error of the Taylor series 29
  • 30. If a=0, the Taylor series is known as Maclaurin series. 30
  • 31. or 31
  • 33. Example 4  Find the Taylor series of sin(x) about x=0.  Solution: 33
  • 34. 34 This pattern will repeat. Thus the Taylor series for sin(x) about x=0 is Exercise. Find the Taylor series for f(x)=cos(x) about x=0 and x=pi/4.