Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: NDSolve very very slow

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128509] Re: NDSolve very very slow
  • From: "Kevin J. McCann" <kjm at KevinMcCann.com>
  • Date: Thu, 25 Oct 2012 23:34:47 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <k6aje7$r2t$1@smc.vnet.net>

Bob Hanlon and others may have suggestions to speed things up, but note 
that you are doing your calculations with 40 place precision. Since it 
is not machine precision, this significantly impacts the speed. How 
would you do a 40-place calculation in C++?

Kevin

On 10/25/2012 1:41 AM, popov.ghost at gmail.com wrote:
> M=1;
> \[Lambda][l_] = l (l + 1);
> rinf = 15000;
> $MinPrecision = 40;
> wp = $MinPrecision;
> ac = $MinPrecision - 8;
> pg = wp/2;
>
> eq[\[Omega]_,
>     l_] := \[CapitalPhi]''[r] + (2 (r - M))/(
>       r (r - 2 M)) \[CapitalPhi]'[
>        r] + ((\[Omega]^2 r^2)/(r - 2 M)^2 - \[Lambda][l]/(
>         r (r - 2 M))) \[CapitalPhi][r] == 0;
>
> (*The solution:*)
>
> \[CapitalPhi]out[\[Omega]_, l_] := \[CapitalPhi]out[\[Omega], l] = {\[CapitalPhi], \[CapitalPhi]'} /.
>     Block[{$MaxExtraPrecision = 100},
>       NDSolve[{eq[\[Omega], l], \[CapitalPhi][rinf] ==
>          init, \[CapitalPhi]'[rinf] ==
>          dinit}, {\[CapitalPhi], \[CapitalPhi]'}, {r, 29,
>          39}, WorkingPrecision -> wp,
>        AccuracyGoal -> ac, PrecisionGoal -> pg,
>        MaxSteps -> \[Infinity]]][[1]];
>
> (*Run as:*)
>
> \[CapitalPhi]out[2, 1]//AbsoluteTiming



  • Prev by Date: Re: How accurate is the solution for high degree algebraic equation?
  • Next by Date: Re: Fourier Transform of a "step" function
  • Previous by thread: NDSolve very very slow
  • Next by thread: Fourier Transform of a "step" function