# How to plot an unstable attractor?

I'm trying to solve and plot the following in Mathematica:

eqns = {x'[t] ==
x[t] - y[t] -
x[t] (x[t]^2 + y[t]^2) + (x[t] y[t])/Sqrt[x[t]^2 + y[t]^2],
y'[t] ==
x[t] + y[t] - y[t] (x[t]^2 + y[t]^2) -
x[t]^2/Sqrt[x[t]^2 + y[t]^2]};
DSolve[eqns, {x, y}, t]


This is supposed to be an example of unstable attractor ODE. However, execution never ends and I don't manage to see the solution of the equation.

• Try using NDSolve instead – b3m2a1 May 26 at 20:55

To visualize a 2D system, I would start with StreamPlot:

vf = {x', y'} /. First@Solve[eqns /. f_[t] :> f, {x', y'}]; (* strip the args *)
StreamPlot[vf, {x, -2, 2}, {y, -2, 2}] You can use StreamPoints to highlight the structure and Epilog to mark the attractor at $$(1,0)$$:

ics = {{{Cos[1/5], Sin[1/5]}, Red},
{{0.5, 0}, Magenta}, {{1.5, 0.}, Magenta}};
StreamPlot[vf, {x, -2, 2}, {y, -2, 2},
StreamPoints -> {Append[ics, Automatic]},
Epilog -> {White, EdgeForm[Black], Disk[{1, 0}, 0.03]}] eqns = {x'[t] ==
x[t] - y[t] -
x[t] (x[t]^2 + y[t]^2) + (x[t] y[t])/Sqrt[x[t]^2 + y[t]^2],
y'[t] ==
x[t] + y[t] - y[t] (x[t]^2 + y[t]^2) -
x[t]^2/Sqrt[x[t]^2 + y[t]^2]};
sol = NDSolve[Join[{x==1.5, y==1.5}, eqns], {x, y}, {t, 0, 50}];
ParametricPlot[{x[t], y[t]}/.sol//Evaluate, {t, 0, 50}, PlotRange->All] 