plotting - How to plot the stable and unstable manifolds of a hyperbolic fixed point of a nonlinear system of differential equations?
Suppose we have the following simplified system of two ordinary differential equations:
$$\dot{x}(t)=x(t)^2+2y(t)\\ \dot{y}(t)=3x(t)$$
The system has a hyperbolic fixed point the origin. Hence there exits a stable and an unstable manifold going through the origin.
I would like to plot these exact sets. I am able to plot basins of attraction for regions in phase space but I fail to do so once the attracting region is a one-dimensional line (as is the case here with the stable manifold).
Edit: With MMM's help I was able to roughly plot the unstable manifold. However, what is more challenging is to plot the stable one.
Eq1 = x'[t] == x[t]^2 + 2*y[t];
Eq2 = y'[t] == 3*x[t];
splot = StreamPlot[{x^2 + 2*y, 3*x}, {x, -6, 6}, {y, -6, 6}];
Show[splot,
ParametricPlot[
Evaluate[First[{x[t], y[t]} /.
NDSolve[{Eq1, Eq2, Thread[{x[0], y[0]} == {-0.01, 0}]}, {x,
y}, {t, 0, 3}]]], {t, 0, 3}, PlotStyle -> Red],
ParametricPlot[
Evaluate[First[{x[t], y[t]} /.
NDSolve[{Eq1, Eq2, Thread[{x[0], y[0]} == {0.01, 0}]}, {x,
y}, {t, 0, 2.4}]]], {t, 0, 2.4}, PlotStyle -> Red]]
Answer
The trick to getting the unstable manifold is to run backwards in time. Here I added two more solutions starting near the equilibrium but with negative t:
Eq1 = x'[t] == x[t]^2 + 2*y[t];
Eq2 = y'[t] == 3*x[t];
splot = StreamPlot[{x^2 + 2*y, 3*x}, {x, -6, 6}, {y, -6, 6}];
Show[splot,
ParametricPlot[Evaluate[First[{x[t], y[t]} /.
NDSolve[{Eq1, Eq2, Thread[{x[0], y[0]} == {-0.01, 0}]}, {x, y}, {t, 0, 4}]]],
{t, 0, 4}, PlotStyle -> Red, PlotRange -> {{-6, 6}, {-6, 6}}],
ParametricPlot[Evaluate[First[{x[t], y[t]} /.
NDSolve[{Eq1, Eq2, Thread[{x[0], y[0]} == {0.01, 0}]}, {x, y}, {t, 0, 2.6}]]],
{t, 0, 2.6}, PlotStyle -> Red, PlotRange -> {{-6, 6}, {-6, 6}}],
ParametricPlot[Evaluate[First[{x[t], y[t]} /.
NDSolve[{Eq1, Eq2, Thread[{x[0], y[0]} == {-0.01, 0}]}, {x, y}, {t, 0, -2.6}]]],
{t, 0, -2.6}, PlotStyle -> Green, PlotRange -> {{-6, 6}, {-6, 6}}],
ParametricPlot[Evaluate[First[{x[t], y[t]} /.
NDSolve[{Eq1, Eq2, Thread[{x[0], y[0]} == {0.01, 0}]}, {x, y}, {t, 0, -4}]]],
{t, 0, -4}, PlotStyle -> Green, PlotRange -> {{-6, 6}, {-6, 6}}]
]
Comments
Post a Comment