I'll use the Lotka-Volterra model as an example since I can't copy your code.
First way:
Use Show
to get the forward t>0
and backward t<0
solutions to be different colors.
{xsol, ysol} = NDSolveValue[{
x'[t] == x[t] - 2 x[t] y[t],
y'[t] == x[t] y[t] - y[t],
x[0] == y[0] == 1},
{x, y}, {t, -20, 20}]
Show[{
ParametricPlot[{xsol[t], ysol[t]}, {t, -4, 0}, PlotStyle -> Red,
PlotRange -> {{0, 2.5}, {0, 1.5}},
Prolog -> {PointSize[Large], Blue, Point[{1, 1}]}],
ParametricPlot[{xsol[t], ysol[t]}, {t, 0, 4}, PlotStyle -> Green]}]
Second way:
Have a forward and a backward NDSolve
.
Forward solution
{xsolf, ysolf} = NDSolveValue[{
x'[t] == x[t] - 2 x[t] y[t],
y'[t] == x[t] y[t] - y[t],
x[0] == y[0] == 1},
{x, y}, {t, 0, 20}]
Backward solution
{xsolb, ysolb} = NDSolveValue[{
x'[t] == -(x[t] - 2 x[t] y[t]),
y'[t] == -(x[t] y[t] - y[t]),
x[0] == y[0] == 1},
{x, y}, {t, 0, 20}]
Notice that the backward solve has the same initial conditions and time range as the forward solve, but that the equations are negated.
This lets you use only a single ParametricPlot
for both forward and backward solutions.
ParametricPlot[{{xsolf[t], ysolf[t]}, {xsolb[t], ysolb[t]}}, {t, 0, 4},
PlotStyle -> {Red, Green},
Prolog -> {PointSize[Large], Blue, Point[{1, 1}]}]
I've also gone with NDSolveValue
instead of the regular NDSolve
since you asked to store the data in a table which you can do pretty easily with
xfData = Table[xsolf[t], {t, 0, 5, .1}]
If you use the second way, remember that for the backward solve time is "negative time" so you might need to do something like
xbData = Table[xsolb[t], {t, 10, 0, -.1}]
data=Table[{t, x[t], y[t]},{t, -1.7, 1.6}]; Export["ode.dat", data]
$\endgroup$