Bill Allombert on Mon, 08 Nov 2010 11:00:37 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Integration |
On Mon, Oct 11, 2010 at 02:54:48PM +0200, Sumaia Saad-Eddin wrote: > Dear all, > > here is a simple script I use: > ---------------------------------------------------- {calF3b(n, y, borne=0)= local(res); if(borne == 0, res = intnum(u = y, [[1], I], (n*(n-1)*log(u/y)^(n-2) -n*log(u/y)^(n-1) +2*(-n*log(u/y)^(n-1)+log(u/y)^n))*(-cos(u))/u^3 )*2/factorial(n), res = intnum(u = y, borne, (n*(n-1)*log(u/y)^(n-2) -n*log(u/y)^(n-1) +2*(-n*log(u/y)^(n-1)+log(u/y)^n))*(-cos(u))/u^3 )*2/factorial(n)); return(res); } > Can anyone explain me why these results are so > different, or give me a pointer to some litterature? intnum uses the double-exponential integration method that has strong regularity requirement, but is often much faster than intnumromb. The correct integration formula to use is: intnum(u = y,borne, expr ) = intnum(u = y,[[1],I], expr ) - intnum(borne, [[1],I], expr ) This avoid the exponential growth of the cosinus when the imaginary part get large (after the change of variable). I suggest reading Pascal Molin Ph.D. thesis (Bordeaux, 2010) for more detail. Cheers, Bill