CENGR 3140:: Numerical Solutions To Ce Problems

You might also like

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

09/09/2021

CENGR 3140:
NUMERICAL SOLUTIONS TO CE PROBLEMS
Solving System of Non-Linear Equations

ENGR.MJCPEREZ

SOLVING NON-LINEAR EQUATIONS


NEWTON’S METHOD
• Also called the Newton-Raphson method

• Is a scheme for finding a numerical solution of an equation of the form


f(x) = 0 where f(x) is continuous and differentiable and the equation is
known to have a solution near a given point.

ENGR.MJCPEREZ

1
09/09/2021

SOLVING NON-LINEAR EQUATIONS


For the 1st iteration, the slope of the tangent at point (x1, f(x1)) is given by:

Solving for x2: General equation:

ENGR.MJCPEREZ

SOLVING NON-LINEAR EQUATIONS


ALGORITHM FOR THE NEWTON’S METHOD

1. Choose a point x1 as an initial guess of the solution.

2. For i = 1, 2, …., until the error is smaller than a specified value, calculate
xi+1 by using the equation below.

ENGR.MJCPEREZ

2
09/09/2021

SOLVING NON-LINEAR EQUATIONS


WHEN THE ITERATION BE STOPPED?
“Exact Solution is obtained”

Estimated Relative Error: Tolerance in f(x):

Note: Note:
Iterations are stopped when the Iterations are stopped when the
estimated relative error is absolute value of f(xi) is smaller
smaller than a specified value ε. than some number δ.

ENGR.MJCPEREZ

SOLVING NON-LINEAR EQUATIONS


SAMPLE PROBLEM:
Find the solution of the equation 8 – 4.5(x – sin x) = 0
by using Newton’s method in the following two ways:

1. Manual calculations: calculate the first two iterations.

2. Use MATLAB software with the function “NewtonRoot”. Use 0.0001


for the maximum relative error and 10 for the maximum number of
iterations.

ENGR.MJCPEREZ

3
09/09/2021

SOLVING NON-LINEAR EQUATIONS


Manual Calc.:
f(x) = 8 – 4.5(x – sin x)

f’(x) = -4.5(1-cos x)

1st iteration:

i=1

x1 = 2

2nd iteration:

i=2

x1 = 2.48517

ENGR.MJCPEREZ

SOLVING NON-LINEAR EQUATIONS


SECANT METHOD
• Is a scheme for finding a numerical solution of an equation of the from
f (x) = 0.

• The method uses two points in the neighborhood of the solution to


determine a new estimate for the solution.

ENGR.MJCPEREZ

4
09/09/2021

SOLVING NON-LINEAR EQUATIONS


Slope of a secant line:

Solving for x3: General equation:

ENGR.MJCPEREZ

5
09/09/2021

You might also like