Programming

February 17 2009 by Jabz 433
false
Maple

0


Hi i was wondering if anyone could tell me what code i have to program the Bisection Method. I can't seem to get the while loop to work. it only gives me the first iteration and stops. Here is what i have done
 

 

f:=x ->x^3-x-8:
a:=2;
b:=3;
f(a);
f(b);

while sign(f(b)) <> sign(f(c)) do
if (f(b)*f(c)) > 0 then
b:=c:
else
a:=c;
c:=(a + b)/2
end if:
end do;
print(c);
2.5
 

I just can't get it to work.
 

P.S I am a begginer and just recently been using maple so please give me a simple answer.

Thank u
 

 
Loading Comments & Answers

You must be logged into your MaplePrimes account in order to post a comment. If you don't have an account, you can create an account here.

     

Forgot Your Password? Create an Account