× back

Simultaneous Linear Algebric Equations

Matrices

Applications of Matrices

Matrix Inversion Method for Solving Linear Equations

Steps:

  1. Convert the linear equation into a matrix in the form AX = B, where A is the matrix of coefficients of the equation, X is the matrix of unknown variables, and B is the matrix of known results.
  2. Calculate the matrix of unknowns using the formula X = A-1B.
  3. Compute A-1 as (Adj A) / |A|.
  4. Determine the matrix of unknowns (X) by multiplying A-1 and the matrix B.

Solve by Matrix Inversion method:
x + y + z = 8
x - y + 2z = 6
3x + 5y - 7z = 14

Sol:
Writing these equation in matrix form:

+--        --+  +-- --+     +--  --+
| 2    1   1 |  |  x  |     |  8   |
| 1   -1   2 |  |  y  |  =  |  6   |  
| 3    5  -7 |  |  z  |     |  14  |
+--        --+  +-- --+     +--  --+
                        
AX = B
X = A-1B
We have to calculate A-1
We know A-1 = Adj A |A|
And Adj A = Transpose of Cofactor matrix
            +--                       --+
            | (7-10)   -(-7-6)   (5+3)  |                
Cofactor =  | -(-7-5)   (-7-3)  -(5-3)  |
            | (2+1)     -(2-1)   (-1-1) |
            +--                       --+

            +--          --+
            | -3   13   8  |                
Cofactor =  | 12  -10  -2  |
            |  3   -1  -2  |
            +--          --+

Adj = Transpose of cofactor matrix

         +--          --+
         | -3   12   3  |                
Adj A =  | 13  -10  -1  |
         |  8   -2  -2  |
         +--          --+

Now finding |A|,
|A| = 1(7-10) -1(-7-6) +1(5+3)
|A| = 18

As X = A-1B 
       +--         --+    +--  --+
       | -3    12    3 |  |  8   |
X = 118 | 13   -10   -1 |  |  6   |
       |  8    -2   -2 |  |  14  |
       +--           --+  +--  --+

       +-  -+  
       | 90 |  
X = 118 | 30 |
       | 24 |
       +-  -+

+-- --+    +--  --+ 
|  x  |    |  5   |
|  y  | =  |  5/3 | 
|  z  |    |  4/3 |
+-- --+    +--  --+
                        

Gauss Elimination Method for Solving Linear Equations

  • In linear algebra, Gaussian elimination is an efficient algorithm for solving systems of linear equations.
  • This is a direct method that is divided into two parts:
    1. Elimination or triangular elimination
    2. Back substitution

Steps for Gauss Elimination

  1. Convert the equation into matrix form, i.e., AX = B, where A is the matrix of coefficients, X is the matrix of unknowns, and B is the result matrix.
  2. The obtained matrix will also be augmented as [AB].
  3. Choose the pivot element as A11 if it is non-zero.
  4. Take the pivot element and make the elements below it zero:
    R2 → R2 - (a21 / a11) * R1
    R3 → R3 - (a31 / a11) * R1

Solve the following equation by Gauss Elimination Method:
2x + y + 4z = 12
4x + 11y - z = 33
8x -3y + 2z = 20

Sol:
First we convert the above equation to augmented form (matrix)

+--               --+
| 2    1   4  :  12 |
| 4   11  -1  :  33 |
| 8   -3   2  :  20 |
+--               --+
                        
pivot = 2
We want to make a21 zero so we use following formula.
R2 ← R2 - (No. to be zero) Pivot Pivot Row
R2 ← R2 - 4 1 R1
R2 ← R2 - 4R1
After performing R2 ← R2 - 4R1 it becomes
+--               --+
| 2    1   4  :  12 |
| 0    9  -9  :   9 |
| 8   -3   2  :  20 |
+--               --+
                        
Pivot is still 2
Now we want to make a31 zero now the formula will be:
R3 ← R3 - 8 2 R1
R3 ← R3 - 4R1
+--                --+
| 2    1    4  :  12 |
| 0    9   -9  :   9 |
| 0   -7  -14  : -28 |
+--                --+
                        
Now we want to set a32 to zero, and since we shifted towards the 2nd column, there will be a new pivot.
New pivot = 9 and Pivot row = R2
Now formula will be:
R3 ← R3 - (-7) 9 R2
R3 ← R3 + 7 9 R2
Now we get
+--                --+
| 2    1    4  :  12 |
| 0    9   -9  :   9 |
| 0    0  -21  : -21 |
+--                --+
                        
Converting this back into equation form, we get:
2x + y + 4z = 12 (eq-1)
9y -9z = 9 (eq-2)
-21z = -21 (eq-3)
From equation 3 we get z = 1
While substituting z in equation 2 we get y = 2
Substitution values of z and y in equation 1 we get x = 3
Hence, x = 3, y = 2 and z = 1

Ill-Conditioned and Well-Conditioned System

  • When the change in the values of the matrix does not significantly affect the determinant, it is called a well-conditioned system. Conversely, when the variation in the determinant is very high, it is referred to as an ill-conditioned system.

Interpolation

Forward and Backward difference table

Newton's methods of Interpolation

1- Newton's forward difference interpolation formula

  • Conditions:
    1. The function should be tabulated at equal intervals, such as regularly spaced values like 1, 2, 3, 4, etc., to ensure the accuracy of the interpolation process.
    2. The point for which the function is to be interpolated should lie in the first or upper half of the table. This means that the value you're trying to estimate falls within the range of known data points towards the beginning or top part of the data set.

Understanding formula using the following example:

2- Newton's backward difference interpolation formula

  • Conditions:
    1. The function should be tabulated at equal intervals.
    2. The point for which the function is to be interpolated should lie in the second or lower half of the table. This means that the value you're trying to estimate falls within the range of known data points towards the ending or bottom part of the data set.

Central Difference Formula

  • The Central Difference Formula is a method used for interpolation that is specifically designed for estimating values near the middle of a data table.
  • There are two main types of Central Difference Formulas:
    • Gauss's Forward Difference Formula
    • Gauss's Backward Difference Formula

Gauss's Forward Difference Formula

y(x) = \(y_0\) + u▵\(y_0\) + \(\frac{(u-1)u}{2!}\)▵2\(y_{-1}\) + \(\frac{(u-1)u(u+1)}{3!}\)▵3\(y_{-1}\) + \(\frac{(u-2)(u-1)u(u+1)}{4!}\)▵4\(y_{-2}\) + \(\frac{(u-2)(u-1)u(u+1)(u+2)}{5!}\)▵5\(y_{-2}\) + ...
u = \(\frac{x - x_o}{h}\)

Q- Use Gauss's forward formula to find the value of y when x = 3.75 from the following table:

x |  2.5   |   3.0   |   3.5   |   4.0   |   4.5   |   5.0   |
y | 24.145 | 22.043  | 20.225  | 18.644  | 17.262  | 16.047  |
                
Sol:
u = \(\frac{x - x_o}{h}\)
here x is the given value in the question, so x = 3.75 and \(x_o\) = just smallest value then x, so \(x_o\) = 3.5
Now h is the difference between two consecutive value of x, so h = 3.0 - 2.5 = 0.5
u = \(\frac{3.75 - 3.5}{0.5}\) = 0.5
If (0 < u < 1) then we use Gauss Forward formula.
Now table:
 x       |      y      |          △y               |    △^2 y   |    △^3 y    |   △^4 y    |   △^5 y
---------+-------------+----------------------------+----------------------------+-------------+-------------
2.5      | 24.145      |                            |             |              |             |
         |             | 22.043-24.145= -2.102  (-2)|             |              |             |
3.0      | 22.043      |                            | 0.284 (y-2) |              |             |
         |             |        -1.818          (-1)|             | -0.047 (y-2) |             |
3.5 (x0) | 20.225 (y0)✮|                            | 0.237 (y-1)✮|              | 0.009 (y-2)✮|
         |             |        -1.581          (0)✮|             | -0.038 (y-1)✮|             | -0.003 (y-2)✮
4.0      | 18.644      |                            | 0.199 (y0)  |              | 0.006 (y-1) |
         |             |        -1.382           (1)|             | -0.032 (y0)  |             |
4.5      | 17.262      |                            | 0.167 (y1)  |              |             |
         |             |        -1.215           (2)|             |              |             |
5.0      | 16.047      |                            |             |              |             |
                
y(x) = 20.225 + 0.5(-1.581) + \(\frac{(0.5-1)0.5}{2!}\) (0.237) + \(\frac{(0.5-1)0.5(0.5+1)}{3!}\)(-0.038) + \(\frac{(0.5-2)(0.5-1)0.5(0.5+1)}{4!}\)(0.009) + \(\frac{(0.5-2)(0.5-1)0.5(0.5+1)(0.5+2)}{5!}\)(-0.003)
y(x) = 22.225 - 0.7905 - 0.029625 + 0.002375 + 0.0002109375 - 0.0000351563
y(x) = 19.4074257812


Gauss's Backward Formula

y(x) = \(y_o\) + u▵\(y_{-1}\) + \(\frac{u(u+1)}{2!}\)▵2\(y_{-1}\) + \(\frac{(u-1)u(u+1)}{3!}\)▵3\(y_{-2}\) + \(\frac{(u-1)u(u+1)(u+2)}{4!}\)▵4\(y_{-2}\) + \(\frac{(u-2)(u-1)u(u+1)(u+2)}{5!}\)▵5\(y_{-3}\)
u = \(\frac{x - x_o}{h}\)

Q- Apply Gauss Backward formula to find the population of the town in 1946, given that

         Year  |  1931  |  1941  |  1951  |  1961  | 1971
   Population  |   15   |   20   |   27   |   39   |  52
(In thousands) | 
                
u = \(\frac{x - x_o}{h}\)
x = 1946 and \(x_o\) is slightly bigger value than x so here \(x_o\) = 1951
h is the difference between two consecutive x values.
u = \(\frac{1946 - 1951}{10}\) = -0.5
We use Gauss Backward when (-1 < u < 0)
 x       |   y     |    △y   | △^2 y  | △^3 y   |   △^4 y  |   
---------+---------+----------+---------+----------+-----------+
1931     | 15      |          |         |          |           |
         |         | 5   (y-2)|         |          |           |
1941     | 20      |          | 2 (y-2) |          |           |
         |         | 7  (y-1)✮|         | 3 (y-2)✮ |           |
1951 (x0)| 27 (y0)✮|          | 5 (y-1)✮|          | -7 (y-2)✮ |
         |         | 12  (y0) |         | -4 (y-1) |           |
1961     | 39      |          | 1 (y0)  |          |           |
         |         | 13   (y1)|         |          |           |
1971     | 52      |          |         |          |           |
            
y(x) = 27 + (-0.5)(7) + \(\frac{(-0.5)(-0.5+1)}{2!}\)(5) + \(\frac{(-0.5-1)(-0.5)(-0.5+1)}{3!}\)(3) + \(\frac{(-0.5-1)(-0.5)(-0.5+1)(-0.5+2)}{4!}\)(-7)
y(x) = 22.7890

Reference