whtitefall

20 Reputation

One Badge

7 years, 46 days

MaplePrimes Activity


These are replies submitted by whtitefall

@vv 

Hi 

I tried to evaluate the DD(1), but I received a long expression, is there anyway to evaluate this ? I tried to use eval and evalf, they don't work, Thank you ! 

@Kitonum 

I'm trying to find the root of the following function 

however, by using my code below, the root is around 0.999

Bisection := proc(f,a,b,delta)
local(startpoint, endpoint, midpoint)
if is(abs(f(a)) < delta) then return a end if
if is(abs(f(b)) < delta) then return b end if
startpoint := a;
endpoint := b
 do midpoint := (startpoint + endpoint)/(2) ; 
if is(abs(f(midpoint)) < delta) or is(abs(startpoint-endpoint) < delta) then return evalf(midpoint) end if

if  is(f(midpoint) < 0)  then endpoint := midpoint ;  
else startpoint := midpoint  fi ; 
 od;   end proc ; 

Bisection(f(x), -1, 1, 0.00001)

but if I copy paste your code, it works fine, I didn't check for continuity in this case

is it because of the parameters ? since I noticed that the parameter you gave is a procedure

 

Sincerely

Page 1 of 1