Docsity

Introduction to Numerical Computation-Numerical Analysis-Lecture Slides, Slides of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Lecture #1 1
Introduction to Numerical Computation:
Many engineering analysis and design problems are far too complex to be solved without
the aid of computers. However, the use of computers in problem solving has made it
increasingly necessary for users to be highly skilled in (practical) mathematical analysis.
There are a number of reasons for this. A few are as follows. For one thing, computers
represent data to finite precision. Irrational numbers such as
π
and 2 do not have an
exact representation on a digital computer (with the possible exception of methods based
on symbolic computing). Additionally, when arithmetic is performed, errors occur as a
result of rounding. Numbers have a limited dynamic range; we might get overflow
(magnitude greater than ) or underflow (magnitude less than ) in a
computation and typically cause the computation to halt. These are examples of finite-
precision arithmetic effects. Beyond this, computational methods frequently have sources
of error independent of these. For example, an infinite series must be truncated if it is to
be evaluated on a computer. The truncation error is something “additional” to errors from
finite-precision arithmetic effects. In all cases, the sources (and sizes) of error in a
computation must be known and understood in order to make sensible claims about the
accuracy of a computer-generated solution to a problem.
1024
21023
2−
Many methods are “iterative.” Accuracy of the result depends on how much iteration is
performed. It is possible that a given method might be very slow, requiring much
iteration before achieving acceptable accuracy. This could involve much computer
runtime. The obvious solution of using a faster computer is usually unacceptable. A
better approach is to use mathematical analysis to understand why a method is slow, and
so to devise methods of speeding it up. Thus, an important feature of analysis applied to
computational methods is that of assessing how much in the way of computing resources
is needed by a given method. A given computational method will make demands on
computer memory, operations count (the number of arithmetic operations, function
evaluations, data transfers, etc.), number of bits in a computer word, and so on. A given
problem almost always has many possible alternative solutions. Other than accuracy and
computer resource issues, ease of implementation is also relevant. This is a human labor
issue. Some methods may be easier to implement on a given set of computing resources
than others. This would have an impact on software/hardware development time, and
hence on system cost. Again, mathematical analysis is useful in deciding on the relative
ease of implementation of competing solution methods.
The subject of numerical computing is truly vast. Methods are required to handle an
immense range of scientific problems, such as solution of differential equations (ordinary
or partial), integration, solution of equations and systems of equations (linear or
nonlinear), approximation of functions, and optimization. These problem types appear to
be radically different from each other. In some sense the differences between them are
true, but there are means to achieve some unity of approach in understanding them.
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
number of tedious arithmetic calculations. It is little wonder that with the development of
fast efficient digital computers, the role of numerical methods in science and engineering
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Introduction to Numerical Computation-Numerical Analysis-Lecture Slides and more Slides Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Introduction to Numerical Computation:

Many engineering analysis and design problems are far too complex to be solved without the aid of computers. However, the use of computers in problem solving has made it increasingly necessary for users to be highly skilled in (practical) mathematical analysis. There are a number of reasons for this. A few are as follows. For one thing, computers

represent data to finite precision. Irrational numbers such as π and 2 do not have an

exact representation on a digital computer (with the possible exception of methods based on symbolic computing). Additionally, when arithmetic is performed, errors occur as a result of rounding. Numbers have a limited dynamic range; we might get overflow

(magnitude greater than ) or underflow (magnitude less than ) in a computation and typically cause the computation to halt. These are examples of finite- precision arithmetic effects. Beyond this, computational methods frequently have sources of error independent of these. For example, an infinite series must be truncated if it is to be evaluated on a computer. The truncation error is something “additional” to errors from finite-precision arithmetic effects. In all cases, the sources (and sizes) of error in a computation must be known and understood in order to make sensible claims about the accuracy of a computer-generated solution to a problem.

21024 2 −^1023

Many methods are “iterative.” Accuracy of the result depends on how much iteration is performed. It is possible that a given method might be very slow, requiring much iteration before achieving acceptable accuracy. This could involve much computer runtime. The obvious solution of using a faster computer is usually unacceptable. A better approach is to use mathematical analysis to understand why a method is slow, and so to devise methods of speeding it up. Thus, an important feature of analysis applied to computational methods is that of assessing how much in the way of computing resources is needed by a given method. A given computational method will make demands on computer memory, operations count (the number of arithmetic operations, function evaluations, data transfers, etc.), number of bits in a computer word, and so on. A given problem almost always has many possible alternative solutions. Other than accuracy and computer resource issues, ease of implementation is also relevant. This is a human labor issue. Some methods may be easier to implement on a given set of computing resources than others. This would have an impact on software/hardware development time, and hence on system cost. Again, mathematical analysis is useful in deciding on the relative ease of implementation of competing solution methods. The subject of numerical computing is truly vast. Methods are required to handle an immense range of scientific problems, such as solution of differential equations (ordinary or partial), integration, solution of equations and systems of equations (linear or nonlinear), approximation of functions, and optimization. These problem types appear to be radically different from each other. In some sense the differences between them are true, but there are means to achieve some unity of approach in understanding them.

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 number of tedious arithmetic calculations. It is little wonder that with the development of fast efficient digital computers, the role of numerical methods in science and engineering

problem solving has increased dramatically in recent years. A working knowledge of numerical methods is highly valuable tool for researcher and scientist in all fields. However, there are some difficulties stem from many causes, including the following:

  1. No complex physical situation can be exactly simulated by mathematical model.
  2. No numerical method is completely trouble-free in all situations.
  3. No numerical method is completely error-free.
  4. No numerical method is optimal for all situations.

Error Analysis

In this course we will be dealing extensively with approximations connected with manipulation of numbers. Consequently, before discussing the error associated with numerical methods, it is useful to review basic concepts related to approximate representation of numbers themselves.

Significant digits

The concept of a significant digit has been developed to formally designate the reliability of a numerical value. 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 example; the numbers 3.1416, 0.6667 and 4.0687 contain five significant digits each.

The number 0.00023 has, however, only two significant digits, viz 2 and 3, since the zeros serve only to fix the position of decimal point. The numbers 0.00001845, 0.0001845 and 0.001845 all have four significant digits. For example, at face value the number 453300 may have three, four or five significant digits depending on whether the zeros are known with confidence. Such uncertainty can be resolved by scientific notation, where , and designate that number is known to three, four and five significant digits respectively.

4.53 × 104 4.530 × 104 4.5300 × 104

The concept of significant digits has two important implications for our study of numerical methods.

  1. We must specify how confident we are in our approximate result. One way to do this is in terms of significant digits. For example, we might decide that our approximation is acceptable if it is correct to four significant digits.

2. For Example, π , e , 7 represent specific quantities, they cannot be expressed

exactly by a limited number of digits i.e., π = 3. 141592653589793238462643 ...because computer retain only a finite number of significant digits, such numbers can never be represented exactly.

Significant digits conventionally follow certain sets of rules such that:

  • All non-zero digits are significant. e.g., 87.636 has five significant digits.
  • Any zeros that are between non-zero numbers are significant e.g., 40.02 has four significant digits.
  • Any zero that follows immediately to the right of the decimal place in numbers smaller than one is not significant e.g., 0.00057 has two significant figures.

x = 3. 241 be the exact value x ∗= 3. 23 be the computed value, than

3

= × =

= = = = ×

−

∗

PE RE

x

AE

RE

AE x x

Sources of errors:

The main sources of errors are

  1. Gross errors,
  2. rounding errors,
  3. truncation/ approximation errors. Gross errors: These errors are not directly concerned with numerical methods or computation. It is caused either by human mistake or by the computer or it may be due to the inherent imperfections of physical measurements.
  • Misreading or misquoting the figures, particularly in the interchanges of adjacent digits.
  • Use of inaccurate mathematical formula (algorithm) to solve a particular problem
  • Use of an inaccurate data. Rounding or roundoff error The roundoff errors arise from the fact that computers retain only a fixed number of

significant digits during calculation. Number such as π , e or 7 can not be expressed by

fixed numbers of significant digits. Therefore, they cannot be represented exactly by the computer. In addition, because computers use base 2 representations, they cannot precisely represent certain exact base 10 numbers. This discrepancy introduced by this omission of significant digits is called roundoff error. There are two ways of performing omission of the significant digits

Chopping Simply choppoff the remaining digits e.g., 0. 142857 ≈ 0. 142 (chopping at after three decimal places) π = 3. 14159265358 ≈ 3. 141592 (chopoff the at 8th^ and higher terms) Rounding

  1. 142857 ≈ 0. 143 (rounding at 5th^ digits, this is roundup because the next digit 8>5) 0.142857 ≈ 0.14 (rounding at 4th^ digits, this is rounddown because the next digit 2<5) The effect of roundoff error can be reduced by using high-order-digit arithmetic such as the double-or multiple-precision option available on most computers. Disadvantage in using double-precision arithmetic are that it takes more computation time and the growth of roundoff error is not eliminated but in only postponed until subsequent computations are performed.

Taylor Series

Suppose f ∈ Cn^ [ a , b ], that f (^ n +^1 )exists on[ a , b ], and x 0 ∈ [ a , b ]. For every , there

exist a number

x ∈ [ a , b ]

ξ ( ) x between x 0 and x with f ( x )= Pn ( x ) + Rn ( x ) , where

∑ (^ )

=

n

k

k k

n n n

x x k

f x

x x n

f x x x

f x P x f x f x x x

0

0

0

()

0

0

() 2 0

0

// 0 0

/ 0

and

( 1 )

1!

−

= n

n n x x n

f x R x

Here is called the nth Taylor polynomial for about , and is called the

remainder term (or truncation error) associated with

Pn ( ) x f x 0 R n ( ) x

Pn ( x ). The infinite series obtained by

taking the limit of Pn ( ) x as n →∞is called the Taylor series for f about x 0. When x 0 = 0 ,

the Taylor series is called Maclaurin series. For Example

... !

x (^) = 1 + + (^2) + (^3) + + xn + n

e x x x

Note that the Taylor polynomial Pn ( x )is the ( n + 1 )st term for the sequence of partial

sum of the Taylor series for f ( ) x at c.

P ( ) x f ( ) x Rn ( ) x f ( x ) f ( x )

n n n n

→∞ →∞ →∞ lim lim lim 0 which show that the sequence of

partial sums converge to f ( ) x.

Truncation/ approximation errors. The term truncation error refers to the error involved in using a truncated, or a finite summation to approximate the sum of an infinite series.

See example 3.