Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12183

Re: NDSolve very very slow

From "Kevin J. McCann" <kjm@KevinMcCann.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NDSolve very very slow
Date 2012-10-26 03:34 +0000
Message-ID <k6d0d2$265$1@smc.vnet.net> (permalink)
References <k6aje7$r2t$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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@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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

NDSolve very very slow popov.ghost@gmail.com - 2012-10-25 05:41 +0000
  Re: NDSolve very very slow "Kevin J. McCann" <kjm@KevinMcCann.com> - 2012-10-26 03:34 +0000

csiph-web