SlideShare a Scribd company logo
computing discrete
approximation of solution
of linear simultaneous
equation
JMHM Jayamaha
Content
 Linear Equations
 What is Linear Equations
 Method for solving the system of linear equations
 Direct Method
 Gauss Elimination method
 LU Decomposition
 Iterative method
 Jacobi's method
 Gauss Seidal method
Linear Equations
What is Linear Equations
 A linear equation is an algebraic equation in which each term is either
a constant or the product of a constant and (the first power of) a
single variable.
Two methods for solving the system of linear
equations
 Direct Method
 Solutions are obtained through a finite number of arithmetic operations
 Gauss Elimination method
 LU Decomposition
 Iterative Method:
 Solutions are obtained through a sequence of successive approximations
which converges to the required solution
 Jacobi's method
 Gauss Seidal method
GAUSS – ELIMINATION METHOD
GAUSS – ELIMINATION METHOD
Consider a system of 3 – equations with 3 – unknowns
)1(
3333232131
2323222121
1313212111








bxaxaxa
bxaxaxa
bxaxaxa
Form the augmented matrix from the given equations as










3333231
2232221
1131211
baaa
baaa
baaa



1
11
21
22operationrowtheUse R
a
a
RR 
1
11
31
33operationrowtheUse R
a
a
RR 
If a11  0
New augmented matrix will be










'''0
'''0
33332
22322
1131211
baa
baa
baaa



2
22
32
33
'
'
operationrowtheUse R
a
a
RR 
New augmented matrix will be










''''00
'''0
333
22322
1131211
ba
baa
baaa



If a22’  0
From the last matrix, the equations can be written as
''''
'''
3333
2323222
1313212111
bxa
bxaxa
bxaxaxa



Use back substitution to get the solution as
11
3132121
1
22
3232
2
33
3
3
,
'
''
,
''
''
a
xaxab
x
a
xab
x
a
b
x





Gauss Elimination method Matlab Implementation
function x = Gauss(A,b);
n = length(b); x = zeros(n,1);
for k=1:n-1 % forward elimination
for i=k+1:n
xmult = A(i,k)/A(k,k);
for j=k+1:n
A(i,j) = A(i,j)-xmult*A(k,j);
end
b(i) = b(i)-xmult*b(k);
end
end
% back substitution
x(n) = b(n)/A(n,n);
for i=n-1:-1:1
sum = b(i);
for j=i+1:n
sum = sum-A(i,j)*x(j);
end
x(i) = sum/A(i,i);
end
LU Decomposition
 Matrix A is decomposed into a product of a lower triangular
matrix L and an upper triangular matrix U, that is A = LU or































100
10
1
0
00
23
1312
333231
2221
11
333231
232221
131211
u
uu
lll
ll
l
aaa
aaa
aaa
Matrices L and U can be obtained by the following rule
1. Step 1: Obtain l11 = a11, l21 = a21, l31 = a31
11
13
13
11
12
12 ,Obtain:2Step.2
a
a
u
a
a
u 
3. Step 3: Obtain l22 = a22 – l21u12
 132123
22
23
1
Obtain:4Step.4 ula
l
u 
5. Step 5: Obtain l32 = a32 – l31u12
6. Step 6: Obtain l33 = a33 – l31u13 – l32u23
Once lower and upper triangular matrices are obtained the
solution of Ax = b can be obtained using the procedure
Ax = b  LUx = b
Let Ux = y
then
LUx = b  Ly = b
Steps to get the solution of linear equations
































3
2
1
3
2
1
333231
2221
11
0
00
b
b
b
y
y
y
lll
ll
l
bLy
 
 2321313
33
3
1212
22
2
11
1
1
1
and
1
,where
ylylb
l
y
ylb
l
y
l
b
y


By Forward substitution
































3
2
1
3
2
1
23
1312
100
10
1
Now
b
b
b
x
x
x
u
uu
bUx
31321211
3232233 ,where
xuxuyx
xuyxyx


By Backward substitution
Matlab Implementation for LU Decomposition
Iterative methods
The Jacobi Method
The Jacobi Method
 This method makes two assumptions
1. that the system given by has a unique solution
2. the coefficient matrix A has no zeros on its main diagonal
 To begin the Jacobi method, solve the first equation for x1 the second
equation for x2 and so on, as follows.
 Then make an initial approximation of the solution,
Algorithm
 Example
 To begin, write the system in the form
 Because you do not know the actual solution, choose
 as a convenient initial approximation. So, the first approximation is
 Continuing this procedure, you obtain the sequence of approximations shown
in Table
 Because the last two columns in Table are identical, you can conclude that to
three significant digits the solution is
Matlab Implementation for jacobi method
Iterative methods
The Gauss-Seidel Method
 Gauss-Seidel iteration is similar to Jacobi iteration, except that new
values for xi are used on the right-hand side of the equations as soon
as they become available.
 It improves upon the Jacobi method in two respects
 Convergence is quicker, since you benefit from the newer, more accurate
xi values earlier.
 Memory requirements are reduced by 50%, since you only need to keep
track of one set of xi values, not two sets.
Algorithm
 Example

 Step 1: reformat the equations, solving the first one for x1, the second for x2,
and the third for x3
 Step 2a: Substitute the initial guesses for xi into the right-hand side of the
first equation
 Step 2b: Substitute the new x1 value with the initial guess for x3 into the
second equation
 Step 2c: Substitute the new x1 and x2 values into the third equation
 Step 3, 4, · · · : Repeat step 2 and watch for the xi values to converge to an
exact solution.
Matlab Implementation of Gauss-Seidel Method
Summary
 Solution of linear simultaneous are discussed.
 Two methods
 Direct
 Gauss Elimination method
 LU Decomposition
 Iterative
 Jacobi's method
 Gauss Seidal method
References
 https://en.wikipedia.org/wiki/Linear_equation(2016-06-15)
 http://homel.vsb.cz/~dom033/predmety/parisLA/02_direct_methods.pdf
 Numerical computational methods by P.B Patill , U.P Verma
 http://college.cengage.com/mathematics/larson/elementary_linear/5e/stud
ents/ch08-10/chap_10_2.pdf
 http://ocw.usu.edu/Civil_and_Environmental_Engineering/Numerical_Method
s_in_Civil_Engineering/NonLinearEquationsMatlab.pdf
 http://people.whitman.edu/~hundledr/courses/M467/GaussSeidel.pdf

More Related Content

PPTX
Runge kutta
PPTX
Presentation on Solution to non linear equations
PPT
Introduction to Differential Equations
PPTX
Jacobi method
PPTX
Interpolation
PPTX
Matrices and System of Linear Equations ppt
PDF
9.1 Systems of Linear Equations
PPT
Newton raphson method
Runge kutta
Presentation on Solution to non linear equations
Introduction to Differential Equations
Jacobi method
Interpolation
Matrices and System of Linear Equations ppt
9.1 Systems of Linear Equations
Newton raphson method

What's hot (20)

PPTX
Gauss jordan method.pptx
PDF
Higher order differential equations
PPTX
ROOT OF NON-LINEAR EQUATIONS
PPT
Solving systems of Linear Equations
PPTX
Interpolation In Numerical Methods.
PPT
systems of linear equations & matrices
PPTX
Numerical analysis ppt
DOCX
Numerical Integration Project Report
PPT
1st order differential equations
PPTX
Direct Methods to Solve Linear Equations Systems
PDF
Numerical method for solving non linear equations
PPTX
Trapezoidal rule
PPTX
Secant Method
PPTX
Eigen value and eigen vector
PPSX
Introduction to Function, Domain and Range - Mohd Noor
PPTX
arijit ppt (1) (1).pptx
PDF
Introduction of Partial Differential Equations
PPTX
Second order homogeneous linear differential equations
PDF
Numerical Solution of Ordinary Differential Equations
PPTX
Lu Decomposition
Gauss jordan method.pptx
Higher order differential equations
ROOT OF NON-LINEAR EQUATIONS
Solving systems of Linear Equations
Interpolation In Numerical Methods.
systems of linear equations & matrices
Numerical analysis ppt
Numerical Integration Project Report
1st order differential equations
Direct Methods to Solve Linear Equations Systems
Numerical method for solving non linear equations
Trapezoidal rule
Secant Method
Eigen value and eigen vector
Introduction to Function, Domain and Range - Mohd Noor
arijit ppt (1) (1).pptx
Introduction of Partial Differential Equations
Second order homogeneous linear differential equations
Numerical Solution of Ordinary Differential Equations
Lu Decomposition
Ad

Viewers also liked (15)

PDF
Solution of non-linear equations
PPT
Gauss sediel
PPTX
Linear and non linear expressions
PPT
Factorization from Gaussian Elimination
PPTX
Lecture 11 systems of nonlinear equations
PDF
metode iterasi Gauss seidel
PPT
bisection method
PPT
Linear Equations Ppt
PPT
linear equation
PDF
Linear non linear
PPT
Numerical Analysis (Solution of Non-Linear Equations) part 2
PPT
Numerical Analysis (Solution of Non-Linear Equations)
PDF
Roots of Nonlinear Equations - Open Methods
PPT
Applications of numerical methods
PPT
Linear Equations
Solution of non-linear equations
Gauss sediel
Linear and non linear expressions
Factorization from Gaussian Elimination
Lecture 11 systems of nonlinear equations
metode iterasi Gauss seidel
bisection method
Linear Equations Ppt
linear equation
Linear non linear
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations)
Roots of Nonlinear Equations - Open Methods
Applications of numerical methods
Linear Equations
Ad

Similar to Linear and non linear equation (20)

PDF
CHAPTER 3 numer.pdf
PPTX
PPTX
Iterativos methods
PPTX
Iterativos Methods
PPS
Pair of linear equation in two variables (sparsh singh)
PPS
Pair of linear equation in two variables (sparsh singh)
PPTX
Direct-Method-Mathematics_Numerical_methods.pptx
PDF
Gaussian
PPTX
Pair of linear equations in two variables for classX
PPTX
Chapter 4: Linear Algebraic Equations
DOCX
algebra
PPTX
Gauss Elimination & Gauss Jordan Methods in Numerical & Statistical Methods
PPTX
Solution of equations for methods iterativos
PPTX
Directs Methods
 
PPTX
Linear equations
PPTX
Solution of equations for methods iterativos
PPTX
Solution of equations for methods iterativos
PDF
Ijetr021210
CHAPTER 3 numer.pdf
Iterativos methods
Iterativos Methods
Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)
Direct-Method-Mathematics_Numerical_methods.pptx
Gaussian
Pair of linear equations in two variables for classX
Chapter 4: Linear Algebraic Equations
algebra
Gauss Elimination & Gauss Jordan Methods in Numerical & Statistical Methods
Solution of equations for methods iterativos
Directs Methods
 
Linear equations
Solution of equations for methods iterativos
Solution of equations for methods iterativos
Ijetr021210

More from Harshana Madusanka Jayamaha (8)

PPTX
Handwritten character recognition using artificial neural network
PPTX
Clipping ( Cohen-Sutherland Algorithm )
PPTX
Advance operator and technique in genetic algorithm
PPTX
Artificial Neural Network Topology
PPTX
Parallel algorithm in linear algebra
PPTX
Organizational structure
PPTX
Operating system critical section
PPTX
Distributed System - Security
Handwritten character recognition using artificial neural network
Clipping ( Cohen-Sutherland Algorithm )
Advance operator and technique in genetic algorithm
Artificial Neural Network Topology
Parallel algorithm in linear algebra
Organizational structure
Operating system critical section
Distributed System - Security

Recently uploaded (20)

PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Encapsulation theory and applications.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hybrid model detection and classification of lung cancer
PDF
Getting Started with Data Integration: FME Form 101
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
project resource management chapter-09.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
1. Introduction to Computer Programming.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
August Patch Tuesday
PPTX
A Presentation on Artificial Intelligence
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
A novel scalable deep ensemble learning framework for big data classification...
cloud_computing_Infrastucture_as_cloud_p
Encapsulation theory and applications.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
A comparative analysis of optical character recognition models for extracting...
Enhancing emotion recognition model for a student engagement use case through...
Hybrid model detection and classification of lung cancer
Getting Started with Data Integration: FME Form 101
Heart disease approach using modified random forest and particle swarm optimi...
TLE Review Electricity (Electricity).pptx
project resource management chapter-09.pdf
Zenith AI: Advanced Artificial Intelligence
1. Introduction to Computer Programming.pptx
Assigned Numbers - 2025 - Bluetooth® Document
MIND Revenue Release Quarter 2 2025 Press Release
Building Integrated photovoltaic BIPV_UPV.pdf
August Patch Tuesday
A Presentation on Artificial Intelligence

Linear and non linear equation

  • 1. computing discrete approximation of solution of linear simultaneous equation JMHM Jayamaha
  • 2. Content  Linear Equations  What is Linear Equations  Method for solving the system of linear equations  Direct Method  Gauss Elimination method  LU Decomposition  Iterative method  Jacobi's method  Gauss Seidal method
  • 4. What is Linear Equations  A linear equation is an algebraic equation in which each term is either a constant or the product of a constant and (the first power of) a single variable.
  • 5. Two methods for solving the system of linear equations  Direct Method  Solutions are obtained through a finite number of arithmetic operations  Gauss Elimination method  LU Decomposition  Iterative Method:  Solutions are obtained through a sequence of successive approximations which converges to the required solution  Jacobi's method  Gauss Seidal method
  • 7. GAUSS – ELIMINATION METHOD Consider a system of 3 – equations with 3 – unknowns )1( 3333232131 2323222121 1313212111         bxaxaxa bxaxaxa bxaxaxa
  • 8. Form the augmented matrix from the given equations as           3333231 2232221 1131211 baaa baaa baaa    1 11 21 22operationrowtheUse R a a RR  1 11 31 33operationrowtheUse R a a RR  If a11  0
  • 9. New augmented matrix will be           '''0 '''0 33332 22322 1131211 baa baa baaa   
  • 10. 2 22 32 33 ' ' operationrowtheUse R a a RR  New augmented matrix will be           ''''00 '''0 333 22322 1131211 ba baa baaa    If a22’  0
  • 11. From the last matrix, the equations can be written as '''' ''' 3333 2323222 1313212111 bxa bxaxa bxaxaxa   
  • 12. Use back substitution to get the solution as 11 3132121 1 22 3232 2 33 3 3 , ' '' , '' '' a xaxab x a xab x a b x     
  • 13. Gauss Elimination method Matlab Implementation function x = Gauss(A,b); n = length(b); x = zeros(n,1); for k=1:n-1 % forward elimination for i=k+1:n xmult = A(i,k)/A(k,k); for j=k+1:n A(i,j) = A(i,j)-xmult*A(k,j); end b(i) = b(i)-xmult*b(k); end end % back substitution x(n) = b(n)/A(n,n); for i=n-1:-1:1 sum = b(i); for j=i+1:n sum = sum-A(i,j)*x(j); end x(i) = sum/A(i,i); end
  • 15.  Matrix A is decomposed into a product of a lower triangular matrix L and an upper triangular matrix U, that is A = LU or                                100 10 1 0 00 23 1312 333231 2221 11 333231 232221 131211 u uu lll ll l aaa aaa aaa
  • 16. Matrices L and U can be obtained by the following rule 1. Step 1: Obtain l11 = a11, l21 = a21, l31 = a31 11 13 13 11 12 12 ,Obtain:2Step.2 a a u a a u  3. Step 3: Obtain l22 = a22 – l21u12  132123 22 23 1 Obtain:4Step.4 ula l u  5. Step 5: Obtain l32 = a32 – l31u12 6. Step 6: Obtain l33 = a33 – l31u13 – l32u23
  • 17. Once lower and upper triangular matrices are obtained the solution of Ax = b can be obtained using the procedure Ax = b  LUx = b Let Ux = y then LUx = b  Ly = b
  • 18. Steps to get the solution of linear equations                                 3 2 1 3 2 1 333231 2221 11 0 00 b b b y y y lll ll l bLy    2321313 33 3 1212 22 2 11 1 1 1 and 1 ,where ylylb l y ylb l y l b y   By Forward substitution
  • 20. Matlab Implementation for LU Decomposition
  • 22. The Jacobi Method  This method makes two assumptions 1. that the system given by has a unique solution 2. the coefficient matrix A has no zeros on its main diagonal
  • 23.  To begin the Jacobi method, solve the first equation for x1 the second equation for x2 and so on, as follows.  Then make an initial approximation of the solution,
  • 26.  To begin, write the system in the form  Because you do not know the actual solution, choose
  • 27.  as a convenient initial approximation. So, the first approximation is  Continuing this procedure, you obtain the sequence of approximations shown in Table
  • 28.  Because the last two columns in Table are identical, you can conclude that to three significant digits the solution is
  • 29. Matlab Implementation for jacobi method
  • 31.  Gauss-Seidel iteration is similar to Jacobi iteration, except that new values for xi are used on the right-hand side of the equations as soon as they become available.  It improves upon the Jacobi method in two respects  Convergence is quicker, since you benefit from the newer, more accurate xi values earlier.  Memory requirements are reduced by 50%, since you only need to keep track of one set of xi values, not two sets.
  • 34.  Step 1: reformat the equations, solving the first one for x1, the second for x2, and the third for x3
  • 35.  Step 2a: Substitute the initial guesses for xi into the right-hand side of the first equation  Step 2b: Substitute the new x1 value with the initial guess for x3 into the second equation  Step 2c: Substitute the new x1 and x2 values into the third equation
  • 36.  Step 3, 4, · · · : Repeat step 2 and watch for the xi values to converge to an exact solution.
  • 37. Matlab Implementation of Gauss-Seidel Method
  • 38. Summary  Solution of linear simultaneous are discussed.  Two methods  Direct  Gauss Elimination method  LU Decomposition  Iterative  Jacobi's method  Gauss Seidal method
  • 39. References  https://en.wikipedia.org/wiki/Linear_equation(2016-06-15)  http://homel.vsb.cz/~dom033/predmety/parisLA/02_direct_methods.pdf  Numerical computational methods by P.B Patill , U.P Verma  http://college.cengage.com/mathematics/larson/elementary_linear/5e/stud ents/ch08-10/chap_10_2.pdf  http://ocw.usu.edu/Civil_and_Environmental_Engineering/Numerical_Method s_in_Civil_Engineering/NonLinearEquationsMatlab.pdf  http://people.whitman.edu/~hundledr/courses/M467/GaussSeidel.pdf

Editor's Notes

  • #5: A linear equation is an algebraic equation in which each term is either a constant or the product of a constant and (the first power of) a single variable
  • #8: It is a direct method for finding the solution of a system of linear equations and is based on the principle of elimination. where aij(1)’s (i, j = 1, 2, 3) are the coefficient of unknowns and bi(1)’s (i = 1, 2, 3) are prescribed constants
  • #23: If any of the diagonal entries a11, a22, . . . , ann are zero, then rows or columns must be interchanged to obtain a coefficient matrix that has nonzero entries on the main diagonal.
  • #24: To begin the Jacobi method, solve the first equation for x1 the second equation for x2 and so on, as follows. Initial Approximation and substitute these values of xi into the right-hand side of the rewritten equations to obtain the first approximation. After this procedure has been completed, one iteration has been performed.
  • #26: In the same way, the second approximation is formed by substituting the first approximation’s x-values into the right-hand side of the rewritten equations. By repeated iterations, you will form a sequence of approximations that often converges to the actual solution.
  • #31: Iterative methods provide an alternative approach that an iterative methods starts with an approximate solution , and uses it by means of a recrurrence fomula to provie another approximate solution ; by repeatedly applying the formula, a sequence of solution is abtained with ( under suitable conditions)( converges to the exact solution . Iterative methods have the advantages of simplicity of operation and ease of implementation of computers. And they are realativelyi insensitive to propagation of errors; they would be used in preference to direct methods for solving lenear systems involving several handred variables. Particularly , if many of the coefficients were zero . Systems of over 100000 variable have more variables are difficult or impossible to solve by direct methods.