+ All Categories
Home > Documents > SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Date post: 02-Jan-2017
Category:
Upload: truongquynh
View: 247 times
Download: 3 times
Share this document with a friend
45
SKMM 3023 Applied Numerical Methods Engineering Problem Solving ibn ‘Abdullah Faculty of Mechanical Engineering SKMM 3023 Applied Numerical Methods Engineering Problem Solving 1 / 45
Transcript
Page 1: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

SKMM 3023 Applied Numerical Methods

Engineering Problem Solving

ibn ‘Abdullah

Faculty of Mechanical Engineering

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 1 / 45

Page 2: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Outline

1 Bloom’s Taxonomy and Engineering Problem Solving

2 Engineering Problem

3 Analysis of Engineering Problem

Problem Statement

Mathematical Model

Solution

Verification

4 Accuracy and Precision

5 Error

Absolute & Relative Errors

Absence of True Value

Sources

6 Propagation of Error

In Arithmetic Operations

Examples

7 Bibliographyibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 2 / 45

Page 3: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Bloom’s Taxonomy and Engineering Problem SolvingTerms and Definitions

Cognition

It has to do with how a person understands andacts in the world.

It is a set of abilities, skills or processes that arepart of nearly every human action.

A process by which the sensory input istransformed, reduced, elaborated, stored,recovered, and used.

In science, cognition is the mental processingthat includes the attention of working memory,comprehending and producing language,calculating, reasoning, problem solving, anddecision making.

In psychology and cognitive science, “cognition”usually refers to an information processing viewof an individual’s psychological functions.

Cognitive Process

It is “the process of thinking”.

Basic cognitive process involvesobtaining and storing knowledge.

Higher cognitive process presupposesthe availability of knowledge and put itto use.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 3 / 45

Page 4: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Bloom’s Taxonomy and Engineering Problem SolvingCognitive Process Dimension

1. Remembering 2. Understanding 3. Applying 4. Analyzing 5. Evaluating 6. Creating

Figure 1: Cognitive Process Dimension.

1 Remembering: can the student recall or remember the information?keywords: define, duplicate, list, memorize, recall, repeat, reproducestate

2 Understanding: can the student explain ideas or concepts?keywords: classify, describe, discuss, explain, identify, locate,recognize, report, select, translate, paraphrase

3 Applying: can the student use the information in a new way?keywords: choose, demonstrate, dramatize, employ, illustrate,interpret, operate, schedule, sketch, solve, use, write.

4 Analyzing: can the student distinguish between the different parts?keywords: appraise, compare, contrast, criticize, differentiate,discriminate, distinguish, examine, experiment, question, test.

5 Evaluating: can the student justify a stand or decision?keywords: appraise, argue, defend, judge, select, support, value,evaluate

6 Creating: can the student create new product or point of view?keywords: assemble, construct, create, design, develop, formulate,writeibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 4 / 45

Page 5: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Bloom’s Taxonomy and Engineering Problem SolvingKnowledge Dimension

1. Factual

2. Conceptual

3. Procedural

4. Metacognitive

1 Factual Knowledge The basic elements

students must know to be acquainted with a

discipline or solve problems in it

2 Conceptual Knowledge The inter-relationships

among the basic elements within a larger

structure that enable them to function together

3 Procedural Knowledge How to do something,

methods of inquiry, and criteria for using skills,

algorithms, techniques and methods

4 Metacognitive Knowledge Knowledge of

cognition in general as well as awareness and

knowledge of one’s own cognition

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 5 / 45

Page 6: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Bloom’s Taxonomy and Engineering Problem SolvingLearning Matrix

Laying the cognitive process dimension horizontally, and the knowledge dimension

vertically, we get a learning matrix.

KnowledgeDimension

Cognitive Process Dimension

1. Remembering 2. Understanding 3. Applying 4. Analyzing 5. Evaluating 6. Creating

1. Factual

2. Conceptual

3. Procedural

4. Metacognitive

Every engineer should strive to reach some level of metacognitive knowledge and

master higher cognitive processes, viz. evaluating & creating.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 6 / 45

Page 7: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Engineering ProblemPicturing the Problem

Figure 2: Open belt drive.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 7 / 45

Page 8: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Engineering ProblemStating the Problem

The length L of a belt in an open-belt drive, Figure 2, is given by

L =p

4c2 − (D − d)2 +1

2

`

DθD + dθd

´

(1)

where

θD = π + 2 sin−1

D − d

2c

«

θd = π − 2 sin−1

D − d

2c

«

c is the centre distance, D is the diameter of the larger pulley, d is the diameter of the

smaller pulley, θD is the angle of contact of the belt with the larger pulley, and θd is the

angle of contact of the belt with the smaller pulley.

If a belt having a length 11 m is used to connect the two pulleys with diameters 0.4 m

and 0.2 m, determine the centre distance between the pulleys.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 8 / 45

Page 9: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSteps Involved

1 Problem Statement: Recognise and understand the problem (what is it that

needed to be solved?).

2 Governing Equations or Mathematical Models: Identify parameters affecting the

problem, make the necessary assumptions, develop mathematical model or

governing equations (based on theories from Engineering Mathematics and other

Engineering Subjects).

3 Solution: Solution of the governing equations may make use of the computer

programming (why?).

4 Verification: Verify and interpret the solution (right/wrong?).

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 9 / 45

Page 10: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemProblem Statement

The length of a belt in an open-belt drive, L, is given by

L =p

4c2 − (D − d)2 +1

2

`

DθD + dθd

´

(2)

where

θD = π + 2 sin−1

D − d

2c

«

θd = π − 2 sin−1

D − d

2c

«

c is the centre distance, D is the diameter of the larger pulley, d is the diameter of the

smaller pulley, θD is the angle of contact of the belt with the larger pulley, and θd is the

angle of contact of the belt with the smaller pulley, see Figure-2.8 of Rao (2002).

If a belt having a length 11 m is used to connect the two pulleys with diameters 0.4 m

and 0.2 m, determine the centre distance between the pulleys.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 10 / 45

Page 11: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemMathematical Model

Defined as a formulation or equation that expresses the essential features of a

physical system or process in mathematical terms.

Its simplest form can be represented as a functional relationship thus

Dependent variable = f(independent variables, parameters, forcing functions)

where

dependent variable: a characteristic that reflects the behaviour/state of systemindependent variables: dimensions (time, space, mass) along which the system’sbehaviour that is being determinedparameters: reflective of system’s properties or compositionforcing functions: external influences acting on the system

Mathematical model ranges from a simple algebraic relationship to largecomplicated set of DE. Mathematical models (a.k.a. governing equations) arederived by applying physical laws such as

Equilibrium EquationNewton’s Law of MotionConservation Laws: Mass, Momentum, EnergyEquation of Stateibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 11 / 45

Page 12: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemMathematical Model

Specific to our open belt drive problem in Figure 2,

Mathematical Model

L =q

4c2 − (D − d)2 +1

2

`

DθD + dθd

´

where

θD = π + 2 sin−1

D − d

2c

«

θd = π − 2 sin−1

D − d

2c

«

which is a well known relationship, readily derived for us.

In the majority of engineering problems, the engineer might have to derive the

mathematical model from the first principles.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 12 / 45

Page 13: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSolution

Solution of the governing equation or mathematical model may appear as

Transcendental FunctionsLinear or Nonlinear Algebraic EquationsHomogeneous Equations leading to an Eigenvalue ProblemOrdinary or Partial Differential EquationsEquations involving Integrals or Derivatives

which are either closed-form or open-ended.

Closed-form mathematical expression, e.g.

I1 =

Z b

a

xe−x2

dx =h

− 12e−x2

ib

a= − 1

2e−b2

+ 12e−a2

= 12

e−a2

− e−b2

leads to analytical solution

Open-ended mathematical expressions, e.g.

I1 =

Z b

a

f(x)dx =

Z b

a

e−x2dx

need to be approximated numericallyibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 13 / 45

Page 14: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSolution: Computer Program

Nowadays, approximated numerical solutions are done by developing a computer

program.

Because numerical methods deal extensively with approximations connected with

the manipulation of numbers, accuracy, precision and error feature prominently in

programming the solution. We shall cover these later!

Steps in computer program development:

Algorithm Design: Listing down of the sequence of steps to define the problem at hand.Techniques available: algorithm, flowchart, pseudocodeProgram Coding: Writing these steps in a computer language.Debugging: Testing the program to ensure that it is error-free and reliable.Documentation: Making the program easy to understand and use through manual orguide.

Note:

See SKMM 1013 Programming for Engineers for details.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 14 / 45

Page 15: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSolution: Computer Program

Algorithm: A general sequence of the logical steps in solving a specific problem.

Flowchart: A graphical representation of the algorithm. Better suited for

visualizing complex algorithms.

Pseudocode: Uses code-like statements in place of the graphical symbols of

flowchart. Easier to develop a program with it than with a flowchart.

Elements of good algorithm

Each step must be deterministic i.e. not ambiguous.The process must end after a finite number of steps.The algorithm must be general enough to deal with any contingency.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 15 / 45

Page 16: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSolution: Computer Program–Flowchart

Figure 3: Some of the symbolsused in flowcharting.

Name Function

Terminal Represents the beginning or end of a program.

Flowlines Represents the flow of logic. The humps on thehorizontal arrow indicate that it passes overand does not connect with the vertical flowlines.

Process Represents calculations or data manipulations.

Input/Output Represents inputs or outputs of data and information.

Decision Represents a comparison, question, or decision thatdetermines alternative paths to be followed.

Junction Represents the confluence of flowlines.

Off-page Represents a break that is continued on another page.Connector

Count-controlled Used for loops which repeat a pre-specified numberloop iterations.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 16 / 45

Page 17: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSolution: Computer Program–Algorithm & Pseudocode

Problem Statement:

Find roots of equation ax2 + bx + c = 0 using the quadratic formula

x =−b ±

√b2 − 4ac

2a

Before the actual program is written, we need to outline an algorithm and/or

pseudocode for solving this problem:

Algorithm

1 Start

2 Read coefficients a, b and c

3 Implement quadratic formula. Avoid division by zero,allow for complex roots.

4 Display solution i.e. values of x

5 Stop

PseudocodeDO READ a, b, root1 = (-b + SQRT(b^2 - 4a )/(2a)root2 = (-b - SQRT(b^2 - 4a )/(2a)PRINT root1, root2PRINT 'Try again? Answer yes or no'READ responseIF response = 'no' EXITENDDOibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 17 / 45

Page 18: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemSolution: Computer Program–Coding

A program is a sequence of instructions to the computer for it to solve a particular

problem. A set of programs is called code.

Programs are written in some programming language, e.g. C/C++, Fortran,

Matlab, Basic, Pascal, Java.

Programs are stored in files which are a sequence of bytes which is given a name

and stored on a disk.

A program is a file containing a sequence of statements, each of which tells the

computer to do a specific action.

Once a program is run or executed the commands are followed and actions occur

in a sequential manner.

If the program is designed to interact with the outside world, then it must have

input and output.

A program is said to have a bug if it contains a mistake or it does not function in

the way it is intended to.

Bugs can happen both in the logic of the program, and in the commands.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 18 / 45

Page 19: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemVerification

The final step of any engineering analysis should be the verification of results.

Various sources of error can contribute to wrong results. Common sources of errorinclude:

misunderstanding a given problem,making incorrect assumptions to simplify the problem,applying a physical law that does not truly fit the given problem, andincorporating inappropriate physical properties

Before you present your solution or the results to your instructor or, later in yourcareer, to your manager, you need to learn to think about the calculated results.You need to ask yourself the following question:

Do the results make sense?

A good engineer must always find ways to check results.

Ask yourself this additional question:

What if I change one of the given parameters. How would that change the result?

Then consider if the outcome seems reasonable.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 19 / 45

Page 20: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemVerification

If you formulate the problem such that the final result is left in parametric

(symbolic) form, then you can experiment by substituting different values for

various parameters and look at the final result.

In some engineering work, actual physical experiments must be carried out to

verify one’s findings.

Starting today, get into the habit of asking yourself if your solution to a problem

makes sense.

Asking your instructor if you have come up with the right answer or checking the

back of your textbook to match answers are not good approaches in the long run.

You need to develop the means to check your results by asking yourself the

appropriate questions.

Remember, once you start working for hire, there are no answer books. You will

not want to run to your boss to ask if you did the problem right!

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 20 / 45

Page 21: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemExample Problem 1

Problem Statement:

Assuming that the thrust T of a screw propeller is dependent upon diameter D, speed of

advance v, fluid density ρ, rotational speed of propeller N and coefficient of viscosity µ,

derive and expression that relates all the parameters involved and solve for T.

Mathematical Model:

Through dimensional analysis

T = ρv2D

2f

µ

ρvD,

ND

v

«

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 21 / 45

Page 22: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemExample Problem 2

Problem Statement:

Given temperature in degrees Fahrenheit, the temperature in degrees Kelvin is to be

computed and shown.

Mathematical Model:From Physics, these two temperature scales are related through

Tk =

TF − 32

1.8

«

+ 273.15

and the parameters involved in this problem are TK and TF

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 22 / 45

Page 23: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemExample Problem 2

Algorithm

1 Start

2 Get the temperature in Fahrenheit, TF

3 Compute the temperature in Kelvin using the formula:

Tk =

TF − 32

1.8

«

+ 273.15

4 Show the temperature in Kelvin, Tk

5 Stop

PseudocodeStartRead TFTK = (TF-32)/1.8 + 273.15Print TKStopibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 23 / 45

Page 24: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemExample Problem 3

Problem Statement:

A bungee jumper with a mass of 68.1 kg leaps from a stationary hot air balloon.

Compute velocity for the first 12 s of free fall and determine the terminal velocity that

will be attained for an infinitely long cord. Use a drag coefficient of 0.25 kg/m and the

acceleration due to gravity is 9.81 m/s.

Mathematical Model:

The downward force, FD, and upward force, FU , are, respectively,

FD = mg and FU = −cdv2

The net force, F, on the jumper is the difference between FD and FU. Therefore,

F = FD + FU =⇒ ma = mg − cdv2 =⇒ m

dv

dt= mg − cdv

2

dv

dt= g − cd

mv

2(E0)

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 24 / 45

Page 25: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemExample Problem 3

Solution:

If the jumper is initially at rest (v = 0 at t = 0), calculus can be used to solve Eq. (E0)

for

v(t) =

r

gm

cd

tanh

r

gcd

mt

«

(E1)

Algorithm

1 Start

2 Assign values to parameters and constant (g, m, cd)

3 Create vector containing 0 < t < 20, in steps of 2

4 Evaluate Eq. (E1), where v is computed for each valueof t, and the result is assigned to a correspondingposition in the v array

5 Display solution by plotting the graph of v vs. t

6 Stop

Figure 4: Flowchart.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 25 / 45

Page 26: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Analysis of Engineering ProblemExample Problem 3

Solution:

Matlab Code% Assign values to the parameters:g = 9.81; m = 68.1; d = 0.25;% Create olumn ve tor that ontains values% 0 < t < 20 in steps of 2:t = [0:2:20';% Evaluate Eq. (E1) where the formula is% omputed for ea h value of the t array, and% the result id assigned to a orresponding% position in the v array:v = sqrt(g*m/ d) * tanh(sqrt(g* d/m)*t);% Plot graph of velo ity (v) versus time (t):plot(t, v)title('Plot of v versus t')xlabel('Time t (se )'); ylabel('Velo ity v (m/s)');grid onibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 26 / 45

Page 27: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Accuracy and Precision

Because numerical methods deal extensively with approximations connected with the

manipulation of numbers, accuracy, precision and error feature prominently in

programming the solution. We shall now look at them in more details.

Errors associated with calculations and measurements can be characterized with regard

to their accuracy and precision.

Accuracy refers to how closely a computedor measured value agrees with true value.The opposite, inaccuracy (also called bias),is defined as systematic deviation fromtruth.

Precision refers to how closely individualcomputed or measured value agrees witheach other. The opposite, imprecision (alsocalled uncertainty), refers to the magnitudeof the scatter.

Figure 5: Concepts of accuracy and precision.(a) Inaccurateand imprecise; (b) accurate and imprecise; (c) inaccurate andprecise; (d) accurate and precise.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 27 / 45

Page 28: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Accuracy and Precision

Implied Precision When writing down a measurement as a decimal number, there

is an implied level of precision, namely, 0.5 unit in the last position. For example, a

measurement of 23.534 implies that the maximum error is correct to at least

0.0005.

Alternatively, it may be convenient to write down a measurement with the

maximum error explicitly given: 23.534 ± 0.012, implying that the actual answer

lies in the interval (23.522, 23.546). While such a notation is useful for the actual

study of error propagation, this will not be used much in this course.

Implied precision is a measure of absolute error, covered later!

Numerical methods should be

sufficiently accurate or unbiased to meet the requirements of a particular engineeringproblem,precise enough for adequate engineering design.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 28 / 45

Page 29: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Error

Error is the collective term to represent both inaccuracy and imprecision ofpredictions by numerical methods. If x is an approximation of true value, x, then. . .

true or absolute error is defined as

Ex = x − x (3)

and relative error is defined as

Rx =

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

, x 6= 0 (4)

x is an approximation of x to d significant digits if d is the largest integer for which

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

<1

210

−d(5)

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 29 / 45

Page 30: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorExample Problem 4a

Problem Statement:

Suppose that you are asked to measure the lengths of a bridge and a rivet, and came up

with 9,999 cm and 9 cm, respectively. If the true values are 10,000 cm and 10 cm,

respectively, compute the absolute error and the relative error (in %) for each case.

Solution:

Absolute error for measuring

bridge: Ex = x − x = 10000 − 9999 = 1 cm

rivet: Ex = x − x = 10 − 9 = 1 cm

Percent relative error for measuring

bridge: Rx =

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

× 100 =

˛

˛

˛

˛

1

10000

˛

˛

˛

˛

× 100 = 0.01%

rivet: Rx =

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

× 100 =

˛

˛

˛

˛

1

10

˛

˛

˛

˛

× 100 = 10%ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 30 / 45

Page 31: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorExample Problem 4b

Problem Statement:

1 What are the absolute and relative errors of the approximation 3.14 to the value π?

2 A resistor labeled as 240 Ω is actually 243.32753 Ω. What are the absolute and

relative errors of the labeled value?

Solution:

1 Errors

Absolute: Ex = x − x = π − 3.14 ≈ 0.0016

Relative: Rx =

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

=

˛

˛

˛

˛

π − 3.14

π

˛

˛

˛

˛

≈ 0.00051

2 Errors

Absolute: Ex = x − x = 243.32753− 240 ≈ 3.3 Ω

Relative: Rx =

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

=

˛

˛

˛

˛

243.32753− 240

243.32753

˛

˛

˛

˛

≈ 0.014ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 31 / 45

Page 32: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorExample Problem 4c

Problem Statement:

Given x = e (where e is a constant and base of the natural logarithm = 2.718281828) is

approximated by x = 2.71828, find

absolute and relative errors,

number of significant digits d to which x approximates x.

˛

˛

˛

˛

x − x

x

˛

˛

˛

˛

<1

2× 10

−d

Solution:

Work through the example.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 32 / 45

Page 33: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorIn Absence of True Value

How do we determine error estimates in the absence of knowledge regarding the

true value?

Example: Many numerical methods use an iterative approach to compute answers.

In such approach, a present approximation is made on the basis of a previous

approximation i.e. process is performed repeatedly, or iteratively, to successfully

compute better and better approximations.

In this case, error is estimated as the difference between previous and current

approximations, thus

ǫ =current approximation − previous approximation

current approximation

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 33 / 45

Page 34: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorSources

1 Errors in mathematical modeling:

simplifying approximation,assumption made in representing physical system by mathematical equations

2 Blunders:

undetected programming errors,silly mistakes

3 Errors in input:

due to unavoidable reasons e.g. errors in data transfer,uncertainties associated with measurements

4 Machine errors:

rounding,chopping,overflow,underflow

5 Truncation errors associated with mathematical process:

approximate evaluation of an infinite series,integral involving infinityibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 34 / 45

Page 35: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorSources: Due to Floating-Point Representation

Number is expressed as fractional part, called a mantissa or significand and an

integer part, called an exponent or characteristic

m · be

where m is mantissa, b is the base of the number system being used and e the

exponent. If the number has leading zeros digits, the mantissa is usually

normalized. If 1/34 = 0.029411765 . . . were to be stored in a floating-point

base-10 system that allows only four decimal places to be stored, then 1/34 would

be stored as

1/34 = 0.0294 × 100 → 0.2941 × 10

−1

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 35 / 45

Page 36: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorSources: Due to Truncation Error

The discrepency introduced by the use of an approximate expression in place of an

exact mathematical expression.

Example: Taylor’s series expansion of ln(1 + x)

y(x) = ln(1 + x) =∞

X

i=1

(−1)i+1

ixi

= x − 1

2x

2 +1

3x

3 − 1

4x

4 − 1

5x

5 − 1

6x

6 +1

7x

7 + . . . ; |x| ≤ 1

If y(x) is approximated by the first four terms of this Taylor’s series, the resulting

discrepency between the exact function y(x) and the approximate function

y(x) = x − 12x2 + 1

3x3 − 1

4x4, is called the trunction error.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 36 / 45

Page 37: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorSources: Due to Round-off

Computer can only store a finite number of digits, so actual numbers may undergo

chopping or rounding.

Let a decimal number x = 0.b1b2 . . . bibi+1bi+2 where 0 ≤ bi ≤ 9 for i ≥ 1. If themaximum number of decimal digits used in the floating-point computation is i:

chopped floating-point representation of x is xchop = 0.b1b2 . . . bi where ith digit of xchop

is identical to the ith digit of x.rounded floating-point representation of x is xround = 0.b1b2 . . . bi−1diwheredi(1 ≤ di ≤ 9) is obtained by rounding the number didi+1di+2 . . . to the nearest integer.

Numerical solution of engineering problem uses suitable algorithm and local

computational errors involved in various steps of this algorithm will accumulate to

a computational error in output

Local computational error arise due to errors involved during arithmetic operationssuch as

subtraction of numbers of near-equal magnitude,

irrational numbers (such as√

3 and π) being replaced by machine numbers with finitenumber of digitsibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 37 / 45

Page 38: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

ErrorExample Problem 5

Problem Statement:

The value of e is given by e = 2.718281828459045 . . .. Show the seven-digit

representations of e by chopping and rounding are

echop = 0.2718281× 101

eround = 0.2718282× 101

Solution:

Work through the example.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 38 / 45

Page 39: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Propagation of Error

Error in the output of a procedure due to the error in the input date

Output of a procedure f is a function of input parameters (x1, x2, . . . , xn)

f = f(x1, x2, . . . , xn) ≡ f(~X)

Value of f is found by Taylor’s series expansion about the approximate values~X = x1, x2, . . . , xnT as

f(x1, x2, . . . , xn) = f(x1, x2, . . . , xn) +∂f

∂x1

(~X)(x1 − x1)

+∂f

∂x2

(~X)(x2 − x2) + . . . +∂f

∂xn(~X)(xn − xn)

+ higher order derivative terms

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 39 / 45

Page 40: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Propagation of Error

Neglecting higher order derivative

terms, the error in the output can be

expressed as

∆f = f − f

≡ f(x1, x2, . . . , xn) − f(x1, x2, . . . , xn)

and denoting errors in input

parameters as

∆xi = xi − xi, i = 1, 2, . . . , n

we can estimate propagation error

as

∆f ≈n

X

i=1

∂f

∂xi

(~X)(xi − xi)

Taylor’s series expansion of f(x) in Figure 6 at a known pointxi for a given step size h yields

f(xi+1) = f(xi) + f′(xi)h +

f ′′(xi)

2!h

2

+f ′′′(xi)

3!h

3+ . . .

Figure 6: Relative margin of error for neglecting higherorder terms of Taylor’s series.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 40 / 45

Page 41: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Propagation of Error

If f(x1, x2, . . . , xn) 6= 0 and xi 6= 0, the relative propagation error, εf , is

εf =∆f

f=

nX

i=1

(

xi

f(~X)

∂f

∂xi

(~X)

)

εxi(6)

where εxiis relative error in xi

εxi=

xi − xi

xi

i = 1, 2, . . . , n

The quantity

ci =

(

xi

f(~X)

∂f

∂xi

(~X)

)

in Eq. (6) is called the amplification or condition number of relative input error εxi.ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 41 / 45

Page 42: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Propagation of ErrorIn Arithmetic Operations

When two numbers are used in an arithmetic operations, the numbers cannot be

stored exactly by the floating-point representation.

Let x and y be the exact number and x and y their approximate values. Then

x = x + εx y = y + εy

εx and εy denote errors in x and y, respectively.

When arithmetic operation, say multiplication, is carried out on the numbers,

associated error, E, results

E = xy − xy = xy − (x − εx)(y − εy) = xεy + yεx − εxεy

and relative error, R, is

R =E

xy=

εx

x+

εy

y− εx

x

εy

y= Rx + Ry − RxRy ≈ Rx + Ry

where |Rx| << 1 and |Ry| << 1ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 42 / 45

Page 43: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Propagation of ErrorExample Problem 6

Problem Statement:

The deflection y of the top of a sailboat mast is

y =FL4

8EI

where F is a uniform side loading (lb/ft), L is height (ft), E is the modulus of elasticity

(lb/ft2), and I is the moment of inertia (ft4). Estimate the error in y given the following

data:

F = 50 lb/ft L = 30 ft E = 1.5 × 108

lb/ft2

I = 0.06 ft4

∆F = 2 lb/ft ∆L = 0.1 ft ∆E = 0.01 × 108

lb/ft2 ∆I = 0.0006 ft

4

Solution:

Work through the example.

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 43 / 45

Page 44: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Further Reading

Your homework!

Read Section 1, pp 1–13 of STEPHEN J. CHAPMAN (2001): MATLAB Programming for Engineers, 2ed, Brooks/Cole

Read part of Chapter 1, pp. 1–40 of RICHARD L. BURDEN & J. DOUGLAS FAIRES (2011): Numerical Analysis, 9ed, ISBN-13:978-0-538-73351-9, Brooks/Cole

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 44 / 45

Page 45: SKMM 3023 Applied Numerical Methods - @let@token Engineering ...

Bibliography

1 STEVEN C. CHAPRA & RAYMOND P. CANALE (2009): Numerical Methods for Engineers, 6ed,ISBN 0-39-095080-7, McGraw-Hill

2 SINGIRESU S. RAO (2002): Applied Numerical Methods for Engineers and Scientists, ISBN0-13-089480-X, Prentice Hall

3 DAVID KINCAID & WARD CHENEY (1991): Numerical Analysis: Mathematics of ScientificComputing, ISBN 0-534-13014-3, Brooks/Cole Publishing Co.

4 STEVEN C. CHAPRA (2012): Applied Numerical Methods with MATLAB for Engineers andScientists, 3ed, ISBN 978-0-07-340110-2, McGraw-Hill

5 JOHN H. MATHEWS & KURTIS D. FINK (2004): Numerical Methods Using Matlab, 4ed, ISBN0-13-065248-2, Prentice Hall

6 WILLIAM J. PALM III (2011): Introduction to MATLAB for Engineers, 3ed, ISBN978-0-07-353487-9, McGraw-Hill

ibn.abdullahdev.null 2014 SKMM 3023 Applied Numerical Methods Engineering Problem Solving 45 / 45


Recommended