Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: NDSolve very very slow
Replies: 1   Last Post: Oct 25, 2012 11:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kevin J. McCann

Posts: 145
Registered: 12/7/04
Re: NDSolve very very slow
Posted: Oct 25, 2012 11:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.