jackhunt13

5 Reputation

3 Badges

9 years, 311 days

MaplePrimes Activity


These are answers submitted by jackhunt13

Thanks for your advice, ive managed to come up with

TrapRule3:=proc(f,n,a,b)
local AVR,sum,h,i:
h:=(b-a)/n:
sum:=0:
for i from 1 by 1 to n-1 do
sum:=sum+f(a+i*h):
end do:
AVR:=(h/2)*(f(a)+2*sum+f(b)):
return (AVR):
end proc:

this seems to work but any ajustmentsor tips you can think of would be greatly appreciated.

Thanks again, jack

Page 1 of 1