+ All Categories
Home > Documents > A2 Mathematics Course Work C3 Finle

A2 Mathematics Course Work C3 Finle

Date post: 07-Apr-2018
Category:
Upload: acampbell10
View: 222 times
Download: 0 times
Share this document with a friend
11
Ashley Campbell A2 Mathematics Coursework C3 Numerical solutions of equations Decimal Search method The graph below shows the function of f(x)= x³+3x²2x1. The equation x³+3x²2x1=0 has three roots, I will used the change of sine method involving the decimal search method to find one of the roots of the equation. I have drawn the graph using the autograph software. These are the 3 roots of the equation, the highlighted one is the root I will find using the decimal search method. From my graph I can see that the fact that f(0) is negative and f(1) is positive tells me the graph must cross the x axis between 0 and 1. I will work out values of f(x) by substituting in x values in to the equation using 0.1 increments for x in a table of vales to see where the answer for f(X) changes sign. From my table I can see that the change of sine from negative to positive occurs between x=0.8 and x=0.9 as highlighted in the table, now I can do another test at 0.01 increments between x=0.8 and x=0.9 in another table. For x=0 f(x) =0³+3x0²2x01 = -1 For x=0.1 f(X) = 0.1³+3x0.1²2x0.11 = -1.169 Level of accuracy of answer: x=1 to 0 d.p x=0.85 +/- 0.05 0.8 >x< 0.9 x f(X) 0 -1 0.1 -1.169 0.2 -1.272 0.3 -1.303 0.4 -1.256 0.5 -1.125 0.6 -0.904 0.7 -0.587 0.8 -0.168 0.9 0.359 1 1 Root 1 Root 2 Root 3
Transcript
Page 1: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 1/11

Ashley Campbell

A2 Mathematics Coursework C3

Numerical solutions of equations 

Decimal Search method

The graph below shows the function of f(x)=x³+3x²−2x−1. The equation x³+3x²−2x−1=0 has

three roots, I will used the change of sine method involving the decimal search method to

find one of the roots of the equation.

I have drawn the graph using the

autograph software.

These are the 3 roots of the equation,

the highlighted one is the root I will

find using the decimal search method.

From my graph I

can see that the fact that f(0) is negative and f(1) is

positive tells me the graph must cross the x axis between

0 and 1.

I will work out values of f(x) by substituting in x values in

to the equation using 0.1 increments for x in a table of 

vales to see where the answer for f(X) changes sign.

From my table I can see that the change of sine from negative to positive occurs

between x=0.8 and x=0.9 as highlighted in the table, now I can do another test

at 0.01 increments between x=0.8 and x=0.9 in another table.

For x=0 f(x) =0³+3x0²−2x0−1 = -1

For x=0.1 f(X) = 0.1³+3x0.1²−2x0.1−1 = -1.169

Level of accuracy

of answer:

x=1 to 0 d.px=0.85 +/- 0.05

0.8 >x< 0.9

x f(X)

0 -1

0.1 -1.169

0.2 -1.272

0.3 -1.303

0.4 -1.256

0.5 -1.125

0.6 -0.904

0.7 -0.587

0.8 -0.168

0.9 0.359

1 1

Root 1Root 2 Root 3

Page 2: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 2/11

Ashley Campbell

From my results I can conclude that the root is x=0.83425 to 5 decimal places, and the maximum

error for the root would be +/- 0.00005.

x f(X)

0.8 -0.168

0.81 -0.12026

0.82 -0.07143

0.83 -0.02151

0.84 0.029504

0.85 0.081625

0.86 0.134856

0.87 0.189203

0.88 0.244672

0.89 0.301269

0.9 0.359

x f(X)

0.83 -0.02151

0.831 -0.01646

0.832 -0.0114

0.833 -0.00632

0.834 -0.00124

0.835 0.003858

0.836 0.008965

0.837 0.014083

0.838 0.019212

0.839 0.024353

0.84 0.029504

x f(X)

0.834 -0.00124

0.8341 -0.00073

0.8342 -0.00022

0.8343 0.000289

0.8344 0.000799

0.8345 0.001308

0.8346 0.001818

0.8347 0.002328

0.8348 0.002838

0.8349 0.003348

0.835 0.003858

Change of sine between

x=0.83 and x=0.84

Level of accuracy of answer:

x=0.8 to 1 d.p

x=0.835 +/- 0.005

0.83<x>0.84

Change of sine between

x=0.834 and x=0.835

Level of accuracy of answer:

x=0.84 to 2 d.p

x=0.8345 +/0.0005

0.834<x>0.845

Change of sine between

x=0.8342 and x=0.8343

Level of accuracy of answer:

x=0.834 to 3 d.p

x=0.83425 +/- 0.00005

0.8342<x>0.8343

Page 3: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 3/11

Ashley Campbell

You can use the decimal search method to fined roots that go throw the x axis but if it does not pass

throw the x axis as in the equation 48x³−152x²+147x−45=0 the method doesn’t work because there

is no change of sign .

The graphs below shows this:

I can see that the root is between x=0 and x=1. I will work out values of f(x) by substituting in x

values in to the equation using 0.1 increments for x in a table of vales to see whether the answer for

f(X) changes sign.

As we can see from my table it does not show that there as a root between

x=0 and x=1 because there is no change on sine but from my graph we can

see that there is one there, so for equations like this with roots that do notcross the x axis will not be found by decimal search so we would need to use

an alternate method.

x f(X)

0 -45

0.1 -31.7720.2 -21.296

0.3 -13.284

0.4 -7.448

0.5 -3.5

0.6 -1.152

0.7 -0.116

0.8 -0.104

0.9 -0.828

1 -2

Doesn’t cross

the x axis

Page 4: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 4/11

Ashley Campbell

Nowton- Raphson method 

The graph below shows the function f(x)=2x´−2x−3. The equation 2x´−2x−3=0 has 2 roots that I need

to find, I shall do this by the Nowton-Rapson method.

The Nowton-Rapson method works by drawing a line up from x0 and then taking the tangent to the

curve at that point  and where that tangent crosses the x axis is worked out as x1 the new value for x.This proses is repeated until the value for x is the same as the last to 5 signifigent figures.

I will need to find these 2

roots, we can see that they

are in the intervals 1<x<2 and

-1<x<0

X0 X1 

X0 X1 X2 

Root 1 Root 2 

Root 1 

Root 1 

Page 5: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 5/11

Ashley Campbell

The formula that is used for the Nowton-Rapson method is:

I will start by doing my positive root first in the interval 1<x<2, I can see that my first value for x, x0 =

2.

X0 = 2

x1= x0 - 2x0´−2x0−3 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

eeeeeeeee8x03-2

x2= x1 - 2x1´−2x1−3 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8x1

3-2

x3= 1.300409

x4= 1.292805

x5= 1.292728

x6= 1.292728

Now I shall find the x value for my negative root in the interval -1<x<0. The starting value for x, x0 for

this root is -1.

n xn f(x) f'(x)

0 -1 1 -10

1 -0.9 0.1122 -7.832

2 -0.88567 0.001974 -7.55792

3 -0.88541 6.42E-07 -7.5534 -0.88541 6.79E-14 -7.553

If f(x)= 2x´−2x−3 

Then f’(x) = 8x3-2

So the equation becomes: xn+1= xn - 2x´−2x−3 

rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8x3-2

= 2 - 2(2)´−2(2)−3 = 1.59677

rrrrrrrrrrrr8(2)3-2

= 2 - 2(1.59677 )´−2(1.59677)−3 = 1.37406

rrrrrrrrrrrr8(1.59677)3-2

I can see that there is some

convergence between x4 and x5 but

only to 3 s.f. but between x5 and x6

there is no change in the x values somy root is x= 1.292728 to 5

signifigent figures. With an error

bound of +/- 0.000005.

X1 X0 

Root 2 

I can see that there is some convergence between x2 and

x3 but only to 3 s.f. but between x3 and x4 there is no

change in the x values so my root is x= -0.88541 to 5

signifigent figures. With an error bound of +/- 0.000005.

Page 6: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 6/11

Ashley Campbell

The Nowton-Rapson method does fail when the starting value is close to a turning point as in the

graph of x³+1.75x²−0.7x−0.95=0.

The turning point near to x0 caused the divergence, that takes the value further away from

the desired root.

Newton-Rapson formula:

From my table I can see that the value for x1

is smaller than -1 so is serenely further away

from my root, so this meathead has failed.

Rearranging method 

I wish to use the rearranging meathord to find a

root on the graph of f(x)=x³−2x−1. I will rearrange

f(x)=0 in the form of x = g(x). One possible

rearrangement of the formula is:

x³−2x−1=0

x3=2x+1

x=(2x+1)1/3 

so g(x)=(2x+1)1/3 

n xn f(x) f'(x)

0 0 -0.95 -0.7

1 -1.35714 6.499011 -21.9971

2 -1.06169 1.664523 -11.5739

Desired root X0 X1 

Turning point

Further away from

my desired root

This is the root I

wish to find 

Page 7: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 7/11

Ashley Campbell

If you add the graph of y=x and y=g(x) to the

orginal graph where they intersept is the roots of 

the orignal equashon, as shown in the graph.

I can use this fact to find the roots of the

equashon. The rearrangement x =(2x+1)1/3 gives

the iteration formula xn+1 =(2x0+1)1/3. 

I was to find the root indicated on the graph I can

see that it is in the intivle 1<x<2 and it is closesed

to 2 so x0 =2

Using x0=2

xn1 =(2x2+1)1/3 = 51/3 =1.709975947

xn2 =(2x1.709975947+1)1/3

= 1.641115627

I can see that between x9 and x10 the answer for the root is

1.61803 to 5 s.f.

xn x (2x+1)1/3 

0 2 1.709976

1 1.709976 1.641116

2 1.62389

3 1.62389 1.619524

4 1.619524 1.6184135 1.618413 1.618131

6 1.618131 1.618059

7 1.618059 1.61804

8 1.61804 1.618036

9 1.618036 1.618034

10 1.618034 1.618034

This is the root I

wish to find 

Root 1

X0=2X1=1.70997X2=1.64111

X10=1.618034

X9=1.618036 X8=1.61804

Root 1

Page 8: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 8/11

Ashley Campbell

Rearranging method steps 

First you start at the point x0 on the x axis and draw a line vertically towards the curve of y=g(x). At

the point where it touches the curve draw another line horizontally towards the line of y=x. At the

point where it touches the line the x coordinate becomes x1. This method is repeated until you get a

value for x which is the same as the one before for to 5 s.f.

As we can see form the graph root A has a gradient of 0.25 which is between 1 and -1 so would be

successful in the rearranging method, Root C has a gradient of 0.68 which is between the limits so

also will be successful. Because both root A and C have gradients between 0 and 1 they will converge

on the root in a staircase pattern. Root B would not be successful because it has a gradient of 1.78

which is above 1 so is too steep for the method to work and it will diverge away from the root in a

staircase fashion.

If there was a root with a gradient of between -1 and 0 then it would converge on the root in a

cobweb fashion being a success and if it was below -1 it would diverge away from the root in a

cobweb fashion being a failure.

If the gradient of g(x) at the roots is

between 1 and -1 the Rearranging method

will be successful, but if it is above or

below the method will fail because the

gradient is too steep, the method will work

quicker the closer the gradient is to 1 or -1.

Y=1

Y=-1

A

B

C

To find the gradient of a particular root

you need to draw a line from the point

where the two graphs cross vertically

towards the gradient graph of y=g(x), then

at the point where it touches the gradient

curve draw a horizontal line towards the y

axis, the point that it touches on the y axis

is the gradient of that root.

0.25

1.78

0.68

Page 9: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 9/11

Ashley Campbell

The Rearranging method does fail when the gradients of the roots are outside the limits of between

1 and -1, on my graph I have one root that fails this is root B. I can see that root B is in the interval

-1<x<0 and I shall take the starting value x0 = 0. I shall use the equation xn+1 =(2x0+1)1/3

to work out x.

Comparison of methods

I will use the equation x³−2x−1=0 that I solved using the Rearrangement method and see if I can find

the same root in the interval 1<x<2 using the other two methods, the Decimal Search method and

the Newton-Raphson method. I will start off with the Decimal Search method.

This is the root

that I want

X0 X1 X2 X3

xn x (2x+1)1/3 

0 0 1

1 1 1.44225

2 1.44225 1.571973

3 1.571973 1.606219

4 1.606219 1.61502

5 1.61502 1.617266

From my graph and table I can see that it

has diverged towards root A in a staircase

fashion which was not the desired root.

This shows it was a failure, it failed because

the gradient is too steep g’(x)>1, so it

diverges away from the desired root.

It is diverging

towards root A

This is the root I

wish to find 

x f(X)

1 -2

1.1 -1.869

1.2 -1.672

1.3 -1.403

1.4 -1.0561.5 -0.625

1.6 -0.104

1.7 0.513

1.8 1.232

1.9 2.059

2 3

Change of sign

between 1.6 and

1.7

x f(X)

1.6 -0.104

1.61 -0.04672

1.62 0.011528

1.63 0.070747

1.64 0.1309441.65 0.192125

1.66 0.254296

1.67 0.317463

1.68 0.381632

1.69 0.446809

1.7 0.513

Change of sign

between 1.61 and

1.62

Page 10: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 10/11

Ashley Campbell

I will now try to find this root using the Newton-Raphson method.

f(x) = x³−2x−1  f’(x) = 3x2-2

The iterative formula for the Newton-Raphson method is: xn+1=xn- f(xn)

44444444444444444444444444444444444444444444444444444 f’(xn)

So my iterative formula is: xn+1=xn- xn3+2xn-1

ccccccccccccccccccccccccccccccccccc3xn2-2

I will start with x0 = 2

n xn f(x) f'(x)

0 2 3 10

1 1.7 0.513 6.67

2 1.623088 0.029714 5.903248

3 1.618055 0.000123 5.854306

4 1.618034 2.15E-09 5.854102

5 1.618034 0 5.854102

Because I have found the same answer for the root using the Decimal Search method, the

Rearrangement method and the Newton-Raphson method. It is now possible for me to compare

these methods in terms of ease of use and the speed of convergence.

For each of my methods to get to the same level of accuracy converging on the root it took 5

iterations for the Decimal Search method and the Newton-Rapson method and it took 10 iterations

for the Rearrangement method.

The decimal search method has the least amount of iterations and was the simplest to do because

there is no iterative formula to uses that could cause mistakes like in the Newton-Rapson methodand there is no need for rearrangements like in The Rearrangement method. This is because it uses

x f(X)

1.61 -0.04672

1.611 -0.04094

1.612 -0.03515

1.613 -0.02935

1.614 -0.023541.615 -0.01772

1.616 -0.01189

1.617 -0.00605

1.618 -0.0002

1.619 0.00566

1.62 0.011528

Change of sign

between 1.618 and

1.619

x f(X)

1.618 -0.0002

1.6181 0.000386

1.6182 0.000972

1.6183 0.001558

1.6184 0.002143

1.6185 0.002729

1.6186 0.003315

1.6187 0.003901

1.6188 0.004487

1.6189 0.005073

1.619 0.00566

Change of sign

between 1.618 and

1.6181

x f(X)

1.61801 -0.00014

1.61802 -8.2E-05

1.61803 -2.3E-05

1.61804 3.52E-05

1.61805 9.37E-05

1.61806 0.000152

1.61807 0.000211

1.61808 0.000269

1.61809 0.000328

1.6181 0.000386

1.61811 0.000445

Change of sign

between 1.61803

and 1.61804

I can see that the change of sign is

between x=1.61803 and x =

1.61804 

As there is a change of sign, I can

say that the root of this function is

1.61803 +/- 0.000005, to 5 s.f. and

it took 5 iterations to get to the

root, the root is the same to the

answer of 1.61803 I got when

finding the same root using the

Rearrangement method.

I can see that there is some convergence

between x3 and x4 but only to 4 s.f. but

between x4 and x5 there is no change in the x

values so my root is x= 1.618034 +/-

0.000005 to 5 signifigent figures and took 5

iterations to get to the root. This answer is

the same as the ones I got for the

Rearrangement method and the Decimal

Search method.

Page 11: A2 Mathematics Course Work C3 Finle

8/3/2019 A2 Mathematics Course Work C3 Finle

http://slidepdf.com/reader/full/a2-mathematics-course-work-c3-finle 11/11

Ashley Campbell

boundaries working in towards the root. This method is easy to do on the graphical calculator

because there are no complicated equations to input, this means that it is less likely to have a

mistake in the answer whereas there is a greater risk in the other two method’s, but it is time

consuming to have to type out all the numbers from the calculator. You can also use an excel spread

sheet which quickly enters in the answers but even though its quicker than the calculator it is still

the most time consuming of the methods because you have to make many tables in excel moving to

more decimal places each time there’s a change of sine. An advantage of using the decimal search

method is that it has a very low risk of errors and is the easiest to do out of all the methods but a

disadvantage is that it is time consuming making multiple tables.

The Newton-Rapson method is a fixed point estimate and is the most complicated of the methods

because of the use of the specific formula in its working, even though it has the same number of 

iterations as the decimal search method it produces a quick result the fastest convergence of the

three methods. The uses of excel for this method greatly speeds up the proses by automating

entering and reduces the risk for mistake, using the graphical calculator makes this method slower

and gives it a larger chance of error because of the difficulty in entering the equshion and the speed

to which it can be done. An advantage is that it is the fastest method to use but it is quite

complicated pouting all the equshon parts into the excel table.

The Rearrangement method is also a fixed point estimate like in the Newton-Rapson method and is

the most time consuming because the method doesn’t converge on the root quickly, and took 10

iterations to get to the root to 5 d.p., also with this method you have to use the original equshon and

make a rearrangement of it that produces a graph with points that don’t have a gradient that is too

steep to calculate the root which can take more than once to get right. Using an exel sped sheet for

calculating the root decreased the time of getting to the answer from using a graphical calculator. An

advantage is that it is not terribly complicated to do but it is quite time consuming to do all the

different stages in this method.

I used an excel sped sheet to help quickly find the answers for the roots in all the methods instead of 

using the graphical calculator, this was the easiest with the Newton-Rapson method because there

was less to enter in to get the answer for the root.

I also used autograph to draw the graphs for the different methods, this was much easier than

drawing them out by hand, this was most useful with the Rearrangement method because it let me

see many graphs on top of each other and I could work out if the gradients of the points where

inside the range that would be a successful. The software was very easy to use and it helped me to

find out which of the rearrangements of my function were suitable in the Rearrangement method

and in which intervals the roots are in for all the methods.


Recommended