I have a simple code to get a planet's true anomaly as a function of time, using Newton's method and a series expansion. (Note that I purposefully iterate Newton's method two more times than the order I end up taking the expansion in)
I have used this code for years on M9 and 10. I just got 11, and now takes an obscenely long time to expand anything past linear.
TA[k_]:= Block[{Qfunc, EoM, foE, foM},
Qfunc[M_, e_, Ecc_] := -(Ecc - e Sin[Ecc] - M)/(1 - e Cos[Ecc]);
EoM[e_, M_, 1] := M;
EoM[e_, M_, kk_] := EoM[e, M, kk] = EoM[e, M, kk - 1] + Qfunc[M, e, EoM[e, M, kk - 1]];
foE[e_, Ecc_] := 2 ArcTan[Sqrt[(1 + e)/(1 - e)] Tan[Ecc/2]] + Ecc - 2 ArcTan[Tan[Ecc/2]];
foM[e_, M_, kk_] := foE[e, EoM[e, M, kk]];
Series[foM[e, t n, k + 2], {e, 0, k}]
];
Then you run it with
TA[0];//Timing
TA[1];//Timing
TA[2];//Timing
The first two output quite quickly, the last one takes a very long time. On version 11, it looks like
{0.195877, Null}
{0.15612, Null}
{174.727, Null}
Why did it take so much longer to find the e^2 term? On previous versions of Mathematica with this exact same code it has always taken fractions of a second to expand even to much higher order.
Maybe there's an oversight, or some setting I need to tweak for this new version?
Thanks in advance!
foM[e, t n, 4]
takes negligible time. However, expanding this quantity to second order ine
is very slow. $\endgroup$