+ All Categories
Home > Documents > C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3...

C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3...

Date post: 26-Mar-2018
Category:
Upload: doanminh
View: 221 times
Download: 3 times
Share this document with a friend
35
Methods for Advanced Mathematics (C3) Coursework Numerical Methods © Woodhouse College 2011 Page 1
Transcript
Page 1: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 1

Page 2: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 2

Introduction .................................................................................................................... 3 Terminology ................................................................................................................... 3

Activity 1 ................................................................................................................... 4 Why use numerical methods? ........................................................................................ 5 Change of sign ............................................................................................................... 5

Activity 2 ................................................................................................................... 6 Interval Bisection ........................................................................................................... 7 Decimal Search .............................................................................................................. 8

Coursework Requirements on Change of Sign .......................................................... 9 Activity 3 ................................................................................................................. 11

Setting up a spreadsheet to do Decimal Search. .................................................. 11 Activity 4 ................................................................................................................. 13

Fixed point iteration using x = g(x) ............................................................................. 14 Activity 5 ................................................................................................................. 14 Staircase and Cobweb Diagrams ............................................................................. 15 Activity 6 ................................................................................................................. 16

Exploring cobweb and staircase diagrams ........................................................... 16 Activity 7 ................................................................................................................. 18

Setting up a spreadsheet to do x = g(x) fixed point iteration ............................... 18 Activity 8 ................................................................................................................. 20 When the x = g(x) method fails to converge............................................................ 20

Why the method fails ........................................................................................... 20 Coursework Requirements on x = g(x) fixed point iteration ................................... 21

Newton-Raphson method............................................................................................. 22 Activity 9 ................................................................................................................. 23 Setting up a spreadsheet for Newton-Raphson method ........................................... 23 Activity 10 ............................................................................................................... 24

Investigating why the Newton-Raphson Method fails ......................................... 24 Coursework Requirements on the Newton-Raphson Method ................................. 24 Coursework Requirements on Comparison of the methods .................................... 25 Coursework Requirements on Oral Communication ............................................... 25

Change of sign method ................................................................................................ 27 x = g(x) method ............................................................................................................ 30 Newton-Raphson method............................................................................................. 32 Comparison of methods ............................................................................................... 34 Written Communication............................................................................................... 34 Oral Communication .................................................................................................... 34 Methods for Advanced Mathematics (C3) Coursework: Assessment Sheet ............... 35

Page 3: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 3

Introduction In this coursework you will investigate numerical methods of solving equations. By the end of the coursework you should be able to:

• use the terms equation, function, root and solution appropriately • understand that some equations cannot be solved analytically by, for example,

factorising • apply different methods for the numerical solution of such equations to any

degree of accuracy using computers and calculators • compare the methods in terms of their efficiency and ease of use • be able to explain how the methods work with the help of graphs

The methods you will learn are

• Systematic search for a change of sign (decimal search, bisection or linear interpolation)

• Fixed point iteration after rearranging the equation f(x) = 0 into the form x = g(x)

• Fixed point iteration using the Newton-Raphson method This coursework represents 20% of the assessment for this module.

Terminology You must use the following terms correctly:

You can obtain up to one mark for the correct use of notation and terminology:

• 1 mark Correct terminology throughout • ½ mark Some errors in terminology • 0 mark Repeated failure to use the correct terminology

–6 –4 –2 2 4 6

–4

–3

–2

–1

1

2

3

4

x

y

rootx = 0.9755

rootx = 0.4087

rootx = 0

rootx = -1.384

Graph y = f(x)

Function f(x) = 2.9x´-4.4x²+1.6x

Equation 2.9x´-4.4x²+1.6x = 0

Solution (1 solution, 4 roots)

x = -1.384, x = 0, x = 0.4087, x = 0.9755

Page 4: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 4

Activity 1 Find all the mistakes in the following: In order find the three roots of the expression 2 5x x= we could draw the functions

2xy = and 5y x= then find the points at which they intersect.

Alternatively the function 2 5x x= can be rearranged to give 2 5 0x x− = . If we now let ( ) 2 5xf x x= − we can check if one of the solutions, x = 4.488, found before will work:

4.488 5(0.2355) 2 5(4.488) 1.20 10f −= − = − × This gives a value that is close to zero. It is not exactly zero because the x-values we obtained were rounded to four decimal places and so were not exact. If we draw the graph of ( )y f x= then this curve will cross the y-axis at the roots of

the function:

1 2 3 4

10

20

x

y

Solution: x=0.2355

Solution: x=4.488

- 6 - 4 - 2 2 4 6 8

- 40

- 20

20

40

x

y

Solution: x=0.2355Solution: x=4.488

Page 5: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 5

Why use numerical methods? If we want to find the solution to the equation 03 =− xx we can factorise it, so that

( )( ) 011 =−+ xxx so the three roots are 0=x , 1−=x and 1=x . If we want to find the solution to the equation 08102 =++ xx we can use the

quadratic equationa

acbbx

2

42 −±−= which gives the two roots d.p.) (4 -0.8769=x

and -9.1231 (4 d.p.). Some equations, however, like 0353 =+− xx cannot be solved by algebraic or analytical methods (factorising or by a simple equation). To solve these equations we use numerical methods. You will be asked to investigate using three numerical methods and will have to choose your own equations to use. You will lose marks if you choose equations which can be solved algebraically or analytically as we should only use numerical methods when we cannot solve them otherwise.

Change of sign The first method that we are going to explore uses the fact that around a root, the value of a function changes sign: As an example consider the function 35)( 5 +−= xxxf .

( ) ( ) 19310323252)2( 5 −=++−=+−−−=−f

( ) ( ) 73513151)1( 5 =++−=+−−−=−f Since the function changes sign between -2 and -1 (it goes from -19 to +7) then there must be a root in the interval [-2,-1].

root +

-

root +

-

Page 6: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 6

Activity 2

One player chooses a number between 1 and 100 and writes it down. The other player can ask yes/no questions to try and find out the number. How many questions did you take? What is the smallest number of questions you can guarantee finding the number in? What if the number chosen was between 1 and 1000? What if the number chosen was between 1 and n?

53 Is your number over 10?

No.

Page 7: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 7

- 2 - 1

- 30

- 20

- 10

10

yf(- 1) = 7

f(- 2) = - 19

f(- 1.5) = 2.91 (3 s.f.)

f(- 1.75) = - 4.66 (3 s.f)

Interval Bisection Consider the equation 0355 =+− xx . We use the function 35)( 5 +−= xxxf and we have already seen that there is a sign change and therefore a root in the interval [-2,-1]. With interval bisection, we now bisect the interval, in other words we next try the midpoint of the interval (-2 + -1) / 2 = -1.5

( ) ( ) s.f.) (3 91.235.155.1)5.1( 5 =+−−−=−f

We now know that there is a sign change from f(-2) = -19 to f(-1.5) = 2.91 and so the root must lie in the interval [-2,-1.5]. We now repeat the process. The midpoint of the current interval is (-2 + -1.5) / 2 = -1.75 and f(-1.75) = -4.66 We know that there is a sign change from f(-1.75) = -4.66 to f(-1.5) = 2.91 and so the root must lie in the interval [-1.75, -1.5] Our current estimate of the root is (-1.75 + -1.5) / 2 = -1.625 The maximum possible error is -1.625 – (-1.75) = 0.125 so root = -1.625 ± 0.125 We can repeat the process until any required degree of accuracy is obtained.

- 2 - 1 1 2

- 30

- 20

- 10

10

x

yf(- 1) = 7

f(- 2) = - 19

Next try midpointf(- 1.5) = 2.91 (3 s.f.)

Page 8: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 8

Decimal Search Consider the equation 0355 =+− xx . We use the function 35)( 5 +−= xxxf and we have already seen that there is a sign change and therefore a root in the interval [-2,-1].

In this method, you first take increments in x of size 0.1 within the interval and work out the value of the function for each one:

x -2 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1

f(x) -19.00 -12.26 -6.90 -2.70 0.51 2.91 4.62 5.79 6.51 6.89 7.00 From the table we can see that there is a sign change from -1.7 to -1.6 and so this is our new interval in which the root must lie [-1.7, -1.6]

- 2 - 1 1 2

- 30

- 20

- 10

10

x

yf(- 1) = 7

f(- 2) = - 19

- 1.7 - 1.65 - 1.6 - 1.55 - 1.5

- 2

- 1

0

1

x

y

Page 9: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 9

We now repeat the process by considering steps of size 0.01 from -1.7 to -1.6 :

x -1.7 -1.69 -1.68 -1.67 -1.66 -1.65 -1.64 -1.63 -1.62 -1.61 -1.6

f(x) -2.70 -2.34 -1.98 -1.64 -1.30 -0.98 -0.66 -0.36 -0.06 0.23 0.51 We can see that there is a sign change from -1.62 to -1.61 and so this is the new interval in which the root must lie [-1.62, -1.61]

x -1.62 -1.619 -1.618 -1.617 -1.616 -1.615 -1.614 -1.613 -1.612 -1.611 -1.61

f(x) -0.0577 -0.0283 0.0010 0.0302 0.0594 0.0884 0.1174 0.1463 0.1751 0.2038 0.2324 We can see that there is a sign change from -1.619 to -1.618 and so our estimate of the root at this stage is (-1.619 + -1.618) / 2 = -1.6185 with a maximum error of ± 0.0005

Coursework Requirements on Change of Sign You will need to demonstrate one change of sign method for your coursework. You can use Interval Bisection or Decimal Search You should find a root of an equation that cannot easily be found using algebraic or analytical methods. You must choose an equation for yourself that does not appear in these notes and must not be the same equation as anyone else. ( 1 mark ) You must explain the method you have used, and your explanation must include graphs to illustrate the method. ( ½ mark ) You must correctly state the error bounds for your answer (e.g. ±0.0005) ( ½ mark) You must give an example of an equation where one of the roots cannot be found using your chosen change of sign method. You must include an explanation with graphs to illustrate why the method does not work in this case. ( 1 mark ) Examples of why change of sign might not work:

Page 10: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 10

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

- 0.06

- 0.04

- 0.02

0.02

0.04

x

y

A repeated root causes change of sign to fail.Note that the root must be to 2 dp or it will beeasily found.

0.4 0.42 0.44 0.460

0.0002

0.0004

0.0006

0.0008

x

y

Roots that are very close togetherwill cause the change of signmethod to fail.

Page 11: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 11

Activity 3

Setting up a spreadsheet to do Decimal Search. We are going to use an Excel spreadsheet to do a decimal search for a root of the equation 22 += xx . We need to rearrange the equation to give 022 =−− xx . We will draw the graph

22 −−= xy x (using Omnigraph or Autograph) in order to locate a root of the

function 22)( −−= xxf x :

It appears from the graph that there is a root at x = 2 and if we check:

0222)2( 2 =−−=f , this confirms that one root is 2. As this root was easily located from the graph, it was not appropriate to use numerical methods to find it. Also looking at the graph we can see there is a root between -2 and -1 which we can confirm by looking for a sign change:

( ) 25.0222)2( 2 =−−−=− −f ( ) 5.0212)1( 1 −=−−−=− −f The sign change shows that there is a root between -2 and -1. We will set up an Excel spreadsheet to do a decimal search for this root. The diagram below shows the formulas we need to enter. You will find it easier if you copy the formulas in cells C1 and B2 across the page using the autofill tool.

This should give a spreadsheet that looks like this. Set the format of row 2 to four decimal places so that the information can be read easily.

- 4 - 2 2 4

- 1

1

2

x

y

Page 12: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 12

We can see from the table that there is a sign change between -1.7 and -1.6 so we now need to zoom in on this interval. Copy and paste the first table then change it to look at this interval.

You will have to change B4 to be -1.7 and remember to change the increment to 0.01 instead of 0.1 in cell C4 then copy the new formula across. The spreadsheet should then look like this:

Now we can see that the sign change is between -1.7 and -1.69 so we zoom in on this interval. Again copy and paste the table down then change it.

Set the increment in the formula in C7 to 0.001 then copy the formula across.

Our estimate of the root is (-1.691 + -1.69)/2 = -1.6905 and the error bounds are ± 0.0005 (since the root must be between -1.691 and -1.69)

Page 13: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 13

Activity 4 Explain why a change of sign method will not work in the following cases:

1. The equation 2

3

10

3 3

x x

x x

− + =+ −

is to be solved using a change of sign method.

Show that the function 2

3

1( )

3 3

x xf x

x x

− +=+ −

gives a sign change from

x = 2 to x = 3 and explain with the aid of a graph why the sign change method fails to find a root in this case.

2. The equation 016116 234 =+−+− xxxx has a root 2.618 (3 d.p.) but testing

for a sign change from x = 2 to x = 3 fails. Show that the function 16116)( 234 +−+−= xxxxxf does not give a sign change from x = 2 to x = 3 and explain with the aid of a graph why the sign change method fails to find the root in this case.

3. The equation 01101025 23 =−−+ xxx is to be solved using a change of sign method. Show that the function 1101025)( 23 −−+= xxxxf does not give a sign change from x = -1 to x = 0 and explain with the aid of a graph why the sign change method fails to find a root in this interval even though one exists.

Page 14: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 14

cos 0

Fixed point iteration using x = g(x)

Activity 5 1. Set your calculator in radian mode. Enter the following keys: 0 = cos ANS =

Press = repeatedly and describe what happens. 2. Enter the following keys: 0.5 =

√ ANS = Press = repeatedly and describe what happens. Repeat the process with other positive values in place of 0.5. What happens?

3. Enter the following keys: 0.5 =

√ (ANS + 1) = Press = repeatedly and describe what happens. Repeat the process with other positive values in place of 0.5. What happens?

4. A diagram that goes with the first question above is given below: The equation that this solves is x = cos x (why?) or x – cos x = 0 Check that your final value from question 1 is a root of this equation. Draw similar diagrams for questions 2 and 3. Write down the equations that they solve. 5. Two graphs connected with question 1 are:

Indicate which point on each of these graphs corresponds to the root you found. Sketch similar graphs for questions 2 and 3 and indicate which points the roots correspond to.

2 4 6 8 10

- 2

2

x

y

y=x- cos x

2 4 6 8 10

- 2

2

x

y

y=x

y=cosx

Page 15: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 15

Staircase and Cobweb Diagrams To solve the equation x – cos x = 0 we firstly rearrange it so that it is in the form

x = g(x) which in this case could be x = cos x. If we write this as an iterative formula: rr xx cos1 =+ This says that the next x is the cosine of the previous x If we start with 00 =x then

10coscos 01 === xx

540302.01coscos 12 === xx

857553.0540302.0coscos 23 === xx and so on

Drawing the graphs of y = x and y = cos x, we can show these values on the graph:

The diagram shows how the iterative process converges in on the root. This type of diagram is called a cobweb diagram.

Looking at the second example, to solve 02 =− xx we can rearrange to xx = Note that this equation would not normally be solved using numerical methods because it can be solved by factorising and would not be suitable for your coursework.

If we write this as an iterative formula:

rr xx =+1

This says that the next x is the square root of the previous x If we start with 5.00 =x then

707107.05.001 === xx

840896.0707107.012 === xx

0.5 1 1.5

- 1

- 0.5

0.5

1

x

y

y = x

y = cos x

0x

1x

2x

3x

Page 16: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 16

917004.0840896.023 === xx and so on

Drawing graphs of y = x and xy = we can show these values on a graph:

The diagram shows how the iterative process converges in on the root. This type of diagram is called a staircase diagram.

Activity 6

Exploring cobweb and staircase diagrams 1. Below are the graphs of y = x and 4

13 += xy used to illustrate how the equation

0144 3 =+− xx can be solved using fixed point iteration. a) Show that the equation 0144 3 =+− xx can be rearranged into this form x = g(x) b) Starting with 7.00 =x draw lines to show whether this is a staircase or a cobweb

c) What happens if you started with 9.00 =x ?

0.5 1 1.5

- 1

- 0.5

0.5

1

x

y

y = x

y = cos x

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

1.2

x

y

0x 1x

2x

3x

Page 17: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 17

2. Below are the graphs of y = x and 50

3

4 xy −= used to illustrate how the equation

0200503 =−+ xx can be solved using fixed point iteration. a) Show that the equation 0200503 =−+ xx can be rearranged to x = g(x) b) Starting with 20 =x draw lines to show whether this is a staircase or a cobweb

3. Below are the graphs of y = x and 2

1222 −−= xy x .

a) Which equation of the form f(x) = 0 do these graphs illustrate the solution of? b) Starting with 5.00 −=x draw lines to show fixed point iteration

c) Explain why the iteration starts out as a staircase and then becomes a cobweb.

- 2 2 4 6

- 2

2

4

x

y

- 0.5 0.5 1

- 0.6

- 0.4

- 0.2

0.2

0.4

0.6

x

y

Page 18: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 18

Activity 7

Setting up a spreadsheet to do x = g(x) fixed point iteration We are going to set up a spreadsheet to solve 0)cos(sin2 =−+ xxx

1. Show that this can be rearranged into the form 2

cossinx

xxx ++=

2. Use a graph drawing program to check the graphs below. What do these graphs illustrate?

3. Set up a new spreadsheet as shown below (the top left cell is A1). Enter the first

formula (for r = 2) and then use the autofill tool to copy the formula down the spreadsheet.

Page 19: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 19

4. You should obtain results like those below:

If you continue the spreadsheet downwards, you should find that the iterative process converges to the root 1.7079 (5 s.f) 5. Use the sign change method with xxxxf −+= )cos(sin2)( to show that this root

is correct to 5 s.f : Calculate f(1.70785) Calculate f(1.70795)

Show that there is a sign change between these and therefore the root must be between 1.70785 and 1.70795. Since all the values in this range are 1.7079 (5 s.f) then the root must be correct to 5 s.f.

6. Draw lines on the graph below to show whether it is a staircase or cobweb diagram:

0.5 1 1.5 2

0.5

1

1.5

2

x

y

Page 20: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 20

Activity 8

When the x = g(x) method fails to converge Consider the equation 0355 =+− xx

1. Show that this can be rearranged to give 5

35 += xx

2. Set up a spreadsheet to do fixed point iteration using this rearrangement. Start with 11 =x to find a root of the equation between x = 0 and x = 1 correct to 5 significant

figures. On the graph below illustrate this process:

3. Change your starting value to 3.11 =x to try and find the root between 1.2 and 1.3.

What happens? Show on the diagram above what is happening.

Why the method fails

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6

0.5

1

1.5

2

x

y

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6

0.5

1

1.5

2

x

y

Gradient of g(x) < 1 (less steep than y = x)and so the sequence converges

Gradient of g(x) > 1 (steeper than y = x)and so the sequence does not converge y = x

y = g(x)

Page 21: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 21

4. Show that another rearrangement of 0355 =+− xx is 5 35 −= xx

5. Use a graph drawing program to show y = x and 5 35 −= xy on the same axes.

6. Set up a spreadsheet to iterate 5 35 −= xx and try to find each of the three roots of

the equation 0355 =+− xx correct to 5 s.f. (don’t forget to check your roots with a sign change)

7. Using your graph from 5 and looking at the gradient of 5 35 −= xy around each of the roots, explain why some of the roots can be found but not all of them.

Coursework Requirements on x = g(x) fixed point iteration Using x = g(x) fixed point iteration you should find one root of an equation that cannot easily be found using algebraic or analytical methods. You must choose an equation for yourself that does not appear in these notes, must not be the same equation as anyone else and should be different from the equation you used for the change of sign method. ( 1 mark ) You must show using a graph of your y = x and your y = g(x) how the convergence works (cobweb or staircase diagram) ( ½ mark ) Explain using your graphs how the gradient of g(x) near to the root means that the iteration converges. (½ mark ) You must give an example, using the same original equation, where x = g(x) fixed point iteration fails to converge. This could be using the same x=g(x) rearrangement as above (if there is another root for which it does not converge) or using a different rearrangement of the same original equation. ( 1 mark ) You must show using a graph of your y = x and your y = g(x) how the convergence fails to work ( ½ mark ) Explain using your graphs how the gradient of g(x) near to the root means that the iteration does not converge. (½ mark )

Page 22: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 22

Newton-Raphson method This is another fixed point iteration method and, as with x = g(x) iteration, you need an estimate of the root as a starting place. Consider finding a root of the graph f(x) = 0 with an initial estimate of 21 =x If we draw a tangent to the curve at x = 2, then where that tangent crosses the x-axis is a better estimate of the root.

We can then iterate (repeat the procedure) to find better and better estimates:

1 2 3

10

20

30

x

y

Draw a tangentat the estimate x = 2

Where the tangentcrosses the x- axisis the next estimate

Root we are finding

- 1 1 2 3

10

20

30

x

y

Initialestimate

Secondestimate

Thirdestimate

Root we are finding

Tangent drawneach time

Page 23: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 23

The Newton-Raphson iterative formula is:

( )( )r

rrr xf

xfxx

′−=+1

Activity 9

Setting up a spreadsheet for Newton-Raphson method Consider the equation 0355 =+− xx . We want to solve ( ) 0=xf where ( ) 355 +−= xxxf 1. Differentiate ( )xf to find ( )xf ′ The Newton-Raphson formula will become:

55

354

5

1 −+−−=+

x

xxxx rr

and we will start with an initial estimate 21 =x

2. Set up the spreadsheet. The formulas are given below. Once you have entered the

formula into cell B3, copy it down using the autofill tool.

3. You should find that the iterations converge to 1.2757 (5 s.f.).

Check with a sign change that this is correct: Calculate f(1.27565) Calculate f(1.27575) Show that there is a sign change between these values and hence the root lies

between them. All values in this interval round to 1.2757 (5 s.f.).

Page 24: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 24

Activity 10

Investigating why the Newton-Raphson Method fails 1. Investigate what happens when you try to use the Newton-Raphson method to solve

the equation 0355 =+− xx with an initial value 11 =x . Draw a graph to explain the problem. 2. Investigate what happens when you try to use the Newton-Raphson method to find

the root of the equation 221

−= −xy between 0 and 1

Try 11 =x , 01 =x Draw a graph to help explain what is happening. 3. Investigate what happens when you try to use the Newton-Raphson method to find

the root of the equation 05

3

=− xx

with an initial value 11 =x

Draw a graph to help explain what is happening.

Coursework Requirements on the Newton-Raphson Method Using Newton-Raphson method you should find all the roots (at least 2) of an equation that cannot easily be found using algebraic or analytical methods. You must choose an equation for yourself that does not appear in these notes, must not be the same equation as anyone else and should be different from the equation you used for either of the other methods (change of sign and x=g(x) iteration).

One root found ( 1 mark ) All the roots are found (+1 mark = 2 marks total)

You must show using a graph of your chosen equation how the convergence works for one of the roots ( 1 mark ) You must use the change of sign method to establish error bounds for one of your roots (1 mark) You must give an example of an equation where the Newton-Raphson method fails to find a particular root, despite a starting value close to it (the starting point should be the nearest integer on either side of the root). Using a graph of your chosen function you must explain why the method fails ( 1 mark)

Page 25: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 25

Coursework Requirements on Comparison of the methods You must select one of the three equations you have used so far for your examples of the 3 different methods and use the other two methods on that same equation so that you can compare the methods. You should use the same starting point for each method and obtain the answer to the same accuracy using each method. (1 mark) You must compare the three methods in terms of speed of convergence (how many calculations/iterations were involved) (1 mark) You must compare the three methods in terms of how easy they were to apply with the software and hardware you used. (1 mark)

Coursework Requirements on Oral Communication You will have a short interview with your teacher about your coursework. They will ask you to explain what you have done, and will ask you to go through the working for one of the methods to check your understanding. (2 marks)

Page 26: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 26

Change of sign method

A 1. Choose an equation, f(x) = 0, that cannot be solved by analytical methods

2. Find one root using decimal

search or interval bisection

3. Make sure you include the correct error bounds

4. Explain your working using

graphs that show your function B 1. Choose an equation for which the

change of sign method fails to find a root

2. Explain why the change of sign

method fails in this case using a graph of your function

x = g(x) method A 1. Choose a different equation,

f(x) = 0, that cannot be solved by analytical methods

2. Rearrange the equation into the

form x = g(x) 3. Find one root using x = g(x)

iteration 4. Establish the accuracy of the root

using a change of sign 5. Explain your working using a

graph that shows your function B 1. Choose a rearrangement of the

equation used in A for which the x = g(x) method fails to find a root

2. Explain why the x= g(x) method

fails in this case using a graph of your function

Newton-Raphson method A 1. Choose a different equation,

f(x) = 0, with at least 2 roots that cannot be solved by analytical methods

2. Differentiate your function and set

up the Newton-Raphson formula 3. Find all the roots using the

Newton-Raphson method 4. Establish the accuracy of the roots

using the change of sign method 5. Explain your working using

graphs that show your function B 1. Choose an equation for which the

Newton-Raphson method fails to find a root

2. Explain why the Newton-Raphson

method fails in this case using a graph of your function

Comparison of methods 1. Choose one of the equations you have already found a root using change of sign, x = g(x) or Newton-Raphson method 2. Find that same root using the other two methods (using the same starting value and finding the answer to the same accuracy) 3. Compare the three methods in terms of speed of convergence (how many iterations to find the root) and ease of use of the hardware / software

COURSEWORK OVERVIEW

Page 27: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 27

Change of sign method A 1. Choose an equation, f(x) = 0, that cannot be solved by analytical methods

• You should not choose a quadratic or linear function as these are easily solved using methods you already know

• A cubic or higher degree polynomial would be suitable as long as it does

not factorise easily or have obvious roots from the graph o For example 03 23 =++ xxx is no good because it can be

factorised ( ) 0132 =++ xxx then one solution is x = 0 and the quadratic can be solved using the quadratic equation.

2. Find one root using decimal search or interval bisection

• If your equation has more than one root, you only have to find one. • Draw a graph of your function to see where the root is approximately

o See which two integer x values your root is between to use as starting points for your method

o You could check that these two values give you a sign change as a starting point

• Apply the method of decimal search or interval bisection to find the root

(see 3 for details of error bounds) o You will probably use a spreadsheet to do this – see the example

in the coursework book

3. Make sure you include the correct error bounds • Your error bounds should be ±0.0005 • Suppose the last sign change interval you find is from 1.456 to 1.457

then you know the root is somewhere in this interval. If you use 1.4565 (the midpoint of the interval) as your estimate then the maximum error (the most you could be wrong by) is ±0.0005

4. Explain your working using graphs that show your function

• If your function was 132)( 23 +++= xxxxf then you would start with

a graph of 132 23 +++= xxxy . You will probably use a graph drawing program to produce this. You may need to zoom in and out to obtain a good graph. You will then need further graphs for the subsequent stages.

• Your explanation should combine graphs and words to explain what you

have done – see the examples in the coursework book for help.

Page 28: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 28

B 1. Choose an equation for which the change of sign method fails to find a root 2. Explain why the change of sign method fails in this case using a graph of your

function

• The equation must not be trivial (they must require a graph to be drawn in order to determine why they don’t work) Examples of trivial equations are

01 =x

, ( ) 03

1 =−x

, ( ) 02 2 =−x

• Three possible ways of designing an equation that fails with change of

sign to find one of the roots are given below - you only need 1

o Designing an equation with repeated roots (done in Polynomials chapter of C1) will give a function which touches the x-axis and thus the method will fail as no root is detected. You should, however, choose the repeated root to be a number to at least 2 DECIMAL PLACES. Otherwise the first table in the decimal search procedure will solve the equation on its own.

For example ( )( ) 043.0250 2 =−+ xx will give the graph below:

The 50 factor in the example is simply to “sharpen” the vertex at 0.43 and emphasise the fact that the graph merely touches at this point. Note that although the initial design of the failure is artificial and uses a squared factor, when writing up the coursework give ALL the equations in an expanded form (without brackets) – otherwise the solution is obvious by algebraic techniques.

0.38 0.4 0.42 0.44 0.46 0.48

- 0.02

0

0.02

0.04

0.06

0.08

0.1

x

y

Page 29: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 29

o Designing an equation with close roots is similar to the repeated roots example above. For example

( )( )( ) 043.042.0250 2 =−−+ xxx

o Designing an equation with a discontinuity can be done with a function that is a fraction where the denominator has solutions.

For example

023

2323

23

=+++−

xx

xx

The function 23)( 23 ++= xxxh in the dominator has a root between 3 and 4 so the whole fraction equation has an asymptote between 3 and 4 causing the change of sign method to think there is a root in the interval when no root exists.

- 5 - 4 - 3 - 2

- 40

- 20

0

20

40

x

y

Page 30: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 30

x = g(x) method A 1. Choose a different equation, f(x) = 0, that cannot be solved by analytical

methods

• The equations that you use for the three methods must all be different to each other and to everybody else doing the coursework (no copying)

• As with change of sign, a quadratic or linear function is no good.

Cubics or higher degree polynomials are ok if they do not factorise easily.

2. Rearrange the equation into the form x = g(x)

• You may have to try several rearrangements until you find one that

will converge with this method. If you find rearrangements that don’t work then you can use one of these to demonstrate failure (see B below)

3. Find one root using x = g(x) iteration

• Draw a graph of your function, y = f(x), to establish an integer close to

a root to use as a starting point • You will probably use a spreadsheet to do the calculations – see the

example in the coursework booklet.

4. Establish the accuracy of the root using a change of sign • Suppose you obtain a root 0.68232 (5 d.p.) then you should check that

the original f(x) (not the rearrangement g(x) formula) gives a sign change from 0.682315 to 0.682325. As all numbers in this interval would round to 0.68232 you can conclude that this is the root to 5 d.p.

5. Explain your working using a graph that shows your function

• You should draw the graph of your y = f(x) to establish a starting

point (see 3 above) • You should draw y = x and your chosen y = g(x) on the same axes and

use your graph to show whether it is a cobweb diagram or a staircase diagram that converges on the root you have found.

• You have to explain why the method converges by comparing the

gradient of y = x with the gradient of y = g(x) around the root you are finding. The gradient of g(x) should be less than the gradient of y = x (i.e. between -1 and 1) if it converges. The graph drawing program has

Page 31: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 31

a ‘gradient’ function which you can use to draw the gradient graph y = g’(x) which will help with your explanation.

• Your explanation should combine graphs and words to explain what

you have done – see the examples in the coursework book for help

B 1. Choose a rearrangement of the equation used in A for which the x = g(x) method fails to find a root.

• Starting with the same f(x) = 0 equation, try rearranging it in a different way to obtain x = g(x). Usually an alternative rearrangement will fail to find the root that you found in A.

2. Explain why the x= g(x) method fails in this case using a graph of your function

• Draw y = x and y = g(x) graphs on the same axes for your rearrangement that doesn’t work and draw lines on it to show that the method diverges rather than converging on the root

• You have to explain why the method diverges by comparing the gradient of y = x with the gradient of y = g(x) around the root you are finding. The gradient of g(x) should be more than the gradient of y = x (i.e. less than -1 or more than 1) if it diverges. The graph drawing program has a ‘gradient’ function which you can use to draw the gradient graph y = g’(x) which will help with your explanation.

• Your explanation should combine graphs and words to explain what you

have done – see the examples in the coursework book for help

Page 32: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 32

Newton-Raphson method A 1. Choose a different equation, f(x) = 0, with at least 2 roots that cannot be solved

by analytical methods

• With the Newton-Raphson method your equation must have at least 2 roots and you have to find all of them

• The equations that you use for the three methods must all be

different to each other and to everybody else doing the coursework (no copying)

• As with change of sign, a quadratic or linear function is no good.

Cubics or higher degree polynomials are ok if they do not factorise easily.

2. Differentiate your function and set up the Newton-Raphson formula

• Check your differentiation to make sure it is correct. • The Newton-Raphson iterative formula is:

( )( )r

rrr xf

xfxx

′−=+1

• You do not have to derive this formula • You should give your own version of it in your coursework

with your f(x) and f’(x) substituted into it

3. Find all the roots using the Newton-Raphson method • Draw a graph of the function ( y =f(x) ) to establish roughly where

the roots are. You will start the search for each root at the closest integer to that root.

• You will probably use a spreadsheet for this – see the coursework

booklet for an example

4. Establish the accuracy of the roots using the change of sign method

• Suppose you obtain a root 0.68232 (5 d.p.) then you should check that the original f(x) (not the rearrangement g(x) formula) gives a sign change from 0.682315 to 0.682325. As all numbers in this interval would round to 0.68232 you can conclude that this is the root to 5 d.p.

Page 33: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 33

5. Explain your working using graphs that show your function

• On a graph of your curve y = f(x) draw the appropriate tangents to show the method converging on the root.

• Your explanation should combine graphs and words to explain what you

have done – see the examples in the coursework book for help

B 1. Choose an equation for which the Newton-Raphson method fails to find a root 2. Explain why the Newton-Raphson method fails in this case using a graph of your

function

• The failure should not be because you have started too far away from the root – you must start at one of the integers either side of the required root

• One possible way of designing an equation that fails with the Newton-

Raphson method to find one of the roots is given below. Other examples are given in the Coursework booklet and could be used to find other examples that fail with this method.

• Start with an equation f(x) = 0 with a repeated root, then subtract a

constant from the function f(x):

Example ( )( )22 3 0x x− − = has a repeated root at x = 3

If we subtract a (small) constant from the left hand side:

( ) ( )22 3 0.0753 0x x− − − =

then the equation will have a root close to 3 but starting with x = 3 using the Newton-Raphson method will not work as the tangent is horizontal at this point:

Note that although the initial design of the failure is artificial and uses a squared factor, when writing up the coursework give ALL the equations in an expanded form (without brackets) – otherwise the solution is obvious by algebraic techniques.

2 2.2 2.4 2.6 2.8 3 3.2 3.4

- 0.2

- 0.1

0

0.1

0.2

x

y

Page 34: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 34

Comparison of methods 1. Choose one of the equations you have used already for change of sign, x = g(x) or

Newton-Raphson method

• It does not matter which one you choose but remember you will have to be able to differentiate in order to do the Newton-Raphson method and the gradient of the g(x) in the rearrangement you use for x = g(x) method must be less than 1.

2. Find that same root using the other two methods (using the same starting value and

finding the answer to the same accuracy)

• You must start from the same starting value for all three methods (and it must converge to the same root for all three methods)

• You must obtain the same root to the same degree of accuracy (and check that

accuracy using a sign change where necessary)

• You must use the same technology (e.g. a spreadsheet) for each method so that you can compare how easy each of the methods was using that technology

3. Compare the three methods in terms of speed of convergence (how many iterations

to find the root) and ease of use of the hardware / software

• How many iterations did each of the methods take? • Talk about how easy each of the methods was to set up in your case (e.g. how

easy to find a rearrangement of the equation for x = g(x), how easy the function was to differentiate for Newton-Raphson) and how these considerations would influence your choice of method for other equations.

• Talk about how easy each of the methods was to implement using the

technology you chose

Written Communication Check through to make sure you have used the correct terminology throughout your work. Be particularly careful with equation, function, graph, root and solution.

Oral Communication You will be given a short interview on your work in which you will be asked to explain what you did in general and explain one of the methods in detail.

Page 35: C3 Numerical Methods Coursework Booklet 2011vle.woodhouse.ac.uk/topicdocs/maths/AutographC3files/C3 Numerical...Why use numerical methods? ... root at this stage is (-1.619 + -1.618)

Methods for Advanced Mathematics (C3) Coursework

Numerical Methods

© Woodhouse College 2011 Page 35

Methods for Advanced Mathematics (C3) Coursework: Assessment Sheet Task: Candidates will investigate the solution of equations using the following three methods:

• Systematic search for change of sign using one of the three methods: decimal search, bisection or linear interpolation.

• Fixed point iteration using the Newton-Raphson method

• Fixed point iteration after rearranging the equation f(x) = 0 into the form x = g(x).

Coursework Title

Candidate Name Candidate Number

Centre Number 1 2 2 9 0 Date

Domain Mark Description Comment Mark

Change of sign

method (3)

1

1

1

The method is applied successfully to find one root of an equation.

Error bounds are stated and the method is illustrated graphically.

An example is given of an equation where one of the roots cannot be found by

the chosen method. There is an illustrated explanation of why this is the case.

Newton-

Raphson

method (5)

1

1

1

1

1

The method is applied successfully to find one root of a second equation.

All the roots of the equation are found.

The method is illustrated graphically for one root.

Error bounds are established for one of the roots.

An example is given of an equation where this method fails to find a particular

root despite a starting value close to it.

There is an illustrated explanation of why this has happened.

Rearranging

f(x) = 0

in the form

x = g(x) (4)

1

1

1

1

A rearrangement is applied successfully to find a root of a third equation.

Convergence of this rearrangement to a root is demonstrated graphically and

the magnitude of g′(x) is discussed.

A rearrangement of the same equation is applied in a situation where the

iteration fails to converge to the required root.

This failure is demonstrated graphically and the magnitude of g′ (x) is

discussed.

Comparison

of methods (3)

1

1

1

One of the equations used above is selected and the other two methods are

applied successfully to find the same root.

There is a sensible comparison of the relative merits of the three methods in

terms of speed of convergence.

There is a sensible comparison of the relative merits of the three methods in

terms of ease of use with available hardware and software.

Written

communication

(1)

1 Correct notation and terminology are used.

Oral

communication

(2)

2

Presentation Please tick at least one box and give a brief report.

Interview

Discussion

Half marks may be awarded but the overall total must be an integer. Please report overleaf on any help that the candidate has received beyond the guidelines. TOTAL /18


Recommended