MODULE 5
SARATH CHANDRAN KG
Sarath chandran K G
ASST. PROF., SCTCE
1
TRIVANDRUM
INTRODUCTION
Problems can be solved analytically and numerically.
1. An analytical solution involves framing the problem in a well-understood form and
calculating the exact solution.
2. A numerical solution means making guesses at the solution and testing whether the
problem is solved well enough to stop.
ERRORS AND APPROXIMATIONS
Types of Errors
SIGNIFICANT DIGITS
• Some numbers cannot be represented exactly in a given number of decimal digits
• Eg: π = 3.1415926535897932384626……..
• These kind of numbers will be approximated to 3.14 or 3.14159 or 3.14159265
• Here, we can say that the numbers have 3,6 and 9 significant digits respectively.
Following statements describe notation of significant figures:
1. All non-zero digits are significant
2. All zeros occurring between non-zero digits are significant
3. Trailing zeros following decimal point are significant
Eg: 3.50, 65.0 and 0.230 has three significant numbers
4. Zeros between decimal point and preceding non-zero digit are not
significant
Eg: 0.0001234, 0.001234 and 0.01234 have four significant numbers
5. When there is no decimal point, trailing zeros are not considered to be
significant
Eg: 4500 has two significant numbers
Q. Determine the relative error, absolute error, relative % error and significant digits 22/7 is
approximated as 3.1414
Solution:
True value = 22/7 = 3.14285714….
Approximate value = 3.1414
Absolute error = | (22/7) – 3.1414| =0.0013571428…
Relative error = Absolute error/ True value = | (22/7) – 3.1414| / |(22/7)|
= 0.0004318181….
Relative % error= Relative error x 100 = 0.04318181…
Number of significant digits = 3
Accuracy.
How close is a computed or measured value to the true value
Precision (or reproducibility).
How close is a computed or measured value to previously computed or measured
values.
Inaccuracy (or bias).
A systematic deviation from the actual value.
Imprecision (or uncertainty).
Magnitude of scatter.
Accuracy:
It also refers to the number of significant digits in a value .
Eg: 57.396 is accurate to five significant digits
Precision:
Also, refers to the number of decimal positions. i.e, the order of magnitude of
the last digit in a value.
Eg: 57.396 has a precision of 0.001 or 10-3
Linear Equations
• Any equation containing a single variable can be written in the form, f(x) = 0
•Where, x is a scalar variable
• The specific values of x which satisfy the equation are called the roots of the equation
• If the order of the equation is n, it will have n roots
• An equation of the first order is called a linear equation
F(x) = ax+b =0 has a single root,i.e x= - b/a
• Similarly, we know regarding quadratic equation
• Cubic and Quartic equations also have methods to get exact roots, but, we prefer
iterative / numerical methods for finding the approximate solutions are adopted
System of Linear Equations
In practice, Linear equations can occur in more than two variables
a1x1 + a2x2 + a3x3 +… anxn = b
The main concern is to solve for xi
If we need a unique solution of an equation with n variables, then we need a
set of n such independent equations. This set of equations is known as system
of simultaneous equations
To solve the above system of equations, there are many methods. We will
dicuss the following methods.
1. Gauss Elimination Method
2. Gauss-Jordan Method
3. Gauss-Siedel iterative Method
Gauss Elimination Method
Steps:
1. Set the augmented matrix
2. Using raw operation, create upper triangular matrix
3. Find the solution for the variables.
Interpolation
• Determination or estimation of the value of f(x), or a function of x, from certain
known values of the function.
• If x0 < … < xn and y0 = f(x0),…, yn = f(xn) are known, and if x0 < x < xn, then the
estimated value of f(x) is said to be an interpolation.
• If x < x0 or x > xn, the estimated value of f(x) is said to be an extrapolation.
PROGRAMS
1. cpp pograms\module 5\5.1 Gauss-Jordan [Link]
2. cpp pograms\module 5\5.2 Gauss elimination [Link]
3. cpp pograms\module 5\5.3 Gauss-Seidel [Link]
4. cpp pograms\module 5\5.4 [Link]
5. cpp pograms\module 5\5.5 Newton-Gregory forward [Link]
6. cpp pograms\module 5\5.6 Aitken's [Link]
Courtesy: Govind S Nair, U5-2022 Pass out for helping and testing the above programs
Sarath chandran K G 56