graphical method
intro
- The term graphical method related root finding might have lots of meanings as follow.
- The graphical method can also be presented in the form of perpendicular segements representing polynomial coefficients in the process of finding the real roots of pthe polynomial (Eisenberg, 1967).
- For complex roots the graphical method perform the analysis in the form of contour in complex plane (Pfeiffer, 1979).
- There is also other graphical technique for nonlinear algebraic equations that employs two graphs of the zero-curves of the real and imaginary parts of the polynomial for locating roots approximate location (Mitsui, 1983).
- Not to related to topic covered here, graphical study in the other form, e.g. polynomiography, can be very helpful in studying the newly development of root-finding algorithm (Naseem et al., 2023).
- In this note the meanings of the graphical method are limited only to the following.
- Graphical method is classified as bracketing methods in root finding methods, which is not very percise (Hedge, 2015).
- It is used usually to find real roots of an equation (Vaniya, 2020).
method
- It draws the function $f(x)$ againts $x$ and try to locate as near as possible to get $x = r$, which makes $f(r) = 0$.
- Choose a range $x \in [x_a, x_b]$ where $x_a < r < x_b$ holds.
- Zoom in by changing the range to $x \in [x_a', x_b']$ as long as $x_a' < r < x_b'$ holds until expected precision, where $x_a' > x_a$ and $x_b' < x_b$.
example
- Suppose that there is function $$\tag{1} f(x) = x^3 + 1.2345x^2 - 9.876x - 1 $$ where one root lies between $2$ and $3$.
graphs
- Figure 1. Plot $f(x)$ for $x \in [0, 10]$.
- Figure 2. Plot $f(x)$ for $x \in [0, 5]$.
- Figure 3. Plot $f(x)$ for $x \in [2, 4]$.
- Figure 4. Plot $f(x)$ for $x \in [2.6, 2.8]$.
- Figure 5. Plot $f(x)$ for $x \in [2.64, 2.66]$.
- Figure 6. Plot $f(x)$ for $x \in [2.642, 2.644]$.
- Figure 7. Plot $f(x)$ for $x \in [2.6438, 2.6440]$.
results
- From Figure 1 the root is hardly seen, lies between 2 and 3.
- From Figure 2 it can be said that $r \approx 2.5$.
- From Figure 3 it can be said that $r \approx 2.6$.
- From Figure 4 it can be said that $r \approx 2.64$.
- From Figure 5 it can be said that $r \approx 2.644$.
- From Figure 6 it lies between $2.6438$ and $2.6440$.
- From Figure 7 in can be obtained that $r \approx 2.64392$, which gives $f(r) \approx 1.07305 \times 10^{-3}$.
code
- Code 1. Generate data for xy scatter plot using Chart.js.url https://onecompiler.com/python/3zxhdejsr .
def generate_data(xa, xb, n): dx = (xb - xa) / n xx = [(xa + i * dx) for i in range(n+1)] yy = [] for x in xx: y = f(x) yy.append(y) return [xx, yy] def f(x): y0 = -1 y1 = -9.876 * x y2 = 1.2345 * x**2 y3 = x**3 y = y0 + y1 + y2 + y3 return y n = 10 [x, y] = generate_data(0, 10, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print() [x, y] = generate_data(0, 5, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print() [x, y] = generate_data(2, 4, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print() [x, y] = generate_data(2.6, 2.8, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print() [x, y] = generate_data(2.64, 2.66, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print() [x, y] = generate_data(2.642, 2.644, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print() [x, y] = generate_data(2.6438, 2.6440, n) for i in range(n + 1): print("{x:", x[i], ", y:", y[i], "},", sep='') print()
challenges
- Try to find $r$ that makes $f(r) \approx 10^{-4}$ for $f(x)$ in Equation (1).
- Could you try further for $r$ that makes $f(r) \approx 10^{-5}$ for the same equation? Give the result.
- Why does the function $f(x)$ seem to be linear, when the range becomes narrower?
refs
- Eisenberg L (1967) “A graphical method for finding the real roots of nth-order polynomials”, IEEE Transactions on Automatic Control, vol 12, no 5, pp 629-631, October 1967, url https://doi.org/10.1109/TAC.1967.1098710 .
- Hedge S (2015) “Lecture 04 Finding Roots of equations Bracketing Methods”, AML702 Applied Computational Methods, Indian Institute of Technology Delhi, 18 Jan 2015, url https://web.iitd.ac.in/~hegde/acm/lecture/L04_roots_of_equations.pdf [20231226].
- Mitsui T (1983) “A graphical technique for nonlinear algebraic equations”, International Journal of Computer Mathematics, vo 13, no 3-4, pp 245-261, url https://doi.org/10.1080/00207168308803367 .
- Naseem A, Rehman M A, Qureshi S, Ide N A D (2023) “Graphical and Numerical Study of a Newly Developed Root-Finding Algorithm and Its Engineering Applications”, IEEE Access, vol 11, pp 2375-2383, 2023, url https://doi.org/10.1109/ACCESS.2023.3234111 .
- Pfeiffer W (1979) “A graphical method for finding complex roots and its application to plasma physics problems”, Journal of Computational Physics, vol 33, no 3, pp 397-404, url https://doi.org/10.1016/0021-9991(79)90164-5 .
- Vaniya K (2020) “Graphical Method to Find Real Root of an Equation”, Mafatlal Gagalbhai Science Institute, Gujarat University, url https://mgscience.ac.in/wp-content/uploads/2020/07/K-K-VANIYA-SEM-4.pdf [20231226].