Sei sulla pagina 1di 21

Errors and Approximations

Significant Figures

Example:

Speedometer: 48.8 km/h or

48.9 km/h ?

Odometer: 87,324.5 km or 87,324.47 km?

Chapra, Numerical Method for Engineers


• Significant figure, ordigit:
• developedtoformally designate thereliabilityof a numericalvalue

• thosethatcan beused withconfidence

• correspondto the number ofcertain digits plus oneestimated digit.

• The examples ofspeedometeryieldthreesignificant figures;the two certain digits are48. Itis


conventional to set the estimated digit atone-halfof the smallest scale division on the
measurement device. Thus the speedometer reading would consist of thethreesignificant
figures:48.5.

• Similarlytheodometeryieldsevensignificantfiguresof 87,324.45.

Chapra, Numerical Method for Engineers


Zero
Example:
• Zerosare not alwayssignificant figuresbecause they may be necessary just to locate a
decimalpoint
• The numbers: 0.00001845, 0.0001845, and 0.001845 all have foursignificant figures

• The number45,300 may have three,four, or five significantdigits,dependingon whether the zeros
are known withconfidence.Such uncertaintycan be resolved by usingscientificnotation,
4.53x104,4.530x 104,4.5300x 104designate that the number is known to three, four, andfive
significant figures, respectively.

Chapra, Numerical Method for Engineers


Accuracy and Precision

Chapra, Numerical Method for Engineers


Binary and Hexadecimal Numbers

• Decimal notation (base 10):

• Binary notation (base 2), usually used by computer machine:

• Hexadecimal (base 16),used by computer system designers and programmers, as they provide a more human-
friendly representation of binary-coded values. Ranging from 0 to F : 0, 1, 2, …, 9, A, B,…,F, where A–F represent
10–15

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


Errors and Approximations

• Source of Numerical Computational Error


Questions:
(a) What are the possible sources of error?
(b) To what degree do these errors affect the final result?

• 3 sources of possible errors:


1. Error in the initial model
• Simplify the assumptions of the derivation of a physical model system
• Using approximate value, such e = 2.7813,π= 3.1416, gravitational acceleration g = 9.81

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


2. Truncation error
Approximation by some type of a mathematical method.
Example: Maclaurin series representation of the Sine Function:

whereEmis the tail end of the expansion, neglected in the process, and known as thetruncation error.

3. Round-off error
Computational errorcaused by the computer during the process of
convertinga decimal number to a binarynumber, and converting back to decimal.

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


Floating Point

Due to a limited number of digits that can be stored in a computer memory, a number must be

represented in a fixed number of digits.

Digital computers represent a number in:

• Fixed point: a fixed number of decimal places

Example (using 4 decimal places): -2.0000, 131.0174, 0.1234.

• Floating point: a fixed number of significant digits

-2 -5
Example (using 4 decimal places): 0.2501x 10 , -0.7012x 10

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


Chopping and Rounding

Consider a positive real number N:

The chopped floating-point representation of N:


Where the last digit is rounded,i.e:
if dm+1< 5, thedmis retained (rounding down)

if dm+1≥ 5, thedmis added 1 (rounding up)

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


•Absolute
  and Relative Errors

Ifis an approximation of a true value, the absolute error is:

The true relative error is:

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB
Subtraction of Nearly Equal Numbers

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB
Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB
Homeworks

1. Solve using Cramer’s rule:

2. Find the inverse matrix:


5. Convert the decimal number of 45.25 to a binary number.

6. Convert thehexadecimalnumber of(3D.2)16to a binary number.

7. Writethefloating-pointform ofthedecimalnumber of 200.346 by m = 5 rounding.


Error Bound

Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB


Esfandiari, Numerical Methods for Engineers and Scientists Using MATLAB

Potrebbero piacerti anche