Download - Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Transcript
Page 1: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

www.le.ac.uk

Numerical Methods: Finding Roots

Department of MathematicsUniversity of Leicester

Page 2: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Content

Motivation

Change of sign method

Iterative method

Newton-Raphson method

Page 3: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Reasons for Finding Roots by Numerical Methods• If the data is obtained from observations,

it often won’t have an equation which accurately models

• Some equations are not easy to solve

• Can program a computer to solve equations for us

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 4: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving equations by change of sign

• This is also known as ‘Iteration by Bisection’

• It is done by bisecting an interval we know the solution lies in repeatedly

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 5: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

METHOD

• Find an interval in which the solution lies

• Split the interval into 2 equal parts

• Find the change of sign

• Repeat

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 6: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 7: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Example: Find a root of the equation

given there is a solution close to x=-2

Step 1: Find the interval

So we know the solution lies between -2 and -1

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 8: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Step 2: We now half the interval and find the

value of f at the half way point

Now we know the solution lies between and

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

𝑓 (−1.5 )=2 (−1.5 )3−2 (−1.5 )+7=6.625

Page 9: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Step 3: Now we just keep repeating the process

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 10: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 11: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

So to 3 s.f. the solution is

Solving equations by change of sign

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

𝑥=−1.74

Page 12: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving equations by change of sign

Number of dp:

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Find a solution

Clear information box

Page 13: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving using iterative method

• ‘Iteration’ is the process of repeatedly using a previous result to obtain a new result

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 14: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

METHOD

• Rearrange the equation to make the highest power the subject

• Use the power root to leave on its own on the LHS

• Make on the LHS

• Make on the RHS

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 15: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

• Now that the function is in the form

we can use the value for to calculate , then we can use the value , and so on...

• When we eventually get a value repeating we have reached the solution

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

𝑥𝑛+1= 𝑓 (𝑥𝑛)

Page 16: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 17: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 18: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 19: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Click on a seed value to see the cobweb:

start

here

start

here

start

here

start

here

start

here

start

here

𝑦=𝑥

𝑦= 𝑓 (𝑥 )

Clear Cobwebs

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 20: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Example: Find a root of the equation

given that there is a solution close to

STEP 1: Rearrange the equation

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 21: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Step 2: We can now input (taken from the

question)

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 22: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

This gives us the solution

to 3 d.p.

Solving using iterative method

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

𝑥=−1.893

Page 23: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Solving using iterative method

Starting value:

Number of d.p.:

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Solve

Clear

Page 24: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Newton-Raphson Method

• Sometimes known as the Newton Method

• Named after Issac Newton and Joseph Raphson

• Iteratively finds successively better approximations to the roots

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 25: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Newton-Raphson Method

The formula is

We start with an arbitrary and wait for the

iteration to converge

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

𝑥𝑛+1=𝑥𝑛−𝑓 (𝑥𝑛)𝑓 ′ (𝑥𝑛)

Page 26: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Newton-Raphson Method

𝑥0𝑥1𝑥3

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 27: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Newton-Raphson Method

Example: Use the Newton-Raphson Method to

approximate the cube root of 37

The equation we use is

Now we need to evaluate

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 28: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Newton-Raphson Method

We then obtain the formula

Choose

Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

𝑓 (𝑥𝑛+1 )=𝑥𝑛−(𝑥𝑛)3−373 (𝑥𝑛 )2

Page 29: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.

Newton-Raphson Method

So this means that the cube root of 37 is approximately 3.3322 Next

Iterative method

Newton-Raphson

Change of sign methodMotivation

Page 30: Www.le.ac.uk Numerical Methods: Finding Roots Department of Mathematics University of Leicester.