MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Performance improvement needed - Help.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63746] Re: Performance improvement needed - Help.
  • From: "antononcube" <antononcube at gmail.com>
  • Date: Fri, 13 Jan 2006 04:48:24 -0500 (EST)
  • References: <dpiotv$l11$1@smc.vnet.net><dq03go$ri5$1@smc.vnet.net> <dq56cj$b0k$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

This seems to work faster

Clear[I1];
I1[n_, m_, X_, c_] :=
 Block[{func},
  func[a_?NumericQ] :=
   Sqrt[Cos[a]] Exp[-Sin[a]^2 c^2] (LegendreP[n, m,
        Cos[a]] (m^2 BesselJ[m, X Sin[a]](1 - Cos[a])/(X Sin[a]) +
         m Cos[a] BesselJ[m + 1,
           X Sin[a]]) + (m BesselJ[m, X Sin[a]]/(X Sin[a]) -
         BesselJ[m + 1, X Sin[a]])(n + m)(n - m + 1)Sin[a] LegendreP[n,
m - 1,
         Cos[a]]);
  NIntegrate[func[a], {a, 0, 1.1}, AccuracyGoal -> Infinity,
   Compiled -> True, MaxRecursion -> 100]
  ]

(V6.0) In[62]:=
n=40; m=1;
X=1;c=1;

(V6.0) In[65]:=I1[n,m,X,c]//Timing

(V6.0) Out[65]={0.569914 Second,-0.12652}

Anton Antonov
Wolfram Research, Inc.


  • Prev by Date: Re: Annoying spacing in Default.nb
  • Next by Date: Pattern Matching: Keep those summands not depending on x
  • Previous by thread: Re: Performance improvement needed - Help.
  • Next by thread: Re: Performance improvement needed - Help.