0% found this document useful (0 votes)
14 views28 pages

03 Roots of Equations II

Uploaded by

v2z2mt9fhb
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)
14 views28 pages

03 Roots of Equations II

Uploaded by

v2z2mt9fhb
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
You are on page 1/ 28

Roots of Equations II

Outline
• Open Methods
• Fixed-point Iteration
• Newton-Raphson Method
Open Methods
• Some information about open methods:
• Need an initial guess where to start looking for the root.
• Will only give the closest root to the initial guess, in case there are multiple
roots.
• Need to know the first derivative of the function.
• Does not always converge, depends on how the function is manipulated.
• Convergence for these methods is relatively fast.
Fixed-point Iteration
• Fixed-point Iteration – also known as successive substitution
• Simple method, needs only an initial guess to compute for the solution.
• Instead of turning the function into a problem of 𝑓 𝑥 = 0, you need to turn
the function into 𝒙 = 𝒈(𝒙), such that the variable we want to solve for is also
on the other side of the equation.
• Can be accomplished by algebraic manipulation or by simply adding 𝑥 to both
sides of the original equation.
• Example:
𝑥 2 +3
𝑥2 − 2𝑥 + 3 = 0 → 𝑥 =
2
sin 𝑥 = 0 → 𝑥 = sin 𝑥 + 𝑥
Fixed-point Iteration
1. Isolate 𝒙 on one side of the equation (for consistency, let’s use the
left side). Let 𝒇(𝒙) be the remaining part of the equation such that
𝒙 = 𝒇(𝒙).
2. Make an initial guess 𝑥0.
3. Iterate using 𝒙𝒊+𝟏 = 𝒇(𝒙𝒊).
4. Identify the exit criterion and set a tolerance then repeat step 3
until the solution converges.
5. The answer is 𝒙𝒊+𝟏 upon convergence.
Fixed-point Iteration
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
1. Isolate 𝒙 on one side of the equation (for consistency, let’s use the
left side). Let 𝒇(𝒙) be the remaining part of the equation such that
𝒙 = 𝒇(𝒙).

Option 1: 𝑥 = 2𝑥 − 2 𝑓1 (𝑥) = 2𝑥 − 2
Option 2: 𝑥 = log2(𝑥2 + 2) 𝑓2 𝑥 = log2(𝑥2 + 2)
Option 3: 𝑥 = 2𝑥 − 𝑥 2 − 2 + 𝑥 𝑓3 𝑥 = 2𝑥 − 𝑥2 − 2 + 𝑥
Fixed-point Iteration
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
2. Make an initial guess 𝑥0.
𝑥0 = 3

Option 1: 𝑥 = 2𝑥 − 2 𝑓1 (𝑥) = 2𝑥 − 2
Option 2: 𝑥 = log2(𝑥2 + 2) 𝑓2 𝑥 = log2(𝑥2 + 2)
Option 3: 𝑥 = 2𝑥 − 𝑥2 − 2 + 𝑥 𝑓3 𝑥 = 2𝑥 − 𝑥 2 − 2 + 𝑥
Fixed-point Iteration
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
3. Iterate using 𝒙𝒊+𝟏 = 𝒇(𝒙𝒊).
𝑥0 = 3
Fixed-point Iteration
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
4. Identify the exit criterion and set
a tolerance then repeat step 3
until the solution converges.
• Let’s use the approximate error as the
exit criterion.
• Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙,
𝑥𝑖+1
stop the iteration
Fixed-point Iteration
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
4. Identify the exit criterion and set
a tolerance then repeat step 3
until the solution converges.
• Let’s use the approximate error as the
exit criterion.
• Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙,
𝑥𝑖+1
stop the iteration
Fixed-point Iteration
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
4. Identify the exit criterion and set
a tolerance then repeat step 3
until the solution converges.
• Let’s use the approximate error as the
exit criterion.
• Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙,
𝑥𝑖+1
stop the iteration
Fixed-point Iteration
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
5. The answer is 𝒙𝒊+𝟏 upon convergence.
• Only option 2 converged to a value of 𝟒. 𝟒𝟑𝟕𝟒𝟗𝟒𝟒𝟎𝟐.

Option 1: 𝑥 = 2𝑥 − 2 𝑓1 (𝑥) = 2𝑥 − 2
Option 2: 𝑥 = log2(𝑥2 + 2) 𝑓2 𝑥 = log2(𝑥2 + 2)
Option 3: 𝑥 = 2𝑥 − 𝑥2 − 2 + 𝑥 𝑓3 𝑥 = 2𝑥 − 𝑥 2 − 2 + 𝑥
Fixed-point Iteration
• Convergence
• As we can see, not all the options converged when used with fixed-
point iteration.
• Let 𝑓(𝑥) be continuous and 𝑓′(𝑥) exists on an interval 𝑥 ϵ [𝑎, 𝑏].
𝒇′ 𝒙 ≤ 𝟏, for all 𝑥 ϵ [𝑎, 𝑏]
• Then for any number 𝒙𝟎 in the interval [𝑎, 𝑏], the sequence defined
by:
𝒙𝒏+𝟏 = 𝒇(𝒙𝒏)
• Converges to the unique fixed point 𝒙𝒎 which is the root between the
interval [𝑎, 𝑏].
Fixed-point Iteration
• Convergence
• Let’s look at the example we discussed: Solve for 𝑥 in 𝒙𝟐 + 𝟐 = 𝟐𝒙
• We already know from solving that the root is somewhere in the interval [𝟑, 𝟓].
• Let’s plot the derivatives in the given interval [3,5] to see if there exists a 𝑘 such
that 𝑓 ′ 𝑥 ≤ 1.

ln 2 (2𝑥)
Option 1: 𝑥 = 2𝑥 − 2 𝑓1(𝑥) = 2𝑥 − 2 𝑓1′(𝑥) =
2 2𝑥 − 2
2𝑥
Option 2: 𝑥 = log2(𝑥2 + 2) 𝑓2 𝑥 = log2(𝑥2 + 2) 𝑓2′ 𝑥 =
(ln 2)(𝑥2 + 2)
Option 3: 𝑥 = 2𝑥 − 𝑥2 − 2 + 𝑥 𝑓3 𝑥 = 2𝑥 − 𝑥2 − 2 + 𝑥 𝑓′(𝑥) = 2𝑥 ln 2 − 2𝑥 + 1
3
Fixed-point Iteration
• Convergence
• Let’s look at the example we
discussed: Solve for 𝑥 in 𝒙𝟐 +
𝟐 = 𝟐𝒙
• We already know from solving
that the root is somewhere in
the interval [𝟑, 𝟓].
• Let’s plot the derivatives in the
given interval [3,5] to see if
there exists a 𝑘 such that
𝑓 ′ 𝑥 ≤ 1.
Newton-Raphson Method
• Newton-Raphson Method
• Most widely used root-finding method
• Named after Isaac Newton and Joseph Raphson
• The problem we need to solve is again 𝑓 𝑥 = 0, no need to isolate 𝑥 like in
fixed-point iteration
• Needs the derivative of the function.
• Number of iterations can greatly vary depending on the initial guess.
Newton-Raphson Method
1. Turn the equation to a function of the variable we want to solve
such that 𝑓 𝑥 = 0.
2. Make an initial guess 𝑥0.
𝒇 𝒙𝒊
3. Iterate using 𝒙𝒊+𝟏 = 𝒙𝒊 −
𝒇′(𝒙𝒊)
4. Identify the exit criterion and set a tolerance then repeat step 3
until the solution converges.
5. The answer is 𝒙𝒊+𝟏 upon convergence.
Newton-Raphson Method
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
1. Turn the equation to a function of the variable we want to solve
such that 𝑓 𝑥 = 0.
𝑥 2 + 2 = 2𝑥
2𝑥 − 𝑥2 − 2 = 0
𝑓 𝑥 =0
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
Newton-Raphson Method
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
2. Make an initial guess 𝑥0.
Option 1: 𝑥0 =1
Option 2: 𝑥0 =2
Option 3: 𝑥0 =3
Option 4: 𝑥0 =4
Newton-Raphson Method
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
𝒇 𝒙𝒊
3. Iterate using 𝒙 𝒊+𝟏 = 𝒙𝒊 − .
𝒇 ′ 𝒙𝒊
𝑓 ′ 𝑥 = 2𝑥 ln 2 − 2𝑥
Newton-Raphson Method
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
𝑓 ′ 𝑥 = 2 𝑥 ln 2 − 2𝑥
4. Identify the exit criterion and set a tolerance then repeat step 3 until the solution converges.

Let’s use the approximate


error as the exit criterion.
Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙,
𝑥𝑖+1
stop the iteration
Newton-Raphson Method
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
𝑓 ′ 𝑥 = 2 𝑥 ln 2 − 2𝑥
4. Identify the exit criterion and set a tolerance then repeat step 3 until the solution converges.

Let’s use the approximate


error as the exit criterion.
Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙,
𝑥𝑖+1
stop the iteration
Newton-Raphson Method
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
𝑓 ′ 𝑥 = 2 𝑥 ln 2 − 2𝑥
4. Identify the exit criterion and set a tolerance then
repeat step 3 until the solution converges.
• Let’s use the approximate error as the exit
criterion.
• Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙, stop the iteration
𝑥𝑖+1
Newton-Raphson Method
• Example:
• Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
𝑓 ′ 𝑥 = 2 𝑥 ln 2 − 2𝑥
4. Identify the exit criterion and set a tolerance then repeat step 3 until the solution converges.

Let’s use the approximate


error as the exit criterion.
Set 𝑡𝑜𝑙 = 1𝑒 − 3
𝑥𝑖+1 − 𝑥𝑖
If < 𝑡𝑜𝑙,
𝑥𝑖+1
stop the iteration
Newton-Raphson Method
• Example: Solve for 𝑥 in 𝑥 2 + 2 = 2𝑥
𝑓 𝑥 = 2𝑥 − 𝑥2 − 2
5. The answer is 𝒙𝒊+𝟏 upon convergence.
• The four initial guesses converged but at different number of iterations

Initial guess 𝑥𝑖+1 # iterations


Option 1: 𝑥0 =1 𝟒. 𝟒𝟒𝟏𝟐𝟗𝟏𝟕𝟏𝟓 9
Option 2: 𝑥0 =2 𝟒. 𝟒𝟒𝟏𝟐𝟖𝟓𝟐𝟖𝟓 7
Option 3: 𝑥0 =3 𝟒. 𝟒𝟒𝟏𝟐𝟖𝟔𝟐𝟖𝟐 32
Option 4: 𝑥0 =4 𝟒. 𝟒𝟒𝟏𝟐𝟖𝟓𝟑𝟓𝟗 4
Assignment
• Let your Student ID be 20𝑥𝑦 − 𝑎𝑏𝑐𝑑𝑒𝑓.
• Let 𝑝 = 10𝑎 + 𝑏; 𝑞 = 10𝑐 + 𝑑; 𝑟 = 10𝑒 + 𝑓.
• Find all the zeros of the following function:
ℎ 𝑥 = 𝑝𝑥2 − 𝑞𝑥 − 𝑟
• Use the approximate error as the exit criterion with a tolerance of 0.01
• If 𝒇 is an even number, use fixed-point iteration
• If 𝒇 is an odd number, use Newton-Raphson method
Assignment
• Determine the drag coefficient 𝑐𝑑 needed for a parachutist of mass 𝑚 = 68.1 𝑘𝑔
to have a velocity of 40 𝑚/𝑠 after free-falling for time 𝑡 = 10 𝑠. Assume the
acceleration due to gravity is 9.8 𝑚/𝑠2.
𝑔𝑚 − 𝑐𝑑 𝑡
𝑣 𝑡 = 1−𝑒 𝑚
𝑐𝑑
• Use the approximate error as the exit criterion with a tolerance of 𝟎. 𝟎𝟎𝟏
• If the last digit of your Student ID is an even number, use Newton-Raphson
method
• If the last digit of your Student ID is an odd number, use fixed-point iteration
• For your solution, show only the first round of calculations, and then a table of all
the values, then your final answer. Make sure to box your final answer with the
correct units. (20 points)
Any questions?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy