Sei sulla pagina 1di 84

Department of Agricultural Engineering

Bahauddin Zakariya University Multan


 Numerical Methods for Engineering Science
and Mathematics, 2nd Edition by Prof. Mumtaz
Khan
 Ordinary & Partial Differential Equations with
Numerical Techniques for Engineering Science
and Mathematics, 2nd Edition by Prof. Mumtaz
Khan
 Numerical Methods for Engineers by Steven C.
Chapra and Raymond P. Cannale
 Applied Numerical Methods with MATLAB by
Steven C. Chapra
 Linear Algebra & Calculus
 Differential Equations
 Computer Fundamentals
 Basis Programming Skills (MATLAB)
 Problem Solving Attitude
 Learning Motivation
 Hard work
 Attendance 5
 Mid Term 20
 Theory 30
 Class/Lab Quizzes 10
 Practical 15
 Lab 10
Numerical Methods:
 To solve complex numerical problems using
simple operations of arithmetic.
 Algorithms that are used to obtain numerical
solutions of a mathematical problem.
 Algorithm are complete descriptions of well
defined operations
Why do we need them?
1. No analytical solution exists,
2. An analytical solution is difficult to obtain
or not practical.
 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.
 Taylor Theorem  Solution of linear
 Number Representation Equations
 Solution of nonlinear  Least Squares curve
Equations fitting
 Interpolation  Solution of ordinary
 Numerical differential equations
Differentiation  Solution of Partial
 Numerical Integration differential equations

CISE301_Topic1 9
Chapter 01

Approximations and Errors


(Significant Figures, Errors, Precision and Accuracy)
Significant Figures:

A speedometer and odometer of a vehicle showing the significant figures


(Steven & Raymonds)
 0.00900
 0.049
 450
 450.
 10.0
 802.003
 73,000

Rules of Thumb!
> Non zero digits and zeros in b/w are significant
> Leading zeros not significant
> Trailing zeros: If decimal(count)
No decimal (ambiguous/not count)
 Numerical methods provide approximate soln. for
complex problems. The approx. soln. differs from the
exact soln. by a certain tolerance.
 Error: simply the difference or deviation of a
computed/measured quantity from exact/true value.
 Round Off error: Numbers are presented on a computer
by a finite number of bits and digits. For e.g. 2/3 =
0.6666….. = 0.6666(chopped off) and 0.6667 (rounded off)
 Truncation error: when approximations are used to
represent exact mathematical procedures. OR only some
of the terms are used in a series of expansion e.g. Taylor
Series expansion
A Taylor Series is a series expansion of a function about a point. A one-dimensional
Taylor series is an expansion of a real function about a point is given by
The Taylor series expansion of f ( x ) about a :
( 2) ( 3)
f ( a ) f (a )
f (a )  f ' (a ) ( x  a )  ( x  a )2  ( x  a ) 3  ...
2! 3!
or

1 (k )
Taylor Series   k!
f (a ) ( x  a )k
k 0
If the series converge, we can write :

1 (k )
f ( x)  ∑ f (a ) ( x  a )k
k 0
k!
Maclaurin series is a special case of Taylor series with the
center of expansion a = 0
The Maclauri n series expansion of f ( x ) :
( 2)
( 3)
( 0 f
) f ( 0) 3
f ( 0)  f ( 0) x 
'
x 
2
x  ...
2! 3!
If the series converge, we can write :

1
f ( x)  ∑ k!
f (k )
( 0) x k
k 0
For example;
𝑥3 𝑥5 𝑥7 𝑥9
sin x = 𝑥 − + − + ………. (1.1)
3! 5! 7! 9!
𝜋
So sin( )
can be determined exactly if infinite number
6
of terms are used. While we can only approximate the
value by using a finite number of terms
𝜋
𝜋 𝜋 ( 6 )3
 2 terms only: sin( ) = - = 0.4996742
6 6 3!
 While more terms would yield an answer close to
exact one.
 Sum of all the remaining terms = Truncation Error
PRECISION, ACCURACY AND TOLERANCE
 TOLERANCE: Acceptable error
 ACCURACY: Agreement between the
approximate result and true result. (directly linked
to error)
 PRECISION: No. of significant digits used in the
computation/measurement.
 Xtrue = 60 mm
X1 = 60.4 mm……first experiment(more accurate)
X2 = 60.66 mm… 2nd experiment (more precise)
 ITERATION: Each step in the algorithm until an
outcome of ‘acceptable tolerance’ is achieved.
ERROR DEFINITIONS:
1. True Error (when true value is known)
Absolute True Error
Et  true value  approximat ion
Absolute Percent Relative Error
true value  approximat ion
t  *100
true value
2. Approximate/Estimated Error: (when true value is not
know)
Estimated Absolute Error
Ea  current estimate  previous estimate
Estimated Absolute Percent Relative Error
current estimate  previous estimate
a  *100
current estimate
1. Graphical Method
2. Bracketing Method:
a. Bisection Method
b. Regula Falsi (False Position) Method
3. Open Methods:
a. Fixed Point Iteration Method
b. Newton Rhapson Method
c. Secant Method
 From the pdf notes
Inflection point or f”(x) =0

Oscillates abt local maxima


or minima (near zero slope)
Initial guess close to one root
can jump to a location several
roots away…

A zero slope f’(x)=0 is a disaster…


soln shoots off horizontally
 Addition of Matrices
 Subtraction of Matrices
 Multiplication of Matrices
 Multiplication of a Matrix by a scalar
 Transpose of Matrices
 Multiplication of a Matrix by its inverse leads to
identity matrix
 Trace of a Matrix (Sum of the elements on its
principal diagonal)
 Augmentation
Reduced matrix can be obtained by performing
elementary row operations. A matrix is reduced
matrix if it satisfies the following conditions:
1. Reading from left to right, the first non-zero
element in any non-zero row must be 1.
2. All matrix elements directly above or below any
leading entry are zero.
3. All zero rows lie below all non-zero rows.

4. The leading entries move downward to the


right as one looks at the matrix.
1 0 0 0 1 0
1 −4 0
0 1 0 0 0 1
0 0 1
0 0 1 0 0 0
 Elementary Row Operations;
Let A be a nxm matrix. We can define 3 types of
elementary row operations on rows of A.
1. Interchange 2 rows of A

2. Multiply a row of A by a non-zero scalar

3. Add a scalar multiple of one row to another


row of A
DIRECT METHODS

 Graphical Methods
 Crammer’s Rule
 Gauss Elimination Rule
 LU Decomposition Method

INDIRECT METHODS:

 Gauss Jacobi Method


 Gauss Seidel Metod
 Hand Written Notes

Potrebbero piacerti anche