0% found this document useful (0 votes)
43 views11 pages

Unit 2

The document discusses various numerical methods for finding roots of equations, including simple fixed-point iteration, Newton-Raphson method, and successive substitution for nonlinear systems. It also covers interpolation techniques such as linear and quadratic interpolation, as well as Newton's and Lagrange's interpolating polynomials. Additionally, it addresses convergence and divergence in iterative methods and provides examples and limitations of each approach.

Uploaded by

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

Unit 2

The document discusses various numerical methods for finding roots of equations, including simple fixed-point iteration, Newton-Raphson method, and successive substitution for nonlinear systems. It also covers interpolation techniques such as linear and quadratic interpolation, as well as Newton's and Lagrange's interpolating polynomials. Additionally, it addresses convergence and divergence in iterative methods and provides examples and limitations of each approach.

Uploaded by

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

A1.

Simple Fixed-Point Iteration


(also called as one-point iteration or successive substitution)
Simple fixed-point iteration
Method of computing the fixed point of iterated functions;
Newton-Raphson method In simple fixed-point iteration, rearrange the function f(x)
so that x is on the left-hand side of the equation:
* Nonlinear System- Successive substitution
f x x g x
f(x) x x x x
fx x x x x
Linear interpolation Let x = g(x)
Quadratic interpolation The iterative formula is
General form of Newton’s interpolation x gx
xi xi
which approximate error is: a
xi

x
Root of Equations Example-1:
Initial Guess

Study numerical methods for finding the root of a single Use simple fixed-point iteration
nonlinear equation: to locate the root of f x e x x
until the prespecified error
f x
criterion conforming to three
significant figures.
Bisection method
Solution:

Fixed-point iteration The iterative formula is: xi+1 e xi


Newton-Raphson If initial guess x = 0, we
Secant method can obtain:
Fixed-Point Iteration Procedure A2. Newton-Raphson Method
Convert f x to x = g x The point where this tangent crosses the x axis is used to
Find an initial guess x represent the improved estimate of the root.
x x
Calculate x g x , and relative error a x f xi
If a s where s n
, end the iteration; otherwise, f xi
xi xi
calculate x g x , and recalculate
x x
a f xi
x xi xi
f xi

(Newton-Raphson formula)

Convergence & Divergence Example-2:


Use the Newton-Raphson method to calculate the root of
Convergence: the estimates
x
of x move closer to the root f x e x
with each iteration; The employing an initial guess of x0=0.
opposite is divergence.
Solution: The first derivative of the function can be evaluated as
Its error propagation f x e x
i xi xi+1 xi xi

characteristics is:
a
xi

Then, the Newton-Raphson formula is 0 0 0.5000 100%


Ei+1=g ( )
xi 1 0.5000 0.5663 11.7093%
e xi
|g ( )| < xi xi xi
e 2 0.5663 0.5671 0.1467%

Starting with an initial guess of x0=0, 3 0.5671 0.5671 0.000022%

|g ( )| > one can calculate:


* Nonlinear system * Successive Substitution
A nonlinear system is any problem where the variable(s) to be A simple approach for solving nonlinear equations is to use the
solved for cannot be written as a linear combination of same strategy that was employed for fixed-point iteration and the
independent components. Gauss-Seidel method:
Nonlinear problems are of interest to engineers, physicists Each one of the nonlinear equations can be solved for one of
and mathematicians because most physical systems are the unknowns.
inherently nonlinear in nature. These equations can then be implemented iteratively to
Nonlinear equations are difficult to solve but give rise to compute new values which (hopefully) will converge on the
interesting phenomena such as chaos. solutions.
A nonlinear system is not random.
This approach is called successive substitution.

Example-3:
Generally, the nonlinear system can be expressed as
Use successive substitution to determine the roots of the following
equations. Initiate the computation with guesses of x1 =1.5 and x2 =3.5.
f x x xn
x xx x g x x
f x x xn
x xx x g x x

fn x x xn

Therefore, the solution are the values of the x’s that make the
equations equal to zero.
Try-1:
x Notes on successive substitution method:
Equation (1) can be solved for x
x
1) the successive substitution will be either diverging or
Equation (2) can be solved for x xx converging, which depends on the manner in which the
equations are formulated;
x x
2) Even in those instances where convergence is possible,
First iteration:
divergence can occur if the initial guesses are insufficiently
x x close to the true solution;

Second iteration:

x x

It seems that the approach is diverging.

Try-2:
Now we will repeat the computation but with the original equations
set up in a different format.
Simple fixed-point iteration
x xx x
x Newton-Raphson method
x
The results can be * Nonlinear system- Successive substitution
x x
First iteration:
x x
Linear interpolation
Second iteration: Quadratic interpolation
x x General form of Newton’s interpolation

The calculation is converging.


Interpolation B1. Newton Interpolating Polynomial
x y x y x y y
Newton’s interpolating polynomial is among the most
fx x x x popular and useful forms;
The Newton polynomial is sometimes called Newton's
divided differences interpolation polynomial because the
coefficients of the polynomial are calculated using divided
differences;
Newton interpolating polynomial has three forms:
1) linear interpolation,
2) quadratic interpolation,
3) general form of Newton’s interpolation.

Polynomial Interpolation B1.1. Linear interpolation


It is the interpolation of a given data set by a polynomial, i.e. given linear interpolation is the simplest form of interpolation just to
some points, find a polynomial which goes exactly through these connect two data points with a straight line.
points.
The general formula for an (n-1)th-order polynomial can be written as In the figure, using similar triangle
f x a ax ax a xn f x f x f x f x
x x x x
It can be rearranged to yield
f x f x
f x f x x x
x x

This is the linear interpolation formula.


linear quadratic parabolic
cubic
2) Using the smaller interval from x1 = 1 to x2 = 4 yields
Linear interpolation:
f x f x f
f x f x x x
x x Thus, using the shorter interval reduces the percent relative
error to t = 33.3%.
The notation f1(x) designates that this is a first-order
interpolating polynomial.
The term [ f(x2) - f(x1)]/(x2 - x1) is a finite-difference
approximation of the first derivative.
In general, the smaller the interval between the data points, the
better the approximation.

Example-1: B1.2. Quadratic Interpolation


Calculate the natural logarithm of 2 using linear interpolation. The linear interpolation approximates a curve with a
First, perform the computation by interpolating between ln1=0 and straight line, which might result in large error;
ln6=1.791759. Then, repeat the procedure, but use a smaller
interval from ln1 to ln4 (1.386294). (Hint: the true value of ln2 is One strategy for improving the estimate is to introduce
0.6931472). some curvature into the line connecting the points;
If three data points are available, this can be accomplished
Solution: with a second-order polynomial (also called a quadratic
1) Use the Newton linear interpolation formula from x1 = 1 to x2 polynomial or a parabola).
= 6 to give
f

which represents an error of t = 48.3%.


Quadratic Interpolation: Example-2:
f x b b x x b x x x x Employ a second-order Newton polynomial to estimate ln 2 with
1) with x=x1, the equation can be used to compute b f x the same three points used in Example-1:
x1 = 1 ; f (x1) = 0
f x f x x2 = 4 ; f (x2) = 1.386294
2) with x=x2, b
x x x3 = 6 ; f (x3) = 1.791759

3) b1,b2 can be substituted into the equation and with x=x3, one Solution:
can solve
Applying the coefficient equation:
f x f x f x f x f x f x f x f x
x x x x x x x x
b b
x x x x b b b

f x b b x x b x x x x

Substituting b1,b2,b3 into quadratic equation


Note that: f x x x x
The case with linear interpolation, b2 still represents the
slope of the line connecting points x1 and x2. Thus, the first this can be evaluated at x = 2 for f2(2) = 0.5658444, which
two terms of the above equation are to linear represents a relative error of t = 18.4%.
interpolation between x1 and x2.
The last term, b3(x x1)(x x2), introduces the second-order
curvature into the formula.
Similarly, the n-th finite divided difference is
B1.3. General Form of Newton’s Interpolating Polynomials f xn xn x f xn xn x
f xn xn x x
The preceding analysis can be generalized to fit an (n-1)th- xn x
order polynomial to n data points. The (n-1)th-order The recursive nature of finite divided differences can be graphically
polynomial is depicted as:

fn x b b x x bn x x x x x xn

For an (n 1)th-order polynomial, n data points are


required: [x1, f (x1)], [x2, f (x2)], . . . , [xn, f(xn)].
Using these data points, one can calculate the coefficients The general form of Newton’s interpolating polynomial:
by the following equations
fn x f x x x f x x x x x x f x x x
b f x x x x x x xn f xn xn x x

b f x x
Example-3:
b f x x x
In Example-2, data points at x1 = 1, x2 = 4, and x3 = 6 were used
to estimate ln2 with a parabola. Now, adding a fourth point
bn f xn xn x x
[x4=5; f (x4) =1.609438], estimate ln2 with a third-order
The bracketed function evaluations are finite divided differences: Newton’s interpolating polynomial.
The first finite divided difference is represented generally as
Solution:
f xi f xj
f xi x j
xi xj The third-order of Newton’s interpolating polynomial with n = 4, is
The second finite divided difference, which represents the
fn x f x x x f x x x x x x f x x x
difference of two first divided differences
x x x x x x f x x x x
f xi x j f x j xk
f xi x j xk
xi xk
The first divided differences are : Thus, the interpolating cubic is
f x x x x
f x x x x x

f x x which can be used to evaluate f3(2) = 0.6287686, which


represents a relative error of t = 9.3%.
f x x The complete cubic polynomial is shown in the following figure

The second divided differences are :

f x x x

f x x x

B2. Lagrange Interpolating Polynomial


The third divided differences are
Suppose we formulate a linear interpolating polynomial as the
f x x x x weighted average of the two values that we are connecting by a
straight line:
f x L f x L f x
The divided differences table is where the L’s are the weighting coefficients:
x x x x
L L
x x x x
Then, one has
x x x x
f x f x f x
x x x x
the nomenclature f1(x) designates that this is a first-order
polynomial and the above equation is referred to as the
linear Lagrange interpolating polynomial.
The linear Lagrange interpolating polynomial can be Example-4:
graphically depicted as
Use a Lagrange interpolating polynomial of the first and second
order to evaluate the density of unused motor oil at T = 15 C
based on the following data:
x1 = 0 f (x1) = 3.85
x2 = 20 f (x2) = 0.800
x3 = 40 f (x3) = 0.212

x x x x
f x f x f x
x x x x

Similarly, the same strategy can be employed to fit a parabola Solution:


through three points. L L L
The first-order polynomial can be used to obtain the estimate at x
x x x x x x x x x x x x = 15
f x f x f x f x
x x x x x x x x x x x x
f
Both the first- and second-order versions as well as higher-order
Lagrange polynomials can be represented concisely as The second-order polynomial can be used to obtain the estimate at
x = 15
n n x xj
fn x Li x f xi where Li x f
i j xi xj
j i

where n=the number of data points and designates the


“product of”.
Questions:
1) How to use simple fixed-point iteration to solve the root of equation?
2) What is the convergence and divergence in the calculation of the root of
equation?
3) How to use Newton-Raphson method for the calculation of the root of
equation?
4) How to use successive substitution to solve nonlinear system?
5) What are the limitations of the successive substitution on solving nonlinear
system?
6) What is the Newton interpolating polynomial method?
7) What is the linear interpolation method?
8) What is the quadratic interpolation method?
9) What is the general form of Newton’s interpolation method?
10)How to use Lagrange interpolating polynomial?

Reference:
( Applied numerical methods with MATLAB for
engineers and scientists )

pp.140-149
(pp. 189 – 191)
pp.235-249

You might also like