Numerical Computing with MATLAB

Chapter 4: Zeros and Roots

This chapter describes several basic methods for computing zeros of functions and then combines three of the basic methods into a fast, reliable algorithm known as zeroin .

4.1 Bisection

Let's compute ?2. We will use interval bisection, which is a kind of systematic trial and error. We know that ?2 is between 1 and 2. Try . Because x 2 is greater than 2, this x is too big. Try . Because x 2 is less than 2, this x is too small. Continuing in this way, our approximations to ?2 are

Here is a MATLAB program, including a step counter.

     M = 2     a = 1     b = 2     k = 0;     while b-a > eps        x = (a + b)/2;        if x^2 > M           b = x        else           a = x        end        k = k + 1;     end

We are sure that ?2 is in the initial interval [ a,b]. This interval is repeatedly cut in half...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: V-ribbed Pulleys
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.