Numerical Analysis Project - Chapter 1 - System of Linear Equations
Numerical Analysis Project - Chapter 1 - System of Linear Equations
1. Theory summary:
- System of linear equations:
+ A system of linear equations consists of two or more equations made up of two or more
variables such that all equations in the system are considered simultaneously.
+ The solution to a system of linear equations in “n” variables is any ordered group of “n”
variable that satisfies each equation independently.
+The general form of linear algebraic equations is:
a11.x1 + a12.x2 +…+ a1n.xn = b1
a21.x1 + a22.x2 +…+ a2n.xn = b2
…
an1.x1 + an2.x2 +…+ ann.xn = bn
- Cramer’s rule:
+ Each unknown in a system of linear algebraic equations may be expressed as a fraction
of two determinants with denominator D and with the numerator obtained from D by
replacing the column of coefficients of the unknown in question by the constants b1, b2,
…, bn.
+ Step to do:
Find the determinant D of a 3 × 3 matrix made from all unknowns a11, a12,...
We make a 3 × 3 matrix by replacing the 1st column of the matrix above by
constants b1, b2, b3.
The first unknown x1 will be equal to the division between the determinant of the
newly created matrix and D.
The same work will be applied for calculating x2 and x3.
- Gauss elimination:
+ Its basic strategy is to multiply the equations by constants so that one of the unknowns
will be eliminated when the two equations are combined.
+ We multiply a11 for a21/a11 and then subtract the coefficients of the 1st equation for the 2nd
equation. We then repeat this method until there is an equation with only one coefficient
and start doing back substitution.
- LU decomposition:
+ LU decomposition methods separate the time-consuming elimination of the matrix [A]
from the manipulations of the right-hand side {B}.
+ [A] is factored into lower [L] and upper [U] triangular matrices.
+ This method can be described as [A]{X} = {B} => [A] = [L][U] where
[L]{D} = [B] and [U]{X} = [D].
+ This method has 2 ways to perform:
Doolitte method: [L] is in row echelon form with zeros above the leading
coefficients, [U] is in echelon form with zeros below the main diagonal.
Crout method: [L] is in echelon form with zeros above the main diagonal, [U] is in
row echelon form with zeros below the leading coefficients.
- Cholesky decomposition:
+ It is a decomposition of a symmetric, positive-definite matrix into the product of a
lower triangular matrix (C) and its conjugate transpose (CT).
+ A matrix is positive-definite when all its sub-determinants are positive.
+ This method can be described as [A] = [C][CT].
Step 2:
| -0.01 0.52 1 |
| 0.67 1 1.9 |
| -0.44 0.3 0.5 | 0.03278
x1 = ----------------------- = -------------- = -14.9
-2.2 × 10-3 -2.2 × 10-3
| 0.3 -0.01 1 |
| 0.5 0.67 1.9 |
| 0.1 -0.44 0.5 | 0.0649
x2 = ----------------------- = -------------- = -29.5
-2.2 × 10-3 -2.2 × 10-3
Step 2: Multiply (2) for 1/5 and subtract it for the coefficients of (3):
0x1 - 0.1x2 - 0.12x3 = 0.574 (2*)
Step 3: Multiply (1*) for 3/4 and subtract it for the coefficients of (2*):
0x1 + 0x2 – 0.055x3 = -1.089 (1**)
Step 3: Eliminate x2 from the 1st row by subtracting it for 0.76 times the 2nd row:
|0 0 -0.044 : -0.8712 |
A(2) = | 0 -0.5 -0.6 : 2.87 |
| 0.1 0.3 0.5 : -0.44 |
5. Conclusion:
- All errors of x1, x2 and x3 are good as all of them are at 0%.
- There is good agreement between solutions obtained by hand and by software, more
specifically Excel.
- Opinion: with the help of software, calculating becomes simpler but it is essential to
practice solving by hand as it gives us the understanding of the actual steps to deal with
the problem.