# MEI numerical Methods

Numerical methods coursework

Introduction:

Consider the problem x + ktanx = 1, the value of x lies between 0 and π/2 for different values of K, it is measured in radians. Normally a solution of a mathematical problem of this nature requires the root of an equation. If we attempt to find the root algebraically, we begin by rearranging the equation to give 0, hence the equation is x + ktanx – 1 = 0. Now lets assume the value of K is 1, we are left with x + tanx – 1 = 0. The only information we are provided is that the value of x is between 0 and π/2. Since x appears twice in the equation, the problem cannot be solved algebraically. In the sense that there are equations which cannot be integrated and require numerical methods to approximate the answer, eg the midpoint rule. In the same way there are equations which cannot be solved algebraically and require numerical methods to approximate the root.

To solve this solution I shall attempt to use numerical methods. I will be using the method of bisection, fixed point iteration, secant method and false position method. All these methods require the use of an excel spreadsheet since all methods require iterations which will get closer and closer to the real answer (converge). This is why the Newton raphson method isn’t being used as it requires differentiation which can be hard to use on computers. The other methods can be converted into formulas and inputted into excel which can easily perform multiple iterations, simply by dragging down the cells.

Strategy:

Method of bisection:

An approximation of the root can be obtained by this method; in order to use the method of bisection the first thing which must be done is to find an interval estimate of the root. In order to find a better interval, add the upper and lower bounds of the estimate and divide by 2 in order to obtain the middle value. Then test this value to see if it’s positive or negative, dependent on the result the interval then becomes smaller, hence the answer gets closer to the real answer (converges).

This method can be used to solve this equation as we have been given the interval estimate, 0 < x < π/2. Hence to obtain a better estimate we test,

(0 + π/2) / 2, which is π/4. We now do f(π/4) in order to see if its negative or positive hence making the interval smaller. If it’s positive we replace it with the upper bound. I will make a spreadsheet with a formula that satisfies this method and I will perform multiple iterations until my answer reaches 9 significant figures. A spreadsheet can be created for this method hence this method can be used to solve the equation.

Fixed point iteration:

An approximation of the root can be calculated via this method. An equation can have more than one root, in order to find both roots we have to rearrange the equation so it equals x and use fixed point iteration for both equations. To use fix point iteration we do rearrange f(x) = 0, to G(x) = x. We then do G(x1), and so on; this is called a recurrence relation. By doing this, most of the time the sequence gets closer to the final answer thus it converges.

For this piece of coursework, my equation can be rearranged into two forms. The first one is, x(n+1)=1-k*tan(n) , this can be described as G(x), it can also be arranged into x(n+1) =arctan(1-x(n))/k, the rearranged form can be described as H(x). In order to find the roots, I would use a sensible starting number, I will choose π/4 and carry out multiple iterations on H(x) and g(x) to see if there’s more than just one root. I will make a spreadsheet with formulas that satisfy both H(x) and g(x) and drag it down to 9 significant figures. A spreadsheet can be made so this method can once again be used to find the root/s of the equation between 0 and π/2.

Secant method:

Earlier I claimed that using the Newton raphson method can’t be used because differentiation on computers doesn’t always work, instead we can approximate the derivative. This creates the secant method, this requires two approximations, x(0) and x(1).

Secant method:

Evaluating this formula means, the first approximation x0 multiplied by the function of the second approximation x1, minus the function of the first approximation x0 multiplied by the second approximation x1. This is then divided by the function of the second approximation minus the function of the first approximation to give the third approximation.

I can use this method because my x(0) is equal to π/2, and x(1) is equal to 0; hence if we were to substitute these values into the formula described above we would have an approximation of the root closer ...