# Boundary condition change in coupled ODEs

MSE ode coupled question

What is a better way to code using Mathematica in my answer in order to visualize a dynamic situation between given $(x,y)$ field limits for several starting curves/points?

Update: You can control (move / remove / add) initial values dynamically using Locators as in, for example, this answer.

tm = 15;
EQ1[a_, b_] := {X'[t] == X[t] (1 - Y[t]),  Y'[t] == 1 + Y[t] (X[t] - 1),
X == a, Y == b};
pf = ParametricNDSolveValue[EQ1[a, b], {X, Y}, {t, 0, tm}, {a, b}];

ab = {{- 0.4, 2.75}, {-.2, 4}, {4.4, 3.75}};

manipulate = Manipulate[
ParametricPlot[Evaluate[Table[Through@pf[a[], a[]][t], {a, u}]], {t, 0, tm},
GridLines -> Automatic, AspectRatio -> 1, PlotRange -> All,
BaseStyle -> Thick, Frame -> True,
Epilog -> ListPlot[{Labeled[#, Style[#, 16, "Panel"]]} & /@ u,
PlotStyle -> PointSize[Large]][]],
{{u, ab}, Locator, Appearance -> None, LocatorAutoCreate -> True}];


Evaluate the following line in place, i.e. highlight it and use Ctrl+Shift+Enter

DynamicSetting[manipulate] To print the current snapshot in the next cell use Shift+Enter: You might find ParametricNDSolveValue convenient:

tm = 10;
EQ1[a_, b_] := {X'[t] == X[t] (1 - Y[t]),  Y'[t] == 1 + Y[t] (X[t] - 1),
X == a, Y == b};
pf = ParametricNDSolveValue[EQ1[a, b], {X, Y}, {t, 0, tm}, {a, b}];

ab = {{- 0.4, 2.75}, {-.2, 4}, {4.4, 3.75}};

ParametricPlot[Evaluate[Table[Through @ pf[a[], a[]][t], {a, ab}]], {t, 0, tm},
GridLines -> Automatic, AspectRatio -> 1, PlotRange -> All, BaseStyle -> Thick,
Epilog -> ListPlot[Labeled[#, Style[#, 16, "Panel"]] & /@ ab,
PlotStyle -> PointSize[Large]][]] colors = Partition[ColorData[63, "ColorList"][[;; 6]], 2];
Table[cf[ab[[i]]] = colors[[i]], {i, Length@ab}];

Show[Table[Plot[Evaluate[Through@pf[a[], a[]][t]], {t, 0, tm},
BaseStyle -> Thick, PlotStyle -> cf[a],
PlotLegends -> (TraditionalForm /@ ({X[##][t], Y[##][t]} & @@ a))], {a, ab}]] 