Anda di halaman 1dari 16

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

Sometimes, we have equations that we cannot solve analytically. This generally means that there are no integer roots; the equation cannot be factorised easily; or there is a term with a power , which there is no uncomplicated formula to solve the equation. Because of this, equations of this nature need to be solved in an alternative method, this usually provides an estimate to the values of the roots. Three possible methods we can use are as follows:

Change of Sign Method using Decimal Search

A root exists here


in the interval [-2,-1]

A root exists here


in the interval [0,1]

A root exists here


in the interval [1,0]

This section is with regard to the equation . After determining that the equation could not be solved analytically (due to the fact that there were no integer roots) I opted to use the change of sign method. The graph is displayed above; we can note that the furthest-right root is situated between and . From this very fact, the change of sign method is ready to be, use of which can be observed as follows: From our understanding that one of the roots lies between a table of against , where
x f(x) 1.0 -1 1.1 -1.058 1.2 -1.024 1.3 -0.886 1.4 -0.632 1.5 -0.25 1.6 0.272

and :
1.7 0.946 1.8 1.784

, we can construct

1.9 2.798

2.0 4

As highlighted in the table above, between the points where and , a root lies. The fact that changes from negative to positive suggests that the graph is ascending from the negative region of the -axis to the positive region of the -axis (and therefore, between these areas of the graph , implying the existence of a root. The graph below justifies the workings of the change of sign method. As we can see, the change in sign exists between and ; meaning that the graph of intercepts the x-axis somewhere in-between. The two vectors on the graph display this. At the result is less than 0; it lies below the -axis. On the contrary, at , the result is greater than 0. Conclusively, our root must lie in between the two, which is also graphically supported below.

Page 1

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

A root exists here


in the interval [1.5, 1.6]

For precision, we can repeat the change of sign method indefinitely; each time we increment the number of decimal places for our values of , we get closer and closer to the actual root of the equation.
x f(x) 1.50 -0.25 1.51 -0.2043 1.52 1.53 1.54 1.55 1.56 1.57 1.58 1.59 1.60 -0.15718 -0.10865 -0.05867 -0.00725 0.045632 0.099986 0.155824 0.213158 0.272

As before, zooming in to a very specific region of the graph allows us to see more clearly where exactly the change of sign occurs. The graph below suggests the same results as the table above, acting as proof that the change of sign method works.

A root exists here


in the interval [1.55, 1.56]

Page 2

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

I repeated this process 5 times, and the results can be observed below. The previous two tables have been included for completeness:
x f(x) x f(x) x f(x) x f(x) x f(x) 1.0 -1 1.50 -0.25 1.550 -0.00725 1.5510 -0.00203 1.55130 -0.00046 1.1 -1.058 1.51 -0.2043 1.551 -0.00203 1.5511 -0.0015 1.55131 -0.00041 1.2 -1.024 1.52 -0.15718 1.3 -0.886 1.53 -0.10865 1.4 -0.632 1.54 -0.05867 1.5 -0.25 1.55 -0.00725 1.6 0.272 1.7 0.946 1.8 1.784 1.9 2.798 2.0 4

1.56 1.57 1.58 1.59 1.60 0.045632 0.099986 0.155824 0.213158 0.272

1.552 1.553 1.554 1.555 1.556 1.557 1.558 1.559 1.560 0.003209 0.008461 0.013727 0.019008 0.024303 0.029613 0.034938 0.040278 0.045632 1.5512 -0.00098 1.55132 -0.00035 1.5513 -0.00046 1.55133 -0.0003 1.5514 6.53E-05 1.55134 -0.00025 1.5515 1.5516 1.5517 1.5518 1.5519 1.5520 0.000589 0.001113 0.001637 0.002161 0.002685 0.003209 1.55135 -0.0002 1.55136 -0.00014 1.55137 -9.2E-05 1.55138 -3.9E-05 1.55139 1.3E-05 1.55140 6.53E-05

From these results, we can interpret that a root on the graph lies within the interval . Taking the midrange of our interval gives us , which is accurate to .

Failure of the change of sign, using decimal search method:


A lot of the time, the change of sign method will work. However, there are cases where it fails. If we take the equation for example, and employ the change of sign method as a means to work out its roots, we find it does not work. As we can see graphically (below) a root clearly exists in the interval .
A root exists here
in the interval [6, 8]

A root exists here


in the interval [3, 4]

When we use the change of sign method, we obtain the following table:
x f(x) 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 2.803086 1.909746 1.134806 0.526266 0.132126 0.000386 0.179046 0.716106 1.659566 3.057426 4.957686

As we can observe, there is no change of sign (which suggests no root). The graph sits on the -axis, indicative of some repeated root. As it sits directly on the -axis, the graph (at this

Page 3

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

point) will not descend any lower than where not be able to find this root.

, meaning the change of sign method will

Fixed point iteration, using

method:

A root exists here


in the interval [1.5, 2]

A root exists here


in the interval [-1.5, -1]

A root exists here


in the interval [0, 0.5]

On the diagram above, roots exist where

and

meet.

Using the method, we can formulate a way to find one of our roots. This method actively searches for a root through a sequential, and repetitive operation; the nature of this means it is an iterative (repeating) method. In this case, we are going to try and solve the function , where . In order to do this, we need to formulate some intermediate step that has some recursive element to it, so we arrange it in the form . From here, we can work out each time, based on a previous result. For our function , our rearrangement is as follows:

Page 4

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

1. 2. 3. 4. 5. Which is now in the form of formula in the form ; from here we can create the corresponding iterative as .

x0 x1 x2 x3 x4 x5 x6 0.000000 0.166667 0.159722 0.160200 0.160168 0.160170 0.160170

After specifying where we want the fixed point iteration to start - , which in this case (as we can see a root exists near this point on our graph), the iteration can begin. 1. 2. 3. 4. 5. (as it exists in the table above) to give ( )

is then substituted into the iterative formula 6. The value of the next value of .

7. This is repeated until the value of repeats ( and ), as this suggests we have our root accurate to the precision specified (in this case to ), repeats at . To then prove that at a root exists at around about , we use the change of sign method. We will substitute a value of that is slightly below and one slightly above.
x f(x) 0.160165 0.160175 0.000030 -0.000034

The change in sign here is significant of there being a root present at error bound of .

, with an

Page 5

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

Graphically, the fixed-point iteration method works in a step-wise fashion. The method searches through in a stairs-like manner searching for the root. Where meets ( ), we can establish that a root exists. This method works in this instance as the absolute value of the gradient at magnitude) is , which can be shown as follows: 1. 2. 3. 4. 5. | | (its

the iterative method is capable of finding the root at due to the magnitude of the gradient of the function at this point being less than 1.

Graphical representati on with x0, x1, x2, x3 (stairs)

Failure of the fixed-point

iterative method:

Like most things in life, the method doesnt always work. There are some scenarios where the method fails to find a root and wanders off into infinity. If we take the same graph however start with a different value of , we will notice that no root is determined. In this case, we take :

Page 6

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

Numerically, this

iteration can be explored in the following table:

x0 x1 x2 x3 x4 x5 x6 x7 -2.000000 -5.166667 ######## ######## ######## ######## ######## #NUM!

As we can see, our steps manoeuvre leftwards and outwards; this means it will continue to search divergently, which is pointless, as it will not identify any root. Graphically, we can notice that there is no root before where and as the search has ended up beyond and continues to search further and further negative on s behalf; no root will be found. We can notice, the values become too large; the table, in which they are held does not offer the capacity to present them. even becomes so large that the computer cannot even recognise or represent its value. If we look at the gradient of ( ) at (where we can approximate one of our roots exists from our graph), it is as follows: 1. 2. 3. 4. 5. | |

The magnitude of the gradient of at is greater than 1; this means that this iterative method will be unable to identify a root at this point. This therefore suggests that the method will diverge from the root, and never be able to identify it, confirming that the method is not flawless.

Page 7

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

Newton Raphson method:


The Newton Raphson method works in a similar way to the iterative method; we establish some point to begin our search from, and then progress from there. The method utilises the gradient at each specified point ( ) then forms a tangent to the curve at this point; the interception the tangent makes with the -axis is where the next search is initiated. A reading of the gradient is taken at this point, and another tangent is created this then allows for the method to become increasingly accurate and reliable, the more times the method is iterated. For the graph of , we can employ this method. The graph cannot be solved analytically due to its cubic nature; we cannot draw out a factor of ; and there are no integer roots (observable on its graph below). This therefore makes for the Newton Raphson method to be a perfectly viable method.

A root exists here


in the interval [-2, -1]

A root exists here


in the interval [0, 1]

A root exists here


in the interval [-1, 0]

We begin by first creating our iterative formula, which should be in the form . Using basic differentiation, the expression our iterative formula as: . We can appreciate from the graph above that a root exists in the interval , an even more specifically, the root is closer to . We can therefore take . From this, we can work out , which is demonstrated as follows: becomes , which leaves

Page 8

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

1. 2. 3. 4. 5. 6. 7. Then inputting following table: into the formula to produce and so forth, we acquire the

x0 x1 x2 x3 x4 -2.000000 -1.875000 -1.855128 -1.854638 -1.854638

The repeating values in of

and

suggests the root has been identified to the used precision

To justify that there is actually a root of the graph where is a change of sign immediately before and after its position ( :
x f(x) -1.854633 -1.854643 0.000014 -0.000015

, we can show there ) in

The change of sign here makes it evident that there is indeed a root at around . Graphical proof of this methods workings are as follows:

Page 9

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

A tangent is drawn on the graph where (our estimate).

Where this tangent intercepts the -axis is where we take our next estimate.

Root being searched:

We the form another tangent at the new estimate and repeat this process until we find our root to an appropriate degree of accuracy

As we can see, the graph and our tables values comply:


x0 x1 x2 x3 x4 -2.000000 -1.875000 -1.855128 -1.854638 -1.854638

initial estimate second estimate

third estimate

Finding the other two roots works in the same manner:

Page 10

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

For the root in the interval


x0 x1 x2 x3

, taking
x4

, the root is found as follows:


x5

-1.000000 -0.500000 -0.600000 -0.596970 -0.596968 -0.596968

And for the root in the interval


x0 x1 x2 x3

, taking
x4

, the root is found as follows:


x5 x6

1.000000 0.642857 0.487474 0.453261 0.451610 0.451606 0.451606

Failure of the Newton Raphson method:


It would not be complete if the Newton Raphson method did not have its own failure case, so indeed it does. Using the same graph, we can note that a root exists in the interval , so it would perfectly reasonable and logical to begin our search at . Tabulating the iteration gives us the following:
x0 x1 0.000000 #DIV/0!

Oops!! What happened here? 1. 2. 3. 4. 5. Well, we ended up with a division by zero. The denominator is the gradient function, so we must have had a gradient of 0, which is indicative of a turning point on the graph; lets check: 1. 2. 3. It is indeed the case that we have a turning point in this location, forcing a division by 0 in our Newton Raphson iterative formula. To further explore the implications of this on the method, we can graphically portray this:

Page 11

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

Root being searched.

Our initial tangent, formed at , has a gradient of 0. Due to the nature of the gradient, the equation of the line is , which is parallel to the -axis ( ). This will mean the tangent will never intercept the -axis, thus forcing the Newton Raphson method to not work.

Comparisons between the methods


So weve seen them all both succeed and fail, but, essentially we want to know which works best at finding the roots of a given equation/graph/function. Taking the graph of , we can employ all of the three methods explored in this project:

A root exists here


in the interval [-2, -1]

A root exists here


in the interval [0, 1]

A root exists here


in the interval [-1, 0]

Page 12

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

For this comparative investigation, we will search for the same root, using the same starting point on the graph. The root we shall be looking for will be that which exists in the interval , and we shall take our starting point as . Change of sign, using decimal search method .

The mid-range of the last values of 1. Fixed point iteration, using 1. 2. 3. 4. 5. 6. 7. taking 8. 9. 10. ;

in the change of sign table above is: , accurate to method .

Page 13

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

The iteration can be further followed in the table:

Newton Raphson method 1. 2. 3. Taking 4. 5. 6. 7. 8. The iteration can be further followed in the table:
x0 x1 x2 x3 x4 x5

-1.000000 -0.500000 -0.600000 -0.596970 -0.596968 -0.596968

Conclusively... With all the methods, as the functions remained constant, the software I used (Microsoft Excel) was extremely useful. I was able to copy and paste the function, whilst keeping the value of relative to each usage of the function. This saved a great deal of time. Excels primitively mathematical nature meant that it could interpret my functions, utilising very basic, ubiquitous syntax: to denote to the power of ; to denote multiplied by ; and so on. I could also specify the precision of my values easily, which was helpful as it meant I could keep with that expressed by the specification. The software also boasted a rich array of formatting tools, which enabled me to present my findings in an understandable and clear manner. Specific to the individual methods, the change of sign method required most work as I had to produce 5 tables, compared to the mere 1 the other two tables required in order to reach the same precision. In terms of how many calculations were necessary in our spreadsheet, the Newton Raphson came on top, only requiring 5 total calculations before the root was identified to the precision required (accurate to ). The fixed-point iteration, using method took 7

Page 14

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

calculations; however, the change of sign method was most demanding in that it took a massive 55 calculations before the root was identified. From this, it is clear to see that the change of sign method All of the methods required additional resources: graphs and rearranged formulas. For all three of the methods, a graphical package was required to represent the graphs, so that it was clear where to begin the search. From the rendering of its corresponsive graph, the change of sign method was ready to go, and it boasted the least preliminary setup before it could be executed. With the fixed-point iteration, using and the Newton Raphson methods both required rearrangements involving processes, such as differentiation. This limits the portability of the latter two methods, as new rearrangements would need to be formed for each equation needing to be solved. Failure-wise, the fixed-point iteration, using method was the easiest to have not found a root. The fact that the magnitude of the gradient of the function could not exceed imposed serious limitations on the method, as this was commonly the case. The change of sign method could find a root in most cases, providing the graph was not too densely packed with roots in specific areas, as the change of sign could commonly be overridden in these cases, and gone unnoticed. There was also its inability to observe repeated roots, which was another downfall of the method. With the Newton Raphson method, it was harder to force a failure to occur and it came out as the most failure-proof method of the bunch, only (from my investigation) failing when was at a turning point, and the gradient was therefore . All of the methods were able to decipher the roots precision down to the same number of decimal places. However, there was slight incongruence between their expectations of the root. The fixed-point iteration, using and the Newton Raphson methods found the root on our last search to be , whereas the change of sign method evaluated it as , and though the difference is menial, the former result was closer to the exact value of the root, putting the change of sign method slightly behind the other two in this respect. The fixed-point iteration, using and the Newton Raphson methods, are both iterative methods, where will use the value of to find its value. The two do work in different ways though. The method relies on any arrangement in that form, which leaves for several possibilities, where each arrangement can be used to identify the different roots on the graph. With the Newton Raphson method however, there is only one rearrangement using differentiation, which has a definite result. This means there will be (on a whole) less steps required to solve an equation using the Newton Raphson method. This quality of the two also suggests that programmatically on a computer representing the method will be more difficult than that for the Newton Raphson method due to the multiple arrangements that can be made, compared to the one, and only, arrangement the Newton Raphson method can take. All in all, taking their strengths and weaknesses into account, and purely by looking at their speed (how quickly the root is found), ease of use (how easy it was to implement, and use of the various software packages available) and reliability (how many times would the method actually find the root), the Newton Raphson method undoubtedly comes out on top. It has proven to be the quickest at identifying a root in our last observation; and in its own section on this project, it was clear that all the roots were found with much ease. Though there were

Page 15

James Stott | Mr Selby | C3 Coursework | Candidate Number: 4557 | Centre Number:

additional steps required before the execution of the method (such as differentiation), it still made for a good method as it was consistent and reliable.

Page 16

Anda mungkin juga menyukai