Re: Integrate got slower in Version 3.0/Example
- To: mathgroup at smc.vnet.net
- Subject: [mg8990] Re: Integrate got slower in Version 3.0/Example
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Tue, 7 Oct 1997 03:35:36 -0400
- Organization: University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
Elias Saab wrote: > > In version 2.2 > > In[1]:= Integrate[Sqrt[R^2-x^2-y^2],{x,-R,R}, > {y,-Sqrt[R^2-x^2],Sqrt[R^2-x^2]}]//Timing > > 3 > 2 Pi R > Out[1]= {5.17 Second, -------} > 3 > > In Version 3.0 > Integrate[Sqrt[R^2-x^2-y^2],{x,-R,R}, > {y,-Sqrt[R^2-x^2],Sqrt[R^2-x^2]}]//Timing > Integrate::"gener": "Unable to check convergence" > > 3 > 2 Pi R > Out[1]= {32.8 Second, -------} > 3 For In[1]:= Integrate[Sqrt[R^2 - x^2 - y^2], {x, -R, R}, {y, -Sqrt[R^2 - x^2], Sqrt[R^2 - x^2]}]//Timing Integrate::"gener": "Unable to check convergence" Out[1]= 3 2 Pi R {13.92 Second, -------} 3 you can turn off GenerateConditions: In[2]:= SetOptions[Integrate,GenerateConditions->False] Out[2]= {Assumptions->{},GenerateConditions->False, PrincipalValue->False} but this is not faster for this case: In[3]:= Integrate[Sqrt[R^2 - x^2 - y^2], {x, -R, R}, {y, -Sqrt[R^2 - x^2], Sqrt[R^2 - x^2]}]//Timing Integrate::"gener": "Unable to check convergence" Out[3]= 3 2 Pi R {13.41 Second, -------} 3 However, why not use polar coordinates anyway? In[4]:= PowerExpand[Integrate[r*Sqrt[R^2 - r^2], {theta, 0, 2*Pi}, {r, 0, R}]]//Timing Out[4]= 3 2 Pi R {0.41 Second, -------} 3 Cheers, Paul s ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://www.pd.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________