Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Numerical Methods with Computer

Application
System of Linear Equations

Engineering Simply the Best !!!


System of Linear Equation
} Linear equation
} an equation in which the highest exponent in a
variable term is no more than one. The graph of such
an equation is a straight line.

Engineering Simply the Best !!!


System of Linear Equation
} System of linear equations (or a linear system)
} a finite set of linear equations.

Engineering Simply the Best !!!


System of Linear Equation
} Solution of the system of linear equations an ordered
set of numbers {c1, c2, ..., cn} which satisfies all m
equations when they are substituted for the variables x1,
x2, ..., xn.
} Types of Linear Systems:
} 1. Overdetermined – has more equations than unknown
variables (m > n); typically has no solution.
} 2. Underdetermined – has more unknown variables than the
number of equations (n > m); has an infinite number of
solutions.
} 3. Simultaneous system – has the same number of
equations as unknown variables (m = n); has a unique
solution if the system satisfies certain conditions (linear
independence).
Engineering Simply the Best !!!
System of Linear Equation
} Linear independent
} if no equation in a simultaneous system can be
expressed as a linear combination of the others; a
unique solution exists.

Engineering Simply the Best !!!


System of Linear Equation
} A system of linear equations can be written as a single
matrix equation:

Engineering Simply the Best !!!


Graphical Method
} Before going thru the direct and iterative process
actually the solution of systems of linear equation
can be solved using graphical method.
} When the equations are plotted, the point where the
lines intersect is the solution of the equation.

Engineering Simply the Best !!!


Graphical Method
} A graphical solution is obtainable for two
equations by plotting them on Cartesian
coordinates with one axis corresponding to x1
and the other to x2. Because we are dealing with
linear systems, each equation is a straight line.
} This can be easily illustrated for the general
equations

Engineering Simply the Best !!!


Graphical Method
} Example: Use the graphical method to solve

Engineering Simply the Best !!!


Graphical Method
}
After plotting the two equations, the
value of x1 and x2 at the
intersection point is the solution of
the equation.

Engineering Simply the Best !!!


Graphical Method
} For three simultaneous equations, each equation
would be represented by a plane in a three-
dimensional coordinate system. The point where
the three planes intersect would represent the
solution.
} Beyond three equations, graphical methods
break down and, consequently, have little
practical value for solving simultaneous
equations.

Engineering Simply the Best !!!


Graphical Method
Also even for just two (2) equations if the plot of the equation is
as in figures (a) – (c)
The solution using graphical method could not be easily
determined.

Engineering Simply the Best !!!


Direct Method.
} The used of Graphical for equations involving
more than 3 equations will no longer be practical.
} Beside from graphical methods, some direct
method could also be utilized to solve systems of
linear equation.
} Direct methods (elimination methods)
} • finds the exact solution (within the accuracy of the
computer) through a finite number of arithmetic
operations.
} guaranteed to succeed & recommended for general
purposes
} round-off and truncation errors may lead to poor results
Engineering Simply the Best !!!
Direct Method.
} Some direct methods
1. Cramer’s rule – (done in advance math)
2. Gaussian elimination method
3. Gauss-Jordan method
4. LU decomposition

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method
} Equation in matrix form (consider a 3 eqns 3
unknowns)

a11x1 a12x2 a13x3 b1 a11x1 a12x2 a13x3 b1

a21x1 a22x2 a23x3 b2 0 a22x2 a23x3 b2

a31x1 a32x2 a33x3 b3 0 0 a33x3 b3

Upper triangular matrix

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method

Engineering Simply the Best !!!


Gaussian Elimination Method
} Example. Find the solution of the linear equations
given below.

Engineering Simply the Best !!!


Gaussian Elimination Method
} Step 1. Convert to its compact matrix equivalent
X1 X2 X3

3 -0.1 -0.2 7.85


0.1 7 -0.3 -19.3
0.3 -0.2 10 71.4

A b

Engineering Simply the Best !!!


Gaussian Elimination Method
} Step 2. considering a11 as the pivot element and
equation 1 as the pivot eqn, solve for the new row2

Old Matrix
3 -0.1 -0.2 7.85 3 -0.1 -0.2 7.85 New row1

0.1 7 -0.3 -19.3 0 7.003333 -0.29333 -19.5617 New row2


0.3 -0.2 10 71.4 0.3 -0.2 10 71.4 Old row3

a21-a11(a21/a11)

a22-a12(a21/a11) a23-a13(a21/a11) b2-b1(a21/a11)

Engineering Simply the Best !!!


Gaussian Elimination Method
} Step 2. considering a11 as the pivot element and
equation 1 as the pivot eqn, solve for the new row3

Old Matrix
3 -0.1 -0.2 7.85 3 -0.1 -0.2 7.85 New row1

0.1 7 -0.3 -19.3 0 7.003333 -0.29333 -19.5617 New row2


0.3 -0.2 10 71.4 0 -0.19 10.02 70.615 New row3

a31-a11(a31/a11)

a32-a12(a31/a11) a33-a13(a31/a11) b3-b1(a31/a11)

Engineering Simply the Best !!!


Gaussian Elimination Method
} Step 2. considering a22 as the pivot element and
equation 2 as the pivot eqn, solve for the new row3

3 -0.1 -0.2 7.85 3 -0.1 -0.2 7.85


0 7.003333 -0.29333 -19.5617 0 7.003333 -0.29333 -19.5617

0 -0.19 10.02 70.615 0 0 10.01204 70.08429 New row3

a32-a22(a32/a22) a33-a23(a32/a22) b3-b2(a32/a22)

Engineering Simply the Best !!!


Gaussian Elimination Method
} Backward substitution to solve for the values of x’s.
X1 X2 X3

3 -0.1 -0.2 7.85

0 7.003333 -0.29333 -19.5617

0 0 10.01204 70.08429

Engineering Simply the Best !!!


Gaussian Jordan Method
} For Gauss-Jordan, it is almost similar with Gauss
elimination. However it did not stop only at upper
triangular matrix but proceed further to make into its
equivalent identity matrix.

1 0 0 b1

0 1 0 b2

0 0 1 b3

Engineering Simply the Best !!!


Gaussian Jordan Method
} From the previous example if we manipulate the
matrix we will end up with this identity matrix.

1 0 0 7

0 1 0 -2.5

0 0 1 3

Engineering Simply the Best !!!


Application
} In the given circuit, solve for the voltage for bus 2
upto bus 4

Engineering Simply the Best !!!

You might also like