[Date Index]
[Thread Index]
[Author Index]
Integrals Crash MMA
*To*: mathgroup <mathgroup at yoda.physics.unc.edu>
*Subject*: Integrals Crash MMA
*From*: Roberto Sierra <73557.2101 at compuserve.com>
*Date*: 17 Jul 93 02:17:46 EDT
The following double integrals crash MMA 2.03 for the Mac. It takes
a while, and you get some warnings about ComplexInfinities first, but
they will crash eventually. I wonder if this problem has been fixed
in MMA 2.2. The variables x, y, z, and sigma are constants within the
integral.
Integrate[ (Sqrt[r^2] r Cos[theta]) /
(r^2 - 2 r x Cos[theta] - 2 r y Sin[theta])^(3/2),
{theta,0,2Pi}, {r,0,R}
]
Integrate[ (Sqrt[r^2] r Sin[theta]) /
(r^2 - 2 r x Cos[theta] - 2 r y Sin[theta])^(3/2),
{theta,0,2Pi}, {r,0,R}
]
Integrate[ (Sqrt[r^2] sigma (x - r Cos[theta])) /
(r^2 + x^2 + y^2 + z^2 - 2 r x Cos[theta] - 2 r y Sin[theta])^(3/2),
{theta,0,2Pi}, {r,0,R}
]
Integrate[ (Sqrt[r^2] sigma (y - r Sin[theta])) /
(r^2 + x^2 + y^2 + z^2 - 2 r x Cos[theta] - 2 r y Sin[theta])^(3/2),
{theta,0,2Pi}, {r,0,R}
]
I tried to evaluate a related 1-D integral, and it took MMA a real
long time before leaving the integral unevaluated. Why does it take
MMA so long (hours) before rejecting this integral, whereas most
unevaluable integrals are rejected within minutes or seconds? [Note
that the reported timing requirements are considerably lower than
what is actually required.] I want to avoid having to wait hours
in the future -- I thought that MMA had crashed at first until I
let it run overnight...
In[1] :=
eqn = (lambda (x - R Cos[theta])
Sqrt[R^2 Cos[theta]^2 + R^2 Sin[theta]^2]) /
(z^2 + (x - R Cos[theta])^2 + (y - R Sin[theta])^2)^(3/2)
Out[1] =
2 2 2 2
lambda (x - R Cos[theta]) Sqrt[R Cos[theta] + R Sin[theta] ]
---------------------------------------------------------------
2 2 2 3/2
(z + (x - R Cos[theta]) + (y - R Sin[theta]) )
In[2] :=
Timing[eqn1 = Simplify[eqn]]
Out[2] =
{38.15 Second,
2
lambda Sqrt[R ] (x - R Cos[theta])
------------------------------------------------------------}
2 2 2 2 3/2
(R + x + y + z - 2 R x Cos[theta] - 2 R y Sin[theta])
In[3] :=
Timing[int1 = Integrate[eqn1, {theta,0,2Pi}]]
Out[3] =
2
{4044.6 Second, lambda Sqrt[R ]
x - R Cos[theta]
Integrate[------------------------------------------------------------,
2 2 2 2 3/2
(R + x + y + z - 2 R x Cos[theta] - 2 R y Sin[theta])
{theta, 0, 2 Pi}]}
In[4] :=
Timing[int = Integrate[eqn, {theta,0,2Pi}]]
Out[4] =
{3856.17 Second, lambda Integrate[
2 2 2 2
(x - R Cos[theta]) Sqrt[R Cos[theta] + R Sin[theta] ]
--------------------------------------------------------,
2 2 2 3/2
(z + (x - R Cos[theta]) + (y - R Sin[theta]) )
{theta, 0, 2 Pi}]}
-- Roberto Sierra
Tempered MicroDesigns
Prev by Date:
**Summary: Performance of numerical functions decreases with time**
Next by Date:
**how to disable wrap-around of the printout lines ?**
Previous by thread:
**Summary: Performance of numerical functions decreases with time**
Next by thread:
**how to disable wrap-around of the printout lines ?**
| |