whtitefall

20 Reputation

One Badge

7 years, 46 days

MaplePrimes Activity


These are questions asked by whtitefall

I'm trying to evaluate function like this , but  D(x) always returns 0, is  there any way to evaluate the function ? 

 

f := proc (x) options operator, arrow, function_assign; piecewise(x < 0, 3^(-(1/3)*x^2), .5*2^(5^(-x))) end proc;
R(x) := int(f(t), t = x .. x+l):
L(x) := int(f(t), t = x-l .. x):
D(x) := (R(x)-L(x))/(R(x)+L(x)):

 

Hi 

I have a question about function as parameter in procedure

is it possible that I type 

f := x-> x+1

Test (f(x))

instead of Test(f) ? 

where Test is a simple procedure that takes in one function parameter 

Test := proc (f)
return f(1) + f (2) 

 

How am I going to evaluate function like this ? I tried signum evalf, eval and solve, they dont work

Bisection := proc (f, a, b, delta)

local startpoint, endpoint, midpoint; startpoint := a; endpoint := b;

do midpoint := (1/2)*startpoint+(1/2)*endpoint;

if abs(startpoint-endpoint) < delta or abs(f(midpoint)) < delta then

return midpoint

elif f(midpoint) < 0 then endpoint := midpoint

elif 0 < f(midpoint) then startpoint := midpoint

end if end do end proc

 

I'm trying to do a procedure for bisection method but it doesnt give me answer when  I type 

Bisection (x-> x + 0.001 , 1, -1, 0.001 )

it returns Bisection (x-> x + 0.001 , 1, -1, 0.001 )

why this is happening, Is it because the procedure is wrong ? or does not provide answer 

Page 1 of 1