Академический Документы
Профессиональный Документы
Культура Документы
Definition
A nonlinear equation is one that contains variables of degree
greater or lower than 1.
Definition
A nonlinear equation is one that contains variables of degree
greater or lower than 1.
Examples:
f (x, y) = x2 + y, the variable x is of degree 2 > 1.
√ 1
f (x, y) = y + 2x, the variable y is of degree < 1.
2
Definition
A nonlinear equation is one that contains variables of degree
greater or lower than 1.
Examples:
f (x, y) = x2 + y, the variable x is of degree 2 > 1.
√ 1
f (x, y) = y + 2x, the variable y is of degree < 1.
2
Nonlinear equations are important due to they commonly appear
in physical phenomenas.
𝑟𝑎𝑑𝑖𝑢𝑠 𝑟
𝑑𝑒𝑛𝑠𝑖𝑡𝑦 𝜌
𝑑𝑒𝑝𝑡ℎ 𝑑
General Sequence
Function Staring value Iterative rule
p0 g(x) P0 Pk+1 = g(Pk )
p1 = g(p0 )
p2 = g(p1 )
..
.
pk = g(pk−1 )
pk+1 = g(pk )
..
.
Professor Henry Arguello Numerical methods March 12, 2018 6 / 68
Iteration approach for finding roots
General Sequence
Function Staring value Iterative rule
p0 g(x) P0 Pk+1 = g(Pk )
p1 = g(p0 )
p2 = g(p1 ) Possible results:
.. XUnending sequence of numbers
.
pk = g(pk−1 ) XDiverge or periodic sequences
pk+1 = g(pk ) XConvergent sequences
..
.
Professor Henry Arguello Numerical methods March 12, 2018 6 / 68
Iteration for Solving x = g(x)
Definition 1
A fixed point of a function g(x) is a real number P such that P = g(P).
Definition 1
A fixed point of a function g(x) is a real number P such that P = g(P).
Definition 2
The iteration pn+1 = g(pn ) for n = 0, 1, ... is called fixed-point iteration.
Definition 1
A fixed point of a function g(x) is a real number P such that P = g(P).
Definition 2
The iteration pn+1 = g(pn ) for n = 0, 1, ... is called fixed-point iteration.
Theorem 1
Assume that g is a continous function and that {pn }∞
n=0 is a sequence
generated by fixed-point iteration. If limn→∞ pn = P, then P is a fixed
point of g(x).
EXAMPLE Given the starting point, p0 = 0.5, and the rule iteration
pk+1 = e−pk , find the sequence for k = 0, 1, ....
EXAMPLE Given the starting point, p0 = 0.5, and the rule iteration
pk+1 = e−pk , find the sequence for k = 0, 1, ....
EXAMPLE Given the starting point, p0 = 0.5, and the rule iteration
pk+1 = e−pk , find the sequence for k = 0, 1, ....
EXAMPLE Given the starting point, p0 = 0.5, and the rule iteration
pk+1 = e−pk , find the sequence for k = 0, 1, ....
lim pn = 0.567143 . . . .
n→∞
Theorem 2
Assume that g ∈ C[a, b].
1. If the range of the mapping y = g(x) satisfies y ∈ [a, b] for all x ∈ [a, b],
then g has a fixed point in [a, b].
Example:
1
Let y = , x on [0.5, 5.2]. Determine if a fixed point exists according to
x
literal 1 in Theorem 2.
The range of the mapping y = g(x) does not satisfy y ∈ [0.5, 5.2] for all
x ∈ [0.5, 5.2].
Professor Henry Arguello Numerical methods March 12, 2018 11 / 68
Iteration for Solving x = g(x)
Example:
1
Let y = , x on [0.5, 2]. Determine if a fixed point exists according to
x
literal 1 in Theorem 2.
* If |g0 (x)| ≤ K < 1 for all x ∈ [a, b], then the iteration pn = g(pn−1 ) will
converge to the unique fixed point P ∈ [a, b]. In this case, P is said to be
an attractive fixed point.
** If |g0 (x)| > 1 for all x ∈ [a, b], then the iteration pn = g(pn−1 ) will not
converge to P. In this case, P is said to be a repelling fixed point and
the iteration exhibits local divergence.
P
P y = g(x)
y = g(x)
x x
P P2 P1 P0 P0 P2 P P1
y=x
y=x
(p0 , g(p0))
P
x x
P P0 P1 P2 P2 P0 P P1 P3
Only one analytical fixed point P = 2 exists. The derivative is g0 (x) = 1/(x − 1)1/2 and
g0 (2) = 1, so Theorem 3 does not apply. There are two cases to consider when the
starting value lies to the left or right of P = 2.
1. Relative error
|p1001 − p1002 | = 0.00000396
2. Absolute error
|P − p1000 | = 0.00398714
Professor Henry Arguello Numerical methods March 12, 2018 22 / 68
Bracketing Methods for Locating a Root
Example:
I 2 I N−1
I
A=P+P 1+ +P 1+ + ··· + P 1 + .
12 12 12
In geometric series:
1 − rN
1 + r + r2 + r3 + · · · + rN−1 = .
1−r
Then, the annuity-due equation is,
I N
1− 1+ N !
12 P I
A=P = 1+ −1 .
I I/12 12
1− 1+
12
Professor Henry Arguello Numerical methods March 12, 2018 23 / 68
Bracketing Methods for Locating a Root
EXAMPLE
You save $250 per month and you desire that the total value of all payments
and interest be $250, 000 at the end of 20 years. What interest rate I is needed
to achieve your goal?
You save $250 per month and you desire that the total value of all payments
and interest be $250, 000 at the end of 20 years. What interest rate I is needed
to achieve your goal?
N = 240 months P = $250 I =?
A = A(I) A = $250000
N !
P I
A= 1+ −1 .
I/12 12
You save $250 per month and you desire that the total value of all payments
and interest be $250, 000 at the end of 20 years. What interest rate I is needed
to achieve your goal?
N = 240 months P = $250 I =?
A = A(I) A = $250000
N !
P I
A= 1+ −1 .
I/12 12
To determine the value of I that satisfies our desire, we start with two guesses,
I0 = 0.12 and I1 = 0.13, and we calculate the amount A for each case.
247,314 282,311
A(0.12) A(0.13)
Desired A = $250000
Professor Henry Arguello Numerical methods March 12, 2018 24 / 68
Bracketing Methods for Locating a Root
As the desired A is between the obtained values, we try a new value in
the middle I2 = I0 +I
2 = 0, 125
1
The desired rate lies in the interval [0.12, 0.125]. Therefore, we take the
next guess in the midpoint I3 = 0.1225,
The desired rate lies in the interval [0.12, 0.125]. Therefore, we take the
next guess in the midpoint I3 = 0.1225,
The interval is now narrowed to [0.12, 0.1225]. Our last calculation uses
the midpoint I4 = 0.12125
We could continue until finding the proper value for I that produces
A = 250000.
Definition 3
Assume that f (x) is a continuous function. Any number r for which
f (r) = 0 is called a root of the equation f (x). Also, we say that r is a
zero of the function f (x).
Definition 3
Assume that f (x) is a continuous function. Any number r for which
f (r) = 0 is called a root of the equation f (x). Also, we say that r is a
zero of the function f (x).
Example
The equation 2x2 + 5x − 3 = 0 has two real roots r1 = 0.5 and r2 = −3,
whereas the corresponding function f (x) = 2x2 + 5x − 3 = (2x − 1)(x + 3)
has two real zeros, r1 = 0.5 and r2 = −3.
(4) a0 ≤ a1 ≤ . . . ≤ an ≤ . . . ≤ r ≤ . . . ≤ bn ≤ . . . ≤ b1 ≤ b0 .
where cn = (an + bn )/2, and if f (an+1 )f (bn+1 ) < 0, then
(5) [an+1 , bn+1 ] = [an , cn ] or [an+1 , bn+1 ] = [cn , bn ] for all n.
y = f(x)
(r,0) (r,0)
[ ] Ι Ι [ ]
a c b a c b
(c, f(c))
(b, f(b))
(b, f(b))
(a) If f (a) and f (c) have opposite signs, (b) If f (c) and f (b) have opposite signs,
then squeeze from the right. then squeeze from the left.
b−a
|r − cn | ≤ for n = 0, 1, ...
2n+1
and therefore the sequence {cn }∞
n=0 converges to the zero x = r; that is
lim cn = r.
n→∞
an cn bn
|r- cn|
r
|bn- an|
2
Example
Find the value of x that lies in the interval [0, 2], where the function
h(x) = xsin(x) takes the value h(x) = 1 (the function sin(x) is evaluated
in radians).
Example
Find the value of x that lies in the interval [0, 2], where the function
h(x) = xsin(x) takes the value h(x) = 1 (the function sin(x) is evaluated
in radians).
Example
How do you calculate the error bound in the thirty-first iteration?
Example
How do you calculate the error bound in the thirty-first iteration?
According with theorem 4 we have:
b−a
error= |r − cn | ≤
2n+1
Example
How do you calculate the error bound in the thirty-first iteration?
According with theorem 4 we have:
b−a
error= |r − cn | ≤
2n+1
(2 − 0)
Thus, |E31 | ≤ ≈ 4.656613 × 10−10
232
Equating, we have,
L
r r
[ ] Ι Ι [ ]
a (c, 0) b a (c,0) b
(b, f(b))
(c, f(c)) (b, f(b))
(a) If f (a) and f (c) have opposite signs, (b) If f (c) and f (b) have opposite signs,
then squeeze from the right. then squeeze from the left.
f (b)(b − a)
c=b−
f (b) − f (a)
XIf f (a) and f (c) has opposite signs, a zero lies in [a, c].
XIf f (c) and f (b) have opposite signs, a zero lies in [c, b].
XIf f (c) = 0, then the zero is c.
f (bn )(bn − an )
cn = bn −
f (bn ) − f (an )
and it can be proved that the sequence {cn } will converge to r.
Professor Henry Arguello Numerical methods March 12, 2018 37 / 68
Bracketing Methods for Locating a Root
If the graph of y = f (x) is concave near (r, 0), one of the endpoints
becomes fixed and the other one marches into the solution.
y = f(x)
r
[ ] ] ]
a0=a1=a2 b2 b1 b0
Example: Using the false position method find the root of xsin(x)−1 = 0
that is located in the interval [0, 2] ( sin(x) is evaluated in radians).
Example: Using the false position method find the root of xsin(x)−1 = 0
that is located in the interval [0, 2] ( sin(x) is evaluated in radians).
1. Calculate f (a0 ) and f (b0 )
a0 = 0 −→ f (0) = −1.00 and b0 = 2 −→ f (2) = 0.81859485
Example: Using the false position method find the root of xsin(x)−1 = 0
that is located in the interval [0, 2] ( sin(x) is evaluated in radians).
1. Calculate f (a0 ) and f (b0 )
a0 = 0 −→ f (0) = −1.00 and b0 = 2 −→ f (2) = 0.81859485
2. Verify that f (a0 )f (b0 ) < 0
Example: Using the false position method find the root of xsin(x)−1 = 0
that is located in the interval [0, 2] ( sin(x) is evaluated in radians).
1. Calculate f (a0 ) and f (b0 )
a0 = 0 −→ f (0) = −1.00 and b0 = 2 −→ f (2) = 0.81859485
2. Verify that f (a0 )f (b0 ) < 0
3. Calculate c0
0.81859485(2 − 0)
c0 = 2 − = 1.09975017 and f (c0 ) = −0.02001921
0.81859485 − (−1)
Example: Using the false position method find the root of xsin(x)−1 = 0
that is located in the interval [0, 2] ( sin(x) is evaluated in radians).
1. Calculate f (a0 ) and f (b0 )
a0 = 0 −→ f (0) = −1.00 and b0 = 2 −→ f (2) = 0.81859485
2. Verify that f (a0 )f (b0 ) < 0
3. Calculate c0
0.81859485(2 − 0)
c0 = 2 − = 1.09975017 and f (c0 ) = −0.02001921
0.81859485 − (−1)
4. Define the new interval:
New interval [c0 , b0 ] = [1.09975017, 2]. Then a1 = c0 and b1 = b0 .
0.81859485(2 − 1.09975017)
c1 = 2 − = 1.12124074 and f (c1 ) = 0.00983461
0.81859485 − (−0.02001921)
0 − f (p0 )
m= ,
p1 − p0
m = f 0 (p0 ),
Equating:
f (p0 )
p1 = p0 − .
f 0 (p0 )
f (pk−1 )
pk = g(pk−1 ) = pk−1 − for k = 1, 2, ...
f 0 (pk−1 )
will converge to p for any initial approximation p0 ∈ [p − δ, p + δ].
f (x)
g(x) = x − .
f 0 (x)
√
Example: Use Newton’s square-root algorithm to find 5.
√
Example: Use Newton’s square-root algorithm to find 5.
A
pk−1 +
pk−1
Starting with p0 = 2 and using pk = , we compute
2
√
Example: Use Newton’s square-root algorithm to find 5.
A
pk−1 +
pk−1
Starting with p0 = 2 and using pk = , we compute
2
2 + 5/2
p1 = = 2.25
2
2.25 + 5/2.25
p2 = = 2.236111111
2
2.236111111 + 5/2.236111111
p3 = = 2.236067978
2
2.236067978 + 5/2.236067978
p4 = = 2.236067978
2
y = vy t − 16t2 and x = vx t,
where the horizontal and vertical components of the initial velocity are
vx = v0 cos(b0 ) and vy = v0 sin(b0 ). If the air resistance is proportional to
the velocity, the equations of motion become
y
(x, y) = (r(t), f(t))
300
Ι
200
Ι
100
Ι
Ι Ι Ι Ι Ι x
200 400 600 800 1000
y = f (t) = (Cvy + 32C2 )(1 − e−t/C ) − 32Ct and x = r(t) = Cvx (1 − e−t/C )
y = f (t) = (Cvy + 32C2 )(1 − e−t/C ) − 32Ct and x = r(t) = Cvx (1 − e−t/C )
To find the elapsed time we need to find the root of the equation f (t)
f (pk−1 )
pk = g(pk−1 ) = pk−1 − for k = 1, 2, ...
f 0 (pk−1 )
f (pk−1 )
pk = g(pk−1 ) = pk−1 − for k = 1, 2, ...
f 0 (pk−1 )
83.22097200
p1 = 8 − = 8.797731010
−104.3220972
The value p4 has eight decimal places of accuracy, and the time until
impact is t ≈ 8.74217466 seconds. The range can now be computed
using r(t), and we get
Lemma 1
If the equation f (x) = 0 has root of order M at x = p, there exists a
continuous function h(x) so that f (x) can be expressed as the product
Lemma 1
If the equation f (x) = 0 has root of order M at x = p, there exists a
continuous function h(x) so that f (x) can be expressed as the product
Example:
Lemma 1
If the equation f (x) = 0 has root of order M at x = p, there exists a
continuous function h(x) so that f (x) can be expressed as the product
Example:
Lemma 1
If the equation f (x) = 0 has root of order M at x = p, there exists a
continuous function h(x) so that f (x) can be expressed as the product
Example:
Speed of Convergence
If p is a simple root of f (x) = 0, Newton’s method will converge
rapidly, and the number of accurate decimal places doubles with
each iteration.
Definition 5
Assume that {pn }∞n=0 converges to p and set En = p − pn for n ≥ 0. If two
positive constants A 6= 0 and R > 0 exist, and
|p − pn+1 | |En+1 |
lim R
= lim = A, (4)
n→∞ |p − pn | n→∞ |En |R
Definition 5
Assume that {pn }∞n=0 converges to p and set En = p − pn for n ≥ 0. If two
positive constants A 6= 0 and R > 0 exist, and
|p − pn+1 | |En+1 |
lim R
= lim = A, (4)
n→∞ |p − pn | n→∞ |En |R
Start with p0 = −2.4 and use Newton-Raphson iteration to find the root
p = −2 of the polynomial f (x) = x3 − 3x + 2. The iteration formula for
computing {pk } is
x3 −3x+2
pk+1 = pk − 3x2 −3
.
Start with p0 = −2.4 and use Newton-Raphson iteration to find the root
p = −2 of the polynomial f (x) = x3 − 3x + 2. The iteration formula for
computing {pk } is
x3 −3x+2
pk+1 = pk − 3x2 −3
.
Start with p0 = 1.2 and use Newton-Raphson iteration to find the double
root p = 1 of the polynomial f (x) = x3 − 3x + 2. Using formula (4) to
check for linear convergence, we get the values.
Start with p0 = 1.2 and use Newton-Raphson iteration to find the double
root p = 1 of the polynomial f (x) = x3 − 3x + 2. Using formula (4) to
check for linear convergence, we get the values.
|Ek+1 |
k pk pk+1 − pk Ek = p − pk
|Ek |
0 1.200000000 -0.096969697 -0.200000000 0.515151515
1 1.103030303 -0.050673883 -0.103030303 0.508165253
2 1.052356420 -0.025955609 -0.052356420 0.496751115
3 1.026400811 -0.013143081 -0.026400811 0.509753688
4 1.013257730 -0.006614311 -0.013257730 0.501097775
5 1.006643419 -0.003318055 -0.006643419 0.500550093
. . . . .
. . . . .
. . . . .
|f 00 (p)|
|En+1 | ≈ |En |2 for n sufficiently large.
2|f 0 (p)|
M−1
|En+1 | ≈ |En | for n sufficiently large.
M
Pitfalls
f (pk−1 )
pk = g(pk−1 ) = pk−1 − for k = 1, 2, ...
f 0 (pk−1 )
will wander back and forth from left to right and not converge. A simple
analysis of the situation reveals that f (x) > 0 and has no real roots.
y
0.3 y=xe -x
Ι
0.2
Ι
0.1
Ι
x
p0 = 2 p1 = 2 p2 p3
- 5 --
- 10 --
- 15 --
y = x3– x - 3 - 20 --
- 25 --
-- 1
1 p0 2
x
I I I I I
p p p2
-3 3 -2 1 -1
-- -1
y = arctan(x)
The secant method will require only one evaluation of f (x) per step and
at a simple root has an order of convergence R = 1.618033989. It is
almost as fast as Newton’s method, which has order 2.
The secant method will require only one evaluation of f (x) per step and
at a simple root has an order of convergence R = 1.618033989. It is
almost as fast as Newton’s method, which has order 2.
Two initial points (p0 , f (p0 )) and (p1 , f (p1 )) near the point (p, 0) are needed.
Define p2 to be the abscissa of the point of intersection of the line
through these two points and the x-axis. The equation relating p2 , p1 ,
and p0 is found by considering the slope
The values of m are the slope of the secant line through the first two
approximations and the slope of the line through (p1 , f (p1 )) and (p2 , 0),
respectively.
Professor Henry Arguello Numerical methods March 12, 2018 61 / 68
Newton-Raphson and Secant Methods
Set the right-hand sides equal and solve for p2 = g(p1 , p0 ) and get
f (p1 )(p1 − p0 )
p2 = g(p1 , p0 ) = p1 − .
f (p1 ) − f (p0 )
The general term is given by the two-point iteration formula
f (pk )(pk − pk−1 )
pk+1 = g(pk , pk−1 ) = pk − .
f (pk ) − f (pk−1 )
The geometric construction of p2 for the secant method.
y
y = f(x)
p2 p1 p0 x
II I I
(p,0)
( p1 ,f( p1 ))
( p0 ,f( p0 ))
Start with p0 = −2.6 and −2.4 and use the secant method to find the
root p = −2 of the polynomial function f (x) = x3 − 3x + 2. In this case
the iteration formula is.
|Ek+1 |
k pk pk+1 − pk Ek = p − pk
|Ek |1.618
0 -2.600000000 0.200000000 0.600000000 0.914152831
1 -2.400000000 0.293401015 0.400000000 0.469497765
2 -2.106598985 0.083957573 0.106598985 0.847290012
3 -2.022641412 0.021130314 0.022641412 0.693608922
4 -2.001511098 0.001488561 0.001511098 0.825841116
5 -2.000022537 0.000022515 0.000022537 0.727100987
6 -2.000000022 0.000000022 0.000000022
7 -2.000000000 0.000000000 0.000000000
f (p) 0.618
00
|Ek+1 | ≈ |Ek |1.618
2f 0 (p) .
f (p) 0.618
00
|Ek+1 | ≈ |Ek |1.618
2f 0 (p) .
√
Where the order of convergence is R = (1 + 5)/2 ≈ 1.618
Accelerated Convergence
Mf (pk−1 )
pk = pk−1 − ,
f 0 (pk−1 )
1
Bisection Ek+1 ≈ |Ek |
2
Regula falsi Ek+1 ≈ A|Ek |
Secant method Multiple root Ek+1 ≈ A|Ek |
Newton-Raphson Multiple root Ek+1 ≈ A|Ek |
Secant method Simple root Ek+1 ≈ A|Ek |1.618
Newton-Raphson Simple root Ek+1 ≈ A|Ek |2
Accelerated Multiple root Ek+1 ≈ A|Ek |2
Newton-Raphson