I am using Intel Core(™) processor, 32 bit operating system, 4GB RAM, Windows 7. I am running the following code and it is taking hours to obtain the result. Can any one help me in improving the codes so that it takes less time.
μ = 0.01214398779977472`
μ1 = 328823.8592475095`
Subscript[e, 1] = 0.0167`
A = 389.1779396462019`
ϕ = 0
Subscript[e, 2] = 0.0549`
Vx =
x + μ/(y^2 + (-1 + x + μ)^2)^(3/2) - x μ/(y^2 + (-1 + x + μ)^2)^(3/2) -
μ^2/(y^2 + (-1 + x + μ)^2)^(3/2) - x/(y^2 + (x + μ)^2)^(3/2) -
μ/(y^2 + (x + μ)^2)^(3/2) + x μ/(y^2 + (x + μ)^2)^(3/2) +
μ^2/(y^2 + (x + μ)^2)^(3/2) + x μ1/(2 A^3) + (3 x μ1 Cos[2 ϕ])/A^3 +
(3 y μ1 Sin[2 ϕ])/A^3 - (μ1 Cos[ϕ] Subscript[e, 1]^2)/(2 A^2);
Vy =
y - (y μ)/(y^2 + (-1 + x + μ)^2)^(3/2) - y/(y^2 + (x + μ)^2)^(3/2) +
(y*μ)/(y^2 + (x + μ)^2)^(3/2) + (y*μ1)/(2 A^3) - (3 y μ1 Cos[2 ϕ])/A^3 +
(μ1 Sin[ϕ])/A^2 + (3 x μ1 Sin[2 ϕ])/A^3 - (μ1 Sin[ϕ] Subscript[e, 1]^2)/(2 A^2);
Vxx = D[Vx, x];
Vyy = D[Vy, y];
Vxy = D[Vx, y];
Vyx = D[Vy, x];
newton[{x_, y_}] :=
{x, y} +
{Simplify[-(Vx Vyy - Vy Vxy)/(Vyy Vxx - Vxy^2)],
Simplify[(Vx Vyx - Vy Vxx)/(Vyy Vxx - Vxy^2)]};
sol =
{{ 0.188277, -0.9824026}, { 0.188277, 0.9824026}, { 1.152706, 0},
{-0.998550, 0}, { 0.987856, 0}, { 0.835518, 0}, { -0.012144, 0}};
tab =
ParallelTable[
N[FixedPoint[newton, {i, j}, 10]],
{j, -2, 2, 0.003},
{i, -2, 2, 0.003}]
rules = Rule @@@ Transpose[{sol, Range[Length[sol]]}];
newtab = Map[First @ Nearest[rules, #] &, tab, {2}];
P1 =
ArrayPlot[newtab,
ColorFunction -> "Rainbow", DataReversed -> True]