Root ?nding using the bisection method, MATLAB Programming

Assignment Help:

In many applications, including ?nancial mathematics, ?nding zeros of a function

f(x) = 0 (4)

is paramount. One of the simplest method is the Bisection Method. The bisection method is a systematic search technique for ?nding a zero of a continuous function. The method is based on a well-known property of continuous functions, the intermediate value theorem. We ?rst ?nd an interval in which a zero is known to occur. This is done by evaluating the function f(x) at a and b: if f(a) > 0 and f(b) < 0 or if f(a) < 0 and f(b) > 0 then there exists a number x = c, say, between a and b such that f(c) = 0.

Suppose that an interval [a, b] has been located which is known to contain a zero, since the function changes sign between a and b. The approximate solution is the midpoint of the interval and therefore the zero must now lie either in the interval [a, x1] or [x1, b]. The appropriate subinterval is determined by testing the function to see whether it changes sign on [a, x1].

If yes, the search continues to obtain the next point x2 = a+x1 Otherwise, the search continues on [x1, b to obtain x1 = x1+b And the search is repeated until one converges to the approximate root either given some tolerance or number of iterates to convergence.

Below, I give you a head start to writing a MATLAB function bisect to compute a zero of a function. Let us consider as inputs a, b, tolerance, nmax (we do not want our algorithm to run forever in case it can not ?nd a zero), and the function fun. You must ?nd was of declaring the function fun such that it can be read easily into our function bisect. We want to output xvect (the vector containing the approximates zeros x0, x1, · · · , etc.), xdif (this is the difference between the roots to monitor the error), fx (this is a vector with the values of the function evaluated at it approximate zero, i.e. a vector of all f(xi)) and ?nally nit (this is the maximum number of iterations taken to converge. If the  algorithm can not ?nd the zero, then nit = nmax).


Related Discussions:- Root ?nding using the bisection method

How do I export multisignal wavelet signals, I am using the wavelet gui (wa...

I am using the wavelet gui (wavemenu) to decompose some data. I need to be able to export the signals. This is not a problem using only "Wavelet 1D" where only one time series is b

Creating column vectors, Creating Column Vectors: One way to generate ...

Creating Column Vectors: One way to generate a column vector is by explicitly putting the values in square brackets, separated by the semicolons: >> c = [1; 2; 3; 4] c =

Create a super mario brothers game application, Create a Super Mario Brothe...

Create a Super Mario Brothers game in Matlab. The lines of codes do not matter. But, The requirements are: REQUIREMENTS: Modular design and implementation Algorithm docu

Program to find the minimum total cost for the fence, A fence enclosure con...

A fence enclosure consists of a rectangle of length L and width 2 R , and a semicircle of radius R , as shown in Figure 1. The enclosure is to be built to have an area of 1600 m

Sum of two numbers, write the program sum of two numbers using matlab code

write the program sum of two numbers using matlab code

Rules for variable names, Rules for variable names: In addition, the v...

Rules for variable names: In addition, the variable names must always be mnemonic that means they should make some sense. For illustration, if the variable is storing the radi

#signals and systems, convolve the following sequences using tabulation met...

convolve the following sequences using tabulation method and verify the same using matrix mmethhod

Robot, How to simulate a robot

How to simulate a robot

Rungakuta methord, the basic equation of modeling radioactive decay is wher...

the basic equation of modeling radioactive decay is where the amount of the radioactive substance is at time and is the decay rate. Some radioactive substances decay into other rad

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd