Home Page    |  PIC18F4431 Programming: Position Tracking      | Flash Game: Find Matching Pair Programming |

|  Device Generating Continuously ON-OFF Signal Using Hardware Timers & Relays  Equation Root Finding Methods Using VB   |

 

 

Roots Finding Approximations Using VB

 

Here we will be demonstrating three methods, 'Bisection Approach', 'False Position Approach' and 'Newton-Raphson Approach' to find the equation roots using microsoft visual basic.

.

Roots of Equations

A root of an equation is defined as a value of X0 that yields:

f(x) = f(x0) = 0

Where f (x) can be a polynomial, exponential, logarithmic, or trigonometric function.

Our Visual Basic demonstrate the below three types of ways used to determine the roots of an equation:

  1. Bisection Approach
  2. False Position Approach
  3. Newton-Raphson Approach

 

1. Bisection Approach

The bisection method in mathematics is a roof-finding method that repeatedly bisects an interval and then selects a subinterval in which a root must lie for further processing. It is a very simple and robust method, but it is also relatively slow. The method is also called the interval halving method, the binary search method, or the dichotomy method.

This method assumes f (x) is a monotonic function. Given a value x, there is one and only one value for f (x) . Since this method requires a guess interval in which a root exists, it is also referred as a bracketing method in other textbooks.

1.1 Initial Interval Determination

Suppose an interval [x1, x2] is the guess interval within which the function changes sign, that is,

f(x1) * f(x2) < 0

If the above inequality satisfies, the interval [x1, x2] has at least one real root and is the guess interval for the search.

 

2. False-Position Approach

False-position approach determines the roots of an equation by taking advantage of the shape of the function f (x) . Using the characteristics of the function, the false-position method converges to an actual root more rapidly than the bisection method.    

2.1 Initial Interval Determination

Similar to the bisection method, the false-position approach also needs an initial interval within which a root exists. The initial interval is determined by a simple plot or by the incremental search method. Suppose an interval [x1, x2] is the interval within which the function is known to change sign. This change of sign can be simply determined by checking if:

f(x1) * f(x2) < 0

If the above inequality satisfies, the interval [x1, x2] has at least one real root and is the guess interval for the search.

 

3. Newton-Raphson Approach

Newton-Raphson method requires only a single starting point of x for the hunting of the root.

3.1 Starting Point

The determination of the starting value is critical to the search. A wrong starting value could diverge or move away from the actual root when the iterations continue.

Convergence may not be reached to the root due to the shape of the curve and the wrong location of the starting point. A suggestion to choose a starting point is to observe the shape of the curve before the starting point is located along the x-axis.

 

Programming code

  1. VB program source code
  2. Visual Basic program VB exercutive file 
  3. Root Finding Mathematical Explanation by Xudong & Shu Li (PDF file)