Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

ROOTS OF EQUATIONS – BRACKETING METHODS

Here is the quadratic formula that you’ve learned years ago…

−𝑏 ± √𝑏 2 − 4𝑎𝑐
𝑥=
2𝑎
to solve the function below:

𝑓(𝑥) = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0

The values calculated in the first equation called roots which represent the values of x
that make the second equation equals to zero. Although there were equations like this
that could be solved directly, there were many more that could not.

One method to obtain an approximate solution is to plot function and determine where it
crosses the x-axis. This point, which represents the value for f(x) = 0, is the root.
Graphical methods are limited, and they are lack of precision but there is alternatively
trial and error method. But this is absolutely about guessing. These methods are
inefficient for engineering calculations and determining the design criteria. That’s why
we use more precise and efficient numerical methods.

1. Graphical Methods

In graphical method, you should solve the equation with the givens and plot the results as
shown below. Then you should guess a root from the graph, and check this value whether
working with the given function or not? This is a useful but a rough method.

Ex. In Course Quiz (1) : Use the graphical method to determine the bungee jumper’s
mass with the givens below.
cd = 0.25; g = 9.81; v = 36; t =4;
mp = linspace(50,200);
fp = sqrt(g*mp/cd)*tanh(sqrt(g*cd/mp)*t)-v;

2. Bracketing Methods and Initial Guesses

In bracketing methods, as the name implies, these are based on two initial guesses that
“bracket” the root that is, are on either side of the root. For well-posed problems,
bracketing methods work but very slowly. In each bracketing/open method initial guesses
are strongly needed. We will mention the open methods in the upcoming sections.

2.1 Incremental Search

When applying graphical method in Ex.1, you observed that f(x) changed sign on opposite
sides of the root. In general, if f(x) is real and continuous in the interval from x1 to xu and
f(x1) and f(xu) have opposite signs,

f(x1)* f(xu) < 0

then, there is one real root btw x1 and xu.

Incremental search method capitalizes on this observation by locating an interval where


the function changes sign. A potential problem with an incremental search is the choice
of increment length. If it is too small, the search can be time consuming. If it is too long,
then there is a possibility that closely spaced roots might be missed. If there are multiple
roots you can easily miss one/more than one roots. Graphical illustration of the
incremental method is given below.

Ex. In Course Quiz (2) : Use the m-file incsearch to identify brackets within the interval
[3,6] for the function:
𝑓(𝑥) = sin(10𝑥) + cos⁡(3𝑥)
3. Bisection Method

It is a variation of the incremental search method in which is the increments is always


divided in half. If a function changes sign over an interval, the function value at the
midpoint is evaluated. The location of the root is then determined as lying within the
subinterval where the sign change occurs. The subinterval becomes the interval for the
next iteration. The process is repeated until the root is known to the required precision.
The graphical illustration of the bisection method is given below.

Ex. 3. Use bisection to solve the first problem (Ex.1) which we solved with using graphical
method previously.
The first step in bisection method is to guess two values of the unknown that gives the
values for f(x) with different signs. Here is our unknown is the weight of the bungee
jumper (m) and the function is the f(m). In above graph, the graphical solution is given
again for the Ex.1. It is obvious that the function changes sign btw 50 and 200. Plotting
suggest better guesses btw let say 140 and 150. But if we don’t have a plot we should start
the guessing btw 50 and 200.

Therefore, initial estimate of the root (xr) lies at the midpoint of the interval as

50 + 200
𝑥𝑟 = = 125
2

Note that the true root is 142.7376. This means that the value of 125 calculated here has
a true percent relative error of

142.7376 − 125
|𝜀1 | = | | × 100% = 12.43%
142.7376

Next step, we compute the product of the function at the lower bound and at the midpoint:

𝑓(50)𝑓(125) = −4.5794(−0.4086) = 1.8711

which is greater than zero, so no sign change occurs btw the lower bound and the
midpoint. That means that root must be located in the upper interval btw 125 and 200.
Then we create a new interval with lower bound x1 = 125 and the upper bound as xu =
200. Revised root estimate becomes:

125 + 200
𝑥𝑟 = = 162.5
2

and corresponding true percentage error:

142.7376 − 162.5
|𝜀1 | = | | × 100% = 13.85%
142.7376

We compute the product of the function at the midpoint and at the upper bound:

𝑓(125)𝑓(162.5) = −0.4086 ∗ 0.3594 = −0.1469

Which is lower than zero, that means that sign change occurs. So, the root is btw 125 and
162.5. Now lower bound x1 = 125 and the upper bound xu = 162.5.

125 + 162.5
𝑥𝑟 = = 143.75
2

then the relative percentage error becomes:


142.7376 − 143.75
|𝜀1 | = | | × 100% = 0.709%
142.7376

The method can be repeated as the accuracy satisfies your needs.

Now it’s time to determine when to terminate the process. We need to develop an
objective criterion for this need.

3.1. Error Estimates for Bisection

In above example we already knew the true root. This would not be the case in an actual
situation because there would be no point in using the method if we already knew the
root.

So, we require an error estimate that is not addicted on foreknowledge of the real root.
One way to do this estimating an approximate percent relative error as in Ex.3.

𝑥𝑟𝑛𝑒𝑤 − 𝑥𝑟𝑜𝑙𝑑
|𝜀𝑎 | = | | × 100%
𝑥𝑟𝑛𝑒𝑤

Here xrnew : the root for the current iteration and xrold : the root for the previous iteration.
When εa becomes less than a prespecified criterion as εs, the computation is terminated.

Ex.4. Continue Ex.3 until the approx. error falls below a stopping criterion of εs = 0.5%.
Use the above equation to compute the errors.

In Ex.3 we started with a true percentage error of 12.43% (ε1) for btw 50 and 200. The
midpoint was 125. In second step we calculated for btw 125 and 200, and the midpoint
was 162.5 (ε1 = 13.85). If we calculate the approx. for this step:

162.5 − 125
|𝜀𝑎 | = | | × 100% = 23.08%
162.5

If we continue to calculate εa and ε1 for each iteration step we’ll get the below values.

Iteration x1 xu xr εa (%) ε1(%)


1 50 200 125 12.43
2 125 200 162.5 23.08 13.85
3 125 162.5 143.75 13.04 0.71
4 125 143.75 134.375 6.98 5.86
5 134.375 143.75 139.0625 3.37 2.58
6 139.0625 143.75 141.4063 1.66 0.93
7 141.4063 143.75 142.5781 0.82 0.11
8 142.7581 143.75 143.1641 0.41 0.30

After the eight iterations εa falls below 0.5%, and the computation is terminated. If we
plot these approx. and true percent errors as below graph:
The true and approx. errors are far apart when the interval happens to be centered on
the true root. They can be close when the true root falls at either end of the interval. Don’t
generalize the conclusion as approx. error is always greater than the true error. Keep that
in mind that the above results are for only an example.

We can state the number of iterations before starting the bisection method with
determining the approx. error stopping criterion. As there are iterations in bisection
method, the starting one is the zero iteration. Absolute error for zero iteration is:

𝑥𝑢0 − 𝑥10 ∆𝑥 0
𝐸𝑎0 = =
2 2

After the first iteration error becomes:

∆𝑥 0
𝐸𝑎1 =
4

When you employ n number of iterations then the formula becomes:

∆𝑥 0
𝐸𝑎𝑛 =
2𝑛+1

If Ea,d is the desired error, the equation can be solved for2:

𝑙𝑜𝑔(∆𝑥 0 /𝐸𝑎,𝑑 ) ∆𝑥 0
𝑛= = 1 + 𝑙𝑜𝑔2 ( )
𝑙𝑜𝑔2 𝐸𝑎,𝑑

4. False Position

Another well known bracketing method is false position or linear interpolation method.
Different from the bisecting the interval, it locates the root by joining f(x1) and f(xu) with
a straight line. The intersection of this line and the x-axis represents the improved
estimate of the root. The method uses the similar tringles as shown below figure
formulated as:
𝑓(𝑥𝑢 )(𝑥1 − 𝑥𝑢 )
𝑥𝑟 =
𝑓(𝑥1 ) − 𝑓(𝑥𝑢 )

Ex.5. Use false position to solve the same example which we solve before.

You might also like