Chapter I
Chapter I
Chapter I
• What is Matlab?
3
Typical Uses
• Algorithm development
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:
8
Cont.
9
Cont.
Stage 1. The mathematical model
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
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