Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
University of Baghdad
College of Engineering
Mechanical Engineering Department
Methods Used:
1. Simple Fixed-Point Iteration
2. NEWTON-RAPHSON Method (Univariate)
3. Multivariate Newton-Raphson
4. SECANT METHOD
5. Gauss-Seidel Method
6. Relaxation Method
1 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
Introduction
nonlinear equations may be: an algebraic equation, a transcendental equation, a solution of
differential equation or any nonlinear function of x, given a
continuous nonlinear
function f(x): find the
value x=c such that f(c)=0
a) a single real root
b) no real roots exist (but
complex roots may exist)
c) two simple roots
d) three simple roots
e) two multiple roots
f) three multiple roots
g) one simple root and two
multiple roots
h) multiple roots
2 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
2. NEWTON-RAPHSON Method (Univariate)
Perhaps the most widely used of all root-locating formulas is the Newton-Raphson method (Fig.1). If
the initial guess at the root is xi, a tangent can be extended from the point [xi, f (xi)]. The point where
this tangent crosses the x axis usually represents an improved estimate of the root.
The Newton-Raphson method can be derived on the basis of this geometrical interpretation. As in Fig.1,
the first derivative at x is equivalent to the slope:
f( xi)-0 f(xi)
'
f ( x)= x =x-
x-i xi+1 i+1 i f'( x)i
Fig.1
Example2:
f ( x)= e-x x
f'( x)=-e -x-1
e -x x
xi+1=xi- -x
- e -1
Although the Newton-Raphson method is often very efficient, there are situations where it performs
poorly.
However, even when dealing with simple roots, difficulties can also arise, as in the following example.
Example3: Determine the positive root of f (x) = x10 - 1 using the Newton-Raphson method and an initial
guess of x = 0.5.
xi10-1
Ans : xi+1=xi- 9
xi
3. Multivariate Newton-Raphson
3 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
Recall that when we wanted to find the solution to a single non-linear equation of the form f(x)=0, The
basis of the Newton-Raphson method lay in the fact that we can approximate the derivative of f(x)
numerically.
df( x1) f(x1)-f( x2)
f'( x1)= =
dx x1-x2
f( x)
leading to the iterative formula: xi+1=xi-f'( xi )
i
for the n variable case. We can discretize this expression and write:
Just as in the single variable case, we want our next iteration to take us to the root so we assume
that f ( { x} (2) )= 0 . We can then write this system in matrix notation as:
(*)
4 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
where R(k) is called the residual vector at the kth iteration and is defined as
where J (k) is called the Jacobian matrix at the kth iteration is defined as
and where
The algorithm for solving the multivariate Newton-Raphson follows analogously from the single
variable NRM. The steps are as follows:
1. Make an initial guess for x
2. calculate the Jacobian and the Residual.
3. Solve equation (*)
4. Calculate new x from equation (**)
5. If the solution has not converged, loop back to step 2.
The multivariate Newton-Raphson Method suffers from the same short-comings as the
single-variable Newton-Raphson Method.
(1) You need a good initial guess.
(2) You don t get quadratic convergence until you are close to the solution.
(3) If the partial derivatives are zero, the method blows up. If the partial derivatives are close to zero,
the method may not converge.
5 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
Example4:
In order to use MNRM, we must first determine the functional form of the partial derivatives
6 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
Step Five. Loop back to Step 2. and repeat until converged. Here are what further iterations yield
7 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
4.SECANT METHOD
A potential problem in implementing the Newton-Raphson method is the evaluation of the derivative.
Although this is not inconvenient for polynomials and many other functions, there are certain functions
whose derivatives may be difficult or inconvenient to evaluate. For these cases, the derivative can be
f(x )-f(x)
approximated by a backward finite divided difference: f'( xi) i-1 i
x -x i-1 i
f( x)( x - x
This approximation can be substituted to yield the following iterative equation: xi-1=x-i f xi -fi-1 x i)
( i-1) ( i)
Notice that the approach requires two initial estimates of x, rather than using two arbitrary values to
estimate the derivative, an alternative approach involves a fractional perturbation of the independent
variable to estimate f'(x)
f (xi + xi ) - f (xi )
f' (xi )
xi
where = a small perturbation fraction. This approximation can be substituted to yield the following
iterative equation:
xif(xi)
xi+1=xi-
f ( xi + xi )-f (xi)
We call this the modified secant method. As in the following example, it provides a nice means to attain
the efficiency of Newton-Raphson without having to compute derivatives.
Example5: Use the modified secant method to determine the mass of the bungee jumper with a drag
coefficient of 0.25 kg/m to have a velocity of 36 m/s after 4 s of free fall. Note: The acceleration of
gravity is 9.81 m/s2. Use an initial guess of 50 kg and a
value of 106 for the perturbation fraction.
First iteration:
x0 = 50
f (x0) = 4.57938708
x0 + x0 = 50.00005
f (x0 + x0) = 4.579381118
( 50)( -4.57938708)*10 -6
x1=50- =88.39931
-4.579381118 - ( -4.57938708)
The calculation can be continued to yield the correct answer
The choice of a proper value for is not automatic. If is too small, the method can be swamped by
round-off error caused by subtractive cancellation in the denominator. If it is too big, the technique can
become inefficient and even divergent. However, if chosen correctly, it provides a nice alternative for
cases where evaluating the derivative is difficult and developing two initial guesses is inconvenient.
8 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
5- Gauss-Seidel Method
The Gauss-Seidel method is the most commonly used iterative
method for solving linear algebraic equations. Assume that we
are given a set of n equations:
[A ]{x} = {b}
Suppose that for conciseness we limit ourselves to a 3 3 set
of equations. If the diagonal elements are all nonzero, the first
equation can be solved for x1, the second for x2, and the third
for x3 to yield
where j and j 1 are the present and previous iterations.
To start the solution process, initial guesses must be made for the
x s. A simple approach
is to assume that they are all zero. These zeros can be substituted
into first equation,
which can be used to calculate a new value for x1 = b1/a11. Then we substitute this new
value of x1 along with the previous guess of zero for x3 into second equation to compute a new
value for x2. The process is repeated for third equation to calculate a new estimate for x3. Then
we return to the first equation and repeat the entire procedure until our solution converges
closely enough to the true values. Convergence can be checked using the criterion that for
all is
Example6:
3x1 0.1x2 0.2x3 = 7.85
0.1x1 + 7x2 0.3x3 = 19.3
0.3x1 0.2x2 + 10x3 = 71.4
Note that the solution is x1 = 3, x2 = 2.5, and x3 = 7.
6. Relaxation Method
9 |Page
Finding Roots of Nonlinear Equations Numerical MethodsMSc Applied Mechanics (2016-2017)
Relaxation represents a slight modification of the Gauss-Seidel method that is designed to enhance
convergence. After each new value of x is computed, that value is modified by a weighted average of
the results of the previous and the present iterations:
xi*new=xinew+(1-)xiold
Example7: Solve the following system with Gauss-Seidel using overrelaxation (= 1.2) and a stopping
criterion of
s = 10%:
3x1 + 12x2 = 9
10x1 2x2 = 8
10| P a g e