Matrix

Matrices

An m×n matrix is a rectangular array of complex or real
numbers arranged in m rows and n columns:

Types, Operations, etc.

▪ Types: square, symmetric, diagonal, Hermithean, …
▪ Basic operations: A+B, A-B, AB (AB≠BA).
Square matrices
▪ Determinant: det(A)
▪ Inverse matrix A-1: AA-1 = I (I is a unit matrix)
▪ …

Applications

Linear systems of equations
Eigenvalue problem

Linear systems of equations

▪ m>n over determined system (data processing)
▪ m=n square case (what we will do)
▪ m<n under determined system

Linear systems in matrix notation

or Ax = b

Two cases for right-hand coefficients

right-hand coefficients b i ≠ 0
Unique solution if the determinant det(A) ≠ 0

right-hand coefficients bi = 0
Unique solution if the determinant det(A) = 0

Analytic solutions for n=2

a11x1 + a12x2=b1
a21x1 + a22x2=b2

expressing the first unknown x 1 from the first equation

x1 = (b1 - a12x2)/a11

and substituting to the second equation we have a
single
equation with one unknown x2.

Gaussian elimination

Since there is no such an operator as elimination
neither in C++ nor Fortran we should translate this
procedure to an appropriate numerical method for
solving systems of linear equations.

Numerical method = Gaussian elimination

Gaussian elimination for n =3

Let subtract the first equation multiplied by the coefficient a21/a11 from the
second one, and multiplied by the coefficient a31/a11 from the third equation.


Step 2:
Repeating the same procedure to the last of two equations
gives

where

Step 3:

Doing back substitution we will find x2 and then x1.

This direct method to find solutions for a system of
linear equations by the successive elimination is
known as Gaussian elimination.

Problems!

zero diagonal elements
round-off errors
ill-conditioned systems
computational time

Prev Next