The Bisection Method


This program searches for the root of a function that crosses the axis between two bounds.


Introduction

The bisection method requires two bounds at which a function has opposite signs. It checks the sign at the midpoint of the interval to decide where to search for the root next. Each midpoint check bisects the interval. This process continues until the size of the interval is less than the allowable error.

You must store the function as a subroutine labeled fx before running the program. When the program calls the subroutine, the value for the independent variable is available in both the display and data register A (000).

The function must have a value at the lower bound that is opposite in sign from the value of the function at the upper bound. This requirement prevents the program from finding a root at which the function is tangent to the axis.

For the Beginning Programmer

Before using the bisection method program, you must store the function as a subroutine in program memory.

If you are not familiar with keystroke programming, refer to the following chapters in the RPD-95 Programming Guide for instructions.
  • "Working with Programs on the RPD-95"
  • "Using Calculator Keystrokes in a Program"
  • "Controlling the Sequence of Operations"

Rules for Storing the Function

When you store the function as a subroutine, follow these rules.
The subroutine must be labeled fx (lowercase only).
  • Anytime the subroutine needs the independent variable, use a RCL A or RCL 000 instruction.
  • The subroutine must terminate with a RTN instruction.

Starting the Program

To start the program that uses the bisection method:
Store the function as a subroutine, following the rules listed above.
If the subroutine involves any of the trig functions, select the angle units you want to use.
  1. Select { ZRO } from the MATHEMATICS menu.
    The calculator displays the FUNCTION ZEROS menu.
  2. Press { BIS }.
    The program displays:
    D_2KEDHE
  3. Enter the lower limit of x and press { LO }.
  4. Enter the upper limit of x and press { HI }.
  5. Enter the allowable error and press { err }.

Finding the Root

After you have entered the parameters for the program, you can find the root of the function stored in program memory.
  1. Press { EOD }. The program searches for the root.
    If the program finds a root, it is displayed.
    D_5QSNmHwhere the value shown is the root.
    If the values of the function at the limits indicate no root is in the interval, the message INVALID LIMITS is displayed.
  2. Press { ESC }.
    The program returns to the BISECTION METHOD menu where you can either
    •Change the limits to specify a different interval.
    • Change the parameters to find a different root.
    • Change only the allowable error to find the root more accurately.


Back