CH-1 Basic Concepts in Error Estimation.pdf

KebedeHaile2 121 views 41 slides Aug 21, 2024
Slide 1
Slide 1 of 41
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41

About This Presentation

numerical modeling in civil engineering


Slide Content

1
Well Come
Numerical Methods
(CEng-3112)

CHAPTER 1: BASIC CONCEPTS IN ERROR ESTIMATION
1.1 Computer Arithmetic
1.2 Sources of errors
1.3 Absolute and relative errors
1.4 Approximations of errors
1.5 Truncation errors and the Taylor series
1.6 Propagation of errors
http://numericalmethods.eng.usf.edu

specific objectives
Aftercompletionofthischapter,youwillbeableto:
Understandhownumbersarerepresentedindigitalcomputers
Recognizehowcomputerarithmeticcanintroduceandamplifyround-offerrorsin
calculations
Recognizethedifferencebetweentruerelativeerrorεt,approximaterelativeerrorε
a,
andacceptableerrorε
s
Understandtheconceptsofsignificantfigures,accuracy,andprecision.
Recognizethedifferencebetweenanalyticalandnumericalsolutions
Recognizethedistinctionbetweentruncationandround-offerrors.
Analyzehowerrorsarepropagatedthroughfunctionalrelationships.
3

Introduction
Numericaltechniqueiswidelyusedbyscientistsandengineerstosolvetheir
problems.Amajoradvantagefornumericaltechniqueisthatanumericalanswer
canbeobtainedevenwhenaproblemhasnoanalyticalsolution.
Whatarenumericalmethodsandwhyshouldyoustudythem?
NumericalMethodsaretechniquesbywhichmathematicalProblemsare
formulatedsothattheycanbesolvedwitharithmeticandlogicaloperations.
Becausedigitalcomputersexcelatperformingsuchoperations,numerical
methodsaresometimesreferredascomputermathematics”.
Beyondcontributingtoyouroveralleducation.thereareseveraladditional
reasonswhyyoushouldstudynumericalmethods:
Numericalanalysisisconcernedwiththemethodsoffindingtheapproximate
valuesandtheabsoluteerrors.
4

Reasons
1)Numericalmethodsareextremelypowerfulproblem-solvingtools.They
arecapableofhandlinglargesystemsofequationsnonlinearities,and
complicatedgeometriesthatarenotuncommoninengineeringandscience
andthatareoftenimpossibletosolveanalyticallywithstandardcalculus.As
suchtheygreatlyenhanceyourproblem-solvingskills.
2)Numericalmethodsallowyoutouse"canned“softwarewithinsight.During
yourcareer,youwillinvariablyhaveoccasiontousecommerciallyavailable
pre-packagedcomputerprogramsthatinvolvenumericalmethods.The
intelligentuseoftheseprogramsisgreatlyenhancedbyanunderstandingof
thebasictheoryunderlyingthemethods.Intheabsenceofsuchunderstanding
youwillbelefttotreatsuchpackagesas“blackboxes“withlittlecritical
insightintotheirinnerworkingsorthevalidityoftheresultstheyproduce.
5

Cont...
4)Numericalmethodshelptodesignyourownprogram.
Manyproblemscannotbeapproachedusingcannedprograms.Ifyouare
conversantwithnumericalmethods,andareadept(verySkilled)atcomputer
programming,youcandesignyourownprogramstosolveproblemswithout
havingtobuyorcommissionexpensivesoftware.
5)Numericalmethodsareanefficientvehicleforlearningtousecomputers.
Becausenumericalmethodsareexpresslydesignedforcomputerimplementation,
theyareidealforillustratingthecomputer'spowersandlimitations.Whenyou
successfullyimplementnumericalmethodsonacomputer,andthenapplythemto
solveotherwiseintractableproblems,youwillbeprovidedwithadramatic
demonstrationofhowcomputercanserveourprofessionaldevelopment.Atthe
sametime,youwillalsolearntoacknowledgeandcontroltheerrorsof
approximationthatarepartandparceloflarge-scalenumericalcalculations.
6

Cont...
6)Numericalmethodsprovideavehicleforyoutoreinforceyour
understandingofmathematics.Becauseonefunctionofnumericalmethodsis
toreducehighermathematicstobasicarithmeticoperations.theygetatthe
"nutsandbolts"ofsomeotherwiseobscuretopics.Enhancedunderstanding
andinsightcanresultfromthisalternativeperspective.
Whereas
Mathematics,thescienceofstructure,order,andrelationthathasevolved
fromelementalpracticesofcounting,measuring,anddescribingthe
shapesofobjects.Itdealswithlogicalreasoningandquantitative
calculation,anditsdevelopmenthasinvolvedanincreasingdegreeof
idealizationandabstractionofitssubjectmatter.
7

Applications of numerical methods
in civil engineering
1.UsedinstructuralAnalysistodetermineforcesandmomentsin
structuralsystemspriortodesign
2.Numericalmethodsprovideanapproximationthatisgenerallygood
enough.Itisusefulinallfieldsofengineeringandphysicalsciencesand
growinginutilityinthelifesciencesandtheartsMovementof
planets,starsandgalaxiesInvestmentportfoliomanagement
QuantitativepsychologySimulationoflivingcellsAirlineticket
pricing,crewscheduling,fuelplanning
3.Traffic Simulations: Collision avoidance, exit position, entrance, turning
point of vehicles are solved by forming mathematical model. Numerical
method is used to solve these mathematical models in traffic simulations.
8

Cont...
4.Weatherprediction:Numericalmethodisusedtopredictweather
andenvironmentalsimulationsbydataassimilationtoproduce
outputsoftemperature,precipitation,andhundredsofother
meteorologicalelementsfromtheoceanstothetopofthe
atmosphere.
5.Groundwater&pollutantmovement:Groundwaterformsapart
ofthehydrologiccycle.Numericalmethodisusedtoanalyzethe
movementofgroundwaterandpollutants.
6.Estimationoftheamountofwater:Numericalmethodisusedto
estimatetheamountofwaterthatflowsinariver,oceancurrent
duringayear.
9

Cont....
7.Theusageofnumericalmethodsinsolving
differentialequationinordertodetermine
theterminalvelocityetc.inproblemsofstaticsand
dynamics.
8. The usage of numerical methods in the problems of fluid
for example the solving of balance of flow at a junction for
incompressible fluid flow in pipes.
9.Theimportantusedinthematrixmethodsofsolving
variouscomplexstructuralengineeringproblemsinvolving
trusses,portalframes,beamsetc
10

1.1 Computer Arithmetic
Computerarithmeticisafieldofcomputersciencethatinvestigateshow
computersshouldrepresentnumbersandperformoperationsonthem.Itincludes
integerarithmetic,fixed-pointarithmetic,andfloating-point(FP)arithmetic,The
basicarithmeticOperationsPerformedbytheComputerareaddition(+),
Subtraction(-),Multiplication(x)andDivision()
And,logicaloperationsare,,,,,,,,,,,,,,,
,,,,,etc....
ThedecimalnumbersarefirstevolvedtothemachinenumbersConsistingof
theonlydigits0and1withabaseorradixdependinguponthecomputer.
Ifthebaseistwo,eightorsixteenthenumbersystemiscalledbinary,Octal
orhexadecimalrespectively.
11

Types of Number System
12

A) Decimal integer number
DecimalNumberSystemisthatnumbersysteminwhichatotaloftendigitsor‘ten
signs’(0,1,2,3,4,5,6,7,8,9)areusedforcounting/counting.Thisisthemost
commonlyusednumbersystembyhumans.
Forexample,645.7isanumberwritteninthedecimalsystem.
Representation
4987=(4987)
10=4000+900+80+7=4x10
3
+9x10
2
+8x10
1
+7x10
0
4987.6251=(4987.6251)
10=4000+900+80+7=4x10
3
+9x10
2
+8x10
1
+7x10
0
+6x10
-1
+2x10
-2
+5x10
-3
+1x10
-4
B)BinarynumberSystem
Abinarynumberisanumber expressed inthebase-2numeral
systemorbinarynumeralsystem,amethodofmathematicalexpression
whichusesonlytwosymbols:typically"0"(zero)and"1"(one)
calledbits.Thebase-2numeralsystemisapositionalnotationwitha
radixof2.
13

14

Ex: Convert (58)
10in to binary number system
2 58 0
2 29 1
2 14 0
2 7 1
2 3 1
1
15
Start with 58 2
5829 2
0 28 14 2
1 14 7 2
0 63 2
1 2 1 less than 2. Stop here!
1
Then, pick all the remainder from the last to the initial
(111010)
2is the Correct answer
Ex: Convert (1011.0011)
2in to decimal number system?1875.11
)21212020(
)21212021(
)0011.1011(
10
4321
0123
2














Fractional Decimal Number to Binary
EX: Convert (0.859375)
10in to Binary system
16
Multiplication After Decimal Before Decimal
0.859375*2=1.718750 0.718750 1
0.718750*2 = 1.437500 0.437500 1
0.437500*2 = 0.875000 0.875000 0
0.875000*2 = 1.750 1.750 1
0.75*2 = 1.50 0.50 1
0.50*2= 1.0 0.000 1
Hence, write all numbers after decimal from top to Bottom (0.110111)
2 is the answer

C) Octal number System
17

.
18
Conversion Table
Decimal
(Base 10)
Binary
(Base 2)
Octal
(Base 8)
0 000 0
1 001 1
2 010 2
3 011 3
4 100 4
5 101 5
6 110 6
7 111 7

Ex: Convert (1478.21)
10in to Octal ?
Division After Decimal multiply Before Decimal
14788 =184.75 0.75*8=6 184
1848 =23.0 0.0*8 =0 23
238 =2.875 0.875*8=7 2
19
Hence, (2706.153412---)
8is the Correct answer
Example : Convert
(64.25)
8in to Binary ?
Multiplication After Decimal Before Decimal
0.21*8=1.68 0.68 1
0.68*8 =5.44 0.44 5
0.44*8 = 3.52 0.52 3
0.52*8 = 4.16 0.16 4
0.16*8 = 1.28 0.28 1
0.28*8 =2.24 0.24 2
Less than 8. Stop here!!

.
20
D)

.
21

22

.
23
(Least Sig digit)
(Most Sig digit)
Example−Convertdecimalnumber98into
octalnumber.
Firstconvertitintobinaryorhexadecimal
number,=(98)
10
=(1x2
6
+1x2
5
+0x2
4
+0x2
3
+0x2
2
+1x2
1
+0x2
0
)
10or
(6x16
1
+2x16
0
)
10
Becausebaseofbinaryandhexadecimalare2
and16respectively.
=(1100010)
2or(62)
16
Thenconverteachdigitofhexadecimalnumber
into4bitofbinarynumberwhereasconvert
eachgroupof3bitsfromleastsignificantin
binarynumber.
=(001100010)2
or(01100010)2
=(001100010)2
=(142)8
=(142)8
Exercise:
Convert (456.824)
10to binary, Octal and
hexadecimal system?

Grouping Binary bits in to three and four will give Octal
number and Hexadecimal number respectively
24

1.2 Sources of errors
25
InNumericalmethodsbothaccuracyandPrecisionarerequiredfora
particularProblem.
WewillusetheCollectivetermerrortorepresentbothinaccuracyand
imprecisioninourPredictions.
Numericalerrorsarisefromtheuseofapproximationtorepresentthe
exactmathematicaloperationsorquantities.
Considertheapproximationwedidintheproblemoffallinganobjectin
air.Weobservedsomeerrorbetweentheexact(true)andnumerical
Solutions(Approximation)
Therelationshipbetweenthem:
TrueValue(Tv)=Approximation +TrueError
TrueError=TrueValue–ApproximateValue

Why we measure errors?
1) To determine the accuracy of numerical results.
2) To develop stopping criteria for iterative algorithms.
26
Errors and Approximations in Computation
Acomputerhasafinitewordlengthandsoonlyafixednumberof
digitsarestoredandusedduringcomputation.
Exactnumber:numberwithwhichnouncertainlyisassociatedtono
approximationistaken
Approximatenumber:Therearenumberswhicharenotexact.

Types of Errors
27
1)TrueError:thedifferencebetweenthetruevalueinacalculation
andtheapproximatevaluefoundusinganumericalmethodetc.
TrueError=TrueValue–ApproximateValue
2)InherentError:Theinherenterroristhatquantitywhichisalreadypresentin
thestatement.
3)Round-offerror:isthequantity,whicharisesfromtheprocessofrounding
offnumbers.
4)TruncationError:Thesetypesoferrorscausedbyusingapproximate
formulaeincomputationoronreplaceaninfiniteprocessbyafiniteone.
5)Absoluteerror:isthenumericaldifferencebetweenthetruevalueofa
quantityanditsapproximatevalue.

6) Relative True Error
the ratio between the true error, and the true value.
????????????????????????�??????�??????????????????�????????????????????????�????????????
??????=
????????????�????????????????????????�??????
????????????�??????�????????????�??????
7)ApproximateError:isdefinedasthedifferencebetweenthepresent
approximationandthepreviousapproximation.
9)RelativeApproximateError:Definedastheratiobetweenthe
approximateerrorandthepresentapproximation.
28
= Present Approximation –Previous Approximation Approximate Error (E
apx)
Relative Approximate Error (E
rapx)=
Approximate Error
Present Approximation

How is Absolute Relative Error used as a stopping criterion?
If∈
??????<∈
??????,where
sisapre-specifiedtolerance,thennofurther
iterationsarenecessaryandtheprocessisstopped.
Ifatleastmsignificantdigitsarerequiredtobecorrectedinthe
finalanswer,then
29%105.0||
2m
a



Significant digits or Figures
The significant digits of a number are the digits that have meaning or contribute to the
value of the number. Sometimes they are also called significant figures.
Which digits are significant?
Therearesomebasicrulesthattellsyouwhichdigitsinanumberare
significant:
All non-zero digits are significant
Any zeros between significant digits are also significant
Trailing zeros to the right of a decimal point are significant
30

Which digits aren't significant?
Theonlydigitsthataren'tsignificantarezerosthatareactingonlyasplace
holdersinanumber.Theseare:
Trailingzerostotheleftofthedecimalpoint(note:thesezerosmayormaynot
besignificant)
Leadingzerostotherightofthedecimalpoint
31

Examples
32
10.0075Thereare6significantdigits.Thezerosareallbetweensignificant
digits.
10.007500Thereare8significantdigits.Inthiscasethetrailingzerosaretothe
rightofthedecimalpoint.
0.0075Thereare2significantdigits.Thezerosshownareonlyplaceholders.
5000.00Thereare6significantdigits.Thezerostotherightofthedecimal
pointaresignificantbecausetheyaretrailingzerostotherightofadecimal
point.Thezerostotherightofthe5aresignificantbecausetheyarebetween
significantdigits.

1.3 Absolute, relative error, and Percentage error
Absolute : if X’is the approximate value of quantity X then |X-X’| is
called the absolute error and denoted by Ea.
Therefore, Ea= |X-X’|
Relative Error : The relative error is defined as the ratio of the absolute
error of the measurement to the actual measurement.

??????=
??????
??????
??????
??????
=
??????−??????

??????
Percentage error: The percentage error in X’which is the
approximate value of X is given by

??????=∈
??????∗&#3627409359;&#3627409358;&#3627409358;=
??????−??????

??????
*100
33

Mean Absolute Error
Themeanabsoluteerroristheaverageofallabsoluteerrorsofthedata
collected.ItisabbreviatedasMAE(MeanAbsoluteError).Itis
obtainedbydividingthesumofalltheabsoluteerrorswiththenumber
oferrors.TheformulaforMAEis:
??????????????????=
&#3627409359;
&#3627408423;

??????=&#3627409359;
&#3627408423;
??????
??????−??????
Here,
|x
i–x| = absolute errors
n = number of errors
34

1.4 Approximations of errors
Theapproximationerrorinadatavalueisthediscrepancybetweenanexactvalue
andsomeapproximationtoit.Thiserrorcanbeexpressedasanabsoluteerror(the
numericalamountofthediscrepancy)orasarelativeerror(theabsoluteerror
dividedbythedatavalue).
Accuracyandprecisionareonlytwoimportantconceptsusedinscientific
measurements.
Accuracyreferstohowcloseameasurementistothetruevalue.Itreflectshow
closeameasurementistoaknownoracceptedvalue,
Precisionishowrepeatableameasurementis.Itreflectshowreproducible
measurementsare,eveniftheyarefarfromtheacceptedvalue.
35

Error Approximation of a function
Let y =f(X
1, X
2-------X
n) be a function of two variables X
1and X
2. If x
1and x
2 are errors in
X
1, X
2, the error yin y is given by:
Y +y = f(X
1+X
1, X
2+ X
2, -------X
n+X
n)
Error in Addition of Numbers
Error in Subtraction of Numbers
Error in Product of Numbers
Error in Division of Numbers
36
we can get maximum absolute error and relative
errorfrom these operations

Con’t...
Thederivative,f’(x)ofafunctionf(x)canbeapproximatedbythe
equation:
EX
If andh=0.30,
a)Findtheapproximatevalueoff’(2)? ,
b)Findthetruevalueoff’(2)?
c)Findthetrueerrorforpart(a)?
Solution:ForX=2,h=0.30
A)
=10.263
37h
xfhxf
xf
)()(
)('

 x
exf
5.0
7)( 3.0
)2()3.02(
)2('
ff
f

 3.0
)2()3.2( ff 

b) The exact value of f’(2)
the true value of f’ (2)=9.514
C)
Trueerror = True Value –Approximate
Valuex
exf
5.0
7)( x
exf
5.0
5.07)('  x
e
5.0
5.3 722.0263.105140.9  3.0
028.19107.22

Inverse problem of the theory of errors
Tofindtheerrorinthefunctionu=f(x
1,x
2,x
3,.......x
n)istohavea
desiredaccuracyandtoevaluateerrorsx
1,x
2,x
3,........x
ninx
1,
x
2,x
3,.......x
n,Wehave∆??????=∆??????
&#3627409359;∗
????????????
????????????
&#3627409359;
+∆??????
&#3627409360;∗
????????????
????????????
&#3627409360;
+---+∆??????
&#3627409359;∗
????????????
????????????
&#3627409359;
Using the principle of equal effects which states , ∆??????
&#3627409359;∗
????????????
????????????&#3627409359;
=∆??????
&#3627409360;∗
????????????
????????????&#3627409360;
=---=∆??????
&#3627409359;∗
????????????
????????????&#3627409359;
This implies that ∆??????=??????∗∆??????
&#3627409359;∗
????????????
????????????&#3627409359;
or∆??????
&#3627409359;=
∆??????
??????∗
????????????
????????????
&#3627409359;
, ∆??????
&#3627409360;=
∆??????
??????∗
????????????
????????????
&#3627409360;
, ∆??????
&#3627409360;=
∆??????
??????∗
????????????
????????????
&#3627409360;
..... Etc
Example: The percentage error in R is given by is not allowed to exceed
0.2% , find the allowable error in r and h , where r =4.5cm and h=5.5cm?
38

1.5 Truncation errors and the Taylor series
Truncationerrorsarethosethatresultfromusinganapproximation
inplaceofanexactmathematicalprocedure.
Thesetypesoferrorscausedbyusingapproximateformulaein
computationorinplaceofaninfiniteprocessbyafiniteone.
TaylorseriesThegeneralformoftheTaylorseriesisgivenby:
providedthatallderivativesoff(x)arecontinuousandexistintheinterval
[x,x+h]
SomeExamplesoftailorseries
39
 





32
!3!2
h
xf
h
xf
hxfxfhxf 
!6!4!2
1)cos(
642
xxx
x 
!7!5!3
)sin(
753
xxx
xx 
!3!2
1
32
xx
xe
x

1.6 Propagation of errors (Propagation of Uncertainty)
It is defined as the effects of a function by a variables uncertainty. It is
denoted by:
Innumericalmethods,thecalculationsarenotmadewithexact
numbers.Howdotheseinaccuraciespropagatethroughthe
calculations?
40

Propagation of Errors In Formulas
Propagation of error Addition
Propagation of error Subtraction
Propagation of error Product
Propagation of error Division
If f is a function of several variables then the
maximum possible value of the error in fis
41nn
XXXXX ,,.......,,,
1321  n
n
n
n
X
X
f
X
X
f
X
X
f
X
X
f
f 














1
1
2
2
1
1
.......
Tags