CIE 115 Completed

You might also like

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

CIE 115

Numerical Solutions to CE
Problems

This document and the information thereon is the property of PHINMA Education
Syllabus

PEN Code: CIE 115 Credit: 3 units


PEN Subject Title: Numerical Solution to CE Problems Prerequisite: MAT 052

A. Subject Description:
The course provides background on numerical analysis needed to solve civil engineering problems
numerically when their analytical solution is either not available or difficult to obtain.

B. Objectives:
At the end of the course, the students should be able to:
1. Identify appropriate numerical/mathematical tool or concepts suitable for the solution of the CE
problem;
2. Analyze the CE problem to translate it to a numerical solution;
3. Use microsoft excel to develop a solution to the problem.
4. Solve civil engineering problems numerically when their analytical solution is either not available
or difficult to obtain.

C. Subject Outline and Time Allotment:


Lesson
Topics Week
No.
Review of the Mathematical Foundations / Intro to Numerical Solution
1 Definition, Addition, Subtraction and Multiplication of Matrices; Transpose and 1
Common Types
2.1 Determinant of a Matrix
2.2 Inverse of a Matrix 2
3 Fundamental of Computer aided mathematical calculations: MS Excel
4 Solving System of Linear Equations Using Cramer's Rule 3
5.1 Solving System of Linear Equations Using Gaussian Elimination
4
5.2 Solving System of Linear Equations Using Gauss-Jordan Elimination
FIRST PERIODICAL EXAM 5
6.1 Jacobi Iteration Method
6
6.2 Gauss-Seidel Method
7 Bisection Method 7
8.1 Fixed-point Iteration
8
8.2 Newton's Method
SECOND PERIODICAL EXAM 9
9.1 Secant Method
10
9.2 Regula-Falsi Method
10 Newton-Raphson Method for System of Equation 11
Numerical Integration: Trapezoidal Rule, Simpson’s Rule, Simpson’s 3/8 Rule, and
11 12
Boole’s Rule
THIRD PERIODIC EXAM 13

D. References:
1.0 Engeln-Mullges G. and Uhlig F. Numerical Algorithms with C, Springer, © 1996
2.0 Carnahan B., et.al., Applied Numerical Methods, John Wiley & Sons, Inc., © 1969

1
E. Course Requirements
Requirements Due Dates
Problem Set
There will be three periodic examinations and a quiz for every periodic and passing score for all
activities/evaluations is 60%.

F. Grading System:

The Final Grade is computed as follows:


FG= (17% P1) + (17% P2) + (16% P3) + (50%FE)

The 1st Periodical Grade is computed as follows:


P1 = (60% CLASS STANDING) + (40% EXAM)

The 2nd Periodical Grade is computed as follows:


P2 = (60% CLASS STANDING) + (40% EXAM)

The 3rd Periodical Grade is computed as follows:


P3 = (60% CLASS STANDING) + (40% EXAM)

Class Standing = 50% QUIZ + 50% Class Participation


Class Participation = Seatwork, Assignment, Problem set

2
CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Review of Mathematical Foundations - Matrix Materials:


Lesson Objectives: Paper, pen, and calculator
At the end of this lesson, the student should be able to:
1. Add and subtract matrices References:
2. Multiply matrices https://www.mathsisfun.com/algebr
3. Know the common types of matrix a/matrix-types.html

https://www.purplemath.com/modul
4. es/mtrxadd.htm

Productivity Tip:
Have a good morning routine!

A. LESSON PREVIEW/REVIEW
1) Introduction

Numerical analysis is the area of mathematics that creates, analyzes, and implements algorithms for
solving numerically the problems of continuous mathematics. Such problems originate generally from
real-world applications of algebra, geometry, and calculus, and they involve variables which vary
continuously. A numerical solution, however, is an approximation to the solution of a mathematical
equation, often used when analytical solutions are hard or impossible to find. All numerical solutions
are approximations, some better than others, depending on the context of the problem and the numerical
method used.

Numerical solution uses direct method and indirect methods (iterative method) to solve mathematical
problems. Direct method provides the exact solution of an equation system in a finite number of steps
while iterative method uses algorithms to approximate the solution of an equation. Very often, direct
method uses the concept of matrices. That’s why today, you will have a review on the mathematical
foundations of Matrix.

2) Activity 1: What I Know Chart, part 1

What I Know Questions: What I Learned (Activity 4)


1. Do you know how to add and
subtract matrices?

2. Do you know how to multiply a


matrix by another matrix?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

A Matrix is an array of numbers:

A “TWO BY THREE” (2x3) MATRIX 


(This one has 2 Rows and 3 Columns)

The Main Diagonal starts at the top left and A Transpose is where we swap entries across the
goes down to the right: main diagonal (rows become columns) like this

A. ADDING
To add two matrices, add the numbers in the matching positions:

These are the calculations:

3+4=7 8+0=8
4+1=5 6−9=−3

Note: The two matrices must be the same size, i.e. the rows must match in size, and the columns must
match in size.
 a matrix with 3 rows and 5 columns can be added to another matrix of 3 rows and 5 columns.
 But it could not be added to a matrix with 3 rows and 4 columns (the columns don't match in
size)

B. SUBTRACTING
To subtract two matrices, subtract the numbers in the matching positions:

These are the calculations:

3−4=−1 8−0=8
4−1=3 6−(−9)=15

Note: Same with addition, the two matrices must be the same size.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

C. MULTIPLY BY A CONSTANT

These are the calculations:

2×4=8 2×0=0
2×1=2 2×−9=−18

We call the constant a scalar, so officially this is called "scalar multiplication".

TYPES OF MATRIX

A. SQUARE
A square matrix has the same number of rows as columns.

(2x2 Matrix - 2 rows, 2 columns) (3x3 Matrix - 3 rows, 3 columns)

B. IDENTITY MATRIX
An Identity Matrix has 1s on the main diagonal and 0s everywhere else:

A 3×3 Identity Matrix

C. TRIAGULAR MATRIX
All entries above or below the main diagonal are zero:

A lower triangular matrix An upper triangular matrix

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

D. SYMMETRIC
In a Symmetric matrix matching entries either side of the main diagonal are equal, like this:

Note: It must be square, and is equal to its own transpose: (A = A T)

HOW TO MULTIPLY MATRICES

 to multiply a matrix by another matrix we need to do the "dot product" of rows and columns ...
what does that mean? Let us see with an example:

To work out the answer for the 1st row and 1st column:

The "Dot Product" is where we multiply matching members, then sum up:

(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58

We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the
3rd members (3 and 11), and finally sum them up.

 Here it is for the 1st row and 2nd column:

(1, 2, 3) • (8, 10, 12) = 1×8 + 2×10 + 3×12 = 64

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

 We can do the same thing for the 2nd row and 1st column:
(4, 5, 6) • (7, 9, 11) = 4×7 + 5×9 + 6×11 = 139

 And for the 2nd row and 2nd column:


(4, 5, 6) • (8, 10, 12) = 4×8 + 5×10 + 6×12 = 154

 And we get:

When we do multiplication:
 The number of columns of the 1st matrix must equal the number of rows of the 2nd matrix.
 And the result will have the same number of rows as the 1st matrix, and the same number
of columns as the 2nd matrix.

In General:
To multiply an m×n matrix by an n×p matrix, the ns must be the same,
and the result is an m×p matrix.

So ... multiplying a 1×3 by a 3×1 gets a 1×1 result:

But multiplying a 3×1 by a 1×3 gets a 3×3 result:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2) Activity 3: Skill-building Activities

1. GIVEN
FIND:
a. A+B
b. B–A
c. CxA
d. BT x C (BT means Transpose of Matrix B)

3) Activity 4: What I Know Chart, part 2


What I Know (Activity 1) Questions: What I Learned
1. Do you know how to add and
subtract matrices?

2. Do you know how to multiply a


matrix by another matrix?

4) Activity 5: Check for Understanding

SEATWORK: Solve the problem.

GIVEN:

CALCULATE:
a. V + Q
b. V x Q
c. Q x V

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

KEY OF CORRECTION
Activity 3:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Determinant and Inverse of a Matrix Materials:


Lesson Objectives: Paper, pen, and calculator
At the end of this lesson, you should be able to:
1. Calculate the determinant of a matrix References:
2. Calculate the inverse of a matrix https://www.mathsisfun.com/algebr
a/matrix-determinant.html

3. https://www.mathsisfun.com/algebr
a/matrix-inverse.html

Productivity Tip:
Create flashcards for key terms and concepts you learned every
module. Quiz yourself using these flashcards every few days!

A. LESSON PREVIEW/REVIEW
1) Introduction

Good Day!

Last meeting, we discuss how to add, subtract and multiply


matrices. ADDITION. SUBTRACTION. MULTIPLICATION. But are we
missing something? Look at the picture, the operation holding by the
Letter M… IT’S DIVISION!
Actually there is no such thing as division for matrices. You
can add, subtract, and multiply matrices, but you cannot divide them. But
there is a related concept, though, which is called "inversion" or the
inverse of the matrix.
Inverse matrices can be very useful for solving matrix equations.
Like Cramer’s rule that we are going to discuss next module. For us to
know the inverse of a matrix we also need to solve its determinant. That’s
what we are going to discuss in this module.

2) Activity 1: What I Know Chart, part 1

What I Know Questions: What I Learned (Activity 4)


1. Do you know how to calculate
the determinant of a matrix?
2. How about determining its
inverse?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

A. DETERMINANT OF A MATRIX
The determinant of a matrix is a special number that can be calculated from a square matrix. It
helps us find the inverse of a matrix, tells us things about the matrix that are useful in systems of
linear equations, calculus and more.

The symbol for determinant is two vertical lines either side.


|A| means the determinant of the matrix A

Calculating the Determinant


First of all the matrix must be square (i.e. have the same number of rows as columns).

i. 2x2 Matrix

The determinant is: |A| = ad – bc


("The determinant of A equals a times d minus b times c")

Example:

ii. 3x3 Matrix

The determinant is: |A| = a(ei − fh) − b(di − fg) + c(dh − eg)

It may look complicated, but there is a pattern:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

To work out the determinant of a 3×3 matrix:

 Multiply a by the determinant of the 2×2 matrix that is not in a's row or column.
 Likewise for b, and for c
 Sum them up, but remember the minus in front of the b

As a formula (remember the vertical bars || mean "determinant of"):

Example:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

iii. 4x4 Matrix


a b c d
e f g h
A=[ ]
i j k l
m n o p

The pattern continues for 4×4 matrices:

 plus a times the determinant of the matrix that is not in a's row or column,
 minus b times the determinant of the matrix that is not in b's row or column,
 plus c times the determinant of the matrix that is not in c's row or column,
 minus d times the determinant of the matrix that is not in d's row or column,

As a formula:

 Notice the + − + − pattern (+a... −b... +c... −d...). This is important to remember.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example:

B. INVERSE OF A MATRIX
 The Inverse of a Matrix is the same idea as the reciprocal of a number but we write it A-1
 Why not 1/A? Because we don't divide by a matrix!

 When we multiply a number by its reciprocal we get 1. Like  8 × (1/8) = 1


 When we multiply a matrix by its inverse we get the Identity Matrix, I (A type of matrix we discuss
from previous module): A × A-1 = I

Therefore, The inverse of A is A-1 only when: A × A-1 = A-1 × A = I (identity matrix)

EXAMPLE: Find the inverse of matrix A.

STEP 1: Matrix of Minors


The first step is to create a "Matrix of Minors". This step has the most calculations.

For each element of the matrix:

 ignore the values on the current row and column


 calculate the determinant of the remaining values

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Put those determinants into a matrix (the "Matrix of Minors")

Here are the first two, and last two, calculations of the "Matrix of Minors" (notice how I ignore the values in the
current row and columns, and calculate the determinant using the remaining values):

And here is the calculation for the whole matrix:

STEP 2: Matrix of Cofactors


This is easy! Just apply a "checkerboard" of minuses to the "Matrix of Minors". In other words, we need to
change the sign of alternate cells, like this:

STEP 3: Adjugate (Also called Adjoint)


Now "Transpose" all elements of the previous matrix... in other words swap their positions over the diagonal
(the diagonal stays the same):

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

STEP 4: Multiply by 1/Determinant


Now find the determinant of the original matrix. This isn't too hard, because we already calculated the
determinants of the smaller parts when we did "Matrix of Minors".

 In practice we can just multiply each of the top row elements by the cofactor for the same location:

Elements of top row: 3, 0, 2


Cofactors for top row: 2, −2, 2

Determinant = 3×2 + 0×(−2) + 2×2 = 10

And now multiply the Adjugate by 1/Determinant:

It is exactly the same steps for larger matrices!

2) Activity 3: Skill-building Activities

Solve the following problems: (Use extra sheet of paper if needed)


5 −3
a. What is the determinant of the matrix 𝐴 = [ ]? Ans. |A| = -2
−4 2

3 0 −1
b. What is the determinant of the matrix 𝐵 = [ 2 −5 4 ]? Ans. |B| = -44
−3 1 3

1 7 6 3
c. What is the determinant of the matrix 𝐶 = [−1 −1 −2 1]? Ans. |C| = -88
0 1 3 −1
−2 6 0 2

−3 10 𝟏 −𝟐
d. Determine the inverse of the matrix 𝐷 = [ ] Ans. 𝑫−𝟏 = [ ]
−2 5 𝟎. 𝟒 −𝟎. 𝟔

1 0 −3 −𝟓 𝟑 −𝟔
e. Determine the inverse of the matrix E = [2 −2 1] Ans. 𝑬−𝟏 = [−𝟔 𝟑 −𝟕]
0 −1 3 −𝟐 𝟏 −𝟐

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3) Activity 4: What I Know Chart, part 2


What I Know (Activity 1) Questions: What I Learned
1. Do you know how to calculate
the determinant of a matrix?
2. How about determining its
inverse?

4) Activity 5: Check for Understanding

ASSIGNMENT #1: Solve the problem.

3 1 3 2
Determine the inverse of V=[ 6 −5 2 1 ]
1 1 −2 0
−3 5 5 −1

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #2

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Fundamental of Computer aided mathematical Materials:


calculations: MS Excel MS Excel
Lesson Objectives:
At the end of this lesson, you should be able to: References:
1. Add, subtract, and multiply matrices using MS Excel https://exceljet.net/excel-functions
2. Calculate the determinant of a matrix using MS Excel
3. Calculate the inverse of a square matrix using MS Excel https://bettersolutions.com/excel/fu
nctions/matrix-category.htm

Productivity Tip:
One of the keys to effective studying is not simply memorizing
information but gaining understanding of a topic.

A. LESSON PREVIEW/REVIEW
1) Introduction

Good Day!

In the first two modules, you learned how to add, subtract and multiply matrices; find its determinant and
its inverse. From the previous module, your assignment was to find the inverse of a 4x4 matrix. How long
did it take you to solve for the inverse? Well, calculating the inverse of a 4x4 matrix can give you a hard
time. But what if you are required to calculate the inverse of a 10x10 matrix? Or maybe 20x20? Are you
still going to try it?

Scientific calculators today are limited to 3x3 matrix; higher models are also limited to 4x4 matrix. So
what are the alternatives we can use if we’re dealing with larger matrices?

You can use Microsoft Excel! MS Excel has functions for array of numbers or matrix that can easily
calculate the inverse of a 20x20 matrix even a 100x100 matrix. You can also add, subtract, multiply and
find the determinant of matrices using MS Excel.

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. What are the matrix
commands/functions in MS
Excel?
2. What is the command in MS
Excel you always use when
dealing with arrays?
3. What is a way to check if the
inverse of the matrix you
computed is correct?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

Matrix Functions

MDETERM The matrix determinant of an array.


MINVERSE The inverse matrix of an array.
MMULT The matrix product of two arrays.
TRANSPOSE The matrix transposed (i.e. with its orientation changed).

Vectors and Matrices


 Rectangular arrays of numbers are called matrices.
 A matrix can be represented as any small table of numbers.
 A single column matrix is called a column vector.
 A single row matrix is called a row vector.
 The dimension of a matrix is written as (rows x columns)
 A matrix is said to be square if it has the same number of rows and columns.

Adding and Subtracting Matrices


 You can only add and subtract matrices that have the same dimension.
 The result is the sum and difference of the corresponding entries.
 There is no special Excel function to add because you can use straight addition.
 This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Multiplying Matrices
 The MMULT function returns the product of two matrices.
 You must have a common dimension in the matrices that you want to multiple together.
 The number of columns for one must equal the number of rows for the other.
 This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).
 Matrix A multiplied by Matrix B is not the same as Matrix B multiplied by Matrix A (i.e. matrix multiplication
is not commutative).

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Determinant of a Matrix
 The MDETERM function returns the matrix determinant as an array formula.

Transpose
 The TRANSPOSE function will transpose a matrix and return an array formula.
 Transposing an array converts rows into columns and columns into rows.
 This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Inverse of a matrix
 The MINVERSE function returns the inverse of the matrix as an array formula.
 This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).
 Only square matrices "can have" inverses. Not all square matrices have inverses.

 To prove that these are infact the correct inverses we need to multiply the two matrices together. This is
shown below. (A matrix multiplied by its inverse will be an Identity matrix as discuss in module #1 and
#2)

 A matrix that has no inverse has a determinant of zero and is said to be singular.
 Not all square matrices have inverses.
 A square matrix with an inverse is called "invertible" or "nonsingular".
 A square matrix with no inverse is called "noninvertible" or "singular".

2) Activity 3: Skill-building Activities

Solve the problems in ‘Activity 3’ from module #1 and module #2 using MS Excel. (Compare
your answers to the given answers in the module#1 and #2)

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3) Activity 4: What I Know Chart, part 2


What I Know (Activity 1) Questions: What I Learned
1. What are the matrix
commands/functions in MS
Excel?
2. What is the command in MS
Excel you always use when
dealing with arrays?
3. What is a way to check if the
inverse of the matrix you
computed is correct?

4) Activity 5: Check for Understanding

Solve the following problems using MS Excel.

1. GIVEN:

CALCULATE:
a. V + Q
b. V x Q
c. Q x V

3 1 3 2
2. Determine the determinant and inverse of matrix V=[ 6 −5 2 1 ]
1 1 −2 0
−3 5 5 −1

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #3

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #4

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: CRAMER’S RULE Materials:


Lesson Objectives: Paper, pen, and calculator
At the end of this lesson, you should be able to:
1. Solve a system of linear equation using Cramer’s rule. References:
https://www.purplemath.com/modul
2. es/cramers.htm

https://www.mathsisfun.com/algebr
a/systems-linear-equations.html

Productivity Tip:
Take notes. No seriously, take notes. 

A. LESSON PREVIEW/REVIEW
1) Introduction

A system of linear equations is just a set of two or more linear equations.

Example: Here are two linear equations:


1) x+y=6
2) −3x + y = 2

Together they are a system of linear equations. Can you solve the values of x and y?

The values of x and y are actually the point of intersection of the two linear equations and
we can determine it by graphing the linear equations in a Cartesian plane. From the
graph, it’s clear that the point of intersection is (1, 5)  x =1 and y = 5

We can also determine the values of x and y using different methods: One is by Cramer’s
rule.

Note that linear equations can be in 3 dimensions, 4 dimensions or more!

2) Activity 1: What I Know Chart, part 1

What I Know Questions: What I Learned (Activity 4)


1. What is a linear equation?

2. Do you know how to use


Cramer’s rule?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #4

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

CRAMER’S RULE is an explicit formula for the solution of a system of linear equations with as many
equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in
terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by
replacing one column by the column vector of right-hand-sides of the equations.

 Example #1
Let's use the system of equations earlier and solve for the value of x and y.
1) x+y=6
2) −3x + y = 2

System of Coefficient Answer column Dx Dy


Equations matrix’s
determinant
x+y=6 1 1 6 6 1 1 6
D=[ ] [ ] Dx = [ ] Dy = [ ]
-3x + y = 2 −3 1 2 2 1 −3 2

Dx : coefficient determinant with answer-column values in x-column


Dy: coefficient determinant with answer-column values in y-column

Evaluating each determinant (using the method explained last module), we get:

1 1 |D| = (1x1 − 1x − 3) = 4
D=[ ]
−3 1
6 1 |Dx | = (6x1 − 1x2) = 4
Dx = [ ]
2 1
1 6
Dy = [ ] |Dy | = (1x2 − 6x − 3) = 20
−3 2

Then,
|Dx | 4 |Dy | 20
𝐱= = =𝟏 𝐲= = = 𝟓
|D| 4 |D| 4

 Example #2
If 3p - 2q = 4 and 7p - 3q = 1, then what is 4p - 5q equal to?

Solution:
3p - 2q = 4
7p - 3q = 1

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #4

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3 −2 |D| = (3x − 3 − (−2x7)) = 5


D=[ ]
7 −3
4 −2
Dp = [ ] |Dp | = (4x − 3 − (−2x1)) = −10
1 −3
3 4
Dq = [ ] |Dq | = (3x1 − 4x7) = −25
7 1
|Dp | −10 |Dq | −25
𝐩= = = −𝟐 𝐪= = = −𝟓
|D| 5 |D| 5

4p - 5q = 4(-2) – 5(-5) = 17

 Example #3
How about 3 equations with 3 unknowns? Like this one:

2x + y + z = 3
x– y–z=0
x + 2y + z = 0

Solution:
Matrix Form Determinant of the Matrix

2 1 1
D = [1 −1 −1] |D| = 2 [−1 −1] − 1 [1 −1
] + 1[
1 −1
]
2 1 1 1 1 2
1 2 1
= 2((−1x1) − (−1x2)) − 1(1x1 − (−1x1)) + 1(1x2 − (−1x1))
= 2(1) − 1(2) + 1(3) = 3

3 1 1
Dx = [0 −1 −1] |Dx | = 3 [−1 −1] − 1 [0 −1] + 1 [0 −1
]
2 1 0 1 0 2
0 2 1
= 3(1) − 1(0) + 1(0) = 3

2 3 1
0 −1 1 −1 1 0
Dy = [1 0 −1] |Dy | = 2 [ ] − 3[ ] +1[ ]
0 1 1 1 1 0
1 0 1
= 2(0) − 3(2) + 1(0) = −6

2 1 3
−1 0 1 0 1 −1
Dz = [1 −1 0] |Dy | = 2 [ ]−1[ ] + 3[ ]
2 0 1 0 1 2
1 2 0
= 2(0) − 1(2) + 3(3) = 9

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #4

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Then,
|Dx | 3 |Dy | −6 |Dz | 9
𝐱= = =𝟏 𝐲= = = −𝟐 𝐳= = = 𝟑
|D| 3 |D| 3 |D| 3

Ans. x = 1, y = -2, and z = 3

2) Activity 3: Skill-building Activities

1. If a + b = 5 and 3a + 2b = 20, then what is 3a + b equal to? Ans. 25

2. The following system of linear equations is given:

3x + 2y − 4z = 4 (1)
-2x + 3y + z = 12 (2)
x − 2y + 2z = -10 (3)

What is the value of x + y + z? Ans. 0

3) Activity 4: What I Know Chart, part 2


What I Know (Activity 1) Questions: What I Learned
1. What is a linear equation?

2. Do you know how to use


Cramer’s rule?

4) Activity 5: Check for Understanding

SEATWORK: Determine the value of a, b, c, and d using Cramer’s Rule.


2a + 3b − c − d = 4
a + 5b − c + d = 5
a − b − 3c + 2d = −1
5a − b + c − d = 2

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #4

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Gaussian and Gauss-Jordan Elimination Materials:


Lesson Objectives: Paper, pen, and calculator
At the end of this lesson, you should be able to:
1. Solve a system of linear equation using Gaussian References:
Elimination. https://www.mathwords.com/g/gau
2. Solve a system of linear equation using Gauss-Jordan ssian_elimination.htm
Elimination.
https://www.mathwords.com/g/gau
3. ss-jordan_elimination.htm

“Some people dream of accomplishing great things. Others stay


awake and make it happen.”

A. LESSON PREVIEW/REVIEW
1) Introduction

Good Day!

Aside from Cramer’s Rule, there are another way to solve a system of
linear equation in a matrix form; and that’s what we’re going to discuss
today.
 Gaussian Elimination
 Gauss-Jordan Elimination

Gaussian elimination, also known as row reduction, is an algorithm in linear algebra for solving
a system of linear equations. It is usually understood as a sequence of operations performed on the
corresponding matrix of coefficients. The method is named after Carl Friedrich Gauss (1777–1855). It was
further popularized by Wilhelm Jordan, who attached his name to the process by which row reduction is used
to compute matrix inverses, Gauss-Jordan elimination.

As mention earlier, Gauss-Jordan elimination can be used to calculate the inverse of a matrix, but we
will discuss that in the next module (module #6). Today let’s focus in solving system of linear equation using
the two elimination method.

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. What is an augmented matrix?

2. What is the echelon form for


Gauss-Jordan Elimination?
3. What is the similarity between
Gaussian and Gauss-Jordan?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

I. GAUSSIAN ELIMINATION

 A method of solving a linear system of equations. This is done by transforming the system's augmented
matrix into row-echelon form by means of row operations. Then the system is solved by back-
substitution.

There are three types of row operations which may be performed on the rows of a matrix:
1. Swap the positions of two rows.
2. Multiply a row by a non-zero scalar.
3. Add to one row a scalar multiple of another.

If the matrix is associated to a system of linear equations, then these operations do not change the solution
set. Therefore, if one's goal is to solve a system of linear equations, then using these row operations could
make the problem easier.

Sample Problem #1:

The following system of linear equations is given:

3x + 2y − 4z = 4 (1)
-2x + 3y + z = 12 (2)
x − 2y + 2z = -10 (3)

What is the value of x + y + z?

Solution:

[x y z | k ]

3 2 −4 4 x1 y1 z1 k1
Augmented Matrix  [−2 3 1 | 12 ] [x 2 y2 z2 |k 2 ]
x3 y3 z3 k 3
1 −2 2 −10
Then, the Augmented Matrix should be reduce into Echelon form by means of row operations.

 The Echelon form of Guassian Elimination are like an upper triangle matrix (type of matrix from module
#1)
 x2 , x3 , and y3 should be reduced to 0.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Let’s begin:

3 2 −4 4 → row 1
[−2 3 1 | 12 ] → row 2
1 −2 2 −10 → row 3

For x3 be reduce to zero, multiply row 3 by “2” and “add” row 2.  2R3 + R2

2(1) + (−2) = 0
3 2 −4 4
2(−2) + 3 = −1
[−2 3 1 | 12 ]
2(2) + 1 = 5 row 3 becomes → 0 −1 5 −8
2(−10) + 12 = −8

For x2 be reduce to zero, multiply row 2 by “3”, multiply row 1 by “2” then “add” row 2 and row 1.  3R2 + 2R3

3(−2) + 2(3) = 0
3(3) + 2(2) = 13 3 2 −4 4
row 2 becomes → [0 13 −5| 44 ]
3(1) + 2(−4) = −5
0 −1 5 −8
3(12) + 2(4) = 44

Lastly, for y3 be reduce to zero, multiply row 3 by “13” and “add” row 2.  13R3 + R2

13(0) + 0 = 0
13(−1) + 13 = 0 3 2 −4 4
[0 13 −5| 44 ]
13(5) + (−5) = 60 row 3 becomes → 0 0 60 −60
13(−8) + 44 = −60

3 2 −4 4
Echelon form  [0 13 −5| 44 ]
0 0 60 −60

3x + 2y − 4z = 4
The system becomes → 13y − 5z = 44
60z = −60

By back-substitution,

60z = −60 𝐳 = −𝟏

13y − 5(−1) = 44 𝐲=𝟑

3x + 2(3) − 4(−1) = 4 𝐱 = −𝟐

𝐻𝑒𝑛𝑐𝑒, 𝑥 + 𝑦 + 𝑧 = −2 + 3 − 1 = 𝟎 Ans.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Let’s have another example so that you can familiarize the pattern in transforming the augmented matrix into
echelon form.

Sample problem #2

Determine the value of a, b, c, and d.

2𝑎 + 3𝑏 − 𝑐 − 𝑑 = 4
𝑎 + 5𝑏 − 𝑐 + 𝑑 = 5
𝑎 − 𝑏 − 3𝑐 + 2𝑑 = −1
5𝑎 − 𝑏 + 𝑐 − 𝑑 = 2

Solution:
2 3 −1 −1 4
𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑀𝑎𝑡𝑟𝑖𝑥 → [1 5 −1 1|5]
1 −1 −3 2 −1
5 −1 1 −1 2

2 3 −1 −1 4 2 3 −1 −1 4
2𝑅2 − 𝑅1 [ 1 5 −1 1 | 5 ] → [0 7 −1 3 | 6 ]
𝑅3 − 𝑅2 1 −1 −3 2 −1 0 −6 −2 1 −6
𝑅4 − 5𝑅3 5 −1 1 −1 2 0 4 16 −11 7

2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 |6]
7𝑅3 + 6𝑅2 0 −6 −2 1 −6 0 0 −20 25 −6
6𝑅4 + 4𝑅3 0 4 16 −11 7 0 0 88 −62 18

2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 | 6 ]
0 0 −20 25 −6 0 0 −20 25 −6
20𝑅4 + 88𝑅3 0 0 88 −62 18 0 0 0 960 −168

2 3 −1 −1 4
Echelon form  [0 7 −1 3 | 6 ]
0 0 −20 25 −6
0 0 0 960 −168

2a + 3b − c − d = 4
The system becomes → 7b − c + 3d = 6
−20c + 25d = −6
960d = −168

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

By back-substitution,

𝐚 = 𝟎. 𝟓𝟑𝟕𝟓

𝐛 = 𝟎. 𝟗𝟒𝟑𝟕𝟓

𝐜 = 𝟎. 𝟎𝟖𝟏𝟐𝟓

𝐝 = −𝟎. 𝟏𝟕𝟓 ANS.

II. Gauss-Jordan Elimination

Gauss-Jordan Elimination is like the continuation of Guassian Elimination; the process is the same.

 The Echelon form of Gauss-Jordan Elimination is an identity matrix (type of matrix from module #1)
 Let’s try to solve the previous sample problem using Gauss-Jordan Elimination.

Sample Problem #1:


The following system of linear equations is given:

3x + 2y − 4z = 4 (1)
-2x + 3y + z = 12 (2)
x − 2y + 2z = -10 (3)

What is the value of x + y + z?

Solution:
3 2 −4 4
Augmented Matrix  [−2 3 1 | 12 ]
1 −2 2 −10

3 2 −4 4 3 2 −4 4
[
3𝑅2 + 2𝑅1 −2 3 1 | 12 ] → [0 13 −5| 44 ]
2𝑅3 + 𝑅2 1 −2 2 −10 0 −1 5 −8

3 2 −4 4 3 2 −4 4
[0 13 −5| 44 ] → [0 13 −5| 44 ]
13𝑅3 + 𝑅2 0 −1 5 −8 0 0 60 −60

From here the process is the same as gaussian elimination. Now let’s continue the process,

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5𝑅1 − 4𝑅2 3 2 −4 4 15 −42 0 −156


60𝑅2 + 5𝑅3 [0 13 −5| 44 ] → [0 780 0 | 2340 ]
0 0 60 −60 0 0 60 −60

780𝑅1 + 42𝑅2 15 −42 0 −156 11700 0 0 −23400


[0 780 0 | 2340 ] → [ 0 780 0 | 2340 ]
0 0 60 −60 0 0 60 −60

𝑅1/11700 11700 0 0 −23400 1 0 0 −2


𝑅2/780 [ 0 780 0 | 2340 ] → [0 1 0| 3 ]
𝑅3/60 0 0 60 −60 0 0 1 −1

1 0 0 −2
Echelon form  [0 1 0| 3 ] as you can see, the matrix at the left is an identity matrix.
0 0 1 −1

Thus,
x = -2, y = 3, z = -1. x + y + z = −2 + 3 − 1 = 𝟎 Ans.

Sample problem #2

Determine the value of a, b, c, and d. Let’s also solve problem #2 using Guass-Jordan Elimination.

2𝑎 + 3𝑏 − 𝑐 − 𝑑 = 4
𝑎 + 5𝑏 − 𝑐 + 𝑑 = 5
𝑎 − 𝑏 − 3𝑐 + 2𝑑 = −1
5𝑎 − 𝑏 + 𝑐 − 𝑑 = 2

Solution:

2 3 −1 −1 4
𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑀𝑎𝑡𝑟𝑖𝑥 → [1 5 −1 1|5]
1 −1 −3 2 −1
5 −1 1 −1 2
2 3 −1 −1 4 2 3 −1 −1 4
2𝑅2 − 𝑅1 [ 1 5 −1 1 | 5 ] → [0 7 −1 3 | 6 ]
𝑅3 − 𝑅2 1 −1 −3 2 −1 0 −6 −2 1 −6
𝑅4 − 5𝑅3 5 −1 1 −1 2 0 4 16 −11 7

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 |6]
7𝑅3 + 6𝑅2 0 −6 −2 1 −6 0 0 −20 25 −6
6𝑅4 + 4𝑅3 0 4 16 −11 7 0 0 88 −62 18

2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 | 6 ]
0 0 −20 25 −6 0 0 −20 25 −6
20𝑅4 + 88𝑅3 0 0 88 −62 18 0 0 0 960 −168

From here the process is the same as gaussian elimination. Now let’s continue the process,

3𝑅1 + 𝑅2 2 3 −1 −1 4 6 16 −4 0 18
25𝑅2 − 3𝑅3 [0 7 −1 3 | 6 ] → [0 175 35 0 | 168 ]
960𝑅3 − 25𝑅4 0 0 −20 25 −6 0 0 −19200 0 −1560
0 0 0 960 −168 0 0 0 960 −168
35𝑅1 + 4𝑅2 6 16 −4 0 18 210 1260 0 0 1302
19200𝑅2 + 35𝑅3 [0 175 35 0 | 168 ] → [ 0 3360000 0 0 |3171000]
0 0 −19200 0 −1560 0 0 −19200 0 −1560
0 0 0 960 −168 0 0 0 960 −168
3360000𝑅1 − 1260𝑅2 210 1260 0 0 1302 705600000 0 0 0 379260000
[ 0 3360000 0 0 | 3171000]→[ 0 3360000 0 0 | 3171000 ]
0 0 −19200 0 −1560 0 0 −19200 0 −1560
0 0 0 960 −168 0 0 0 960 −168

𝑅1/705600000 705600000 0 0 0 379260000 1 0 0 0 0.5375


𝑅2/3360000 0 0 3171000
[ 0 3360000 | ] → [0 1 0 0|0.94375]
𝑅3/−19200 0 0 −19200 0 −1560 0 0 1 0 0.08125
𝑅4/960 0 0 0 960 −168 0 0 0 1 −0.175

1 0 0 0 0.5375
Echelon form  [0 1 0 0|0.94375]
0 0 1 0 0.08125
0 0 0 1 −0.175

Therefore,

𝐚 = 𝟎. 𝟓𝟑𝟕𝟓

𝐛 = 𝟎. 𝟗𝟒𝟑𝟕𝟓

𝐜 = 𝟎. 𝟎𝟖𝟏𝟐𝟓

𝐝 = −𝟎. 𝟏𝟕𝟓

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2) Activity 3: Skill-building Activities

Determine the values of the variables to satisfy the equation using a) Gaussian Elimination and b) Gauss-
Jordan Elimination.
𝑥+𝑦−𝑧 =4 𝑨𝒏𝒔. 𝒙 = 𝟏, 𝒚 = 𝟐, 𝒂𝒏𝒅 𝒛 = −𝟏
𝑥 − 2𝑦 + 3𝑧 = −6
2𝑥 + 3𝑦 + 𝑧 = 7

2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9 𝑨𝒏𝒔. 𝒘 = 𝟓. 𝟕𝟗𝟕𝟏, 𝒙 = −𝟎. 𝟓𝟏𝟒𝟓, 𝒚 = 𝟏. 𝟏𝟑𝟎𝟒, 𝒂𝒏𝒅 𝒛 = 𝟑. 𝟒𝟕𝟏𝟎


𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4

3) Activity 4: What I Know Chart, part 2


What I Know Questions: What I Learned
1. What is an augmented matrix?

2. What is the echelon form for


Gauss-Jordan Elimination?
3. What is the similarity between
Gaussian and Gauss-Jordan?

4) Activity 5: Check for Understanding

ASSIGNMENT #2: Determine the values of the variables to satisfy the equation using Gaussian Elimination
OR Gauss-Jordan Elimination.

𝑎 + 2𝑏 − 𝑐 − 𝑑 + 3𝑒 = −2
𝑎 − 𝑏 + 3𝑐 − 2𝑑 + 𝑒 = 3
2𝑏 + 𝑐 − 𝑑 + 𝑒 = 5
2𝑎 − 𝑐 + 𝑒 = −1
3𝑎 + 𝑏 − 2𝑐 = 4

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

PROBLEM SET #1:

1. Determine the matrices C = 2A + B and D = A − 3B if

2. Determine the products C = AB and D = BA if

3. Determine the inverse of the matrix A.

4. Solve the following systems of simultaneous equations by any direct method

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #5

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Iterative Method: Jacobi and Gauss-Seidel Iteration Materials:


Lesson Objectives: Paper, pen, and calculator
At the end of this lesson, you should be able to:
1. Solve system of linear equation using the following iterative References:
(indirect) method: Atkinson & Han. Elementary Numerical
a. Jacobi Iteration Analysis, John Wiley & Sons, © 2004.
b. Gauss-Seidel Iteration Engeln-Mullges G. and Uhlig F. Numerical
2. Algorithms with C, Springer, © 1996

“You do what you can for as long as you can, and when you finally can’t, you do
the next best thing. You back up but you don’t give up.” ―Chuck Yeager

A. LESSON PREVIEW/REVIEW
1) Introduction

ITERATIVE (INDIRECT) METHODS

Iterative methods start from an approximation to the true solution


and, if successful, obtain better approximations from a
computational cycle repeated as often as may be necessary for
achieving a required accuracy.

In certain cases, these methods are preferred over the direct methods (e.i. Cramer’s Rule, Gauss-
Jordan Elimination) – when the coefficient matrix is sparse (has many zeros) or diagonally dominant.

For example:

a square matrix is said to be diagonally dominant if, for every row of the matrix,
the magnitude of the diagonal entry in a row is larger than or equal to the sum of
the magnitudes of all the other (non-diagonal) entries in that row.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. What is the difference
between direct and indirect
method?
2. What is the difference
between Jacobi and Gauss-
Seidel method?

B. MAIN LESSON
1) Activity 2: Content Notes

A. JACOBI ITERATION

An iterative algorithm for determining the solutions of a strictly diagonally dominant system of linear equations.
Each diagonal element is solved for, and an approximate value is plugged in. The process is then iterated until
it converges. This algorithm is a stripped-down version of the Jacobi transformation method of matrix
diagonalization. The method is named after Carl Gustav Jacob Jacobi.

Example #1.

Calculate the value of x, y and z.

6𝑥 − 2𝑦 + 𝑧 = 11
𝑥 + 2𝑦 − 5𝑧 = −1
−2𝑥 + 7𝑦 + 2𝑧 = 5

Solution:

6x − 2y + z = 11 → eq. 1 6x − 2y + z = 11
x + 2y − 5z = −1 → eq. 2  −2x + 7y + 2z = 5
−2x + 7y + 2z = 5 → eq. 3 x + 2y − 5z = −1

𝑊𝑒 𝑠𝑤𝑎𝑝 𝑡ℎ𝑒 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 𝑜𝑓 𝑒𝑞. 2 𝑎𝑛𝑑 3 𝑠𝑜 𝑡ℎ𝑎𝑡 𝑡ℎ𝑒 𝑎𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑚𝑎𝑡𝑟𝑖𝑥 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙𝑙𝑦 𝑑𝑜𝑚𝑖𝑛𝑎𝑛𝑡 (𝑠𝑒𝑒 𝑖𝑛𝑡𝑟𝑜𝑑𝑢𝑐𝑡𝑖𝑜𝑛)

11 + 2𝑦 − 𝑧
6x − 2y + z = 11 → x=
6

5 + 2𝑥 − 2𝑧
−2x + 7y + 2z = 5 → y=
7
−1 − 𝑥 − 2𝑦 1 + 𝑥 + 2𝑦
x + 2y − 5z = −1 → z= ; 𝑧=
−5 5

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

make your Initial Guess: x =0, y = 0, and z = 0


Now, let’s begin to the Iteration…

In the first iteration, we used the “Initial guess” for the value of x, y, and z. (x = 0, y = 0, z = 0)

For the second iteration, we used the values that we solved from the first iteration. (x = 1.833, y = 0.714, z =
0.2) This iteration will go on until the “two consecutive iterations” have the same value. Like 8 th Iteration and 9th
Iteration.

After 9th Iteration, we have x = 2, y = 1, and z = 1. Ans.

Here is the Iteration using MS Excel:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

You can also change your “initial guess” values.

Note: The closest your Initial Guess to the right value the lesser the number of iteration.

Example #2.

Calculate the value of a, b and c.

5𝑎 − 𝑏 + 𝑐 = 5
2𝑎 + 7𝑏 − 3𝑐 = 3
𝑎 − 3𝑏 + 4𝑐 = −1

Solution:

Always check if the augmented matrix is diagonally dominant, then proceed to iteration.

5 −1 1
𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑀𝑎𝑡𝑟𝑖𝑥 → |2 7 −3|
1 −3 4

5+𝑏−𝑐
5𝑎 − 𝑏 + 𝑐 = 5 → a=
5
3 − 2𝑎 + 3𝑐
2𝑎 + 7𝑏 − 3𝑐 = 3 → b=
7
−1 − 𝑎 + 3𝑏
𝑎 − 3𝑏 + 4𝑐 = −1 → 𝑐=
4

ANS. a = 1.097, b = -0.161, and c = -0.645

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #3.

Determine the values of the variables to satisfy the equation

2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9
𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4

Solution:

Note: Always check if the position of the equations is diagonally dominant!

−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4

−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11 → w= (−11 + 𝑥 + 3𝑦 − 𝑧)/−2


𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5 → x= (5 − 𝑤 − 𝑦 + 𝑧)/−3
2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9 → 𝑦= (9 − 2𝑤 − 3𝑥 − 𝑧)/−4
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4 → z= (−4 − 𝑤 − 𝑥 − 𝑦)/−3

Using MS Excel for the Iteration and After 101st Iteration, we get the right values. 

The number of iteration will also vary on accuracy that you consider. Like for the examples we are always
doing 3 decimal places. What if we just consider 1 decimal place. Then,

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. GAUSS-SEIDEL ITERATION
Also known as the Liebmann method or the method of successive displacement, is an iterative method used to
solve a linear system of equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp
Ludwig von Seidel, and is similar to the Jacobi method. Though it can be applied to any matrix with non-zero
elements on the diagonals, convergence is only guaranteed if the matrix is either strictly diagonally dominant.

Example #1. (same as the example from Jacobi Iteration)

Calculate the value of x, y and z.

6𝑥 − 2𝑦 + 𝑧 = 11
𝑥 + 2𝑦 − 5𝑧 = −1
−2𝑥 + 7𝑦 + 2𝑧 = 5

Solution:

6x − 2y + z = 11 → eq. 1 6x − 2y + z = 11
x + 2y − 5z = −1 → eq. 2  −2x + 7y + 2z = 5
−2x + 7y + 2z = 5 → eq. 3 x + 2y − 5z = −1

𝐴𝑔𝑎𝑖𝑛, 𝑦𝑜𝑢 𝑛𝑒𝑒𝑑 𝑡𝑜 𝑚𝑎𝑘𝑒 𝑦𝑜𝑢𝑟 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 𝑎𝑠 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙𝑙𝑦 𝑑𝑜𝑚𝑖𝑛𝑎𝑛𝑡!

11 + 2𝑦 − 𝑧
6x − 2y + z = 11 → x=
6

5 + 2𝑥 − 2𝑧
−2x + 7y + 2z = 5 → y=
7
−1 − 𝑥 − 2𝑦 1 + 𝑥 + 2𝑦
x + 2y − 5z = −1 → z= ; 𝑧=
−5 5

make your Initial Guess: x =0, y = 0, and z = 0


Now, let’s begin to the Iteration…

The only difference of the Gauss-Seidel from Jacobi is that you immediately plug-in the values the you solved.
After we solved the value of “x” using the initial guess, we used the computed value of x to find the value of “y”.
Same as the we solve for the value of “z”.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

In this case, Gauss-Seidel is faster to converge than Jacobi. We get the value of the variables after 4th
iteration.

Example #2.

Determine the values of the variables to satisfy the equation

2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9
𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4

Solution:

−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11 → w= (−11 + 𝑥 + 3𝑦 − 𝑧)/−2


𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5 → x= (5 − 𝑤 − 𝑦 + 𝑧)/−3
2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9 → 𝑦= (9 − 2𝑤 − 3𝑥 − 𝑧)/−4
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4 → z= (−4 − 𝑤 − 𝑥 − 𝑦)/−3

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Using MS Excel for the Iteration and After 17th Iteration;

ANS. w = 5.80, x = -0.51, y = 1.13, and z = 3.47

2) Activity 3: Skill-building Activities

1. Determine the values of the variables to satisfy the equation using Jacobi.
5𝑎 − 2𝑏 = 40 𝑨𝒏𝒔. 𝒂 = 𝟏𝟎, 𝒃 = 𝟓
𝑎 + 3𝑏 = 25

2. Determine the values of the variables to satisfy the equation using Gauss-Seidel.
3𝑉 − 𝐶 + 2𝑄 = −13 𝑨𝒏𝒔. 𝑽 = −𝟏, 𝑪 = 𝟒, 𝑸 = −𝟑
2𝑉 + 5𝐶 − 𝑄 = 21
𝑉 − 2𝐶 + 3𝑄 = −18

3. Determine the values of the variables to satisfy the equation using a) Jacobi and b) Gauss-Seidel.
3𝑥 + 2𝑦 − 𝑧 = −2.1 𝑨𝒏𝒔. 𝒙 = 𝟎. 𝟓, 𝒚 = 𝟎. 𝟐, 𝒛 = 𝟒
−4𝑥 + 𝑦 + 7𝑧 = 26.2
2𝑥 − 4𝑦 + 𝑧 = 4.2

3) Activity 4: What I Know Chart, part 2


What I Know Questions: What I Learned (Activity 4)
3. What is the difference
between direct and indirect
method?
4. What is the difference
between Jacobi and Gauss-
Seidel method?

4) Activity 5: Check for Understanding


ASSIGNMENT #3: Determine the values of the variables to satisfy the equation using a) Jacobi and b) Gauss-
Seidel.
4𝑎 − 𝑏 + 𝑐 + 𝑑 = 14
2𝑎 − 2𝑏 + 3𝑐 − 7𝑑 = −21
𝑎 − 5𝑏 − 𝑐 + 2𝑑 = 24
𝑎 − 2𝑏 + 4𝑐 − 𝑑 = 10

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #6

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #7

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Numerical Solution of Nonlinear Equations in One Materials:


Variable: Bisection Method Paper, pen, and calculator
Lesson Objectives:
At the end of this lesson, you should be able to: References:
1. Solve the roots of nonlinear equation using Bisection Method Engeln-Mullges G. and Uhlig F. Numerical
Algorithms with C, Springer, © 1996

Carnahan B., et.al., Applied Numerical


Methods, John Wiley & Sons, Inc., © 1969.

“The only way to learn mathematics is to do mathematics.” – Paul Halmos

A. LESSON PREVIEW/REVIEW
1) Introduction

When the solution of a single equation f(x) = 0 cannot be obtained using


formulas (except in a few simple cases), one depends almost entirely on
numerical algorithms. A solution of f(x) = 0 is a number x = k such that f(k) = 0.

The nonlinear equation, f(x) = 0, may be an algebraic equation, a transcendental equation, a solution of a
differential equation or any nonlinear function of x.

Some Behavior of Nonlinear Equation:

Example of Nonlinear equations:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #7

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. Do you know how to find the
root/s of a 3rd degree
polynomial?
2. Can you solve the root of x-
cos(x)=0?

B. MAIN LESSON
1) Activity 2: Content Notes

BISECTION METHOD

A root-finding method that applies to any continuous functions for which one knows two values with opposite
signs. The method consists of repeatedly bisecting the interval defined by these values and then selecting the
subinterval in which the function changes sign, and therefore must contain a root.

The input for the method is a continuous function f, an interval


[a, b], and the function values f(a) and f(b). The function values
are of opposite sign (there is at least one zero crossing within the
interval). Each iteration performs these steps:

𝑎+𝑏
1. Calculate c, the midpoint of the interval, 𝑐 =
2
2. Calculate the function value at the midpoint, f(c).
3. If convergence is satisfactory (that is, c - a is sufficiently
small, or |f(c)| is sufficiently small), return c and stop
iterating.
4. Examine the sign of f(c) and replace either (a, f(a)) or
(b, f(b)) with (c, f(c)) so that there is a zero crossing within
the new interval.

Sample Problem #1.

𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1

Using Quadratic Formula: x = 2.618034 and 0.381966


(I believe we all know what Quadratic formula is and how to use it.)

Now let’s solve the roots using Bisection Method.

Solution:
First, we need to approximate our interval [a, b] that contain the roots.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #7

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

𝑓(0) = 02 − 3(0) + 1 = 𝟏 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)

𝑓(1) = 12 − 3(1) + 1 = −𝟏 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

Thus, the root is between 0 and 1. [0, 1]


We can also let the range of the interval smaller so that the iteration will be lesser.

𝑓(0) = 02 − 3(0) + 1 = 𝟏 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)

𝑓(0.5) = 0.52 − 3(0.5) + 1 = −𝟎. 𝟐𝟓 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

𝑓(1) = 12 − 3(1) + 1 = −𝟏 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

Thus, the root is between 0 and 0.5. [0, 0.5]

Now, we are ready to start our iteration. Initial Interval: [a, b]  [0, 5]  a = 0, b = 0.5

𝑎 + 𝑏 0 + 0.5
c= = = 0.25 𝑓(𝑐) = 0.252 − 3(0.25) + 1 = 0.3125 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)
2 2

We change the interval into [0.25, 0.5] and repeat the process.

𝑎 + 𝑏 0.25 + 0.5
c= = = 0.375 𝑓(𝑐) = 0.3752 − 3(0.375) + 1 = 0.015625 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)
2 2

We change the interval into [0.375, 0.5].

𝑎 + 𝑏 0.375 + 0.5
c= = = 0.4375 𝑓(𝑐) = 0.43752 − 3(0.4375) + 1 = −0.121094 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)
2 2

We change the interval into [0.375, 0.4375]. Note the positive and negative sign. We continue this process until
f(c) will be approximately equal to zero. Here is the complete iteration using MS Excel:

When the f(c) is approximately equal to zero, the root be equal to “c”.
Therefore, x = 0.382 Ans.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #7

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

How about the other root, 2.618034?

𝑓(0) = 02 − 3(0) + 1 = 𝟏 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)

𝑓(1) = 12 − 3(1) + 1 = −𝟏 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

𝑓(2) = 22 − 3(2) + 1 = −𝟏 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

𝑓(3) = 32 − 3(3) + 1 = 𝟏 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)

Thus, the other root is between 2 and 3. [2, 3]


Initial Interval: [a, b]  [2, 3]  a = 2, b = 3

Therefore, x = 2.618 Ans.

Sample Problem #2.

𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 3 − 4𝑥 − 9
Analytical Solution: x = 2.7065 (one real root)

Solution:

𝑓(0) = 03 − 4(0) − 9 = −𝟗 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

𝑓(1) = 13 − 4(1) − 9 = −𝟏𝟐 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

𝑓(2) = 23 − 4(2) − 9 = −𝟗 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

𝑓(3) = 33 − 4(3) − 9 = 𝟔 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)

Thus, the root is between 2 and 3. [2, 3]

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #7

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Initial Interval: [a, b]  [2, 3]  a = 2, b = 3

Therefore, x = 2.707 Ans.

2) Activity 3: Skill-building Activities

Find the root/s using Bisection method


a) 𝑥 2 − 6𝑥 + 9 = 0 Ans. x = 3
b) 𝑥 − 𝑒 −𝑥 = 0 Ans. x = 0.567
c) 𝑓(𝑥) = 𝑐𝑜𝑠𝑥 − 𝑥𝑒 𝑥 Ans. x = 0.518
4
d) 𝑥 − 𝑥 − 10 = 0 Ans. x = -1.697 and 1.855

3) Activity 4: What I Know Chart, part 2


What I Know Questions: What I Learned
1. Do you know how to find the
root/s of a 3rd degree
polynomial?
2. Can you solve the root of x-
cos(x)=0?

4) Activity 5: Check for Understanding

SEATWORK: Find the root/s using Bisection method


a. 𝑒 −𝑥 − 3𝑙𝑜𝑔𝑥 = 0
b. 𝑓(𝑥) = 𝑒 −𝑥 (𝑥 2 − 5𝑥 + 2)

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #7

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Numerical Solution of Nonlinear Equations in One Materials:


Variable: Fixed point Iteration and Newton’s Method Paper, pen, and calculator
Lesson Objectives:
At the end of this lesson, you should be able to: References:
1. Solve the roots of nonlinear equation using Fixed-point Engeln-Mullges G. and Uhlig F. Numerical
Iteration Algorithms with C, Springer, © 1996
2. Solve the roots of nonlinear equation using Newton’s Method Carnahan B., et.al., Applied Numerical
3. Methods, John Wiley & Sons, Inc., © 1969.

“Sometimes, things may not go your way, but the effort should be there
every single night.” – Michael Jordan

A. LESSON PREVIEW/REVIEW
1) Introduction
FIXED-POINT ITERATION

𝒙𝒏+𝟏 = 𝒈(𝒙𝒏 ) 𝒇𝒐𝒓 𝒏 = 𝟏, 𝟐, 𝟑, …


General Procedure:
1. Find an interval I that you know to contain the solution r to the equation.
2. Transform the equation to the form x = g(x). Estimate g’(x) over the
interval.
3. If |g’(x)| is less than 1 over the interval, then use g.
4. Otherwise, choose a new transformation x = g(x) and begin again.

NEWTON’S METHOD

𝒇 (𝒙 𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − 𝒇𝒐𝒓 𝒏 = 𝟏, 𝟐, 𝟑, …
𝒇′ (𝒙 𝒏 )

Notes on Convergence:
 Poor initial estimate
 Termination at a stationary point
 Difficulty in calculating the derivative of a function - Use secant method (topic that we will discuss next
module)

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. Do you know how Fixed-point
Iteration works in solving
nonlinear equation?
2. When is the Newton’s Method
not suitable to use?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

I. FIXED-POINT ITERATION

The transcendental equation f(x) = 0 can be converted


algebraically into the form x = g(x) and then using the
iterative scheme with the recursive relation
xi+1= g(xi), i = 0, 1, 2, . . .

with some initial guess x0 is called the fixed point


iterative scheme.

Example #1.

𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1

Solution:

Fixed-point method: possible g(x)


a) 𝑥 2 − 3𝑥 + 1 = 0
𝑥2 + 1 𝒙𝟐 + 𝟏
𝑥 2 + 1 = 3𝑥 → 𝑥 = → 𝒈𝟏 (𝒙) =
3 𝟑

b) 𝑥 2 − 3𝑥 + 1 = 0
3𝑥 − 1 𝟏
𝑥 2 = 3𝑥 − 1 → 𝑥= → 𝒈𝟐 (𝒙) = 𝟑 −
𝑥 𝒙

c) 𝑥 2 − 3𝑥 + 1 = 0
𝑥 2 = 3𝑥 − 1 → 𝑥 = √3𝑥 − 1 → 𝒈𝟑 (𝒙) = √𝟑𝒙 − 𝟏

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Let’s try…
𝒙𝟐 + 𝟏
𝒈𝟏 (𝒙) =
𝟑

Initial guess: x = 1.0


Iteration Solution x
Initial 1.02 + 1 0.667
𝑔1 (𝑥) = = 0.667
3
1 0.6672 + 1 0.481
𝑔1 (𝑥) = = 0.481
3
2 2
0.481 + 1 0.411
𝑔1 (𝑥) = = 0.411
3
3 2
0.411 + 1 0.390
𝑔1 (𝑥) = = 0.390
3
4 0.3902 + 1 0.384
𝑔1 (𝑥) = = 0.384
3
5 0.3842 + 1 0.382
𝑔1 (𝑥) = = 0.382
3
2
6 0.382 + 1 0.382
𝑔1 (𝑥) = = 0.382
3

Therefore, x = 0.382 Ans.

Here is the solution using MS Excel. Using the other equation will lead you to the other root.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #2.

𝐹𝑖𝑛𝑑 𝑡ℎ𝑒 𝑟𝑜𝑜𝑡 𝑜𝑓 cos(𝑥 ) − 𝑥𝑒 𝑥 = 0

Solution:

cos(𝑥) 𝐜𝐨𝐬(𝒙)
cos(𝑥 ) = 𝑥𝑒 𝑥 → 𝑥= → 𝒈𝟏 (𝒙) =
𝑒𝑥 𝒆𝒙

 It will take 38 Iteration if Initial Guess = 0


 It will take 22 Iteration if Initial Guess = 0.5
 It will take 39 Iteration if Initial Guess = 2

x = 0.518 Ans.

II. NEWTON’S METHOD

Also known as the Newton–Raphson method, named after Isaac Newton and Joseph Raphson, is a root-finding
algorithm which produces successively better approximations to the roots (or zeroes) of a real-valued function.

If a differentiable function y = f(x) has a simple root s in (a, b) and f’(s) ≠ 0, then the iteration rule is given as

𝒇(𝒙𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − 𝒇𝒐𝒓 𝒏 = 𝟏, 𝟐, 𝟑, …
𝒇′ (𝒙𝒏 )

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #1.
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1

Solution:

Differentiate the given equation  𝑓 ′ (𝑥) = 2𝑥 − 3

Make your INITIAL GUESS: x0 = 0

Apply the Given Formula for Iteration:

𝑥0 2 − 3𝑥0 + 1
x1 = 𝑥0 −
2𝑥0 − 3

02 − 3(0) + 1
x1 = 0 − = 0.333
2(0) − 3

0.3332 − 3(0.333) + 1
x2 = 0.333 − = 0.381
2(0.333) − 3

0.3812 − 3(0.381) + 1
x3 = 0.381 − = 0.382
2(0.381) − 3

0.3822 − 3(0.382) + 1
x4 = 0.382 − = 0.382
2(0.382) − 3

For the other root, make another INITIAL GUESS: x0 = 3

𝑥0 2 − 3𝑥0 + 1
x1 = 𝑥0 −
2𝑥0 − 3

32 − 3(3) + 1
x1 = 3 − = 2.667
2(3) − 3

2.6672 − 3(2.667) + 1
x2 = 2.667 − = 2.619
2(2.667) − 3
2.6192 − 3(2.619) + 1
x3 = 2.619 − = 2.618
2(2.619) − 3

2.6182 − 3(2.618) + 1
x3 = 2.618 − = 2.618
2(2.618) − 3

Therefore, x = 0.382 and 2.618 Ans.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #2.

𝐹𝑖𝑛𝑑 𝑡ℎ𝑒 𝑟𝑜𝑜𝑡 𝑜𝑓 cos(𝑥 ) − 𝑥𝑒 𝑥 = 0

Solution:

Differentiate the given equation  𝑓 ′ (𝑥) = − sin(𝑥) − 𝑥𝑒 𝑥 − 𝑒 𝑥


Make your INITIAL GUESS: x0 = 0

NOTE: ALWAYS SET YOUR CALCULATOR IN RADIAN MODE WHEN DEALING WITH TRIGO FUNCTIONS

cos(0) − 0(𝑒 0 )
x1 = 0 − =1
− sin(0) − 0(𝑒 0 ) − 𝑒 0

cos(0) − 0(𝑒 0 )
x2 = 0 − = 0.653
− sin(0) − 0(𝑒 0 ) − 𝑒 0

cos(0.653) − 0.653(𝑒 0.653 )


x3 = 0.653 − = 0.531
− sin(0.653) − 0.653(𝑒 0.653 ) − 𝑒 0.653

cos(0.531) − 0.531(𝑒 0.531 )


x4 = 0.531 − = 0.518
− sin(0.531) − 0.531(𝑒 0.531 ) − 𝑒 0.531

cos(0.538) − 0.538(𝑒 0.538 )


x5 = 0.538 − = 0.518
− sin(0.538) − 0.538(𝑒 0.538 ) − 𝑒 0.538

After 5th Iteration, x = 0.518 Ans.

2) Activity 3: Skill-building Activities

1. Find the roots/s using Fixed-point iteration


a) 𝑥 4 − 𝑥 − 10 = 0 Ans. x = -1.697 and 1.855
1
b) 𝑥 − sin(𝑥) − = 0 Ans. x = 1.497
2

2. Find the root using Newton’s Method


a) 𝑥 4 − 𝑥 − 10 = 0 Ans. x = -1.697 and 1.855
b) 𝑥 2 − 6𝑥 + 9 = 0 Ans. x = 3
c) 𝑥 − 𝑒 −𝑥 = 0 Ans. x = 0.567

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #8

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3) Activity 4: What I Know Chart, part 2


What I Know Questions: What I Learned
3. Do you know how Fixed-point
Iteration works in solving
nonlinear equation?
4. When is the Newton’s Method
not suitable to use?

4) Activity 5: Check for Understanding

PROBLEM SET #2: Find the root/s using 1) Fixed-point Iteration and 2) Newton’s Method
a. 𝑒 −𝑥 − 3𝑙𝑜𝑔𝑥 = 0
b. 𝑓 (𝑥 )= 𝑒 −𝑥 (𝑥 2 − 5𝑥 + 2)
c. 32𝑥+3 = 2187
d. 15𝑥 2 + 2𝑥 − 8 = 0
1
e. arctan(1 − 𝑥 ) + arctan(1 + 𝑥 ) = arctan ( )
8

5) Activity 6: Assessment for Student Learning

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #9

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Numerical Solution of Nonlinear Equations in One Materials:


Variable: Secant Method and Regula-Falsi Method Paper, pen, and calculator
Lesson Objectives:
At the end of this lesson, you should be able to: References:
1. Solve the roots of nonlinear equation using Secant Method Engeln-Mullges G. and Uhlig F. Numerical
2. Solve the roots of nonlinear equation using Regula-Falsi Algorithms with C, Springer, © 1996
Method Carnahan B., et.al., Applied Numerical
3. Methods, John Wiley & Sons, Inc., © 1969.

“Engineering – If it was easy, everyone would do it.”

A. LESSON PREVIEW/REVIEW
1) Introduction

SECANT and REGULA-FALSI METHOD

This two iterative method works well with functions that are not
differentiable or the derivative is difficult to obtain. It requires two
values x0, x1, and iteration rule is as follows:
𝒙𝒊 − 𝒙𝒊−𝟏
𝒙𝒊+𝟏 = 𝒙𝒊 − 𝒇(𝒙𝒊 )
𝒇(𝒙𝒊 ) − 𝒇(𝒙𝒊−𝟏 )

Inclusion Method

 Bisection method (discuss from module #7)


 Secant method
 Regula-falsi method

Secant and Regula-Falsi Method are also like Bisection Method that uses Interval for iteration; and in
terms on how to approximate this Interval or initial guess, that’s why they are called as inclusion
method.

NOTE: Bolzano’s intermediate value theorem. If f is continuous in I = [a, b] and f(a) ⋅ f(b) < 0, then f has
at least one root in s ∈ I.

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. What is the difference
between Secant and Newton’s
method?
2. What is the difference
between Secant and Regula-
falsi method?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #9

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

SECANT METHOD
A root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of
a function f. The secant method can be thought of as a finite-difference approximation of Newton's method.
However, the method was developed independently of Newton's method and predates it by over 3000 years.

Example #1:

𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1

Solution:

NOTE: The method that we used in order to find the Interval [a, b] for bisection method is the method that we
will use to approximate our interval [xi-1, xi] for Secant Method.

𝑓(0) = 02 − 3(0) + 1 = 𝟏 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)


𝑓(1) = 12 − 3(1) + 1 = −𝟏 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)

The root is between 0 and 1. Initial Interval: [xi-1, xi]  [0, 1]  xi-1 = 0, xi = 1

f(xi−1 ) = 02 − 3(0) + 1 = 1
f(xi ) = 12 − 3(1) + 1 = −1
xi − xi−1 1−0
xi+1 = xi − f(xi ) = 1 − (−1) ( ) = 𝟎. 𝟓
f(xi ) − f(xi−1 ) −1 − 1

𝑓𝑜𝑟 𝑡ℎ𝑒 𝑛𝑒𝑥𝑡 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛, 𝑡ℎ𝑒 𝑛𝑒𝑤 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 xi−1 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 xi 𝑓𝑟𝑜𝑚 𝑡ℎ𝑒 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛
𝑎𝑛𝑑 xi 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 xi+1 ∶ → [1, 0.5] 𝑡ℎ𝑒 𝑖𝑛𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑤𝑖𝑙𝑙 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑒 𝑢𝑛𝑡𝑖𝑙 f(xi+1 ) ≈ 0

Here is the full iteration and solution using MS Excel:

REGULA-FALSI METHOD
The process of iteration for regula-falsi is the same as Secant method, the only difference is the
transformation of the interval for the next iteration. Regula-Falsi consider the “sign” of f(xi+1 ) whether it’s a
negative or positive number just like bisection method. For you to understand, here is an example:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #9

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #1:

𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1

Now, compare this to example #1 of secant method and bisection method.

Here are some sample problems for you to understand the iteration for Secant and Regula-falsi Method.

Example #2.

Find the roots of x 3 + 3x − 5 = 0

Solution:

Using Secant Method

Using Regula-Falsi Method

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #9

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #3.

Find the roots of cos(x) − x𝑒 𝑥 = 0

Solution:

Using Secant Method

Using Regula-Falsi Method

2) Activity 3: Skill-building Activities

1. Find the roots/s using Secant Method


a) 𝑥 4 − 𝑥 − 10 = 0 Ans. x = -1.697 and 1.855
1
b) 𝑥 − sin(𝑥) − = 0 Ans. x = 1.497
2

2. Find the root using Regula-Falsi Method


a) 𝑥 4 − 𝑥 − 10 = 0 Ans. x = -1.697 and 1.855
b) 𝑥 2 − 6𝑥 + 9 = 0 Ans. x = 3
c) 𝑥 − 𝑒 −𝑥 = 0 Ans. x = 0.567

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #9

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3) Activity 4: What I Know Chart, part 2


What I Know Questions: What I Learned (Activity 4)
1. What is the difference
between Secant and Newton’s
method?
2. What is the difference
between Secant and Regula-
falsi method?

4) Activity 5: Check for Understanding

ASSIGNMENT #4: Find the root/s using 1) Secant Method and 2) Regula-falsi Method
a. 𝑒 −𝑥 − 3𝑙𝑜𝑔𝑥 = 0
b. 𝑓 (𝑥 ) = 𝑒 −𝑥 (𝑥 2 − 5𝑥 + 2)

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: System of Nonlinear Equation: Newton-Raphson Materials:


Method Paper, pen, and calculator
Lesson Objectives:
At the end of this lesson, you should be able to: References:
1. Solve a system of nonlinear equation using Newton-Raphson Atkinson & Han. Elementary Numerical
method. Analysis, John Wiley & Sons, © 2004.
2. Recall partial derivative Engeln-Mullges G. and Uhlig F. Numerical
Algorithms with C, Springer, © 1996

“Engineers like to solve problems. If there are no problems handily


available, they will create their own problems."

A. LESSON PREVIEW/REVIEW
1) Introduction

In numerical analysis, Newton's method, also known as the Newton–


Raphson method, named after Isaac Newton and Joseph Raphson, is
a root-finding algorithm which produces successively
better approximations to the roots (or zeroes) of a real-valued function.
The Newton-Raphson method is the most common method for solving
systems of nonlinear equations; and it’s based on an iterative procedure
that updates the value of the unknowns involved until the changes in their
values in two consecutive iterations are small enough.

Example of a system of nonlinear equations:

𝒙𝟐 𝒚 + 𝒚 = 𝟑

𝟑𝒙 − 𝒙𝒚𝟐 = 𝟎

2) Activity 1: What I Know Chart, part 1


What I Know Questions: What I Learned (Activity 4)
1. How do you solve a system of
nonlinear equation?

2. What is a Jacobian matrix?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

Newton’s Method

The solution may be obtained by iteration, starting with x(0), such that

Where J(x(n)) is the Jacobian of the system evaluated for the vector x(n). The element of the Jacobian matrix is

EXAMPLE #1:

Solve the value of x and y.


𝒙𝒚𝟐 + 𝟒𝒚 = −𝟐

𝟑𝒙𝟐 − 𝒙𝒚 = 𝟏𝟎

Solution:

Step 1: Determine the Jacobian Matrix.

Note: Since there are two equations and two unknowns, the Jacobian Matrix will be a two by two
(2x2) matrix.

xy 2 + 4y = −2 → xy 2 + 4y + 2 = 0

3x 2 − xy = 10 → 3x 2 − xy − 10 = 0

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

∂f1 ∂f1 ∂ ∂
(xy2 + 4y + 2) (xy2 + 4y + 2)
∂x ∂y ∂x ∂y 𝑦2 2𝑥𝑦 + 4
J = ∂f ∂f2
= ∂ ∂
=[ ]
2 6𝑥 − 𝑦 −𝑥
(3x2 − xy − 10) (3x2 − xy − 10)
[ ∂x ∂y ] [∂x ∂y ]

𝑦2 2𝑥𝑦 + 4
Jacobian Matrix → [ ]
6𝑥 − 𝑦 −𝑥

Step 2: make your Initial Guess: Let’s try x = 1 and y = 1

Step 3: Substitute your initial guess to the Jacobian Matrix


𝑦2 2𝑥𝑦 + 4 12 2(1)(1) + 4 1 6
J=[ ]=[ ]=[ ]
6𝑥 − 𝑦 −𝑥 6 (1 ) − 1 −1 5 −1

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


1 1.000 6.000
Initial
1 5.000 -1.000

Step 4: Solve for F(x, y). Substitute your initial guess to the given equations.
𝑓(𝑥, 𝑦) = xy 2 + 4y + 2 = (1)(1)2 + 4(1) + 2 = 7
𝑓(𝑥, 𝑦) = 3x 2 − xy − 10 = 3(1)2 − (1)(1) − 10 = −6

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


1 1.000 6.000 7.000
Initial
1 5.000 -1.000 -6.000

Step 5: Calculate the value of d(x, y). First you need to calculate the inverse of the Jacobian matrix, then,
nultiply the inverse to the vector F(x, y).
{d} = [J]−1 {F}

1⁄ 6⁄
1 6 −1 7 31 ] { 7 } = {−0.935}
{d} = [ ] { } = [ 35
5 −1 −6 5⁄ −1⁄ −6 1.3225
31 31

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


1 1.000 6.000 7.000 -0.935
0
1 5.000 -1.000 -6.000 1.323

Step 6: Calculate the updated value of (x, y) for the next iteration by simply subtracting d(x, y) from the
previous value of (x, y).

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

𝑥 = 1 − (−0.935) = 𝟏. 𝟗𝟑𝟓
𝑦 = 1 − 1.323 = −𝟎. 𝟑𝟐𝟑

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


1 1.000 6.000 7.000 -0.935
0
1 5.000 -1.000 -6.000 1.323
1.935
1
-0.323

REPEAT Step 3, 4, 5, and 6 until the value of F(x, y) and d(x, y) are approximately equal to zero!
Iteration (x, y) J(x, y) d(x, y) d(x, y)
1 1.000 6.000 7.000 -0.935
0
1 5.000 -1.000 -6.000 1.323
1.935 0.104 2.751 0.911 0.104
1
-0.323 11.935 -1.935 0.614 0.327
1.831 0.422 1.621 0.174 -0.077
2
-0.650 11.636 -1.831 -1.132 0.127
1.908 0.604 1.034 0.044 -0.036
3
-0.777 12.227 -1.908 -0.559 0.063
1.944 0.707 0.732 0.011 -0.018
4
-0.841 12.505 -1.944 -0.296 0.033
1.963 0.764 0.570 0.003 -0.010
5
-0.874 12.649 -1.963 -0.160 0.019
1.972 0.797 0.479 0.001 -0.005
6
-0.893 12.726 -1.972 -0.090 0.011
1.978 0.817 0.426 0.000 -0.003
7
-0.904 12.770 -1.978 -0.053 0.007
1.981 0.829 0.393 0.000 -0.002
8
-0.910 12.795 -1.981 -0.033 0.004
1.983 0.837 0.373 0.000 -0.001
9
-0.915 12.811 -1.983 -0.020 0.003
1.984 0.842 0.359 0.000 -0.001
10
-0.918 12.821 -1.984 -0.013 0.002
1.985 0.845 0.351 0.000 0.000
11
-0.919 12.827 -1.985 -0.008 0.001
1.985 0.847 0.345 0.000 0.000
12
-0.921 12.831 -1.985 -0.006 0.001

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

1.985 0.849 0.342 0.000 0.000


13
-0.921 12.834 -1.985 -0.004 0.001
1.986 0.850 0.339 0.000 0.000
14
-0.922 12.835 -1.986 -0.002 0.000

Therefore, x = 1.986 and y = -0.923

Example #2:

Consider the following system of nonlinear equation. Solve for x and y.

x 2y + y = 3

3x − xy 2 = 0

Solution:

Jacobian Matrix,

2𝑥𝑦 𝑥2 + 1
J=[ ]
3 − 𝑦2 2𝑥𝑦

Initial Guess: x = 2, y = 1.

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


2 4.000 5.000 2.000 -2.000
0
1 2.000 4.000 4.000 2.000
4.000 -8.000 17.000 -20.000 0.800
1
-1.000 2.000 -8.000 8.000 -0.800
3.200 -1.280 11.240 -5.248 3.153
2
-0.200 2.960 -1.280 9.472 -0.108
0.047 -0.009 1.002 -3.092 0.038
3
-0.092 2.991 -0.009 0.139 -3.085
0.009 0.053 1.000 -0.007 0.009
4
2.993 -5.959 0.053 -0.053 -0.007
0.000 0.000 1.000 0.000 0.000
5
3.000 -6.001 0.000 0.000 0.000

Therefore, x = 0 and y = 3

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #3:

Solve the value of a, b, and c to satisfy the given nonlinear equations:

ab2 + 2bc − 4ac2 − 13 = 0


b2 − ac + b − 5 = 0
2ac2 − 2abc − 7 = 0
Solution:
Jacobian Matrix,

∂f1 ∂f1 ∂f1


∂a ∂b ∂c
∂f2 ∂f2 ∂f2 b2 − 4c 2 2ab + 2c 2b − 8ac
J= = [ −c 2b + 1 −a ]
∂a ∂b ∂c 2
∂f3 ∂f3 ∂f 2c − 2bc −2ac 4ac − 2ab
3
[ ∂a ∂b ∂c ]
Initial Guess: a = 0.5, b = 0.5, c = 0.5.

Iteration (a, b, c) J(a,b,c) F(a,b,c) d(a,b,c)


0.50 -0.75 1.50 -1.00 -12.88 39.50
0 0.50 -0.50 2.00 -0.50 -4.50 5.50
0.50 0.00 -0.50 0.50 -7.00 -8.50
-39.00 -299.00 408.00 2798.00 11558.00 -42.92
1 -5.00 -9.00 -9.00 39.00 366.00 0.17
9.00 252.00 702.00 -1794.00 -9835.00 -0.48
3.92 -332.75 -21.52 -307.27 -1413.83 1.91
2 -5.17 -9.48 -9.34 -3.92 -20.57 -0.82
9.48 277.74 -74.23 188.94 1080.45 2.60
2.01 -170.67 -3.71 -119.40 -415.93 0.60
3 -4.35 -6.88 -7.70 -2.01 -4.27 -0.67
6.88 154.68 -27.68 72.83 303.89 2.65
1.41 -58.08 -1.94 -55.24 -126.29 0.13
4 -3.68 -4.23 -6.36 -1.41 -1.13 -0.39
4.23 66.94 -11.97 34.35 87.69 2.16
1.28 -6.30 -4.31 -27.83 -34.69 -0.22
5
-3.29 -2.07 -5.58 -1.28 -0.13 -0.20

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2.07 22.16 -5.31 19.07 21.46 1.33


1.51 7.35 -7.83 -15.10 -6.50 -0.42
6 -3.09 -0.74 -5.18 -1.51 0.34 -0.08
0.74 5.67 -2.23 13.77 1.54 0.27
1.92 8.15 -10.63 -13.24 -0.14 -0.08
7 -3.00 -0.47 -5.01 -1.92 0.12 0.00
0.47 3.26 -1.81 15.18 -0.72 -0.03
2.00 7.99 -11.00 -14.02 -0.02 0.00
8 -3.00 -0.50 -5.00 -2.00 0.00 0.00
0.50 3.51 -2.01 16.01 0.02 0.00
Another roots;

Initial Guess: a = 1.0, b = 1.0, c = 1.0.

Iteration (a, b, c) J(a,b,c) F(a,b,c) d(a,b,c)


1.0 -3.000 4.000 -6.000 -14.000 10.625
0 1.0 -1.000 3.000 -1.000 -4.000 1.563
1.0 0.000 -2.000 2.000 -7.000 -1.938
-9.625 -34.199 16.703 225.063 312.863 -6.354
1 -0.563 -2.938 -0.125 9.625 23.027 -0.329
2.938 20.563 56.547 -123.922 -204.914 0.449
-3.271 -24.714 6.503 64.658 66.689 0.197
2 -0.233 -2.488 0.533 3.271 2.962 -0.825
2.488 13.545 16.281 -34.089 -51.312 1.190
-3.468 -6.397 -1.505 37.219 10.724 -3.675
3 0.591 -1.299 2.183 3.468 0.446 -1.350
1.299 1.837 9.009 -13.916 -13.373 -0.398
. .
: :
0.069 -260.374 16.514 -0.684 -0.001 0.000
11 1.911 -8.124 4.822 -0.069 0.000 0.000
8.124 100.960 -1.127 1.988 0.000 0.000

YOU CAN ALSO USE THIS METHOD FOR SYSTEM OF LINEAR EQUATION.

Example #4:

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Calculate the value of x, y and z.

6𝑥 − 2𝑦 + 𝑧 = 11
𝑥 + 2𝑦 − 5𝑧 = −1
−2𝑥 + 7𝑦 + 2𝑧 = 5

Solution:

The Jacobian matrix of a linear equation will be equal to its augmented matrix.

6 −2 1
J=[ 1 2 −5]
−2 7 2
Initial Guess: x = 0, y = 0, z = 0.

Iteration (x, y, z) J(x) F(x) d(x)


0.0 6.000 -2.000 1.000 -11.000 -2.000
0 0.0 1.000 2.000 -5.000 1.000 -1.000
0.0 -2.000 7.000 2.000 -5.000 -1.000
2.000 6.000 -2.000 1.000 0.000 0.000
1 1.000 1.000 2.000 -5.000 0.000 0.000
1.000 -2.000 7.000 2.000 0.000 0.000

2) Activity 3: Skill-building Activities

1. Solve the value of a and b.


𝑎𝑏 + 𝑏 − 15 = 0 Ans. a = 2, b = 5 and a = 5.185, b = 2.425
𝑎2 − 𝑏2 + 21 = 0

2. Determine the values of the variables to satisfy the equation.


5𝑎 − 2𝑏 = 40 𝐀𝐧𝐬. 𝑎 = 10, 𝑏 = 5
𝑎 + 3𝑏 = 25

3. Solve the value of x and y.


𝑥𝑦 3 + 𝑦 = −4 Ans. x = 3, y = -1
2𝑥 2 − 10𝑦 2 = 8

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3) Activity 4: What I Know Chart, part 2


What I Know (Activity 1) Questions: What I Learned
1. How do you solve a
system of nonlinear
equation?
2. What is a Jacobian
matrix?

4) Activity 5: Check for Understanding

PROBLEM SET #3
1. Determine the values of the variables to satisfy the equation.
4𝑎 − 𝑏 + 𝑐 + 𝑑 = 14
2𝑎 − 2𝑏 + 3𝑐 − 7𝑑 = −21
𝑎 − 5𝑏 − 𝑐 + 2𝑑 = 24
𝑎 − 2𝑏 + 4𝑐 − 𝑑 = 10

2. Solve the following system of nonlinear equation using Newton’s Method. (you can use MS Excel)

5) Activity 6: Assessment for Student Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #10

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Lesson title: Numerical Integration Materials:


Lesson Objectives: Paper, pen, and calculator
At the end of this lesson, you should be able to:
1. Solve definite integrals using the following numerical References:
integration: Atkinson & Han. Elementary Numerical
a. Trapezoidal Rule Analysis, John Wiley & Sons, © 2004.
b. Simpson’s Rule Engeln-Mullges G. and Uhlig F. Numerical
c. Simpson’s 3/8 Rule Algorithms with C, Springer, © 1996
d. Boole’s Rule
Carnahan B., et.al., Applied Numerical
Methods, John Wiley & Sons,
Inc., © 1969.

“Keep moving in the direction of your dreams. No matter how slows


it may seems, stay focus, you will get to the finish line.”

A. LESSON PREVIEW/REVIEW
1) Introduction

Numerical integration is a primary tool used by engineers and


scientist to obtain approximate answers for definite integrals that cannot be
solved analytically.
In analysis, numerical integration comprises a broad family
of algorithms for calculating the numerical value of a definite integral, and by
extension, the term is also sometimes used to describe the numerical
solution of differential equations.

The basic problem in numerical integration is to compute an approximate solution to a definite integral
𝑏
∫𝑎 𝑓 (𝑥 )𝑑𝑥 to a given degree of accuracy. If f(x) is a smooth function integrated over a small number of
dimensions, and the domain of integration is bounded, there are many methods for approximating the integral to
the desired precision.

2) Activity 1: What I Know Chart, part 1

What I Know Questions: What I Learned (Activity 4)


1. What is a definite integral?

2. What is a closed Newton-


Cotes formula?
3. What is the difference
between Simpson’s rule and
Simpson’s 3/8 rule?

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

B. MAIN LESSON
1) Activity 2: Content Notes

Quadrature Formulas

where xk are called nodes and wk are weights.

 Based on polynomial interpolation.


 Integral is approximated by integral of P(x).
 When sample points x0= a and xM = b are used, it is called closed Newton-Cotes formula.

Newton-Cotes Quadrature Formulas


Assume that xk=x0+kh are equally spaced nodes of fk=f(xk).
The first four closed Newton-Cotes quadrature formulas
are:

1. Trapezoidal Rule
2. Simpson’s Rule
3. Simpson’s 3/8 Rule
4. Boole’s Rule

1. TRAPEZOIDAL RULE

 The first of the Newton-Cotes closed integration formula

 Geometrically, the integral is equivalent to approximating the area of the trapezoid under the straight
line connecting f(a) and f(b).

Approximates integral using y = P1(x)

Where h = b – a, upper limit minus lower limit

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

2. SIMPSON’S RULE

Approximates integral using y = P2(x)

Where h = (c – a)/2, and b = a + h

3. SIMPSON’S 3/8 RULE

Approximates integral using y = P3(x)

Where h = (d – a)/3, b = a + h, and c = b + h

4. BOOLE’S RULE

Approximates integral using y = P4(x)

Where h = (e – a)/4

EXAMPLE #1.

Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.

2
ln⁡(𝑥)
∫ 𝑑𝑥⁡
1 𝑥

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Solution:

a. Trapezoidal Rule

h = 2 -1 = 1; h=1

2
ln⁡(𝑥) ℎ
∫ 𝑑𝑥⁡ ⋍ (𝑓𝑎 + 𝑓𝑏 )⁡
1 𝑥 2
ln⁡(1)
𝑓𝑎 = =0
1
ln⁡(2)
𝑓𝑏 = = 0.34657
2

1
⁡⁡⁡⁡⁡⁡= (0 + 0.34657) = 𝟎. 𝟏𝟕𝟑𝟐𝟖𝟓
2

b. Simpson’s Rule

h = (2 -1)/2 = 0.5; h = 0.5

2
ln⁡(𝑥) ℎ
∫ 𝑑𝑥⁡ ⋍ (𝑓𝑎 + 4𝑓𝑏 + 𝑓𝑐 )⁡
1 𝑥 3
ln⁡(1)
𝑓𝑎 = =0
1
ln⁡(1.5)
𝑓𝑏 = = 0.27031
1.5
ln⁡(2)
𝑓𝑐 = = 0.34657
2

0.5
⁡⁡⁡⁡⁡⁡= (0 + 4(0.27031) + 0.34657) = 𝟎. 𝟐𝟑𝟕𝟗𝟕
3

c. Simpson’s 3/8 Rule

h = (2 -1)/3 = 1/3; h = 1/3

2
ln⁡(𝑥) 3ℎ
∫ 𝑑𝑥⁡ ⋍ (𝑓 + 3𝑓𝑏 + 3𝑓𝑐 + 𝑓𝑑 )⁡
1 𝑥 8 𝑎
ln⁡(1)
𝑓𝑎 = =0
1

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

ln⁡(4/3)
𝑓𝑏 = = 0.21576
4/3

ln⁡(5/3)
𝑓𝑐 = = 0.3065
5/3

ln⁡(2)
𝑓𝑑 = = 0.34657
2

1/3
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡= (0 + 3(0.21576) + 3(0.3065) + 0.34657) = 𝟎. 𝟐𝟏𝟐𝟓𝟗
3

d. Boole’s Rule

h = (2 -1)/4 = 0.25; h = 0.25

2
ln⁡(𝑥) 2ℎ
∫ 𝑑𝑥⁡ ⋍ (7𝑓𝑎 + 32𝑓𝑏 + 12𝑓𝑐 + 32𝑓𝑑 + 7𝑓𝑒 )⁡
1 𝑥 45
ln⁡(1)
𝑓𝑎 = =0
1
ln⁡(1.25)
𝑓𝑏 = = 0.17851
1.25
ln⁡(1.5)
𝑓𝑐 = = 0.27031
1.5
ln⁡(1.75)
𝑓𝑑 = = 0.31978
1.75
ln⁡(2)
𝑓𝑒 = = 0.34657
2

2(0.25)
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡= (7(0) + 32(0.17851) + 12(0.27031) + 32(0.31978) + 7(0.34657)) = 𝟎. 𝟐𝟒𝟎𝟏𝟕
45

Using analytical solution,

2
ln⁡(𝑥) 1 1 1
∫ 𝑑𝑥 = ⁡ (ln⁡(𝑥))2 = ⁡ (ln⁡(2))2 − ⁡ (ln(1))2 = 𝟎. 𝟐𝟒𝟎𝟐𝟑
1 𝑥 2 2 2

Thus, the approximation using Boole’s Rule is best.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #2.

Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.

1
∫ [1 + 𝑒 −𝑧 sin(4𝑥)]𝑑𝑥⁡
0

Solution:

Always set your calculator in ‘Radian Mode’ when dealing with a trigonometric function.

Using analytical solution,

Again, the approximation using Boole’s Rule is best.

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

Example #3.

Evaluate the definite integral using Boole’s Rule.


𝜋
2
∫ 𝑥𝑠𝑖𝑛(2𝑥)𝑑𝑥⁡
0

Solution:

h = (π/2 - 0)/4 = π/8; h = π/8

2
2ℎ
∫ ⁡𝑥𝑠𝑖𝑛 (2𝑥)𝑑𝑥 ⋍ (7𝑓𝑎 + 32𝑓𝑏 + 12𝑓𝑐 + 32𝑓𝑑 + 7𝑓𝑒 )⁡
1 45

Don’t forget to set your calculator in ‘Radian Mode’!


𝑓𝑎 = 0(𝑠𝑖𝑛(2(0))) = 0
𝜋 𝜋
𝑓𝑏 = (𝑠𝑖𝑛 (2 ( ))) = 0.27768
8 8
𝜋 𝜋
𝑓𝑐 = (𝑠𝑖𝑛 (2 ( ))) = 0.78540
4 4
3𝜋 3𝜋
𝑓𝑑 = (𝑠𝑖𝑛 (2 ( ))) = 0.83304
8 8
𝜋 𝜋
𝑓𝑒 = (𝑠𝑖𝑛 (2 ( ))) = 0
2 2

2(𝜋⁄8)
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡= (7(0) + 32(0.27768) + 12(0.78540) + 32(0.83304) + 7(0)) = 𝟎. 𝟕𝟖𝟒𝟖𝟒
45

2) Activity 3: Skill-building Activities

Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.

𝜋
2
𝑎.⁡⁡⁡⁡ ∫ 𝑥 2 cos 𝑥𝑑𝑥⁡
0

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

3
𝑥+3
𝑏.⁡⁡⁡⁡ ∫ 𝑑𝑥
1 𝑥 2 − 3𝑥 − 10

2
𝑐.⁡⁡⁡⁡ ∫ 𝑥 3 ln(𝑥 2 )𝑑𝑥
1

3) Activity 4: What I Know Chart, part 2


What I Know (Activity 1) Questions: What I Learned
1. What is a definite integral?

2. What is a closed Newton-


Cotes formula?
3. What is the difference
between Simpson’s rule and
Simpson’s 3/8 rule?

4) Activity 5: Check for Understanding

ASSIGNMENT #5. Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.

10
√𝑥 2 + 9⁡
𝑎.⁡⁡⁡⁡ ∫ 𝑑𝑥
5 𝑥

1
𝑏.⁡⁡⁡⁡ ∫ 4 𝑥 (𝑥 3 )𝑑𝑥⁡
−1

This document is the property of PHINMA EDUCATION


CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #11

Name: ____________________________________________________________ Class number: _______


Section: ____________ Schedule: _____________________________________ Date: ______________

5) Activity 6: Assessment for Student Learning


Classroom Assessment Technique (CAT) 3-2-1

Three things you learned:


1.
2.
3.
Two things that you would like to learn more about:
1.
2.
One question you still have:
1.

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning

This document is the property of PHINMA EDUCATION

You might also like