davidpthompson

0 Reputation

2 Badges

13 years, 201 days

MaplePrimes Activity


These are replies submitted by davidpthompson

@davidpthompson 

 

I messed round with it a bit and this works for me so far:

 

RombInt:=proc(f,a,b,m::nonnegint,n::nonnegint):
 if m>0 then 
   (1/(4^m)-1)*(4^m*(RombInt(f,a,b,(m-1),(n+1)))-(RombInt(f,a,b,(m-1),n)));
 elif m=0 then
   TrapRule(f,2^n,a,b);
 else 
error "parameter m must be less than or equal to n"; end if: end proc:
 

@davidpthompson 

 

I messed round with it a bit and this works for me so far:

 

RombInt:=proc(f,a,b,m::nonnegint,n::nonnegint):
 if m>0 then 
   (1/(4^m)-1)*(4^m*(RombInt(f,a,b,(m-1),(n+1)))-(RombInt(f,a,b,(m-1),n)));
 elif m=0 then
   TrapRule(f,2^n,a,b);
 else 
error "parameter m must be less than or equal to n"; end if: end proc:
 

This is what I got for the same question, however there are some errors but I can't figure out where.

 

RombInt:=proc(f,a,b,m::nonnegint,n::nonnegint):
if m>n then
   error "parameter m must be less than or equal to n";
elif m>0 then 
   (1/4^m-1)*(4^m*(RombInt(f,a,b,(m-1),(n+1)))-(RombInt(f,a,b,(m-1),n)):
elif m=0 then
   TrapRule(f,2^n,a,b);
end if:
end proc:
 
Thanks

This is what I got for the same question, however there are some errors but I can't figure out where.

 

RombInt:=proc(f,a,b,m::nonnegint,n::nonnegint):
if m>n then
   error "parameter m must be less than or equal to n";
elif m>0 then 
   (1/4^m-1)*(4^m*(RombInt(f,a,b,(m-1),(n+1)))-(RombInt(f,a,b,(m-1),n)):
elif m=0 then
   TrapRule(f,2^n,a,b);
end if:
end proc:
 
Thanks
Page 1 of 1