CHE 358 Numerical Methods For Engineers: Dr. Martinson Addo Nartey
CHE 358 Numerical Methods For Engineers: Dr. Martinson Addo Nartey
CHE 358 Numerical Methods For Engineers: Dr. Martinson Addo Nartey
Numerical Methods
for Engineers
Lesson-01
Mathematical Model & Error Estimation
Learning objectives
❖To introduce students to the concepts of numerical methods
and their applications in solving equations.
2
Recommended Textbook
• Chapra S. C. and Canale R. P. (2010), Numerical Methods
for Engineers, 6th Edition, McGraw-Hall.
Attendance 10
Quiz 5
Mid-Sem Exam 15
End of Sem Exam 70
Total 100
Grading system
70-100 A;
60-69 B;
50-59 C;
40-49 D;
5
0-39 F
What and why numerical methods?
Numerical methods: techniques by which mathematical problems are
formulated so that they can be solved with arithmetic or logical operation
WHY
• Expands the types of problems that can solved
• Capable of handling large systems of equation, nonlinearities and
complicated geometries.
• Newton’s second law of motion. Eg. Fall of a coin from high rise building
• Models to predict underground roof collapse at mine site
• Models for the effective separation of molasses from sugar crystals to
speed up production time
gcd
v(t ) =
gm
tanh t
cd m
dv cd 2
= g− v
dt m
13
Numerical Methods
• To solve the problem using a numerical method, note that the time
rate of change of velocity can be approximated as:
dv cd 2
= g− v
dt m
dv v v(ti+1) − v(ti )
=
dt t ti+1 − ti
14
Numerical Results
• Applying Euler's method in 2 s intervals yields:
16
Bases for Numerical Models
17
Bases for Numerical Models
18
Significant figures
• Significant figures are counted from the first non-zero numeral,
starting from left of the number.
• Once the required number of significant figures are counted,
the remaining numerals are deleted based on the following:
• If the first of a group of numbers to be deleted is a 5 or more, the last
significant figure is increased by 1.
• e.g. 9.4534 to two significant figures is 9.5 and 9.45 for three significant
figures.
• If the only number to be dropped is a 5, then the last numeral is rounded to the
next even number
• e.g. 12.235 to four significant figures is 12.24. For 3.465, three significant
figures becomes 3.46
▪ TRY: 0.001354 to two significant figures and 8.1265 to four significant figures.
19
Error Estimation
Objective
• Understanding the distinction between accuracy and precision.
• True fractional relative error: the true error divided by the true
value.
𝜀𝑡 = 𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒−𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
×100%
Error Definitions
• The previous definitions of error relied on knowing a true value.
If that is not the case, approximations can be made to the error.
𝜀𝑎 = 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑒𝑟𝑟𝑜𝑟
𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 ×100%
s = ( 0.5 10 2− n
)%
Roundoff Errors
• Roundoff errors arise because digital computers cannot represent
some quantities exactly. There are two major facets of roundoff
errors involved in numerical calculations:
• Example
Approximation to a derivative using a finite-difference equation:
dv v v(ti +1 ) − v(ti )
=
dt t ti +1 − ti
Truncation Errors
• Taylor theorem states that any smooth function can be
approximated as a polynomial.
Examples
Given that 𝑓 𝑥 = 9𝑥 2 find 𝑓′(3) at ∆𝑥 = 0.3
Solution:
Approximate value= 56.7
Exact value = 54
Error = 2.7
Relative percentage error = 5%
HINT
𝑓 𝑥 + ∆𝑥 − 𝑓(𝑥)
𝑓 ′ (𝑥) ≅
∆𝑥
Examples
𝑑𝑦
Using Euler’s method, find 𝑦(3) if − 3𝑒 −𝑥 = −0.4𝑦. Take ℎ = 3
𝑑𝑥
and 𝑦(0) = 5
(b) Choose a step size (ℎ) = 1.5
(c) Use a step size of 1 (Homework)
Solution:
(a) (b)
𝑦(3) = 8 𝑦1 = 6.5
𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 = 2.763 𝑦2 = 3.604; |𝐸𝑡 | = 30.44%
𝐸𝑡 = −5.237
|ℇ𝑡 | = 190%
HINT
𝑦𝑖+1 = 𝑦𝑖 + 𝑓(𝑥𝑖 , 𝑦𝑖 )(ℎ)
Examples
Starting with e x = 1 estimate e 0.5 by adding terms one at a time.
Compute the true and approximate percent relative errors after each term
addition. Add terms until the absolute value of the approximate error
a
estimate falls below a prespecified error criterion 𝜀𝑠 conforming to three
significant figures. Use the Maclaurin series expansion
Examples
Use Taylor series expansion with n= 0 to 6 to approximate f(x) = 𝑐𝑜𝑠𝑥 at
𝑥𝑖+1 = 𝜋/3 on the basis of the value of 𝑓 𝑥 and its derivative at 𝑥𝑖 =
𝜋/4