0% found this document useful (0 votes)
292 views11 pages

A2 Mathematics Course Work C3 Finle

The document describes using different numerical methods to find the roots of equations: 1) The decimal search method is used to find a root between 0.8 and 0.9 of the equation x3+3x2-2x-1=0, determining the root is 0.83425 to 5 decimal places. 2) The Newton-Raphson method is used to find two roots of 2x’-2x-3=0, determining the roots are 1.292728 and -0.88541 to 5 significant figures. 3) The rearranging method is used to find a root between 1 and 2 of x3-2x-1=0, determining the root

Uploaded by

acampbell10
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
292 views11 pages

A2 Mathematics Course Work C3 Finle

The document describes using different numerical methods to find the roots of equations: 1) The decimal search method is used to find a root between 0.8 and 0.9 of the equation x3+3x2-2x-1=0, determining the root is 0.83425 to 5 decimal places. 2) The Newton-Raphson method is used to find two roots of 2x’-2x-3=0, determining the roots are 1.292728 and -0.88541 to 5 significant figures. 3) The rearranging method is used to find a root between 1 and 2 of x3-2x-1=0, determining the root

Uploaded by

acampbell10
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 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+3x2x1. The equation x+3x2x1=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.

Root 1

Root 2

Root 3

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. Level of accuracy of answer: x=1 to 0 d.p x=0.85 +/- 0.05 0.8 >x< 0.9

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+3x02x01 = -1

For x=0.1 f(X) = 0.1+3x0.12x0.11 = -1.169

x 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

f(X) -1 -1.169 -1.272 -1.303 -1.256 -1.125 -0.904 -0.587 -0.168 0.359 1

Ashley Campbell x 0.83 0.831 0.832 0.833 0.834 0.835 0.836 0.837 0.838 0.839 0.84 f(X) -0.02151 -0.01646 -0.0114 -0.00632 -0.00124 0.003858 0.008965 0.014083 0.019212 0.024353 0.029504 x 0.834 0.8341 0.8342 0.8343 0.8344 0.8345 0.8346 0.8347 0.8348 0.8349 0.835 f(X) -0.00124 -0.00073 -0.00022 0.000289 0.000799 0.001308 0.001818 0.002328 0.002838 0.003348 0.003858

x 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9

f(X) -0.168 -0.12026 -0.07143 -0.02151 0.029504 0.081625 0.134856 0.189203 0.244672 0.301269 0.359

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

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.

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 48x152x+147x45=0 the method doesnt work because there is no change of sign . The graphs below shows this:

Doesnt cross the x axis

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. x 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 f(X) -45 -31.772 -21.296 -13.284 -7.448 -3.5 -1.152 -0.116 -0.104 -0.828 -2 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 not cross the x axis will not be found by decimal search so we would need to use an alternate method.

Ashley Campbell

Nowton- Raphson method


The graph below shows the function f(x)=2x2x3. The equation 2x2x3=0 has 2 roots that I need to find, I shall do this by the Nowton-Rapson method.

I will need to find these 2 roots, we can see that they are in the intervals 1<x<2 and -1<x<0
Root 2 Root 1

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.

Root 1 Root 1

X2 X1 X0

X1

X0

Ashley Campbell The formula that is used for the Nowton-Rapson method is: If f(x)= 2x2x3 Then f(x) = 8x3-2 So the equation becomes: xn+1= xn - 2x2x3 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8x3-2 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 - 2x02x03 eeeeeeeee8x03-2 x2= x1 - 2x12x13 rrrrrrrrrrrrr8x13-2 x3= 1.300409 x4= 1.292805 x5= 1.292728 x6= 1.292728 I can see that there is some =rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr 1.59677 convergence between x4 and x5 but only to 3 s.f. but between x5 and x6 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr the x values so there is no change in = 2 - 2(1.59677 )2(1.59677)3 = 1.37406 3 my root is x= 1.292728 to 5 rrrrrrrrrrrr8(1.59677) -2 signifigent figures. With an error bound of +/- 0.000005. = 2 - 2(2)2(2)3 rrrrrrrrrrrr8(2)3-2

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 0 1 2 3 4

xn

f(x)

f'(x) -10 -7.832 -7.55792 -7.553 -7.553

-1 1 -0.9 0.1122 -0.88567 0.001974 -0.88541 6.42E-07 -0.88541 6.79E-14

Root 2

X0

X1

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.

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.75x0.7x0.95=0.

X1
Further away from my desired root

Desired root

X0

Turning point The turning point near to x0 caused the divergence, that takes the value further away from the desired root. Newton-Rapson formula:

n 0 1 2

xn

f(x) f'(x) 0 -0.95 -0.7 -1.35714 6.499011 -21.9971 -1.06169 1.664523 -11.5739

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)=x2x1. I will rearrange f(x)=0 in the form of x = g(x). One possible rearrangement of the formula is:
This is the root I wish to find

x2x1=0 x3=2x+1 x=(2x+1)1/3 so g(x)=(2x+1)1/3

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.
This is the root I wish to find

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 xn 0 1 2 3 4 5 6 7 8 9 10 x 2 1.709976 1.62389 1.619524 1.618413 1.618131 1.618059 1.61804 1.618036 1.618034 (2x+1)1/3 1.709976 1.641116 1.62389 1.619524 1.618413 1.618131 1.618059 1.61804 1.618036 1.618034 1.618034

I can see that between x9 and x10 the answer for the root is 1.61803 to 5 s.f.

Root 1 Root 1

X2=1.64111

X1=1.70997

X0=2 X10=1.618034

X9=1.618036

X8=1.61804

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. 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.

1.78

A
To find the gradient of a particular root Y=1 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. Y=-1

0.68 0.25

B C

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.

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. It is diverging towards root A 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 X0 This is the root that I want X1 X2 X3

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.

Comparison of methods
I will use the equation x2x1=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 I wish to find

x f(X) 1 -2 1.1 -1.869 1.2 -1.672 1.3 -1.403 1.4 -1.056 1.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

f(X) 1.6 -0.104 1.61 -0.04672 1.62 0.011528 1.63 0.070747 1.64 0.130944 1.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

Ashley Campbell

x f(X) 1.61 -0.04672 1.611 -0.04094 1.612 -0.03515 1.613 -0.02935 1.614 -0.02354 1.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 1.618 1.6181 1.6182 1.6183 1.6184 1.6185 1.6186 1.6187 1.6188 1.6189 1.619

f(X) -0.0002 0.000386 0.000972 0.001558 0.002143 0.002729 0.003315 0.003901 0.004487 0.005073 0.00566

x 1.61801 1.61802 1.61803 1.61804 1.61805 1.61806 1.61807 1.61808 1.61809 1.6181 1.61811

f(X) -0.00014 -8.2E-05 -2.3E-05 3.52E-05 9.37E-05 0.000152 0.000211 0.000269 0.000328 0.000386 0.000445

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.

Change of sign between 1.618 and 1.6181

Change of sign between 1.61803 and 1.61804

I will now try to find this root using the Newton-Raphson method.
f(x) = x2x1 f(x) = 3x2-2

The iterative formula for the Newton-Raphson method is: xn+1=xn- f(xn) 44444444444444444444444444444444444444444444444444444f(xn) So my iterative formula is: xn+1=xn- xn3+2xn-1 ccccccccccccccccccccccccccccccccccc3xn2-2 I will start with x0 = 2 n 0 1 2 3 4 5 xn f(x) f'(x) 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.

2 3 10 1.7 0.513 6.67 1.623088 0.029714 5.903248 1.618055 0.000123 5.854306 1.618034 2.15E-09 5.854102 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 method and there is no need for rearrangements like in The Rearrangement method. This is because it uses

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 methods, 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 theres 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 doesnt 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 dont 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.

You might also like