Chapter I

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Numerical and Computational

Methods with Matlab


[IEng3042]
Chapter one
1. Fundamentals of Numerical
methods:
• Mathematical Modeling,
• Engineering problem solving,
• Number System ,
• Error analysis and solution of
nonlinear equation
1
Introduction to MATLAB

• What is Matlab?

• What is possible in Matlab? graphic examples


• How Matlab works? matrix, vector & scalar
syntax& important operators basic commands & plot
commands creating a m-file.
• The name MATLAB stands for Matrix laboratory(or
mathematical laboratory)
2
Cont..

• MATLAB is an interactive system whose basic


data element is an array that does not require
dimensioning.
• It's both a computer programming language,
and a software environment for using that
language effectively.

3
Typical Uses

Math and computation

• Algorithm development

• Modeling, simulation, and prototyping

• Data analysis, exploration, and visualization

• Scientific and engineering graphics

• Application development including


4
The Basic Matlab System

It consists of 5 main parts:


– Development Environment.
– MATLAB Mathematical Function Library.
– MATLAB Language.
– Graphics.
– MATLAB External and Internal faces

5
Mathematical Modeling and simulation:

• Mathematical modeling
models: are a representations of a particular thing, idea or
condition in the reality.
A mathematical model : can be broadly defined as a
formulation or equation that express the essential features of a
physical system or process in mathematical terms. In a very
general sense, it can be represented as a functional relationship
of the form:
Dependent variable = f(independent variables; parameters;
forcing functions)

6
Mathematical Modeling and simulation:

7
Mathematical Modeling and simulation:

• Dynamic analysis can be carried out most


conveniently by adopting the following three-stage
approach:
• Stage I. Devise a mathematical or physical model of
the system to be analysed.
• Stage II. From the model, write the equations of
motion.
• Stage III. Evaluate the system response to relevant
specific excitation

8
Cont.

Stage 1. The mathematical model


• A simplified mathematical model of the system is
therefore usually sought which will, when analysed,
produce the desired information as economically as
possible and with acceptable accuracy.
• The derivation of a simple mathematical model to
represent the dynamics of a real system is not easy,
if the model is to give useful and realistic
information.

9
Cont.
Stage 1. The mathematical model

Machine tool vibration analysis model. 10


ACCURACY OF NUMBERS

Exact number: Number with which no uncertainly is associated to no


approximation is taken, are known as exact numbers e.g., 5, 21/6, 12/3, ... etc.
are exact numbers.

Approximate Number: There are numbers, which are not exact, e.g., =
1.41421 ..., e = 2.7183 ...., etc. are not exact numbers since they contain
infinitely many non-recurring digits. Therefore the numbers obtained by
retaining a few digits, are called approximates numbers, e.g., 3.142, 2.718 are
the approximate values of π and e.

Significant Figure :The significant figures are the number of digits used to
express a number. The digits 1, 2, 3, 4, 5, 6, 7, 8, 9 are significant digits. ‘0’ is
also a significant figure except when it is used to fix the decimal point or to fill
the places of unknown or discarded digits. For example, each number 5879,
3.487, 0.4762 contains four significant figures while the numbers 0.00486,
0.000382, 0.0000376 contains only three significant figures since zeros only
help to fix the position of the decimal point. Similarly, in the number
0.0002070, the first four ‘0’s are not significant figure since they serve only to
fix the position of decimal point and indicate the place values of the other
digits. The other two ‘0’s are significant.
12
Error analysis and solution of nonlinear equation

• Error = True value – Approximate value.


• The errors may be divided into the following different types:
a) inherent error
The inherent error is that quantity which is already present in
the statement of the problem before its solution. The inherent
error arises either due to the simplified assumptions in the
mathematical formulation of the problem or due to the errors in
the physical measurements of the parameters of the problem.
• Inherent error can be minimized by obtaining better data, by
using high precision computing aids and by correcting
obvious errors in the data.

13
Error analysis and solution of nonlinear equation

b) round-off error :
• The round-off error is the quantity, which arises from the
process of rounding off numbers. It sometimes also called
numerical error. Also round off denote a quantity, which must
be added to the finite representation of a compound number
in order to make it the true representation of that number.
• The round-off error can be reduced by carrying the
computation to more significant figures at each step of
computation. At each step of computations, retain at least one
more significant figure than that given in the data, perform
the last operation, and then round off.

14
Error analysis and solution of nonlinear equation

c) Absolute error :
• Absolute error is the numerical difference between the true
value of a quantity and its approximate value. Thus if x’ is the
approximate value of quantity x then |x − x′| is called the
absolute error and denoted by . Therefore = |x − x′| . The unit
of exact or unit of approximate values expresses the absolute
error.
d)relative error
• The relative error defined by = = . Where x’ is the
approximate value of quantity x. The relative error is
independent of units.

15
Error analysis and solution of nonlinear equation

e) percentage error :
The percentage error in x′ which is the approximate value of x is
given by = *100. The percentage error is also independent of
units.
Example 1 Round-off the number 75462 to four significant digits
and then calculate its absolute error, relative error and
percentage error.
Solution: After rounded-off the number to four significant digits
we get 75460. Therefore Absolute Error = |75462- 75460|= 2
Relative Error ===0.0058
Percentage Error =× 100 = 0.00265.

16
Error analysis and solution of nonlinear equation
Example 2 Round-Three approximate values of number are given as 0.30,
0.33 and 0.34. Which of these three is the best approximation?
Solution .
The number, which has least absolute error, gives the best approximation.
True value x = 0.333333
• When approximate value x′ is 0.30 the Absolute Error is given by:
= |x − x′| = |0.33333 -0.30|= 0.03333
• When approximate value x′ is 0.33 the Absolute Error is given by:
= |x − x′| = |0.33333 -0.33|= 0.00333
• When approximate value x′ is 0.34 the Absolute Error is given by:
= |x − x′| = |0.33333 -0.34|= 0.00667
Here absolute error is least when approximate value is 0.33. Hence 0.33 is the
best approximation.

17

You might also like