Date post: | 08-Jul-2018 |
Category: |
Documents |
Upload: | inunhazwanikhairuddin |
View: | 215 times |
Download: | 0 times |
of 20
8/19/2019 Week01_Introduction to Numerical (1)
1/48
CHE 555NUMERICAL METHODSAND OPTIMIZATION
8/19/2019 Week01_Introduction to Numerical (1)
2/48
WEEK 1
Introduction to Numerical Methods Mathematical modeling
Approximation and round off errors
Truncation errors and Taylor Series 2
8/19/2019 Week01_Introduction to Numerical (1)
3/48
At the end of this topic, the students will be able:
• To describe numerical techniques as compared
to analytical methods
• To use Taylor series expansion to approximate
a function• To perform error analysis associated with
numerical methods
LESSON OUTCOMES
8/19/2019 Week01_Introduction to Numerical (1)
4/48
4
Why Numerical Method?
• Could handle large systems of equations,
nonlinearity and complex geometries that is notcommon
• It pro!ide approximate solutions to many of theengineering pro"lems
8/19/2019 Week01_Introduction to Numerical (1)
5/48
• #o$erful analysis tool in pro"lem sol!ing andunderstanding pro"lem in mathematical language
• Techniques "y $hich mathematical pro"lems areformulated, so that they can "e sol!ed $ith
arithmetic operations• The role of numerical method in sol!ing engineering
pro"lem%
5
What is Numerical Method&cont'
PROBLEMFORMULATION
Fundamental laws are usedto deelop mathematical
equations that can representthe specific problem
SOLUTION
!uitable numerical methodsare then selected to sole
the mathematical equations
INTERPRETATION
The results obtained canthen be used to
predict"analy#e"understandthe specific problem better
8/19/2019 Week01_Introduction to Numerical (1)
6/48
$
%s the use of mathematics to• &escribe real world phenomena• %nesti'ate important questions about the obsered world• (xplain real world phenomena
• Test ideas• )a*e predictions about the real world
• The real world refers to• (n'ineerin' +hysics• +hysiolo'y (colo'y• ildlife mana'ement -hemistry• (conomics !ports• (tc
Mathematical modeling
8/19/2019 Week01_Introduction to Numerical (1)
7/48
• A mathematical model is represented as a functionalrelationship of the form
.
8/19/2019 Week01_Introduction to Numerical (1)
8/48
• (ependent !aria"le
)"ser!ed "eha!iour*state*phenomenon of a systemCharacteristic that reflects "eha!iour or state of the system
ie y, f(x), f(t)
• Independent !aria"le
(imension that determine a system ie time, t , x
• #arameter
+uantity that ser!es to relate to functions and !aria"les
eflecti!e of the system's properties or composition -ex% T, #, p./
• 0orcing functions
1xternal influence that acts on system ie acceleration gra!ity, g
/
8/19/2019 Week01_Introduction to Numerical (1)
9/48
(xample
0
Apply 1ewtons second law, F 3 ma
And also can write as
(q relates a linear position x
dependent ariable6 to the appliedforce, F forcin' function6 and thetime, t independent ariable6 Themass, m is the only parameter inthe aboe model
F dt
xd m
or
F dt
dvm
=
=
2
2
dt
dxv =
8/19/2019 Week01_Introduction to Numerical (1)
10/48
1xample of mathematical modeling
78
8/19/2019 Week01_Introduction to Numerical (1)
11/48
77
(xample Assume that interested to predict the elocity of the fallin' parachutist with time
9se fundamental *nowled'e to find amathematical equation correlates theelocity to the arious forces actin' on theparachutist
Ne$ton's 2nd la$ of Motion
3the time rate change of momentum of a bodyis equal to the resulting force acting on it 4
The model is formulated as
F = ma
F5net force acting on the "ody -N/
m5mass of the o"6ect -7g/
a5its acceleration -m*s2/
8/19/2019 Week01_Introduction to Numerical (1)
12/48
72
)odel relates acceleration of fallin'obect to the forces actin' on it,
differential equation6
m
F
dt
dv
dt
dv
=
= aonaccelerati
resistanceairof forceup$ard
gra!ityof forcedo$n$ard
=
=
+=
U F
D F
U F
D F F
cvU F
mg D F
−=
=
vm
c g
m
cvmg
dt
dv−=
−=
8/19/2019 Week01_Introduction to Numerical (1)
13/48
7;
(xact or analytical solution: it exactly satisfies the ori'inal equation
dependent ariable
independent ariable
forcin' functions
par ameter
t,s ,m"s6
8 888
2 7$48
4 2...
$ ;5$4
/ 4778
78 44/.
72 4./.
5;;0
Analytical solution of the parachutist
∞
8/19/2019 Week01_Introduction to Numerical (1)
14/48
74
9nfortunately, there are many mathematicalmodels that cannot be soled exactly
1umerical solution that approximates the exact solution
8/19/2019 Week01_Introduction to Numerical (1)
15/48
75
The use of finite difference to approximate thefirst deriatie of with respect to t
Approximate ornumerical solution
/-8
/-/8
-
8
/-/8
-
it
ii
it
it
ii
it
it
vmc g
t t
vv
t t
vv
t
v
dt
dv
vm
c g
m
cvmg
dt
dv
−=
−
−
−
−
=
∆
∆≅
−=
−
=
+
+
+
+
/-8/-/-/- 8 iit t t
t t vm
c g vv
iii
−
−+= +
+
8/19/2019 Week01_Introduction to Numerical (1)
16/48
7$
t,s ,m"s6
8 888
2 70$8
4 ;288
$ ;0/5
/ 44/2
78 4.0.
72 400$
5;;0
1umerical solution
-omparison between the exact andnumerical solution
∞
/- 8/-/-/- 8 iit t t t t vmc g vv
iii−
−+=
++
8/19/2019 Week01_Introduction to Numerical (1)
17/48
Approximation and oundoff 1rrors
• Significant figures
0/
0/80
8880/
Num"ers to "e used in confidence
2 significant figures
9 significant figures
2 significant figures
7.
8/19/2019 Week01_Introduction to Numerical (1)
18/48
7/
Important of signifian! fig"r!s in n"m!ria# m!t$o%s&
• 1umerical methods yield approximate results, therefore,need to deelop criteria to specify the confident inapproximate result
• Althou'h quantities such as π, e, or
8/19/2019 Week01_Introduction to Numerical (1)
19/48
• Accuracy and Precision
70
Ina"rat! ' impr!is!
a"rat! ' pr!is!Ina"rat! ' pr!is!
a"rat! ' impr!is!
Inr!asing a"ra(
I n r ! a s i n g p
r !
i s i o n
>ow closely a computedor measured alue a'reewith the true alue
>ow closely indiidualcomputed or measuredalues a'ree with eachother
8/19/2019 Week01_Introduction to Numerical (1)
20/48
• Error definitions
True !alue
Approximation
!alue
1rror
True !alue 5 1rror : Approximation !alue
28
Tr"nation !rrors ? resultwhen approximations areused to represent exactmathematical procedures
Ro"n%)off !rrors ? resultwhen numbers hain' alimited si'nificant fi'ures
are used to representexact numbers
8/19/2019 Week01_Introduction to Numerical (1)
21/48
• εt designates true percent relati!e error
True !alue 5 error : approximation !alue
True error - E t /5 true !alue ; approximation
27
76
26
;6
8/19/2019 Week01_Introduction to Numerical (1)
22/48
Calculation of errors
True !alue of length of a "ridge is 8
8/19/2019 Week01_Introduction to Numerical (1)
23/48
.o$e!er , in actual situation, true !alue is rarely a!aila"leTherefore, need to estimate the true !alue approximation
In numerical method, iterative approach is used to
compute ans$er, in $hich error is estimated as the
difference "et$een pre!ious and current approximations
The signs of error can "e negati!e or positi!e,
A"solute !alue of error, εa need to "e lo$er than
prespecified percent tolerance, ε s
n is significant figures
2;
46
56
8/19/2019 Week01_Introduction to Numerical (1)
24/48
1rror estimates for iterati!e method
Suppose that $e ha!e exponential function as,
Starting $ith the simplest !ersion, e x58, addterms to estimate e!" Compute true -εt/ and
approximate error -εa/ after each term is added
until εa falls "elo$ ε s , conforming to @significant figures Note that true !alue of e!"
is 89B28
24
8/19/2019 Week01_Introduction to Numerical (1)
25/48
• Ans$er
25
8/19/2019 Week01_Introduction to Numerical (1)
26/48
• Round-off errors
ln 2 5
8/19/2019 Week01_Introduction to Numerical (1)
27/48
• )ther example of roundoff error
2.
8/19/2019 Week01_Introduction to Numerical (1)
28/48
Truncation errors and Taylor series
2/
• Truncation errors
• Truncation error is the discrepancy introduced by the fact thatnumerical methods may employ approximations to represent
exact mathematical operations and quantities
• Truncation error are errors resulted from usin' an approximationin place of an exact mathematical procedure
• The difference between the calculated alue usin' exactmathematical equation and approximation mathematicalequation
8/19/2019 Week01_Introduction to Numerical (1)
29/48
Zero order
First order
Second
order
nth order
20
+roides a means to predict a function alue at one point in terms of the
function alue and its deriatie at another point
• Taylor series
8/19/2019 Week01_Introduction to Numerical (1)
30/48
;8
$6
.6
Taylor series by definin' a step si#e h = x i+1 - x i
8/8-
/F8-
/- ++
+=
nn
n hn
f #
ξ
8/19/2019 Week01_Introduction to Numerical (1)
31/48
;7
8/19/2019 Week01_Introduction to Numerical (1)
32/48
;2
Get say $e truncated the Taylor series expansion after HeroEorder term to
yield
emainder term, n for Hero order !ersion
Get truncate the remainder itself,
This result is still inexact "ecause neglected second and higher order terms
emainder term, n, accounts for all terms from -n:8/ to infinity
It also usually expressed as%
• Remainder for the Taylor series E!ansion
/-/- 8 ii x x f f ≅
+
F@F2
III @
/-@
2/-
/-< +++≅ h f
h f
h f # iii
x x
x
h f #i x /-<
I≅
/- 8+= nn h$ #
8
/8-
/F8-/- +
+
+= n
n
n hn
f # ξ
8/19/2019 Week01_Introduction to Numerical (1)
33/48
Remainder for the Taylor series E!ansion
;;
8/19/2019 Week01_Introduction to Numerical (1)
34/48
;4
Alternati!e simplification that tranforms the approximation into an
equi!alence "ased on graphical insight derivative mean%value theorem states that if a function f(x) and its
deri!ati!e are continous o!er inter!al from xi to xi&',
there exist at least one point on the function that has a slope, designated "y
f(), parallel to line 6oining f (xi ) and f(xi&' )
Thus,
So,
ero order ersion
First order ersion
8/19/2019 Week01_Introduction to Numerical (1)
35/48
• "umericaldifferentiation
0or$ard finite di!ided difference
Jac7$ard finite di!ided difference
Centered finite di!ided difference
;5
8/19/2019 Week01_Introduction to Numerical (1)
36/48
;$
0or$ard finite di!ided difference approximation of first deri!ati!e
Jac7$ard finite di!ided difference approximation of first deri!ati!e
Centered finite di!ided difference approximation of first deri!ati!e
Where,746
756
7$6
7.6
Where,
Where,
$(h)h
f ) f*(x
h #
h ) f(x ) f(x ) f*(x
ii
iii
+∇
=
+−
= −88
8−−= ii x xh
88 −+ −=−= iiii x x x xh
8/19/2019 Week01_Introduction to Numerical (1)
37/48
;.
9se forward and bac*ward difference approximations of O(h) and a centereddifference approximation of O(h2 ) to estimate the first deriatie of
at x 3 85 usin' a step si#e h 3 85 @epeat usin' h 3 825 Also calculate the
true percent relatie error for each approximation
E*amp#! +E*amp#! ,-, +t!*t .oo/00
282D
8/19/2019 Week01_Introduction to Numerical (1)
38/48
;/
E*!ris!
9se forward and bac*ward and a centered difference to estimate the first
deriatie of the function
at x 3 85 usin' a step si#e h385 @epeat usin' h 3 825 Also calculate the
true percent relatie error for each approximation
Ans&
h385F&):7525 470BC&):8/.5 7/$8B
-&):7288 77$;Bh3825F&):72$/.5 7/82BC&):804;.5 7227B-&):778$25 207B
C
8/19/2019 Week01_Introduction to Numerical (1)
39/48
;0
• Second for$ard finite difference approximation of higher deri!ati!es
• Second "ac7$ard finite difference approximation of higher deri!ati!es
• Second centred finite difference approximation of higher deri!ati!es
• >i'her deriaties
8/19/2019 Week01_Introduction to Numerical (1)
40/48
48
• Error !ro!agation
This section is to study how errors in numbers canpropa'ate throu'h mathematical functions %f we multiplytwo numbers that hae errors, we would li*e to estimatethe error in the product
%f a function f is dependent on
a6 a sin'le independent ariable x : fx6
b6 two independent ariables x and y : fx, y6
c6 seeral independent ariables x7, x2, x;, ,xn : fx7 , x2 ,, xn 6
8/19/2019 Week01_Introduction to Numerical (1)
41/48
47
Function of a sin'le ariableDet x be the true alue and
xE be an approximate alue of x
Then, T!( for fx6 computed near fxE6 is 'ien by
Truncatin' after the first deriatie term and rearran'in' the remainin' terms
to 'ie
where
(q276 proides 2 capabilities:
7 to approximate the error in fx6 *nowin' its deriatie
2 to approximate the error in the independent ariable x
276
K/-2
K/-IIK/-K 2 +−+−+= x x
x f x x ) f*(x f(x+) f(x)
KK/I
K/K/-I
x(x f f(x+)
x x(x f f(x+) f(x)
∆=∆
−≈−
x x x x
x f x f (x f
t !aria"leindependenof errortheof estimateanisKK
functiontheof errortheof estimateanisK/-/-K/I
−≡∆
−≡∆
8/19/2019 Week01_Introduction to Numerical (1)
42/48
42
E*amp#!
ien a alue of xE 3 25 with an error of GxE 3 887, estimate the
resultin' error in the function, fx63x;
So#"tion
Hr the true alue lies between 754;.5 and 75/725 %n fact, if x ?240,fx6 could be 754;/2 and if x ? 257, it would be 75/7;2The first order error analysis proides a fairly close estimate of the true error
8BCD
8/19/2019 Week01_Introduction to Numerical (1)
43/48
4;
E*!ris!
Inowin' a alue of xE 3 28 with an error of ΔxE 3 887, estimate the resultin'
error in the function
fx6 3 85x;J87x2K8/xJ8.
Ans: f286345 ± 88$4
8/19/2019 Week01_Introduction to Numerical (1)
44/48
44
Function of a more than Hne ariable
226
2;6
Refer section #$%$%for eam!les
8/19/2019 Week01_Introduction to Numerical (1)
45/48
45
• elati!e error
• Condition num"er
Refer section #$%$&
for eam!le
8/19/2019 Week01_Introduction to Numerical (1)
46/48
• Condition no equals 8 indicates that function's
relati!e error is identical to the relati!e error inx
• Condition no greater than 8 indicates relati!e
error is amplified• Condition no less than 8 indicates relati!e
error is attenuated
• 0unction $ith !ery large !alues are said to "eill%conditioned
4$
8/19/2019 Week01_Introduction to Numerical (1)
47/48
Total numerical errors 5 truncation error : round off error
4.
oundoff error L "y increase no of significant figures orreduce no of computation in analysis
Truncation error L "y decreasing step siHe -h/ or increase
no of computation in analysis
• Total "umerical Error
8/19/2019 Week01_Introduction to Numerical (1)
48/48
Control numerical error
a!oid su"tract 2 nearly equal num"ers to
a!oid loss of significance
se Taylor series for truncation and roundoff
error analysis
#erform numerical experiments
E repeat computation $ith different step siHe or methodand compare results