0% found this document useful (0 votes)
45 views145 pages

Cie 115 Reviewer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views145 pages

Cie 115 Reviewer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 145

CIE 115

NUMERICAL
SOLUTIONS TO
CIVIL ENGINEERING
PROBLEMS
SUMMARY
CIE 115 OUTLINE
PART I: MATRICES

PART II: LINEAR SYSTEMS OF


EQUATIONS

PART III: ROOT-FINDING METHODS AND


NONLINEAR SYSTEMS OF EQUATIONS

PART IV: NUMERICAL INTEGRATION

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PART I

MATRICES
MATRICES
PART I OUTLINE
❑ MATRIX ELEMENTS
❑ ORDER OF MATRICES
❑ TYPES OF MATRICES
❑ MATRIX OPERATIONS
❑ TRANSPOSE OF A MATRIX
❑ DETERMINANT OF A MATRIX
❑ MINOR OF AN ELEMENT
❑ COFACTOR OF AN ELEMENT
❑ ADJOINT OF A MATRIX
❑ INVERSE OF A MATRIX
❑ TRACE OF A MATRIX
❑ CALCULATOR TECHNIQUES

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Matrix Elements
The symbols aij represent any number that lies in the ith
row and jth column.

𝑎11 𝑎12 𝑎13 Row (i)

𝐴 = 𝑎21 𝑎22 𝑎23


𝑎31 𝑎32 𝑎33
Column (j)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Order of Matrices
Matrices are arranged in an m x n array.
m = number of rows, n = number of columns

0 8 −9 8 0 1
−1 1 41 8 9 2
4 6 7 15 6 3
3 9 −7 1 2 4
𝑋=
7 0 4 4 5 5
2 3 1 −4 0 6
−9 2 0 3 0 7
11 −1 1 1 −1 8

1 2 3 4 5
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Order of Matrices
Matrices are arranged in an m x n array.
m = number of rows, n = number of columns

0 8 −9 8 0
−1 1 41 8 9 𝑿 → 𝟖𝒙𝟓 1≤𝑖≤𝑚
4 6 7 15 6 1≤𝑗≤𝑛
3 9 −7 1 2 𝑿𝟒𝟐 = 𝟗
𝑋=
7 0 4 4 5
2 3 1 −4 0 𝑿𝟖𝟒 = 𝟏
−9 2 0 3 0
11 −1 1 1 −1

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A rectangular matrix is a type of matrix where the
number of rows and columns of the array are not equal.
0 8 −9 8 0
−1 1 41 8 9
𝑿 → 𝟖𝒙𝟓
4 6 7 15 6
3 9 −7 1 2
𝑋=
7 0 4 4 5
2 3 1 −4 0
−9 2 0 3 0
11 −1 1 1 −1
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A square matrix is a type of matrix where the number of
rows and columns of the array are equal.

𝑿 → 𝟑𝒙𝟑
−1 1 4
𝑋 = 2 −1 3
0 2 0

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A horizontal matrix is a type of matrix where the number
of columns is more than the number of rows.

𝑿 → 𝟐𝒙𝟑
−1 1 4
𝑋= 𝒏>𝒎
2 −1 3

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A vertical matrix is a type of matrix where the number of
rows is more than the number of columns.

𝑿 → 𝟑𝒙𝟐
1 4
𝒎>𝒏
𝑋 = −1 3
2 0

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A row matrix is a type of matrix where there is only one
row.

𝑿 → 𝟏𝒙𝟒
𝑋= 2 1 0 4

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A column matrix is a type of matrix where there is only
one column.

𝑿 → 𝟒𝒙𝟏
2
−1
𝑋=
9
1
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A null (zero) matrix is a type of matrix where all the
elements are equal to zero.

𝑶 → 𝟑𝒙𝟑
0 0 0
𝑂= 0 0 0
0 0 0

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A diagonal matrix is a type of square matrix where all the
except those not in the main/ principal diagonal are zero.

𝑿 → 𝟑𝒙𝟑
2 0 0
𝑋= 0 2 0
0 0 7

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A scalar matrix is a type of a diagonal matrix where all the
elements in the principal diagonal are the same.

𝑿 → 𝟑𝒙𝟑
5 0 0
𝑋= 0 5 0
0 0 5

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A unit matrix (identity matrix) is a type of matrix where all
the elements in the main diagonal are equal to 1.

𝑰𝟑 → 𝟑𝒙𝟑
1 0 0
𝐼3 = 0 1 0
0 0 1

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
An all-ones matrix is a type of matrix where all the
elements are equal to one.

𝑿 → 𝟑𝒙𝟑
1 1 1
𝑋= 1 1 1
1 1 1

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
An upper triangular matrix is a type of square matrix
where all elements below the principal diagonal are equal
to zero.
𝑿 → 𝟑𝒙𝟑
2 1 −1
𝑋= 0 2 9
0 0 7

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A lower triangular matrix is a type of square matrix where
all elements above the principal diagonal are equal to
zero.
𝑿 → 𝟑𝒙𝟑
2 0 0
𝑋= 2 2 0
1 8 7

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A symmetric matrix is a type of matrix where 𝒙𝒊𝒋 = 𝒙𝒋𝒊

𝑿 → 𝟑𝒙𝟑
1 4 5
𝑋= 4 2 6 𝑿=𝑿 𝑻

5 6 3

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A skew symmetric matrix is a type of matrix where
𝒙𝒊𝒋 = −𝒙𝒋𝒊

𝑿 → 𝟑𝒙𝟑
1 4 −5
𝑋 = −4 2 6 𝑿 = −𝑿 𝑻

5 −6 3

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Types of Matrices
A sparse matrix is a type of matrix where majority of the
elements are zero.

0 0 −9 0 0 𝑿 → 𝟖𝒙𝟓
1 0 1 0 9
0 6 7 0 6
0 9 0 1 2
𝑋=
7 0 4 0 5
0 0 1 −4 0 60% sparse
0 0 0 0 0 40% dense
0 0 0 0 −1
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A banded (or band) matrix is a type of matrix where non-
zero elements are confined to particular diagonals.

1 1 0 0 0 𝑿 → 𝟓𝒙𝟓
1 2 1 0 0
𝑋= 0 6 3 3 0
0 0 2 4 2
0 0 0 8 5
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A tridiagonal matrix is a type of a banded matrix with a bandwidth
(BW) of 3 and half-bandwidth (HBW) of 1 (1 upper and 1 lower). It can
be a rectangular matrix with 𝒎, 𝒏 ≠ 𝑩𝑾.

1 5 0 0 0 0 0 0 𝑿 → 𝟖𝒙𝟖
1 2 1 0 0 0 0 0
0 4 3 6 0 0 0 0
0 0 3 4 −8 0 0 0
𝑋=
0 0 0 −1 5 3 0 0
0 0 0 0 2 6 1 0
0 0 0 0 0 −1 7 4
0 0 0 0 0 0 6 8
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A pentadiagonal matrix is a type of a banded matrix with a bandwidth
(BW) of 5 and half-bandwidth (HBW) of 2 (2 upper and 2 lower). It can
be a rectangular matrix with 𝒎, 𝒏 ≠ 𝑩𝑾.

1 5 6 0 0 0 0 0 𝑿 → 𝟖𝒙𝟖
1 2 1 −1 0 0 0 0
1 4 3 6 7 0 0 0
0 3 3 4 −8 7 0 0
𝑋=
0 0 2 −1 5 3 7 0
0 0 0 −1 2 6 1 3
0 0 0 0 4 −1 7 4
0 0 0 0 0 5 6 8
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A heptadiagonal matrix is a type of a banded matrix with a bandwidth
(BW) of 7 and half-bandwidth (HBW) of 3 (3 upper and 3 lower). It can
be a rectangular matrix with 𝒎, 𝒏 ≠ 𝑩𝑾.

1 5 6 5 0 0 0 0 𝑿 → 𝟖𝒙𝟖
1 2 1 −1 6 0 0 0
1 4 3 6 7 2 0 0
−1 3 3 4 −8 7 1 0
𝑋=
0 4 2 −1 5 3 7 3
0 0 5 −1 2 6 1 3
0 0 0 3 4 −1 7 4
0 0 0 0 7 5 6 8
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A nonadiagonal matrix is a type of a banded matrix with a bandwidth
(BW) of 9 and half-bandwidth (HBW) of 4 (4 upper and 4 lower). It
can be a rectangular matrix with 𝒎, 𝒏 ≠ 𝑩𝑾.

1 5 6 5 3 0 0 0 𝑿 → 𝟖𝒙𝟖
1 2 1 −1 6 −1 0 0
1 4 3 6 7 2 7 0
−1 3 3 4 −8 7 1 1
𝑋=
2 4 2 −1 5 3 7 3
0 −1 5 −1 2 6 1 3
0 0 3 3 4 −1 7 4
0 0 0 4 7 5 6 8
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Types of Matrices
A submatrix is a type of matrix obtained from a given
matrix by deleting any number of rows of columns.

1 1 0 1 0
1 2 1 0 9 2 1 0
𝑋= 0 6 3 3 0 𝑆= 6 3 3 𝑺 𝒊𝒔 𝒂 𝒔𝒖𝒃𝒎𝒂𝒕𝒓𝒊𝒙 𝒐𝒇 𝑿
1 0 2 4 2 0 2 4
0 9 0 8 5

𝑿 → 𝟓𝒙𝟓 𝑺 → 𝟑𝒙𝟑
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Matrix Operations
Scalar Multiplication: Multiplying the scalar to every
element in the matrix.

1 −1 1
𝑋= 1 9 9 ; 𝑆 = 𝜆𝑋 =?
2 0 2
1 −1 1 𝜆 −𝜆 𝜆
𝑆=𝜆 1 9 9 𝑆= 𝜆 9𝜆 9𝜆
2 0 2 2𝜆 0 2𝜆
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Matrix Operations
Addition: Adding matrices of the same orders
(conformable). Each element of a matrix is added to the
matching element of the other matrix.
1 −1 1 2 1 0 𝟑𝒙𝟑 + 𝟑𝒙𝟑 = [𝟑𝒙𝟑]
𝑋= 1 9 9 𝑆= 6 3 3 𝟒𝒙𝟓 + 𝟒𝒙𝟓 = [𝟒𝒙𝟓]
2 0 2 0 2 4 𝟔𝒙𝟕 + 𝟒𝒙𝟕 = 𝑵𝑪
1 + 2 −1 + 1 1 + 0 3 0 1
𝑋+𝑆 = 1+6 9+3 9+3 𝑋 + 𝑆 = 7 12 12
2+0 0+2 2+4 2 2 6
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Matrix Operations: Properties of Addition
It is commutative. 𝐴+𝐵 =𝐵+𝐴

It is associative. 𝐴 + 𝐵 + 𝐶 = 𝐴 + [𝐵 + 𝐶]

It obeys the distributive law. 𝑘 𝐴 + 𝐵 = 𝑘𝐴 + 𝑘𝐵

Existence of additive identity.


O is a null. O is the additive identity. 𝐴+𝑂 =𝐴=𝑂+𝐴

Existence of additive inverse. B = -A.


B is the additive inverse of A. 𝐴+𝐵 =𝑂 =𝐵+𝐴

Cancellation Law. 𝐴 + 𝐵 = 𝐴 + 𝐶; 𝐵 = 𝐶
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Matrix Operations
Subtraction: Subtracting matrices of the same orders
(conformable). Each element of a matrix is subtracted
from the matching element of the other matrix.
1 −1 1 2 1 0 𝟑𝒙𝟑 − 𝟑𝒙𝟑 = [𝟑𝒙𝟑]
𝑋= 1 9 9 𝑆= 6 3 3 𝟒𝒙𝟓 − 𝟒𝒙𝟓 = [𝟒𝒙𝟓]
2 0 2 0 2 4 𝟔𝒙𝟕 − 𝟒𝒙𝟕 = 𝑵𝑪

1 − 2 −1 − 1 1 − 0 −1 −2 1
𝑋 − 𝑆 = 1 − 6 9 − 3 9 − 3 𝑋 − 𝑆 = −5 6 6
2−0 0−2 2−4 2 −2 −2
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Matrix Operations
Multiplication: Conformable matrices are only those that
satisfy:
A B AB
𝑭= 𝒎𝒙𝒏 𝒏𝒙𝒑 =𝒎𝒙𝒑 𝟐𝒙𝟒 𝟒𝒙𝟕 = [𝟐𝒙𝟕]
𝟑𝒙𝟏 𝟏𝒙𝟖 = [𝟑𝒙𝟖]
𝟐𝒙𝟔 𝟓𝒙𝟓 = 𝑵𝑪

The matrix AB is the matrix A post-multiplied


by B, whereas the matrix BA is the matrix A
pre-multiplied by B. pre-factor
AB≠BA in general. post-factor

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Matrix Operations: Properties of Multiplication
It is distributive (left/ right). 𝐴 𝐵 + 𝐶 = 𝐴𝐵 + 𝐴𝐶
𝐴 + 𝐵 𝐶 = 𝐴𝐶 + 𝐵𝐶

It is associative. 𝐴 𝐵𝐶 = 𝐴𝐵 𝐶

It is multiplicative. 𝐴𝐼 = 𝐼𝐴 = 𝐴

If AB = BA, then matrices A and B are said to commute.


If AB = -BA, the matrices A and B are said to anticommute.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Matrix Operations: Properties of Multiplication

𝑎 𝑏 𝑐 𝑔 ℎ
𝐴= 𝐵= 𝑖 𝑗
𝑑 𝑒 𝑓
𝑘 𝑙

𝟐𝒙𝟑 𝟑𝒙𝟐 = 𝟐𝒙𝟐 → 𝑪𝑶𝑵𝑭𝑶𝑹𝑴𝑨𝑩𝑳𝑬

𝑎𝑔
𝑎 𝑔+
+ 𝑏𝑖
𝑏 𝑖 + 𝑐𝑐𝑘 𝑎ℎ
𝑘 𝑎 ℎ+
+ 𝑏𝑏𝑗𝑗 +
+𝑐𝑐𝑙𝑙
𝐴𝐵 = 𝑑 𝑔 𝑒 𝑖 + 𝑓 𝑘 𝑑 ℎ + 𝑒 𝑗 + 𝑓 𝑙
𝑑𝑔 +
+ 𝑒𝑖 + 𝑓𝑘 𝑑ℎ + 𝑒𝑗 + 𝑓𝑙

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Matrix Multiplication

−4 2 5 2 3
𝐴= 𝐵= 4 5
2 1 2
2 1
−4 2 + 2 4 + 5(2) −4 3 + 2 5 + 5(1)
𝐴𝐵 =
2 2 + 1 4 + 2(2) 2 3 + 1 5 + 2(1)

10 3
𝐴𝐵 =
12 13

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Transpose of a Matrix
The transpose of matrix A is found by interchanging its
rows and columns.

−4 2 5 𝒎𝒙𝒏 →𝒏𝒙𝒎
𝐴=
2 1 2
−4 2
𝑇
𝐴 = 2 1
𝒕𝒓 𝑺𝒚𝒎𝒎𝒆𝒕𝒓𝒊𝒄 = 𝑺𝒚𝒎𝒎𝒆𝒕𝒓𝒊𝒄
5 2
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Transpose of a Matrix: Properties

(AT)T=A
(A+B)T = AT + BT
k(AT) = kAT
(ABCDE)T = E T D T C T B T A T

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Determinant of a Matrix
The determinant is a scalar value that is a certain
function of the entries of a square matrix.
𝑛

det 𝐴 = 𝐴 = ෍ 𝑎𝑖𝑘 𝐶𝑖𝑘 (𝑎𝑏𝑜𝑢𝑡 𝑖 𝑡ℎ 𝑟𝑜𝑤)


𝑘=1
𝑛

det 𝐴 = 𝐴 = ෍ 𝑎𝑘𝑗 𝐶𝑘𝑗 (𝑎𝑏𝑜𝑢𝑡 𝑗𝑡ℎ 𝑐𝑜𝑙. )


𝑘=1
𝑎𝑥𝑦 = 𝑒𝑙𝑒𝑚𝑒𝑛𝑡
𝐶𝑥𝑦 = 𝑐𝑜𝑓𝑎𝑐𝑡𝑜𝑟 𝑜𝑓 𝑎𝑛 𝑒𝑙𝑒𝑚𝑒𝑛𝑡
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Determinant of a Matrix
The determinant of a 2 x 2 matrix is equal to:

𝑎 𝑏
𝐴 = BASKET-WEAVE METHOD
𝑐 𝑑
𝐴 = 𝑎𝑑 − 𝑏𝑐

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Determinant of a Matrix
The determinant of a 3 x 3 matrix is equal to:

𝑎 𝑏 𝑐 𝑎 𝑏
𝐴 = 𝑑 𝑒 𝑓 𝑑 𝑒
𝑔 ℎ 𝑖 𝑔 ℎ

𝐴 = 𝑎 𝑒𝑖 − 𝑓ℎ − 𝑏 𝑑𝑖 − 𝑓𝑔 + 𝑐(𝑑ℎ − 𝑒𝑔)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Minor of an Element
The minor of an element 𝑴𝒊𝒋 is equal to the determinant
of the submatrix of matrix A after eliminating the ith row
and jth column of that element:

𝑎 𝑏 𝑐
𝑑 𝑒 𝑓
𝑔 ℎ 𝑖
𝑒 𝑓
𝑀𝑎 = 𝑀11 = = 𝑒𝑖 − 𝑓ℎ
ℎ 𝑖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Cofactor of an Element
The cofactor of an element 𝑪𝒊𝒋 is equal to:

𝐶𝑖𝑗 = −1 𝑖+𝑗 (𝑀 ) 𝑎 𝑏 𝑐
𝑖𝑗
𝑑 𝑒 𝑓
M𝑖𝑗 = 𝑚𝑖𝑛𝑜𝑟 𝑜𝑓 𝑎𝑛 𝑒𝑙𝑒𝑚𝑒𝑛𝑡
𝑔 ℎ 𝑖

𝐶11 = −1 1+1 [𝑒𝑖 − 𝑓ℎ]

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Cofactor of an Element
The cofactor of an element 𝑪𝒊𝒋 is equal to:

𝐶𝑖𝑗 = −1 𝑖+𝑗 (𝑀 ) 𝑎 𝑏 𝑐
𝑖𝑗
𝑑 𝑒 𝑓
M𝑖𝑗 = 𝑚𝑖𝑛𝑜𝑟 𝑜𝑓 𝑎𝑛 𝑒𝑙𝑒𝑚𝑒𝑛𝑡
𝑔 ℎ 𝑖

𝐶12 = −1 1+2 [𝑑𝑖 − 𝑓𝑔]


𝐶12 = − 𝑑𝑖 − 𝑓𝑔 = 𝑓𝑔 − 𝑑𝑖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Determinant of a Matrix
The determinant of a 4 x 4 matrix is equal to:
𝑎 𝑏 𝑐 𝑑 + − + −
𝑒 𝑓 𝑔 ℎ − + − +
𝐴 =
𝑖 𝑗 𝑘 𝑙 + − + −
𝑚 𝑛 𝑜 𝑝 − + − +
𝑓 𝑔 ℎ 𝑏 𝑐 𝑑 𝑏 𝑐 𝑑 𝑏 𝑐 𝑑
𝐴 =𝑎 𝑗 𝑘 𝑙 −𝑒 𝑗 𝑘 𝑙 +𝑖 𝑓 𝑔 ℎ −𝑚 𝑓 𝑔 ℎ
𝑛 𝑜 𝑝 𝑛 𝑜 𝑝 𝑛 𝑜 𝑝 𝑗 𝑘 𝑙

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Determinant of a Matrix
The determinant of a 5 x 5 matrix is equal to:
𝑎 𝑏 𝑐 𝑑 𝑒 + − + − +
𝑓 𝑔 ℎ 𝑖 𝑗 − + − + −
𝐴 = 𝑘 𝑙 𝑚 𝑛 𝑜 + − + − +
𝑝 𝑞 𝑟 𝑠 𝑡 − + − + −
𝑢 𝑣 𝑤 𝑥 𝑦
+ − + − +
𝑔 ℎ 𝑖 𝑗 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒
𝑙 𝑚 𝑛 𝑜 𝑙 𝑚 𝑛 𝑜 𝑔 ℎ 𝑖 𝑗 𝑔 ℎ 𝑖 𝑗 𝑔 ℎ 𝑖 𝑗
𝐴 =𝑎 −𝑓 +𝑘 −𝑝 +𝑢
𝑞 𝑟 𝑠 𝑡 𝑞 𝑟 𝑠 𝑡 𝑞 𝑟 𝑠 𝑡 𝑙 𝑚 𝑛 𝑜 𝑙 𝑚 𝑛 𝑜
𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑞 𝑟 𝑠 𝑡

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Determinant of a Matrix
The determinant of any matrix can be solved by following
these steps:

Pick one row or one column to work


with (preferably those with zeroes).

Draw the cofactor signs.

Sum the products of the elements and


their cofactors.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Matrix of Minors
The matrix of minors is a matrix where each element is
the minor of the elements in the original matrix.

ORIGINAL MATRIX MATRIX OF MINORS

𝑎 𝑏 𝑐 𝑒𝑖 − 𝑓ℎ 𝑑𝑖 − 𝑓𝑔 𝑑ℎ − 𝑒𝑔
𝐴= 𝑑 𝑒 𝑓 𝐴𝑚 = 𝑏𝑖 − 𝑐ℎ 𝑎𝑖 − 𝑐𝑔 𝑎ℎ − 𝑏𝑔
𝑔 ℎ 𝑖 𝑏𝑓 − 𝑐𝑒 𝑎𝑓 − 𝑐𝑑 𝑎𝑒 − 𝑏𝑑

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Cofactor Matrix
The cofactor matrix is a matrix where each element is the
cofactor of the elements in the original matrix.

ORIGINAL MATRIX COFACTOR MATRIX

𝑎 𝑏 𝑐 𝑒𝑖 − 𝑓ℎ −(𝑑𝑖 − 𝑓𝑔) 𝑑ℎ − 𝑒𝑔
𝐶𝐴 = −(𝑏𝑖 − 𝑐ℎ) 𝑎𝑖 − 𝑐𝑔 −(𝑎ℎ − 𝑏𝑔)
𝐴= 𝑑 𝑒 𝑓 𝑏𝑓 − 𝑐𝑒 −(𝑎𝑓 − 𝑐𝑑) 𝑎𝑒 − 𝑏𝑑
𝑔 ℎ 𝑖
+ − +
− + −
+ − + CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Adjugate/ Adjoint of a Matrix
The adjugate/ adjoint of a matrix is the transpose of the
cofactor matrix.

ORIGINAL MATRIX ADJOINT

𝑎 𝑏 𝑐 𝑒𝑖 − 𝑓ℎ −(𝑏𝑖 − 𝑐ℎ) 𝑏𝑓 − 𝑐𝑒
𝐴𝑎𝑑𝑗 = −(𝑑𝑖 − 𝑓𝑔) 𝑎𝑖 − 𝑐𝑔 −(𝑎𝑓 − 𝑐𝑑)
𝐴= 𝑑 𝑒 𝑓 𝑑ℎ − 𝑒𝑔 −(𝑎ℎ − 𝑏𝑔) 𝑎𝑒 − 𝑏𝑑
𝑔 ℎ 𝑖

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Inverse of a Matrix
The inverse of a matrix is equal to the adjoint of the
matrix multiplied by 𝟏/ 𝑨
INVERSE

𝑒𝑖 − 𝑓ℎ −(𝑏𝑖 − 𝑐ℎ) 𝑏𝑓 − 𝑐𝑒
1
𝐴−1 = −(𝑑𝑖 − 𝑓𝑔) 𝑎𝑖 − 𝑐𝑔 −(𝑎𝑓 − 𝑐𝑑)
|𝐴|
𝑑ℎ − 𝑒𝑔 −(𝑎ℎ − 𝑏𝑔) 𝑎𝑒 − 𝑏𝑑

𝑨𝑨−𝟏 =𝑰
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Inverse of a Matrix
The inverse of a 3 x 3 matrix is equal to:
𝑒𝑖 − 𝑓ℎ 𝑏𝑖 − 𝑐ℎ 𝑏𝑓 − 𝑐𝑒 𝑤ℎ𝑒𝑟𝑒:

𝑎 𝑏 𝑐 𝑎 𝑏 𝑐 𝑎 𝑏 𝑐
𝑎 𝑏 𝑐
𝑑 𝑒 𝑓 𝑑 𝑒 𝑓 𝑑 𝑒 𝑓 𝑑 𝑒 𝑓 =
𝑔 ℎ 𝑖 𝑔 ℎ 𝑖 𝑔 ℎ 𝑖 𝑔 ℎ 𝑖
𝑑𝑖 − 𝑓𝑔 𝑎𝑖 − 𝑐𝑔 𝑎𝑓 − 𝑐𝑑
− − 𝑎 𝑒𝑖 − 𝑓ℎ − 𝑏 𝑑𝑖 − 𝑓𝑔 + 𝑐(𝑑ℎ − 𝑒𝑔)
−1 𝑎 𝑏 𝑐 𝑎 𝑏 𝑐 𝑎 𝑏 𝑐
𝐴 =
𝑑 𝑒 𝑓 𝑑 𝑒 𝑓 𝑑 𝑒 𝑓
𝑔 ℎ 𝑖 𝑔 ℎ 𝑖 𝑔 ℎ 𝑖
𝑑ℎ − 𝑒𝑔 𝑎ℎ − 𝑏𝑔 𝑎𝑒 − 𝑏𝑑

𝑎 𝑏 𝑐 𝑎 𝑏 𝑐 𝑎 𝑏 𝑐
𝑑 𝑒 𝑓 𝑑 𝑒 𝑓 𝑑 𝑒 𝑓
𝑔 ℎ 𝑖 𝑔 ℎ 𝑖 𝑔 ℎ 𝑖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Trace of a Matrix
The trace of a matrix is equal to the sum of its diagonal
elements:

𝑎 𝑏 𝑐
𝐴= 𝑑 𝑒 𝑓
𝑔 ℎ 𝑖

𝒕𝒓𝒂𝒄𝒆 𝑨 = 𝒂 + 𝒆 + 𝒊

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Conjugate of a Matrix
The conjugate of a matrix is obtained by replacing each
element with its complex conjugate:

𝑎 𝑏 + 3𝑖 𝑐 𝝀 𝒊 = 𝝀𝒊
𝐴= 𝑑 𝑒 −2𝑖 + 𝑓 𝟐
𝒊 = −𝟏
𝑖 ℎ 7 + 8𝑖 𝟐
𝝀 𝒊 = −𝝀
𝑎 𝑏 − 3𝑖 𝑐
𝐴ҧ = 𝑑 𝑒 2𝑖 + 𝑓
−𝑖 ℎ 7 − 8𝑖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Real Matrix
A real matrix where all elements re composed of real
numbers:

2 3 −1
𝐴= 0 −1 −5 ഥ
𝑨=𝑨
2 1 8

2 3 −1
𝐴ҧ = 0 −1 −5
2 1 8
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Tranjugate of a Matrix
The tranjugate of a matrix is the transpose of its
conjugate:

𝑎 𝑏 + 3𝑖 𝑐
𝐴= 𝑑 𝑒 −2𝑖 + 𝑓
𝑖 ℎ 7 + 8𝑖
𝑎 𝑑 −𝑖
ҧ 𝑇
𝐴 = 𝑏 − 3𝑖 𝑒 ℎ
𝑐 2𝑖 + 𝑓 7 − 8𝑖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
List of Non-Programmable Calculators Allowed

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


List of Non-Programmable Calculators Allowed

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


List of Non-Programmable Calculators Allowed

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


List of Non-Programmable Calculators Allowed

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Calculator Techniques (Canon F-789SGA)
Addition
Subtraction CASIO:
https://www.youtube.com/watch?v=4Is9fLxXCFE&t=320s
Multiplication
CANON:
Transpose https://www.youtube.com/watch?v=ykTr9adhYV8

Determinant
Adjoint
Inverse

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Perform the operations
PROBLEM
𝐴+𝐵
𝐴−𝐵
7 −1 6
2 −1 1 𝐴𝑇 𝐵𝑇
−8 0 1
2 4 1 3 |𝐶|
𝐴= 3 𝐶=
0 −1
−2 −4 2 𝐴𝐷
2 1 3 5 |𝐵|𝐶𝐴
2 0 −1 −2 0 −1 −2 𝐴𝐵𝐶 𝑇
1 2 𝐴𝐵−1 −1
𝐵 = −1 2 𝐷= 4 1 1
2 7
0 6 3 3 2 1 −1 𝐶 𝑇 𝐷𝑇 + 𝐴𝐵 −1

𝐴−1 𝐵𝑇 D−1 𝐶 −1 𝐶 𝑇
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
PROBLEM
3
𝑥 2
𝑓(𝑥) = 𝑡𝑟𝑎𝑐𝑒 𝑓 𝑥 = 𝑥 3 − 6𝑥 2
3 −6𝑥 2
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47

When x for which f(x) has: 𝑓 ′ 𝑥 = 3𝑥 2 − 12𝑥 = 0


a. A relative maximum
𝑥 = 0, 𝑥 = 4
b. A relative minimum
𝑓 ′′ 𝑥 = 6𝑥 − 12
c. An inflection point

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PROBLEM
3
𝑥 2
𝑓(𝑥) = 𝑡𝑟𝑎𝑐𝑒 𝑓 𝑥 = 𝑥 3 − 6𝑥 2
3 −6𝑥 2
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47

When x for which f(x) has: 𝑥 = 0, 𝑥 = 4


a. A relative maximum
𝑓 ′′ 𝑥 = 6𝑥 − 12
b. A relative minimum
𝑥 = 0, 𝑓 ′′ 𝑥 = −12 (𝑙𝑜𝑐𝑎𝑙 𝑚𝑎𝑥)
c. An inflection point
𝑥 = 4, 𝑓 ′′ 𝑥 = 12 (𝑙𝑜𝑐𝑎𝑙 𝑚𝑖𝑛)
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
PROBLEM
3
𝑥 2
𝑓(𝑥) = 𝑡𝑟𝑎𝑐𝑒 𝑓 𝑥 = 𝑥 3 − 6𝑥 2
3 −6𝑥 2
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47

When x for which f(x) has:


a. A relative maximum (x=0) 𝑓 ′′ 𝑥 = 6𝑥 − 12
b. A relative minimum (x=4) 𝑓 ′′ 𝑥 = 6𝑥 − 12 = 0; 𝑥 = 2
c. An inflection point

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PROBLEM
3
𝑥 2
𝑓(𝑥) = 𝑡𝑟𝑎𝑐𝑒 𝑓 𝑥 = 𝑥 3 − 6𝑥 2
3 −6𝑥 2
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47

When x for which f(x) has:


a. A relative maximum (x=0)

b. A relative minimum (x=4)

c. An inflection point (x=2)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PROBLEM
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47
A relative maximum (x=0)
1 −1 2 5 −2 6 13
16 0 −4 0+
−1 −1 −2 4 19 47

𝟔 𝟏𝟑
𝟏𝟗 𝟒𝟕

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PROBLEM
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47
A relative minimum (x=4)
1 −1 2 5 −2 6 13
16 4 −4 4+
−1 −1 −2 4 19 47

𝟏𝟖𝟐 −𝟐𝟏𝟏
−𝟐𝟎𝟓 −𝟐𝟕𝟑

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PROBLEM
Find the matrix defined by:
1 −1 2 5 −2 6 13
16 𝑥 −4 𝑥+
−1 −1 −2 4 19 47
An inflection point (x=2)
1 −1 2 5 −2 6 13
16 2 −4 2+
−1 −1 −2 4 19 47

𝟑𝟎 −𝟑𝟓
−𝟐𝟗 −𝟒𝟗

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PART II

LINEAR
SYSTEMS
LINEAR SYSTEMS OF EQUATIONS
PART II OUTLINE
❑ CRAMER’S RULE
❑ GAUSSIAN ELIMINATION
❑ ROW ECHELON FORM
❑ GAUSS-JORDAN ELIMINATION
❑ REDUCED ROW ECHELON FORM
❑ UNIQUE SOLUTIONS
❑ NO SOLUTION
❑ INFINITE SOLUTIONS
❑ HOMOGENEOUS SYSTEMS OF LINEAR EQUATIONS
❑ JACOBI ITERATION
❑ GAUSS-SEIDEL ITERATION

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Cramer’s Rule
A system of linear equations can either have:

Infinite Unique No
Solutions Solution Solution

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Cramer’s Rule
It expresses the solutions in terms of the determinants of
square matrices.

3𝑥 + 2𝑦 − 4𝑧 = 4 A = coefficient matrix
ቐ−2𝑥 + 3𝑦 + 𝑧 = 12 𝑨𝑿 = 𝑩 X = variable matrix
𝑥 − 2𝑦 + 2𝑧 = −10 B = constants matrix

3 2 −4 𝑥 4
𝐴 = −2 3 1 𝑋 = 𝑦 𝐵 = 12
1 −2 2 𝑧 −10
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Cramer’s Rule
To get the unknowns:

𝑎 𝑏 𝑐 𝑥 𝐶1
𝐴= 𝑑 𝑒 𝑓 𝑋= 𝑦 𝐵 = 𝐶2
𝑔 ℎ 𝑖 𝑧 𝐶3
𝐶1 𝑏 𝑐
𝐴𝑥 , 𝐴𝑦 , 𝐴𝑧
𝑥, 𝑦, 𝑧 = 𝐴𝑥 = 𝐶2 𝑒 𝑓
𝐴 𝐶3 ℎ 𝑖
𝐴𝑥,𝑦,𝑧 = 𝑛𝑢𝑚𝑒𝑟𝑎𝑡𝑜𝑟 𝑑𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑛𝑡 𝑜𝑓 𝑥, 𝑦, 𝑧
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Cramer’s Rule
To determine the type of solution the set of equations
has:
One/ Unique
D≠0
Solution

At least one
numerator Infinite
D=0
determinant Solutions
=0

No
numerator
D=0 No Solution
determinant
=0

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Cramer’s Rule: Four Equations
𝑎𝑤 + 𝑏𝑥 + 𝑐𝑦 + 𝑑𝑧 = 𝑠 𝐴𝑦 𝐴𝑧
𝑒𝑤 + 𝑓𝑥 + 𝑔𝑦 + ℎ𝑧 = 𝑡
𝐴𝑤 𝐴𝑥 𝑧=
𝑤= 𝑥= 𝑦= |𝐴|
𝑖𝑤 + 𝑗𝑥 + 𝑘𝑦 + 𝑙𝑧 = 𝑢 |𝐴| |𝐴| |𝐴|
𝑚𝑤 + 𝑛𝑥 + 𝑜𝑦 + 𝑝𝑧 = 𝑣
𝑠 𝑏 𝑐 𝑑 𝑎 𝑏 𝑠 𝑑
𝑡 𝑓 𝑔 ℎ 𝑒 𝑓 𝑡 ℎ - The number of determinants to be
𝐴𝑤 = 𝐴𝑦 =
𝑢 𝑗 𝑘 𝑙 𝑖 𝑗 𝑢 𝑙
𝑣 𝑛 𝑜 𝑝 𝑚 𝑛 𝑣 𝑝 solved is equal to n+1, where n is the
number of unknowns.
𝑎 𝑠 𝑐 𝑑 𝑎 𝑏 𝑐 𝑠
- The determinants are those of n x n
𝑒 𝑡 𝑔 ℎ 𝑒 𝑓 𝑔 𝑡
𝐴𝑥 = 𝐴𝑥 =
𝑖 𝑢 𝑘 𝑙 𝑖 𝑗 𝑘 𝑢 matrices.
𝑚 𝑣 𝑜 𝑝 𝑚 𝑛 𝑜 𝑣
- If there are n unknowns, you should
𝑎 𝑏 𝑐 𝑑 solve n+1 determinants of n x n
𝑒 𝑓 𝑔 ℎ
𝐴 =
𝑖 𝑗 𝑘 𝑙
matrices.
𝑚 𝑛 𝑜 𝑝
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Gaussian Elimination
The main goal of Gaussian Elimination is to transform the
augmented matrix into a row-echelon form by using
Elementary Row Operations.

𝑥 − 2𝑦 + 3𝑧 = 9 1 −2 3 9 1 −2 39
ቐ −𝑥 + 3𝑦 = −4 → −1 3 0 −4 → 0 1 35
2𝑥 − 5𝑦 + 5𝑧 = 17 2 −5 5 17 0 0 12

𝑦 + 3 2 = 5; 𝑦 = −1
𝑥 − 2𝑦 + 3𝑧 = 9
ቐ 𝑦 + 3𝑧 = 5 𝑥 − 2 −1 + 3 2 = 9; 𝑥 = 1
𝑧=2 𝒙, 𝒚, 𝒛 = {(𝟏, −𝟏, 𝟐)}

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Row-Echelon Form
- Leading entries are
equal to 1.
- All the entries below
the staircase line is
equal to zero.
- Each step of the
staircase has a
height of 1.
- Each circle marks a
free variable.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Row-Echelon Form (Strict Triangular)
A strict triangular form is
a particular case of row-
echelon form that can
occur for systems of n
equations in n variables.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Gaussian Elimination – Unique Solution
0 1 1 −2 −3 𝑅1 𝑅2 1 2 −1 0 2 1
1 2 −1 0 2 0 1 1 −2 −3 3 𝑅3 → 𝑅3
2 4 1 −3 −2 0 0 3 −3 −6
1 −4 −7 −1 −19 0 0 0 −13 −39
1 2 −1 0 2 −2𝑅1 + 𝑅3 → 𝑅3 1 2 −1 0 2 1
0 1 1 −2 −3 𝟏 𝐢𝐬 𝐭𝐡𝐞 𝐩𝐢𝐯𝐨𝐭 (𝐚𝟏𝟏) 0 1 1 −2 −3 − 13 𝑅4 → 𝑅4
2 4 1 −3 −2 0 0 1 −1 −2
1 −4 −7 −1 −19 0 0 0 −13 −39
1 2 −1 0 2 −𝑅 + 𝑅 → 𝑅 1 2 −1 0 2
1 4 4 𝑥1 + 2𝑥2 − 𝑥3 = 2
0 1 1 −2 −3 0 1 1 −2 −3 𝑥2 + 𝑥3 − 2𝑥4 = −3
0 0 3 −3 −6 0 0 1 −1 −2 𝑥3 − 𝑥4 = −2
1 −4 −7 −1 −19 0 0 0 1 3
𝑥4 = 3

1 2 −1 0 2 6𝑅2 + 𝑅4 → 𝑅4 𝑥3 − 3 = −2 + 3; 𝑥3 = 1
0 1 1 −2 −3 𝟏 𝐢𝐬 𝐭𝐡𝐞 𝐩𝐢𝐯𝐨𝐭 (𝐚𝟐𝟐) 𝑥2 + 1 − 2 3 = −3; 𝑥2 = 2
0 0 3 −3 −6
𝑥1 + 2 2 − 1 = 2; 𝑥1 = −1
0 −6 −6 −1 −21
𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑, 𝒙𝟒 = {(−𝟏, 𝟐, 𝟏, 𝟑)}

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Gauss-Jordan Elimination
The main goal of Gauss-Jordan Elimination is to
transform the augmented matrix into a reduced row-
echelon form by using Elementary Row Operations.

𝑥 − 2𝑦 + 3𝑧 = 9 1 −2 3 9 1 −2 39 1 0 0 1
ቐ −𝑥 + 3𝑦 = −4 → −1 3 0 −4 → 0 1 35 → 0 1 0 −1
2𝑥 − 5𝑦 + 5𝑧 = 17 2 −5 5 17 0 0 12 0 0 1 2

𝒙, 𝒚, 𝒛 = {(𝟏, −𝟏, 𝟐)}

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Reduced Row-Echelon Form
- It follows the row-echelon
form.
- The leading entry in each row
is the only non-zero entry in its
column.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Gauss-Jordan Elimination – Unique Solution
1 2 −1 0 2 −2𝑅2 + 𝑅1 → 𝑅1
0 1 1 −2 −3 𝟏 𝐢𝐬 𝐭𝐡𝐞 𝐩𝐢𝐯𝐨𝐭 (𝐚𝟐𝟐)
0 0 1 −1 −2
0 0 0 1 3
1 0 −3 4 8 3𝑅3 + 𝑅1 → 𝑅1
0 1 1 −2 −3 −𝑅3 + 𝑅2 → 𝑅2
0 0 1 −1 −2 𝟏 𝐢𝐬 𝐭𝐡𝐞 𝐩𝐢𝐯𝐨𝐭 (𝐚𝟑𝟑)
0 0 0 1 3
1 0 0 1 2 −𝑅4 + 𝑅1 → 𝑅1
0 1 0 −1 −1 𝑅4 + 𝑅2 → 𝑅2
0 0 1 −1 −2 𝑅4 + 𝑅3 → 𝑅3
0 0 0 1 3 𝟏 𝐢𝐬 𝐭𝐡𝐞 𝐩𝐢𝐯𝐨𝐭 (𝐚𝟒𝟒)
1 0 0 0 −1
0
0
0
1
0
0
0
1
0
0
0
1
2
1
3 → 𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 , 𝒙𝟒 = {(−𝟏, 𝟐, 𝟏, 𝟑)}

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Gaussian/ Gauss-Jordan Elimination – No Solution
1 2 3 4 𝑥1 + 2𝑥2 + 3𝑥3 = 4
0 1 −1 2 ቐ 𝑥2 − 𝑥3 = 2
0 0 0 5 0=5

A system of linear equations has no solution if, after performing


Gaussian elimination, you find a row that consists entirely of
zeros in the coefficient matrix (the part of the matrix excluding
the augmented column) but has a non-zero in the corresponding
entry of the augmented column.

Such system of linear equations is called inconsistent.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Gaussian/ Gauss-Jordan Elimination – Infinite Solutions
1 2 3 4 𝑥1 + 2𝑥2 + 3𝑥3 = 4
0 1 −1 2 ቐ 𝑥2 − 𝑥3 = 2
0 0 0 0 0=0
A system of linear equations has infinite solutions if, after
performing Gaussian elimination, you find at least one row that
consists entirely of zeros in the coefficient matrix (the part of
the matrix excluding the augmented column) but has a zero in
the corresponding entry of the augmented column.

This indicates that there are free/ nonleading variables,


leading to infinitely many solutions.
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Gaussian/ Gauss-Jordan Elimination – Infinite Solutions
1 2 3 4 𝑥 + 2𝑦 + 3𝑧 = 4 𝑥 = −5𝑡
0 1 −1 2 ቐ 𝑦−𝑧 =2 ቐ𝑦 = 2 + 𝑡
0 0 0 0 0=0 𝑧=𝑡
The free/ nonleading variable is z because the last row
contains entirely of zeros. Here, z is considered the
independent variable.

𝒙, 𝒚, 𝒛 = { 𝟎, 𝟐, 𝟎 + 𝒕 −𝟓, 𝟏, 𝟏 }
𝑡 = 1: 𝑥, 𝑦, 𝑧 = 0,2,0 + 1 −5,1,1 = {(−5,3,1)}
𝑡 = 2: 𝑥, 𝑦, 𝑧 = 0,2,0 + 2 −5,1,1 = {(−10,4,2)}
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Gaussian/ Gauss-Jordan Elimination – Infinite Solutions
1 2 3 4 10 −2𝑅2 + 𝑅1 → 𝑅1
0 1 2 3 6 𝑥 + 2𝑥2 + 3𝑥3 + 4𝑥4 = 10
ቊ 1
0 0 0 0 0 𝑥2 + 2𝑥3 + 3𝑥4 = 6
0 0 0 0 0
1 0 −1 −2 −2
0 1 2 3 6
0 0 0 0 0
0 0 0 0 0 𝒙𝟑, 𝒙𝟒 are the FREE variables

𝑥 = 𝑥3 + 2𝑥4 − 2
ቊ 1
𝑥2 = −2𝑥3 − 3𝑥4 + 6
𝐿𝑒𝑡: 𝑥3 = 𝑡, 𝑥4 = 𝑠 𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 , 𝒙𝟒 = { −𝟐, 𝟔, 𝟎, 𝟎 + 𝒕 𝟏, −𝟐, 𝟏, 𝟎 + 𝒔(𝟐, −𝟑, 𝟎, 𝟏)}
𝒕 = 𝟓, 𝒔 = 𝟒
𝑥1 = 𝑡 + 2𝑠 − 2
𝑥2 = −2𝑡 − 3𝑠 + 6 𝒙 𝟏 , 𝒙𝟐 , 𝒙𝟑 , 𝒙𝟒 = { −𝟐, 𝟔, 𝟎, 𝟎 + 𝟓, −𝟏𝟎, 𝟓, 𝟎 + (𝟖, −𝟏𝟐, 𝟎, 𝟒)}
𝑥3 = 𝑡
𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 , 𝒙 𝟒 = { 𝟏𝟏, −𝟏𝟔, 𝟓, 𝟒 }
𝑥4 = 𝑠

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Homogeneous System of Linear Equations
TRIVIAL SOLUTION
𝑥1 , 𝑥2 , 𝑥3 = 0

- Where each of the constant terms is zero, we call such systems


homogeneous.
- If all variables in a homogeneous system have the value zero, then each of
the equations must be satisfied. Such a solution is called trivial (or obvious).
- Every homogeneous system of linear equations is consistent. Moreover, if
the system has fewer equations than variables, then it must have an
infinite number of solutions.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Iterative Methods in Solving Systems of Linear Equations
Iterative methods converge in diagonally dominant
matrices.
−4 2 1 −4 > 2 + 1
𝐶= 1 6 2
6 > 1 + 2
1 −2 5
5 > 1 + −2

SET ONE SET TWO SET THREE


8𝑥 + 3𝑦 + 𝑧 = 12 𝑥 + 𝑦 + 5𝑧 = 7 −𝑥 + 3𝑦 + 5𝑧 = 7
ቐ −6𝑥 + 7𝑧 = 1 ቐ𝑥 + 4𝑦 − 𝑧 = 4 ቐ−2𝑥 + 4𝑦 − 5𝑧 = −3
2𝑥 + 4𝑦 − 𝑧 = 5 3𝑥 + 𝑦 − 𝑧 = 4 2𝑦 − 𝑧 = 1

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Jacobi Iteration
Parallel Updates: All the values are updated simultaneously. The
values at the current iteration are computed using the values
from the previous iteration for all variables.
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ 𝑎2𝑛 𝑥𝑛 = 𝑏2 𝒏
⋮ (𝒌) 𝟏 𝒌−𝟏
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
𝒙𝒊 = ෍ −𝒂𝒊𝒋 𝒙𝒋 + 𝒃𝒊 ,
𝒂𝒊𝒊
𝒋=𝟏
1
𝑥1 = (𝑏 −𝑎 𝑥 − 𝑎13 𝑥3 − ⋯ 𝑎1𝑛 𝑥𝑛 ) 𝒋≠𝒊
𝑎11 1 12 2
1 𝒇𝒐𝒓 𝒊 = 𝟏, 𝟐, … 𝒏
𝑥2 = (𝑏2 −𝑎21 𝑥1 − 𝑎23 𝑥3 − ⋯ 𝑎2𝑛 𝑥𝑛 )
𝑎22

1
𝑥𝑛 = (𝑏𝑛 −𝑎𝑛1 𝑥1 − 𝑎𝑛2 𝑥2 − ⋯ 𝑎𝑛,𝑛−1 𝑥𝑛−1 )
𝑎𝑛𝑛
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Jacobi Iteration 𝑥1 =
1
(12.6 − 2𝑥2 − 2𝑥3 )
26
𝟐𝟔𝒙𝟏 + 𝟐𝒙𝟐 + 𝟐𝒙𝟑 = 𝟏𝟐. 𝟔 1
𝑥2 = (−14.3 − 3𝑥1 − 𝑥3 )
𝟑𝒙𝟏 + 𝟐𝟕𝒙𝟐 + 𝒙𝟑 = −𝟏𝟒. 𝟑 27
1
𝟐𝒙𝟏 + 𝟑𝒙𝟐 + 𝟏𝟕𝒙𝟑 = 𝟔. 𝟎 𝑥3 = (6 − 2𝑥1 − 3𝑥2 ) 𝝐 = |𝒙𝒊 − 𝒙𝒊−𝟏 | < 𝝐𝒔 = 𝟎. 𝟎𝟎𝟎𝟓
17

ITERATION 𝒙𝟏 𝛜𝟏 𝒙𝟐 𝛜𝟐 𝒙𝟑 𝛜𝟑

0 0 - 0 - 0 -
1 0.48462 0.48462 -0.52963 0.52963 0.35294 0.35294
2 0.49821 0.01359 -0.59655 0.06992 0.38939 0.03645
3 0.50055 0.00234 -0.59941 0.00286 0.39960 0.010121
4 0.49999 0.00056 -0.60005 0.00064 0.39983 0.00023
5 0.50002 0.00003 -0.59999 0.000065 0.40001 0.00018

𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 = { 𝟎. 𝟓𝟎𝟎𝟎𝟐, −𝟎. 𝟓𝟗𝟗𝟗𝟗, 𝟎. 𝟒𝟎𝟎𝟎𝟏 }


CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Gauss-Seidel Iteration
Sequential Updates: Each unknown is updated immediately
using the most recent values from the current iteration. Once a
variable is updated, it is used in subsequent calculations within
the same iteration.
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ 𝑎1𝑛 𝑥𝑛 = 𝑏1 𝒊−𝟏 𝒏
𝒌−𝟏
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ 𝑎2𝑛 𝑥𝑛 = 𝑏2 (𝒌) 𝟏 𝒌 𝒂𝒊𝒋 𝒙𝒋
𝒙𝒊 = − ෍ 𝒂𝒊𝒋 𝒙𝒋 − ෍ ,
⋮ 𝒂𝒊𝒊 +𝒃𝒊
𝒋=𝟏 𝒋=𝒊+𝟏
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
𝒇𝒐𝒓 𝒊 = 𝟏, 𝟐, … 𝒏
(𝑘) 𝑘−1 𝑘−1
𝑎11 𝑥1 = −𝑎12 𝑥2 − ⋯ − 𝑎1𝑛 𝑥𝑛 + 𝑏1
(𝑘) (𝑘) 𝑘−1 𝑘−1
𝑎21 𝑥1 + 𝑎22 𝑥2 = −𝑎23 𝑥3 − ⋯ − 𝑎2𝑛 𝑥𝑛 + 𝑏2

(𝑘) (𝑘) (𝑘)
𝑎𝑛1 𝑥1 𝑎𝑛2 𝑥2 + ⋯ 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Gauss-Seidel Iteration 𝑥1 =
1
(12.6 − 2𝑥2 − 2𝑥3 )
26
𝟐𝟔𝒙𝟏 + 𝟐𝒙𝟐 + 𝟐𝒙𝟑 = 𝟏𝟐. 𝟔 1
𝑥2 = (−14.3 − 3𝑥1 − 𝑥3 )
𝟑𝒙𝟏 + 𝟐𝟕𝒙𝟐 + 𝒙𝟑 = −𝟏𝟒. 𝟑 27
1
𝟐𝒙𝟏 + 𝟑𝒙𝟐 + 𝟏𝟕𝒙𝟑 = 𝟔. 𝟎 𝑥3 = (6 − 2𝑥1 − 3𝑥2 ) 𝝐 = |𝒙𝒊 − 𝒙𝒊−𝟏 | < 𝝐𝒔 = 𝟎. 𝟎𝟎𝟎𝟓
17

ITERATION 𝒙𝟏 𝛜𝟏 𝒙𝟐 𝛜𝟐 𝒙𝟑 𝛜𝟑

0 0 - 0 - 0 -

1 0.48462 0.48462 -0.58348 0.58348 0.39889 0.39889

2 0.49981 0.01419 -0.59983 0.01635 0.40011 0.00122

3 0.49998 0.00117 -0.60000 0.00017 0.40000 0.00011

4 0.5 0.00002 -0.6 0 0.4 0

𝒙𝟏 , 𝒙 𝟐 , 𝒙 𝟑 = { 𝟎. 𝟓, −𝟎. 𝟔, 𝟎. 𝟒 }
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
EXAMPLE
𝟐𝒂 + 𝟑𝒃 + 𝒄 + 𝟐𝒅 + 𝟐𝒆 = 𝟏𝟏
−𝒂 + 𝟕𝒃 + 𝟐𝒄 − 𝒅 = −𝟒
𝟒𝒂 + 𝟑𝒄 + 𝟒𝒅 + 𝒆 = 𝟏𝟓
𝒃 + 𝟒𝒄 + 𝒅 − 𝒆 = −𝟏
𝟑𝒂 − 𝟐𝒃 + 𝒄 − 𝒅 − 𝒆 = 𝟏𝟒

𝐹𝑖𝑛𝑑 𝑎!.
2 3 1 2 2 11 3 1 2 2
−1 7 2 −1 0 −4 7 2 −1 0
𝐴 = 4 0 3 4 1 𝐴𝑎 = 15 0 3 4 1
0 1 4 1 −1 −1 1 4 1 −1
3 −2 1 −1 −1 14 −2 1 −1 −1
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
EXAMPLE
𝑎 𝑏 𝑐 𝑑 𝑒 2 3 1 2 2
𝑓 𝑔 ℎ 𝑖 𝑗 −1 7 2 −1 0
𝐴 = 𝑘 𝑙 𝑚 𝑛 𝑜 𝐴 = 4 0 3 4 1
𝑝 𝑞 𝑟 𝑠 𝑡 0 1 4 1 −1
3 −2 1 −1 −1
𝑢 𝑣 𝑤 𝑥 𝑦

𝑔 ℎ 𝑖 𝑗 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒
𝑙 𝑚 𝑛 𝑜 𝑙 𝑚 𝑛 𝑜 𝑔 ℎ 𝑖 𝑗 𝑔 ℎ 𝑖 𝑗 𝑔 ℎ 𝑖 𝑗
𝐴 =𝑎 −𝑓 +𝑘 −𝑝 +𝑢
𝑞 𝑟 𝑠 𝑡 𝑞 𝑟 𝑠 𝑡 𝑞 𝑟 𝑠 𝑡 𝑙 𝑚 𝑛 𝑜 𝑙 𝑚 𝑛 𝑜
𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑞 𝑟 𝑠 𝑡

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


EXAMPLE
𝑎 𝑏 𝑐 𝑑 𝑒 11 3 1 2 2
𝑓 𝑔 ℎ 𝑖 𝑗 −4 7 2 −1 0
𝐴 = 𝑘 𝑙 𝑚 𝑛 𝑜 𝐴𝑎 = 15 0 3 4 1
𝑝 𝑞 𝑟 𝑠 𝑡 −1 1 4 1 −1
14 −2 1 −1 −1
𝑢 𝑣 𝑤 𝑥 𝑦

𝑔 ℎ 𝑖 𝑗 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒
𝑙 𝑚 𝑛 𝑜 𝑙 𝑚 𝑛 𝑜 𝑔 ℎ 𝑖 𝑗 𝑔 ℎ 𝑖 𝑗 𝑔 ℎ 𝑖 𝑗
𝐴𝑎 =𝑎 −𝑓 +𝑘 −𝑝 +𝑢
𝑞 𝑟 𝑠 𝑡 𝑞 𝑟 𝑠 𝑡 𝑞 𝑟 𝑠 𝑡 𝑙 𝑚 𝑛 𝑜 𝑙 𝑚 𝑛 𝑜
𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑣 𝑤 𝑥 𝑦 𝑞 𝑟 𝑠 𝑡

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


EXAMPLE
𝟐𝒂 + 𝟑𝒃 + 𝒄 + 𝟐𝒅 + 𝟐𝒆 = 𝟏𝟏 𝐴𝑤 𝑎=4
−𝒂 + 𝟕𝒃 + 𝟐𝒄 − 𝒅 = −𝟒 𝑎=
𝟒𝒂 + 𝟑𝒄 + 𝟒𝒅 + 𝒆 = 𝟏𝟓 |𝐴|
𝑎! = 4𝑥3𝑥2𝑥1
𝒃 + 𝟒𝒄 + 𝒅 − 𝒆 = −𝟏
1084
𝟑𝒂 − 𝟐𝒃 + 𝒄 − 𝒅 − 𝒆 = 𝟏𝟒 𝑎 = 𝒂! = 𝟐𝟒
271
𝐹𝑖𝑛𝑑 𝑎!.
2 3 1 2 2 11 3 1 2 2
−1 7 2 −1 0 −4 7 2 −1 0
𝐴 = 4 0 3 4 1 𝐴𝑎 = 15 0 3 4 1
0 1 4 1 −1 −1 1 4 1 −1
3 −2 1 −1 −1 14 −2 1 −1 −1
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
PART III
NONLINEAR
EQUATIONS/ SYSTEMS
ROOT FINDING TECHNIQUES AND NONLINEAR
SYSTEMS OF EQUATIONS
PART III OUTLINE
❑ BISECTION METHOD
❑ FIXED POINT ITERATION
❑ NEWTON-RAPHSON METHOD
❑ SECANT METHOD
❑ REGULA FALSI METHOD
❑ STOPPING CRITERIA IN ROOT FINDING TECHNIQUES
❑ NONLINEAR SYSTEMS OF EQUATIONS
❑ JACOBIAN MATRIX
❑ STOPPING CRITERIA IN NONLINEAR SYSTEMS OF
EQUATIONS
NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES
ARE PLACED IN ITERATION 1. (WILL CORRECT ON MONDAY IF
THIS IS NOT THE CASE)
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Bisection Method
𝒇(𝒂)

𝒘𝒆 𝒘𝒂𝒏𝒕 𝒕𝒉𝒊𝒔!

𝒇(𝒄)

𝒃
𝒂 𝒄

𝒇(𝒃)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Bisection Method

𝒘𝒆 𝒘𝒂𝒏𝒕 𝒕𝒉𝒊𝒔!

𝒇(𝒂)

𝒄 𝒃
𝒂
𝒇(𝒄)

𝒇(𝒃)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Bisection Method

𝒘𝒆 𝒘𝒂𝒏𝒕 𝒕𝒉𝒊𝒔!

𝒇(𝒂)

𝒃
𝒂
𝒇(𝒃)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Bisection Method
INITIAL GUESS
(a & b) where a < b

Get f(a) and f(b). If it changes sign, the root exists between a and b. Proceed to Step 3. If not,
go back to Step 1 and refine the guesses.

Get the midpoint, c: c = (a+b)/2. Get f(c).

To proceed, check the two neighboring points that are different in signs. If yes, these are the
two new points a and b. Then repeat Step 3 until you meet the criterion.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Bisection Method NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES ARE PLACED IN
ITERATION 1. (WILL CORRECT ON MONDAY IF THIS IS NOT THE CASE)

𝒇 𝒙 = 𝒙𝟐 − 𝟑𝒙 + 𝟏 = 𝟎
BISECTION METHOD
Iteration a c b f(a) f(c) f(b) Rel. Err
0 0 0.5 1 1 -0.25 -1 -
1 0 0.25 0.5 1 0.3125 -0.25 1
2 0.25 0.375 0.5 0.3125 0.015625 -0.25 0.333333333
3 0.375 0.4375 0.5 0.015625 -0.12109375 -0.25 0.142857143
4 0.375 0.40625 0.4375 0.015625 -0.053710938 -0.12109375 0.076923077
5 0.375 0.390625 0.40625 0.015625 -0.019287109 -0.053710938 0.04
6 0.375 0.3828125 0.390625 0.015625 -0.00189209 -0.019287109 0.020408163
7 0.375 0.37890625 0.3828125 0.015625 0.006851196 -0.00189209 0.010309278
8 0.37890625 0.38085938 0.3828125 0.006851196 0.002475739 -0.00189209 0.005128205

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Fixed Point Iteration
1
𝟐 𝑔 𝑥 =3−
𝒇 𝒙 = 𝒙 − 𝟑𝒙 + 𝟏 = 𝟎 𝑔 𝑥 = 3𝑥 − 1
𝑥
𝑥2 + 1
𝑔 𝑥 = 𝑦=𝑥
3

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Fixed Point Iteration

𝒚=𝒙

𝒈(𝒙)
𝒂𝟏 𝒈(𝒂)

𝒂𝟐
𝒂𝟑 𝒈(𝒂𝟏 )
𝒈(𝒂𝟐 )

𝒘𝒆 𝒘𝒂𝒏𝒕 𝒕𝒉𝒊𝒔! 𝝐

𝒂𝟏 𝒂

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Fixed Point Iteration
Write all the 𝑔 𝑥 .

INITIAL GUESS: a (one point only)

Choose the 𝑔(𝑥) with the smallest value of |𝑔′ 𝑥 | at 𝑥 = 𝑎. To ensure convergence, the value
of |𝑔′ 𝑎 | should be less than 1.
To compute the other roots, you can use the same g(x) but a different initial guess or another
g(x) if it doesn’t converge.

Get g(a) and compute the relative error/ absolute relative error/ the true relative error and
stop when either one of this meets a stopping criterion to get the approximate value.
Continue using the g(a) as the new a.
To get the actual value, stop when 𝑓 𝑎 = 0.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Fixed Point Iteration NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES ARE PLACED IN
ITERATION 1. (WILL CORRECT ON MONDAY IF THIS IS NOT THE CASE)
𝒇 𝒙 = 𝒙𝟐 − 𝟑𝒙 + 𝟏 = 𝟎
FIXED POINT ITERATION
Iteration x Rel. Err
0 0.5 -
1 0.416666667 0.2
2 0.391203704 0.065088757
3 0.384346779 0.017840463
4 0.382574149 0.00463343
5 0.382120993 0.001185896
6 0.382005484 0.000302374
7 0.381976063 7.70234E-05
8 0.381968571 1.96152E-05

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Newton-Raphson Method

𝒇(𝒙𝒊 )

𝒘𝒆 𝒘𝒂𝒏𝒕 𝒕𝒉𝒊𝒔!

𝒇(𝒙𝒊+𝟏 )
𝒇(𝒙𝒊+𝟐 ) 𝒙𝒊
𝒙𝒊+𝟐 𝒙𝒊+𝟏

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Newton-Raphson Method

Find the derivative of the function.

INITIAL GUESS: a (one point only)

𝒇(𝒙𝒊 )
You get the next point by using the formula: 𝒙𝒊+𝟏 = 𝒙𝒊 − 𝒇′ 𝒙
𝒊

Iterate until criterion is met.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Newton-Raphson Method
NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES ARE PLACED IN
ITERATION 1. (WILL CORRECT ON MONDAY IF THIS IS NOT THE CASE)
𝒇 𝒙 = 𝒙𝟐 − 𝟑𝒙 + 𝟏 = 𝟎
NEWTON RAPHSON
Iteration x Rel. Err
0 0.5 -
1 0.375 0.333333333
2 0.38194444 0.018181818
3 0.38196601 5.64621E-05
4 0.38196601 5.4457E-10
5 0.38196601 0
6 0.38196601 0
7 0.38196601 0
8 0.38196601 0

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Secant Method

𝒇(𝒙𝒊+𝟏 )
𝒘𝒆 𝒘𝒂𝒏𝒕 𝒕𝒉𝒊𝒔!

𝒙𝒊−𝟏 𝒙𝒊
𝒙𝒊+𝟐 𝒙𝒊+𝟏

𝒇(𝒙𝒊 )

𝒇(𝒙𝒊−𝟏 )

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Secant Method

INITIAL GUESSES: 𝒙𝒊−𝟏 , 𝒙𝒊 . These may or may not bracket the root.

𝒇(𝒙𝒊 )[𝒙𝒊 −𝒙𝒊−𝟏 ]


You get the next point by using the formula: 𝒙𝒊+𝟏 = 𝒙𝒊 −
𝒇 𝒙𝒊 −𝒇(𝒙𝒊−𝟏 )

Iterate until criterion is met. The value of 𝒙𝒊+𝟏 is the approximate root. To get true value,
𝒇(𝒙𝒊+𝟏 ) = 𝟎.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Secant Method NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES ARE PLACED IN
ITERATION 1. (WILL CORRECT ON MONDAY IF THIS IS NOT THE CASE)

𝒇 𝒙 = 𝒙𝟐 − 𝟑𝒙 + 𝟏 = 𝟎
SECANT METHOD
Iteration xi-1 f(xi-1) xi f(xi) xi+1 f(xi+1) Rel. Err
0 0 1 1 -1 0.5 -0.25 -
1 1 -1 0.5 -0.25 0.33333333 0.11111111 0.5
2 0.5 -0.25 0.33333333 0.11111111 0.38461538 -0.00591716 0.13333333
3 0.33333333 0.11111111 0.38461538 -0.00591716 0.38202247 -0.00012625 0.00678733
4 0.38461538 -0.00591716 0.38202247 -0.00012625 0.38196594 1.4977E-07 0.00014799
5 0.38202247 -0.00012625 0.38196594 1.4977E-07 0.38196601 -3.7819E-12 1.7535E-07
6 0.38196594 1.4977E-07 0.38196601 -3.7819E-12 0.38196601 1.1102E-16 4.4279E-12
7 0.38196601 -3.7819E-12 0.38196601 1.1102E-16 0.38196601 0 1.4533E-16
8 0.38196601 1.1102E-16 0.38196601 0 0.38196601 0 0

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Regula-Falsi Method

𝒇(𝒙𝒖 )

𝒙𝒍 𝒙𝒓
𝒙𝒖
𝒇(𝒙𝒓 )

𝒇(𝒙𝒍 )

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Regula-Falsi Method
INITIAL GUESS
(𝑥𝑙 & 𝑥𝑢 )

Get f(𝑥𝑙 ) and f(𝑥𝑢 ). If it changes sign, the root exists between 𝑥𝑙 and 𝑥𝑢 . Proceed to Step 3. If
not, go back to Step 1 and refine the guesses.

Connect 𝑥𝑙 & 𝑥𝑢 with a straight line and mark 𝑥𝑟 where the line crosses the abscissa.

To proceed, check the two neighboring points that are different in signs. If yes, these are the
two new points 𝑥𝑙 and 𝑥𝑢 . Then repeat Step 3 until you meet the criterion.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Regula-Falsi Method
𝒇 𝒙 = 𝒙𝟐 − 𝟑𝒙 + 𝟏 = 𝟎
REGULA FALSI METHOD
Iteration xl xr xu f(xl) f(xr) f(xu) Rel. Err
0 0 0.5 1 1 -0.25 -1 -
1 0 0.4 0.5 1 -0.04 -0.25 0.25
2 0 0.38461538 0.4 1 -0.00591716 -0.04 0.04
3 0 0.38235294 0.38461538 1 -0.000865052 -0.00591716 0.00591716
4 0 0.38202247 0.38235294 1 -0.000126247 -0.000865052 0.000865052
5 0 0.38197425 0.38202247 1 -1.84199E-05 -0.000126247 0.000126247
6 0 0.38196721 0.38197425 1 -2.68745E-06 -1.84199E-05 1.84199E-05
7 0 0.38196619 0.38196721 1 -3.92094E-07 -2.68745E-06 2.68745E-06
8 0 0.38196604 0.38196619 1 -5.72057E-08 -3.92094E-07 3.92094E-07

NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES ARE PLACED IN
ITERATION 1. (WILL CORRECT ON MONDAY IF THIS IS NOT THE CASE)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Comparison of Root-Finding Techniques
Absolute Relative Error vs. Iterations

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Stopping Criteria Don’t forget to switch to RADIAN when
dealing with trigo functions!

𝐴𝐵𝑆𝑂𝐿𝑈𝑇𝐸 𝐸𝑅𝑅𝑂𝑅 = 𝝐 = |𝒙𝒊 − 𝒙𝒊−𝟏 | < 𝝐𝒔


𝒙𝒊 − 𝒙𝒊−𝟏
𝐴𝐵𝑆𝑂𝐿𝑈𝑇𝐸 𝑅𝐸𝐿𝐴𝑇𝐼𝑉𝐸 𝐸𝑅𝑅𝑂𝑅 = 𝝐𝒂 = < 𝝐𝒔
𝒙𝒊
𝒙𝒕 − 𝒙𝒊
𝑇𝑅𝑈𝐸 𝑅𝐸𝐿𝐴𝑇𝐼𝑉𝐸 𝐸𝑅𝑅𝑂𝑅 = 𝝐𝒕 = < 𝝐𝒔
𝒙𝒕
𝐼𝑇𝐸𝑅𝐴𝑇𝐼𝑂𝑁𝑆 = 𝒎𝒂𝒙𝒊𝒎𝒖𝒎 𝒏𝒖𝒎𝒃𝒆𝒓

𝐶𝐻𝐸𝐶𝐾 𝑃𝑂𝐼𝑁𝑇: 𝒇 𝒑𝒐𝒊𝒏𝒕 = 𝟎


CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Solutions of Nonlinear Systems
The Jacobian matrix of a vector-valued function of
several variables is the matrix of all its first-order partial
derivatives.
𝜕𝑓1 𝑥 𝜕𝑓1 𝑥 𝜕𝑓1 𝑥
𝑓1 𝑥 = 𝑓(𝑥1 , 𝑥2 , 𝑥3 ) 𝜕𝑥1 𝜕𝑥2 𝜕𝑥3
𝜕𝑓2 𝑥 𝜕𝑓2 𝑥 𝜕𝑓2 𝑥
𝑓2 𝑥 = 𝑓(𝑥1 , 𝑥2 , 𝑥3 ) 𝐽=
𝜕𝑥1 𝜕𝑥2 𝜕𝑥3
𝑓3 𝑥 = 𝑓(𝑥1 , 𝑥2 , 𝑥3 ) 𝜕𝑓3 𝑥 𝜕𝑓3 𝑥 𝜕𝑓3 𝑥
𝜕𝑥1 𝜕𝑥2 𝜕𝑥3
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Solutions of Nonlinear Systems
Step 1: Determine the Jacobian Matrix

𝑥 2 + 𝑥𝑦 = 10 → 𝑓1 𝑥, 𝑦 = 𝑥 2 + 𝑥𝑦 − 10

𝑦 + 3𝑥𝑦 2 = 57 → 𝑓2 𝑥, 𝑦 = 𝑦 + 3𝑥𝑦 2 − 57

𝜕𝑓1 𝑥, 𝑦 𝜕𝑓1 𝑥, 𝑦
𝜕𝑥 𝜕𝑦 𝟐𝒙 + 𝒚 𝒙
𝐽= 𝑱= 𝟐
𝜕𝑓2 𝑥, 𝑦 𝜕𝑓2 𝑥, 𝑦 𝟑𝒚 𝟏 + 𝟔𝒙𝒚
𝜕𝑥 𝜕𝑦
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Solutions of Nonlinear Systems
Step 2: Input the initial guesses into the Jacobian matrix.

𝑥 = 1.5, 𝑦 = 3.5

𝟐𝒙 + 𝒚 𝒙
𝑱=
𝟑𝒚𝟐 𝟏 + 𝟔𝒙𝒚

𝟏𝟑 𝟑
𝑱= 𝟐 𝟐
𝟏𝟒𝟕 𝟔𝟓
𝟒 𝟐
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Solutions of Nonlinear Systems
Step 3: Input the initial guesses into the functions.

𝑥 = 1.5, 𝑦 = 3.5

𝒙𝟐 + 𝒙𝒚 − 𝟏𝟎
𝒇(𝒙, 𝒚) =
𝒚 + 𝟑𝒙𝒚𝟐 − 𝟓𝟕
𝟓

𝒇(𝒙, 𝒚) = 𝟐
𝟏𝟑
𝟖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Solutions of Nonlinear Systems
Step 4: Subtract 𝚫𝐱 = 𝐉 −𝟏 𝒇(𝒙, 𝒚) from initial guesses.

𝑥 = 1.5, 𝑦 = 3.5
−𝟏
𝟏𝟑 𝟑 𝟓 𝟑 𝟏𝟑𝟑𝟗
− −
𝟏. 𝟓 𝟐 𝟐 𝟐 = 𝟐 − 𝟐𝟒𝟗𝟖
𝒙𝒏𝒆𝒘 = − 𝟏𝟒𝟕 𝟔𝟓
𝟑. 𝟓 𝟏𝟑 𝟕 𝟏𝟔𝟑𝟗
𝟒 𝟐 𝟖 𝟐 𝟐𝟒𝟗𝟖
𝟐𝟓𝟒𝟑
𝒙𝒏𝒆𝒘 = 𝟏𝟐𝟒𝟗
𝟐. 𝟖𝟒𝟑𝟖𝟕𝟓𝟏
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Solutions of Nonlinear Systems
NOTE, I GOT WORD THAT IN THE EXAM, THE INITIAL GUESSES ARE PLACED IN
ITERATION 1. (WILL CORRECT ON MONDAY IF THIS IS NOT THE CASE)
Step 5: Repeat Steps 2-4 until desired accuracy is
𝒙𝟐 + 𝒙𝒚 − 𝟏𝟎
reached. 𝑱=
𝟐𝒙 + 𝒚
𝟑𝒚𝟐
𝒙
𝟏 + 𝟔𝒙𝒚
𝒇(𝒙, 𝒚) =
𝒚 + 𝟑𝒙𝒚𝟐 − 𝟓𝟕
𝐝(𝐱, 𝐲) = 𝐉 −𝟏 𝒇(𝒙, 𝒚)

Iteration (x,y) J(x,y) f(x,y) d(x,y)


3/2 13/2 3/2 -5/2 -1339/2498
0
7/2 147/4 65/2 13/8 1639/2498
2543/1249 6.915932746 2543/1249 -0.0643749589 0.037328214
1
2.8438751 24.26287675 35.74127004 -4.7562085 -0.1584134629

1.998700609 6.999689781 1.998700609 -4.519896321e-3 -1.299374876e-3


2
3.002288563 27.04120985 37.00405588 0.04957115142 2.289149611e-3
1.999999984 6.999999381 1.999999984 -1.285222e-6 -1.599997974e-8
3
2.999999413 26.99998944 36.99999267 -2.21366048e-5 -5.866110761e-7
2 7 2 0 0
4
3 27 37 0 0

𝒙𝒏𝒆𝒘 = 𝒙𝒐𝒍𝒅 − 𝒅(𝒙, 𝒚) CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Stopping Criteria

Δ𝑥 = 𝑧𝑒𝑟𝑜 𝑣𝑒𝑐𝑡𝑜𝑟 𝑑 𝑥, 𝑦 = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑣𝑎𝑙𝑢𝑒𝑠

𝑓 𝑥, 𝑦 = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑣𝑎𝑙𝑢𝑒𝑠

𝛴 𝛥𝑥 2
𝜖𝑎 = 𝑥100% < 𝜖𝑠
𝑘+1 2
Σ 𝑥𝑛

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


PART IV

NUMERICAL
INTEGRATION
NUMERICAL INTEGRATION
PART IV OUTLINE
❑ NEWTON-COTES CLOSED INTEGRATION FORMULAS
❑ SINGLE-APPLICATION TRAPEZOIDAL RULE
❑ COMPOSITE TRAPEZOIDAL RULE
❑ SINGLE-APPLICATION SIMPSON’S 1/3 RULE
❑ SUN

❑ COMPOSITE SIMPSON’S 1/3 RULE


❑ SIMPSON’S 3/8 RULE
❑ BOOLE’S RULE
❑ HIGHER-ORDER CLOSED FORMULAS
❑ TRUNCATION ERROR
❑ MEAN VALUE FORMULA
❑ CALCULATOR TECHNIQUES
❑ TRAPEZ
O IDALRULE

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Newton-Cotes Closed Integration Formulas
𝒃 𝒃
𝑰 = න 𝒇 𝒙 𝒅𝒙 ≅ න 𝒇𝒏 𝒙 𝒅𝒙
𝒂 𝒂

The Newton-Cotes formulas are:

1. Trapezoidal Rule (𝑛 = 1)
2. Simpson’s 1/3 Rule (𝑛 = 2)
3. Simpson’s 3/8 Rule (𝑛 = 3)
4. Boole’s Rule (𝑛 = 4)

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Trapezoidal Rule

𝒇 𝒂 + 𝒇(𝒃)
𝑰=𝒉
𝟐
ℎ =𝑏−𝑎
𝑎 = lower limit
𝑏 = upper limit

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Trapezoidal Rule: Composite

𝒏−𝟏
𝒉
𝑰= 𝒇 𝒙 𝟎 + 𝟐 ෍ 𝒇 𝒙𝒊 + 𝒇 𝒙𝒏
𝟐
𝒊=𝟏

b−𝑎
ℎ=
𝑛
𝑎 = lower limit
𝑏 = upper limit
𝑛 = number of segments
𝑥𝑖+1 = 𝑥𝑖 + ℎ

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Simpson’s 1/3 Rule

𝒉
𝑰 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇 𝒙𝟐
𝟑

b−𝑎
ℎ=
2
𝑎 = lower limit
𝑏 = upper limit
𝑥𝑖+1 = 𝑥𝑖 + ℎ

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Simpson’s 1/3 Rule: Composite
DEFAULT RULE IF ONLY SIMPSON’S RULE IS MENTIONED.

𝒏−𝟏 𝒏−𝟐
𝒉
𝑰= 𝒇 𝒙𝟎 + 𝟒 ෍ 𝒇 𝒙𝒊 + 𝟐 ෍ 𝒇 𝒙𝒋 + 𝒇 𝒙𝒏
𝟑
𝒊=𝟏,𝟑,𝟓 𝒊=𝟐,𝟒,𝟔
b−𝑎
ℎ=
𝑛
𝑎 = lower limit
𝑏 = upper limit
𝑛 = number of segments
𝑥𝑖+1 = 𝑥𝑖 + ℎ
ONLY FOR EVEN NUMBER OF SEGMENTS AND ODD NUMBER OF POINTS THIS METHOD REQUIRES THREE POINTS PER
INTERVAL TO WORK, i.e. n intervals corresponds to 2n+1 points.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Simpson’s 3/8 Rule

𝟑𝒉
𝑰= 𝒇 𝒙𝟎 + 𝟑𝒇 𝒙𝟏 + 𝟑𝒇 𝒙𝟐 + 𝒇(𝒙𝟑 )
𝟖

b−𝑎
ℎ=
3
𝑎 = lower limit
𝑏 = upper limit
𝑥𝑖+1 = 𝑥𝑖 + ℎ
THIS METHOD REQUIRES FOUR POINTS PER INTERVAL TO WORK, i.e. n
intervals corresponds to 3n+1 points.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Boole’s Rule

𝟐𝒉
𝑰= 𝟕𝒇 𝒙𝟎 + 𝟑𝟐𝒇 𝒙𝟏 + 𝟏𝟐𝒇 𝒙𝟐 + 𝟑𝟐𝒇 𝒙𝟑 + 𝟕𝒇(𝒙𝟒 )
𝟒𝟓

b−𝑎
ℎ=
4
𝑎 = lower limit
𝑏 = upper limit
𝑥𝑖+1 = 𝑥𝑖 + ℎ
THIS METHOD REQUIRES FIVE POINTS PER INTERVAL TO WORK, i.e. n intervals corresponds to 4n+1 points.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Higher-Order Formulas

𝟓𝒉
𝑰= 𝟏𝟗𝒇 𝒙𝟎 + 𝟕𝟓𝒇 𝒙𝟏 + 𝟓𝟎𝒇 𝒙𝟐 + 𝟓𝟎𝒇 𝒙𝟑 + 𝟕𝟓𝒇 𝒙𝟒 + 𝟏𝟗𝒇(𝒙𝟓 )
𝟐𝟖𝟖

b−𝑎
ℎ=
5
𝑎 = lower limit
𝑏 = upper limit
𝑥𝑖+1 = 𝑥𝑖 + ℎ
THIS METHOD REQUIRES FIVE POINTS PER INTERVAL TO WORK, i.e. n intervals corresponds to 4n+1 points.

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Truncation Error
The truncation error is the approximation for the error
added to the Newton-Cotes formulas.
ALLOWABLE TOTAL NUMBER TRUNCATION ERROR
RULE SEGMENTS (n) POINTS
SEGMENTS OF POINTS (SINGLE-APPLICATION)
1 3
Trapezoidal 1 2 2≤𝑚<∞ n+1 − ℎ 𝑓′′(𝜉)
12
1
Simpson’s 1/3 2 3 𝑛 = 2𝑘 (1 ≤ 𝑘 < ∞) 2n + 1 − ℎ5 𝑓 4 (𝜉)
90
3
Simpson’s 3/8 3 4 𝑛 = 3𝑘 (1 ≤ 𝑘 < ∞) 3n + 1 − ℎ5 𝑓 4 (𝜉)
80
8 7 6
Boole’s 4 5 𝑛 = 4𝑘 (1 ≤ 𝑘 < ∞) 4n + 1 − ℎ 𝑓 (𝜉)
945
275 7 6
Higher Order 5 6 𝑛 = 5𝑘 (1 ≤ 𝑘 < ∞) 5n + 1 − ℎ 𝑓 (𝜉)
12096

𝑰 = 𝒇𝒐𝒓𝒎𝒖𝒍𝒂 + 𝑻. 𝑬. 𝟏 𝒃
MEAN: 𝒇𝒏 (𝝃) ≅ න 𝒇𝒏 𝒙 𝒅𝒙
𝒃−𝒂 𝒂
𝒃−𝒂
𝒉=
𝒏 CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Calculator Techniques (Canon F-789SGA)
Y-Values

USE TABLE MODE!


Don’t forget to switch to RADIAN when
dealing with trigo functions!

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Example:
𝟏
Approximate the integral: ‫𝟓𝒙𝟐 𝟎׬‬ + 𝟒𝒙𝟒 − 𝟕𝒙𝟑 − 𝟔𝒙𝟐 𝒅𝒙

Use:
1. Composite Trapezoidal with 5 segments

2. Simpson’s 3/8

3. Composite Simpson’s 1/3 with 8 segments and

calculate the Truncation Error

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Example:
𝟏
Approximate the integral: ‫𝟓𝒙𝟐 𝟎׬‬ + 𝟒𝒙𝟒 − 𝟕𝒙𝟑 − 𝟔𝒙𝟐 𝒅𝒙

Composite Trapezoidal with 5 segments


Y-values
𝒏−𝟏
𝒉 f(x0) 0
𝑰= 𝒇 𝒙𝟎 + 𝟐 ෍ 𝒇 𝒙𝒊 + 𝒇 𝒙 𝒏 f(x1) -0.28896
𝟐
𝒊=𝟏 f(x2) -1.28512
f(x3) -2.99808
𝒃−𝒂 𝟏−𝟎
𝒉= = = 𝟎. 𝟐 f(x4) -5.13024
𝒏 𝟓
f(x5) -7

𝟎. 𝟐
𝑰= 𝟎 − 𝟕 + 𝟐(−𝟎. 𝟐𝟖𝟖𝟗𝟔 − 𝟏. 𝟐𝟖𝟓𝟏𝟐 − 𝟐. 𝟗𝟗𝟖𝟎𝟖 − 𝟓. 𝟏𝟑𝟎𝟐𝟒)
𝟐
𝑰 = −𝟐. 𝟔𝟒𝟎𝟒𝟖
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Example:
𝟏
Approximate the integral: ‫𝟓𝒙𝟐 𝟎׬‬ + 𝟒𝒙𝟒 − 𝟕𝒙𝟑 − 𝟔𝒙𝟐 𝒅𝒙

Simpson’s 3/8
Y-values
𝟑𝒉
𝑰= 𝒇 𝒙𝟎 + 𝟑𝒇 𝒙𝟏 + 𝟑𝒇 𝒙𝟐 + 𝒇(𝒙𝟑 ) f(x0) 0
𝟖
f(x1) -0.8683127572
𝒃−𝒂 𝟏−𝟎 f(x2) -3.687242798
𝒉= = = 𝟎. 𝟑𝟑𝟑𝟑𝟑
𝟑 𝟑 f(x3) -7

𝟑(𝟎. 𝟑𝟑𝟑𝟑𝟑)
𝑰= 𝟎 + 𝟑 −𝟎. 𝟖𝟔𝟖𝟑𝟏𝟐𝟕𝟓𝟕𝟐 + 𝟑 −𝟑. 𝟔𝟖𝟕𝟐𝟒𝟐𝟕𝟗𝟖 − 𝟕
𝟖
𝑰 = −𝟐. 𝟓𝟖𝟑𝟑𝟑𝟑𝟎𝟕
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Example:
𝟏
Approximate the integral: ‫𝟓𝒙𝟐 𝟎׬‬ + 𝟒𝒙𝟒 − 𝟕𝒙𝟑 − 𝟔𝒙𝟐 𝒅𝒙

Composite Simpson’s 1/3 with 8 segments


𝒏−𝟏 𝒏−𝟐 Y-values
𝒉
𝑰 = 𝒇 𝒙𝟎 + 𝟒 ෍ 𝒇 𝒙𝒊 + 𝟐 ෍ 𝒇 𝒙𝒋 + 𝒇 𝒙𝒏 f(x0) 0
𝟑
𝒊=𝟏,𝟑,𝟓 𝒊=𝟐,𝟒,𝟔 f(x1) -0.1063842773
𝒃−𝒂 𝟏−𝟎 f(x2) -0.466796875
𝒉= = = 𝟎. 𝟏𝟐𝟓 f(x3) -1.11895752
𝟖 𝟖
f(x4) -2.0625
𝑰 = −𝟐. 𝟔𝟏𝟔𝟑𝟕𝟑𝟔𝟗𝟖 f(x5) -3.251647949
f(x6) -4.587890625
𝑨𝑪𝑻𝑼𝑨𝑳 𝑽𝑨𝑳𝑼𝑬 = −𝟐. 𝟔𝟏𝟔𝟔𝟔𝟔𝟔𝟔𝟕 f(x7) -5.912658691
f(x8) -7
CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS
Example:
𝟏
Approximate the integral: ‫𝟓𝒙𝟐 𝟎׬‬ + 𝟒𝒙𝟒 − 𝟕𝒙𝟑 − 𝟔𝒙𝟐 𝒅𝒙

Composite Simpson’s 1/3 with 8 segments

𝑰 = −𝟐. 𝟔𝟏𝟔𝟑𝟕𝟑𝟔𝟗𝟖 𝒇𝟒 = 𝟐𝟒𝟎𝒙 + 𝟗𝟔


𝒃
𝑨𝑪𝑻𝑼𝑨𝑳 𝑽𝑨𝑳𝑼𝑬 = −𝟐. 𝟔𝟏𝟔𝟔𝟔𝟔𝟔𝟔𝟕 𝟏
𝒇𝒏 (𝝃) ≅ න 𝒇𝒏 𝒙 𝒅𝒙
𝒃−𝒂 𝒂
𝟏 ′ 𝟎.𝟖
𝑰𝑵𝑻𝑬𝑮𝑹𝑨𝑳 = 𝑺𝑰𝑴𝑷𝑺𝑶𝑵 𝑺 + 𝑻. 𝑬. 𝟏
𝟑 𝒇𝒏(𝝃) ≅ න 𝟐𝟒𝟎𝒙 + 𝟗𝟔𝒅𝒙
𝟎. 𝟖 − 𝟎 𝟎
1 5 4 𝒇𝒏 (𝝃) ≅ 𝟏𝟗𝟐
𝑻. 𝑬. = − ℎ 𝑓 (𝜉)
90

CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS


Example:
𝟏
Approximate the integral: ‫𝟓𝒙𝟐 𝟎׬‬ + 𝟒𝒙𝟒 − 𝟕𝒙𝟑 − 𝟔𝒙𝟐 𝒅𝒙

Composite Simpson’s 1/3 with 8 segments

𝑰 = −𝟐. 𝟔𝟏𝟔𝟑𝟕𝟑𝟔𝟗𝟖 𝒇𝟒 (𝒙) = 𝟐𝟒𝟎𝒙 + 𝟗𝟔


𝒃
𝑨𝑪𝑻𝑼𝑨𝑳 𝑽𝑨𝑳𝑼𝑬 = −𝟐. 𝟔𝟏𝟔𝟔𝟔𝟔𝟔𝟔𝟕 𝟏
𝒇𝒏 (𝝃) ≅ න 𝒇𝒏 𝒙 𝒅𝒙
𝒃−𝒂 𝒂
𝟏 ′ 𝟎.𝟖
𝑰𝑵𝑻𝑬𝑮𝑹𝑨𝑳 = 𝑺𝑰𝑴𝑷𝑺𝑶𝑵 𝑺 + 𝑻. 𝑬. 𝟏
𝟑 𝒇𝒏(𝝃) ≅ න 𝟐𝟒𝟎𝒙 + 𝟗𝟔𝒅𝒙
𝟎. 𝟖 − 𝟎 𝟎
𝒃−𝒂 𝟓 𝟒 𝒇𝒏 (𝝃) ≅ 𝟏𝟗𝟐
𝑻. 𝑬. 𝑪 𝟏/𝟑 =− 𝟒
𝒇 (𝝃)
𝟏𝟖𝟎𝒏 𝟏
𝒃−𝒂 𝟑 𝟐 𝑻. 𝑬. 𝑪 𝟏/𝟑 =−
𝑻. 𝑬. 𝑪 𝒕𝒓𝒂𝒑 = − 𝒇 (𝝃) 𝟑𝟖𝟒𝟎
𝟏𝟐𝒏𝟐 CIE 115 | NUMERICAL SOLUTIONS TO CIVIL ENGINEERING PROBLEMS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy