Question: Very, very slow numerical calculation?

Hi everyone. Long time reader, first time poster.

I have a rather nasty function that I need to use in various calculations (namely, one of them is a numerical integration). But, even evaluating this function at a given point takes exceedingly long (several seconds to tens, maybe even hundreds of seconds!). Is there any way I can make maple do all of the calculations numerically instead of doing all but the last evalf symbolically? I think that may be the problem. Anyway, here is my defined function:

width := 35; gap := 8.89; B0 := 1.30615; centralR := 1.5322550941477154982

z(x,y):=sqrt((-0.012029242-0.05060297686 x+0.2191855734 y)^2+(0.0521043725+0.2191855734 x-0.9493970231 y)^2)

perpDegradation(x,y):=(B0)/(1+(e)^(-6.762031311+17.48081911 z(x,y)+2.232089510 Pi-0.8171 (7.320276006 z(x,y)+0.9347108501 Pi-2.936480740)^2+0.2 (7.320276006 z(x,y)+0.9347108501 Pi-2.936480740)^3)):

extendedField(x,y):=(perpDegradation(x,y))*(Heaviside(-4.331475875 x+7.474536933-y)-Heaviside(-4.331475875 x+6.140092706-y))*Heaviside(-0.2308681911*x-0.05488154218+y)

By(r,theta):=B0*(Heaviside(r-1.3822551)-Heaviside(r-1.6822551))*Heaviside(.2308681911*r*cos(theta)+0.5488154218e-1-r*sin(theta))/(1+exp(.25028469571727139024+2.388*(11.21653020*theta-2.936480740)+((-1)*.8171)*(11.21653020*theta-2.936480740)^2+.2*(11.21653020*theta-2.936480740)^3))

Byextended(r,theta):=By(r,theta)+extendedField(r*cos(theta),r*sin(theta))

The function that is giving me a hard time integrating (or even evaluating) is Byextended. I have tried both in Cartesian coordinates and cylindrical coordinates. The integral I would like to calculate is:

evalf(int(Byextended(centralR,theta), theta=0..Pi/6))

But as you can probably tell, it takes FOREVER to calculate this. I actually was never able to get the calculation done.

Anyone have any thoughts?

Please Wait...