I have this code which manipulates the control parameters of a NDSolve integration of two coupled ODEs with multiple initial conditions and then plots the results in a ParametricPlot.
f[x_, y_, a_, b_] := a - (b + 1) x + x^2 y
g[x_, y_, a_, b_] := b x - x^2 y
Manipulate[
Module[
{
sol =
Table[
NDSolve[
{
D[x[t], t] == f[x[t], y[t], a, b]
,D[y[t], t] == g[x[t], y[t], a, b]
,x[0] == ic[[i, 1]]
,y[0] == ic[[i, 2]]
}
,{x, y}
,{t, 0, tmax}
]
,{i, 1, 3}
]
}
,
ParametricPlot[
Evaluate[{x[t], y[t]} /. sol], {t, 0, tmax}
,PlotRange -> {0, 10}
]
]
,{{ic, Table[{i, i}, {i, 1, 3}]}, ControlType -> Locator}
,{{a, 0.5}, 0, 2}
,{{b, 2}, 0, 3}
,Delimiter
,{{tmax, 50}, 10, 100}
,ControlPlacement -> Left
]
The code works fine in Mathematica 9.0 in Linux -- showing three curves in different colors -- but it shows an empty plot in Mathematica 11.0 in Windows. What can I do to make it work in both Mathematica versions so that the three curves are plotted with different colors?
Notice that the same code without the Evaluate command within the parametric plot works fine in both versions of Mathematica, but of course it plots the three curves with the same color.
I suspect the problem must be with some update from version 9 to version 11 of Mathematica (or alternatively with the way things are handled in Linux vs Windows) of how lists are evaluated within the plot command. I tried to avoid Evaluate
and use the Evaluated -> True
option, but it still plots the three curves with the very same color.