You are on page 1of 2

Lab1: Finding Roots

Abstract

For the graphical method we plot the function and use the graph to estimate the value of the root. Using
the estimated roots, we can create an interval and divide it up to find the approximate value of the
actual root.

- Secant method
- Implementation and results

Introduction

In this lab, our task was to find the angles of the output links of a general four bar mechanism when the
input link is rotated. This problem reduced to finding the roots of a non-linear equation, which would
result in the angle of the output link θ4.

Methodology

To find the roots, we had to employ three different numerical methods: the graphical method, the
bisection method, and the secant method. Using the graphical method, we were able to generate rough
estimates of the roots of the equation, by zooming in on the graph and noting the x-values just before
and after the locations of the roots of the equation. After this, we took these x values and used them as
starting points for the bisection method and the secant method and were able to calculate two values of
θ4 at which the function was zero, with absolute error less than or equal to 10 -6. After finding these
values of θ4, we could then determine two values for θ3 by back substituting θ4 into a previous equation.
Using these methods and an input angle (θ2 = π/3), we found the two roots of the equation to be θ4 =
1.2531 and θ4 = 4.1475, and θ3 was 0.3981 radians and 1.2808 radians, respectively. After this, we then
rotated the input link one full revolution, and plotted how θ3 and θ4 changed with respect to θ2. From
the plot, we saw that both θ3 and θ4 began to increase as θ2 started increasing from 0. Once θ2 reached
just over 4rad, both θ3 and θ4 began decreasing slowly.

Results

Graphical Method

By plotting the graph of the function and the x-axis we obtained bounds for root 1 to be [1,24,1.26] and
root 2 to be [4.14,4.16].

Bisection Method

Using the bounds acquired by the observing the graph of the function as the lower and upper starting
points for the bisection method the program took 21 iterations to find the value of the first root θ4 =
1.2531 where the function value was 5.5076e-9. Using the set of bounds acquired for the second root
the bisection method found θ4 = 4.1475 where the function value was 1.2392e-7 in 19 iterations.
Secant Method

Once again using the bounds obtained through the graphical method the secant method found θ4 =
1.2531 in only 3 iterations. At this point the function value was -5.1070e-15. For the second root using
the bounds obtained through the graphical method resulted in θ4 = 0, this meant the method was
diverging from the root. To counter this, we slightly adjusted the lower bound to be 4.12. With the new
bounds θ4 = 4.1475 was found in 3 iterations where the function value at the point was 1.3900e-13.

Implementation

The figure above shows how the angle between R3 and horizontal axis (θ3) changes with respect to the
angle between R2 and the horizontal axis (θ2). It also shows the relationship between the angle created
by R4 and the horizontal axis (θ4) and θ2. The secant method was used with initial values of x 0= 0 and x1=
2 to find the roots of the equations for different values of theta 2. Some of the figure values appear to
be incorrect, this is likely caused by divergence of the secant method, however by extrapolating the
results that follow the trend of the others an understanding of how this mechanism would function
when θ2 is adjusted can be achieved.

Conclusion

In this lab we learned how to solve roots of non-linear equations using 3 different numerical methods.
The graphical method, bisection method, and secant method. The graphical method plots the function
and the roots are found by estimating the value on the plot. The bisection method finds the roots by
dividing an interval that the root can be found in. The secant method finds the root of the equation by
using the roots of two secant lines as an interval. This lab was completed successfully with the goal of
finding roots with numerical methods obtained

You might also like