Question: Why romberg method do not work for integration if this function?

I am trying to find a fast method for integration of a function composed of several Heavisides. I used Quadrature-Romberg, but no success. What is the problem with it and what method do you recommend instead?

``

restart

``

A := Heaviside(zeta__2-.6429162216568)*Heaviside(eta__2+.5050000000000-10.98537767108*sqrt(492.5151416233-zeta__2^2))+Heaviside(zeta__2-.9999999999936)*Heaviside(eta__2+.9875792458758+3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.4637698986762+2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.4637698986762-2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.1619291800251+3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.1619291800251-3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.7243706106403+1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.7243706106403-1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))+Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2+.9875792458758-3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))-Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2+.9875792458758+3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))+Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2-.8341191288491-1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))-Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2-.8341191288491+1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))-Heaviside(zeta__2-.9999999999796)*Heaviside(eta__2-.8341191288491-1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))-Heaviside(zeta__2-.5527964251744)*Heaviside(eta__2+.5050000000000-10.98537767108*sqrt(492.5151416233-zeta__2^2))+Heaviside(zeta__2-.5527964251744)*Heaviside(eta__2+.5050000000000+10.98537767108*sqrt(492.5151416233-zeta__2^2))+Heaviside(zeta__2-.7684252323012)*Heaviside(eta__2-.5050000000000-8.127372424924*sqrt(269.5813999936-zeta__2^2))-Heaviside(zeta__2-.6466146460206)*Heaviside(eta__2-.5050000000000-8.127372424924*sqrt(269.5813999936-zeta__2^2))-Heaviside(zeta__2-.7684252323012)*Heaviside(eta__2-.5050000000000+8.127372424924*sqrt(269.5813999936-zeta__2^2))+Heaviside(zeta__2-.6466146460206)*Heaviside(eta__2-.5050000000000+8.127372424924*sqrt(269.5813999936-zeta__2^2))-Heaviside(zeta__2-.9999999999936)*Heaviside(eta__2+.9875792458758-3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))+Heaviside(zeta__2-.9999999999796)*Heaviside(eta__2-.8341191288491+1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))+Heaviside(zeta__2+.9999999999972)*Heaviside(eta__2+.9842650870048-1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))-Heaviside(zeta__2+.9999999999972)*Heaviside(eta__2+.9842650870048+1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))+Heaviside(zeta__2+.9999999999990)*Heaviside(eta__2+.1619291800251-3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999990)*Heaviside(eta__2+.1619291800251+3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))+Heaviside(zeta__2+.9999999999988)*Heaviside(eta__2-.4637698986762-2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999988)*Heaviside(eta__2-.4637698986762+2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))+Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2+.7243706106403-1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2+.7243706106403+1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))+Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2-.9031048925918-8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2-.9031048925918+8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.9842650870048-1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.9842650870048+1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))-Heaviside(zeta__2-.6429162216568)*Heaviside(eta__2+.5050000000000+10.98537767108*sqrt(492.5151416233-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.9031048925918-8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.9031048925918+8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2)):

plot3d(A, zeta__2 = -1 .. 1, eta__2 = -1 .. 1, color = green)

 

Digits := 22:

with(Student[NumericalAnalysis]):

Quadrature(Quadrature(A, zeta__2 = -1 .. 1, method = romberg[8]), eta__4 = -1 .. 1, method = romberg[8])

Float(undefined)*Heaviside(eta__2+1212964270000000000001.)+Float(undefined)*Heaviside(eta__2-1279401131003415700657.)-0.1513022270849353690226e-1*Heaviside(eta__2-133.8411610374164929382)+Float(undefined)*Heaviside(eta__2-7483906296259851792359.)+Float(undefined)*Heaviside(eta__2+7483906296259851792361.)+Float(undefined)*Heaviside(eta__2-0.1015456611625000000000e24)+Float(undefined)*Heaviside(eta__2+0.1015456611625000000000e24)+Float(undefined)*Heaviside(eta__2+0.3879094478488497112464e24)+Float(undefined)*Heaviside(eta__2+1279401131003415700655.)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8360207224718595497)+0.4538512794872905686682e-1*Heaviside(eta__2+132.8260207224718595497)+0.4538512794872905686682e-1*Heaviside(eta__2+132.8042477794001150390)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8253766167816064928)-0.4538512794872905686682e-1*Heaviside(eta__2-243.1883998382669648802)+0.1513022270849353690226e-1*Heaviside(eta__2+132.8311610374164929382)+Float(undefined)*Heaviside(eta__2-0.1727743542500000000000e24)-0.1513022270849353690226e-1*Heaviside(eta__2-243.2027260661341424950)+0.1513022270849353690226e-1*Heaviside(eta__2+244.2127260661341424950)+0.4538512794872905686682e-1*Heaviside(eta__2+244.1983998382669648802)-0.4538512794872905686682e-1*Heaviside(eta__2-243.1980716456433769010)+0.4538512794872905686682e-1*Heaviside(eta__2+244.2080716456433769010)+0.4538512794872905686682e-1*Heaviside(eta__2+132.8153766167816064928)+0.1513022270849353690226e-1*Heaviside(eta__2+132.8098727970154075001)+Float(undefined)*Heaviside(eta__2-0.3879094478488497112464e24)-0.4538512794872905686682e-1*Heaviside(eta__2-243.2072595071292620415)+Float(undefined)*Heaviside(eta__2+0.6036743846000000000000e24)+Float(undefined)*Heaviside(eta__2-0.6036743846000000000000e24)+Float(undefined)*Heaviside(eta__2+0.1727743542500000000000e24)-0.1916322521366165064753e-1*Heaviside(eta__2-133.8307592537082147847)+0.1916322521366165064753e-1*Heaviside(eta__2+132.8207592537082147847)-0.1916322521366165064753e-1*Heaviside(eta__2-243.2116719753798543789)+0.1916322521366165064753e-1*Heaviside(eta__2+244.2216719753798543789)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8026340889186250133)+0.4538512794872905686682e-1*Heaviside(eta__2+132.7926340889186250133)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8142477794001150390)-0.1513022270849353690226e-1*Heaviside(eta__2-133.8198727970154075001)+0.4538512794872905686682e-1*Heaviside(eta__2+244.2172595071292620415)-0.1903631769101229216919e-1*Heaviside(eta__2-133.8085015485931455736)+0.1903631769101229216919e-1*Heaviside(eta__2+132.7985015485931455736)+0.1903531841918040745676e-1*Heaviside(eta__2+244.2032962387251632874)-0.1903531841918040745676e-1*Heaviside(eta__2-243.1932962387251632874)+Float(undefined)*Heaviside(eta__2-1212964269999999999999.)

(1)

int(int(A, zeta__2 = -1 .. 1), eta__2 = -1 .. 1)

.4238607655960000000000

(2)

``

Download romberg.mw

Please Wait...