radaar

117 Reputation

6 Badges

2 years, 199 days

MaplePrimes Activity


These are answers submitted by radaar

we can reduce time of function evaluation
 

restart; JJ := Int(exp(-sqrt(4*x^2+4*y^2+4*z^2)^3)*piecewise(x^2+y^2+z^2 < 4, 1, 0), x = -2 .. 2, y = -2 .. 2, z = -2 .. 2); CodeTools:-Usage(evalf(JJ))

memory used=1.37MiB, alloc change=1.00MiB, cpu time=657.00ms, real time=649.00ms, gc time=0ns

 

.5235987756

(1)

restart; JJ := Int(exp(-sqrt(4*x^2+4*y^2+4*z^2)^3)*piecewise(x^2+y^2+z^2 < 4, 1, 0), x = -2 .. 2, y = -2 .. 2, z = -2 .. 2, epsilon = 0.1e-3, method = _cuhre); CodeTools:-Usage(evalf(JJ))

memory used=241.60KiB, alloc change=0 bytes, cpu time=47.00ms, real time=43.00ms, gc time=0ns

 

.5235983900

(2)

``


 

Download int_time.mw

with(Matlab):
FromMatlab("Insert code matlab here"):

Page 1 of 1