You are on page 1of 34

MATH2059

NUMERICAL METHODS
References
Numerical Methods for Engineers, 7th Ed., Steven C. Chapra and
Raymond P. Canale, McGraw-Hill

Contact
Dr. Özge Kerkez Kuyumcu
ozge.kuyumcu@marmara.edu.tr
CHAPTER 1
Introduction, Modeling and Error
Analysis
INTRODUCTION

Numerical methods are techniques by which mathematical problems are formulated so


that they can be solved with arithmetic operations.

Although there are many kinds of numerical methods, they have one common characteristic:
they invariably involve large numbers of tedious arithmetic calculations.

It is little wonder that with the development of fast, efficient digital computers, the role of
numerical methods in engineering problem solving has increased dramatically in recent years.
In the precomputer era there were generally three different ways in which engineers approached
problem solving:

1. Solutions were derived for some problems using analytical, or exact, methods. These
solutions were often useful and provided excellent insight into the behavior of some systems.
However, analytical solutions can be derived for only a limited class of problems. These
include those that can be approximated with linear models and those that have simple
geometry and low dimensionality. Consequently, analytical solutions are of limited practical
value because most real problems are nonlinear and involve complex shapes and processes.

2. Graphical solutions were used to characterize the behavior of systems. These graphical
solutions usually took the form of plots or nomographs. Although graphical techniques can
often be used to solve complex problems, the results are not very precise. Furthermore,
graphical solutions (without the aid of computers) are extremely tedious and awkward to
implement. Finally, graphical techniques are often limited to problems that can be described
using three or fewer dimensions.
3. Calculators and slide rules were used to implement numerical methods manually. Although in
theory such approaches should be perfectly adequate for solving complex problems, in actuality
several difficulties are encountered. Manual calculations are slow and tedious. Furthermore,
consistent results are elusive because of simple blunders that arise when numerous manual
tasks are performed.

Today, computers and numerical methods provide an alternative for such complicated calculations.

Using computer power to obtain solutions directly, you can approach these calculations without recourse to
simplifying assumptions or time-intensive techniques. Although analytical solutions are still extremely valuable
both for problem solving and for providing insight, numerical methods represent alternatives that greatly
enlarge your capabilities to confront and solve problems.

As a result, more time is available for the use of your creative skills.
To introduce you to the types of mathematical subject areas

1. Roots of Equations

Roots of equations
Solve f(x) = 0 for x.

These problems are concerned with the value of a variable or a parameter that satisfi es a single
nonlinear equation. These problems are especially valuable in engineering design contexts where it
is often impossible to explicitly solve design equations for parameters.
2. Systems of Linear Algebraic Equations

Linear algebraic equations


Given the a’s and the c’s, solve
a11x1 + a12x2 = c1
a21x1 + a22x2 = c2
for the x’s.

These problems are similar in spirit to roots of equations in the sense that they are concerned with
values that satisfy equations. However, in contrast to satisfying a single equation, a set of values
is sought that simultaneously satisfi es a set of linear algebraic equations.
3. Optimization

Determine x that gives optimum f(x).

These problems involve determining a value or values of an independent variable that correspond to a
“best” or optimal value of a function. Optimization involves identifying maxima and minima. Such
problems occur routinely in engineering design contexts.
4. Curve Fitting

You will often have occasion to fit curves to data points. The techniques developed for this purpose can
be divided into two general categories: regression and interpolation. Regression is employed where
there is a significant degree of error associated with the data.
Interpolation is used where the objective is to determine intermediate values between relatively
error-free data points. Such is usually the case for tabulated information.
5. Integration

𝑏
I = ‫𝑥𝑑 𝑥 𝑓 𝑎׬‬
Find the area under the curve.

A physical interpretation of numerical integration is the determination of the area under a curve.
Integration has many applications in engineering practice, ranging from the determination of the
centroids of oddly shaped objects to the calculation of total quantities based on sets of discrete
measurements.
6. Ordinary Differential Equations

𝑑𝑦 ∆𝑦
≈ = 𝑓(𝑡, 𝑦)
𝑑𝑥 ∆𝑥

solve for y as a function of t.

𝑦𝑖+1 = 𝑦𝑖 + 𝑓(𝑡𝑖 , 𝑦𝑖 )∆𝑡

Ordinary differential equations are of great significance in engineering practice. This is because
many physical laws are couched in terms of the rate of change of a quantity rather than the
magnitude of the quantity itself. Examples range from population-forecasting models (rate of
change of population) to the acceleration of a falling body (rate of change of velocity).
Two types of problems are addressed: initial-value and boundary-value problems.
7. Partial Differential Equations

𝜕2𝑢 𝜕2𝑢
+ = 𝑓(𝑥, 𝑦)
𝜕𝑥 2 𝜕𝑦 2

solve for u as a function of


x and y.

Partial differential equations are used to characterize engineering systems where the behavior
of a physical quantity is couched in terms of its rate of change with respect to two or more
independent variables. Examples include the steady-state distribution of temperature on a
heated plate (two spatial dimensions) or the time-variable temperature of a heated rod (time
and one spatial dimension).
MATHEMATICAL MODEL

A mathematical model can be broadly defi ned as a formulation or equation that expresses
the essential features of a physical system or process in mathematical terms.

External influences acting


Reflects the behaviour or Usually dimensions System
upon the system
state of the system such as time and space properties or
compositions
A model can be derived by expressing the acceleration as the
Upward force due to air resistance time rate of change of the velocity (dv / dt)

Downward force due to gravity The parameter c accounts for properties of the falling object, such as shape or
surface roughness, that affect air resistance.
a model that relates the acceleration of a falling object to the forces
acting on it.

In contrast to the solution of Newton’s second law, the exact solution of this eq. for the velocity
of the falling parachutist cannot be obtained using simple algebraic manipulation.

More advanced techniques, such as those of calculus, must be applied to obtain an exact or
analytical solution.
𝑣 𝑡
𝑐
න 𝑑𝑣 = න 𝑔 − 𝑣 𝑑𝑡 if the parachutist is initially at rest (v=0 at t=0)
𝑚
0 0

I
Analytical Solution

A parachutist of mass 68.1 kg jumps out of a stationary hot air balloon. Use Eq. I to compute
velocity prior to opening the chute. The drag coefficient is equal to 12.5 kg/s.
There are many mathematical models that cannot be solved exactly. In many of these cases, the
only alternative is to develop a numerical solution that approximates the exact solution.
Numerical methods are those in which the mathematical problem is reformulated so it can be
solved by arithmetic operations.

Finite divided difference approximation


ıı

New value Old value Slope Step size


Numerical Solution

Perform the same computation as in parachutist example but use Eq. II to compute the
velocity. Employ a step size of 2 s for the calculation.
ERROR ANALYSIS

• identification, quantification, and minimization of errors

• two major forms of numerical error:


Round-off error
Truncation error

• Round-off error is due to the fact that computers can represent only quantities with a finite
number of digits.

• Truncation error is the discrepancy introduced by the fact that numerical methods may employ
approximations to represent exact mathematical operations and quantities.

• blunders, formulation or model errors and data uncertainty.


SIGNIFICANT FIGURES
Visual inspection of the speedometer indicates that the
car is traveling between 48 and 49 km/h. Because the
indicator is higher than the midpoint between the markers
on the gauge, we can say with assurance that the car is
traveling at approximately 49 km/h. We have confi dence
in this result because two or more reasonable individuals
reading this gauge would arrive at the same conclusion.

If we insist that the speed be estimated to one decimal


place,
one person might say 48.8, whereas another might say
48.9 km/h.
Therefore, because of the limits of this instrument, only
the first two digits can be used with confidence.
automobile is traveling at 48.8642138 km/h

The significant digits of a number are those that can be used with confidence.
They correspond to the number of certain digits plus one estimated digit.
For the speedometer, the two certain digits are 48. It is conventional to set the estimated digit at one-half
of the smallest scale division on the measurement device. Thus the speedometer reading would consist
of the three significant figures: 48.5.

The numbers
0.00001845, 0.0001845, and 0.001845 all have four significant figures.

0.00180045 has six significant figures.

The number 45300 may have three, four, or five significant digits, depending on whether the
zeros are known with confidence.
With using scientific notation,
4.53 x 104, 4.530 x 104, 4.5300 x 104 designate that the number is known to three, four, and five
significant figures.
Accuracy refers to how closely a computed or measured value agrees with the true value.
Precision refers to how closely individual computed or measured values agree with each other.
ERROR DEFINITIONS

These include truncation errors, which result when approximations are used to represent exact
mathematical procedures, and
round-off errors, which result when numbers having limited significant figures are used to represent exact
numbers.

Et is used to designate the exact value of the error. The subscript t is included to
designate that this is the “true” error.
where 𝜀𝑡 designates the true percent relative error.
For numerical methods, the true value will be known only when we deal with functions that can be
solved analytically.

In real-world applications, we will obviously not know the true answer a priori. For these situations,
an alternative is to normalize the error using the best available estimate of the true value, that is,
to the approximation itself.

where the subscript a signifies that the error is normalized to an approximate value.

iterative approach

If this relationship holds, our result is assumed to be within the prespecified


acceptable level 𝜀𝑠 .
Example: Error Estimates for Iterative Methods

the exponential function can be computed using Maclaurin series expansion.

Thus, as more terms are added in sequence, the approximation becomes a better and better
estimate of the true value of 𝑒 𝑥 .

𝜀𝑠 = 0.05%

Starting with the simplest version 𝑒 𝑥 = 1 add terms one at a time to estimate 𝑒 0.5

Note that the true value


approximate estimate of the error

0.52
𝑒 0.5 = 1 + 0.5 +
2

You might also like