Clear[Field, x, y];
Field[x_, y_] = {-0.036 x E^x^2 + 0.123 y, 0.123 x - 0.087 y E^y^2};
fieldplot = Table[Vector[Field[x, y]/(1 + Norm[Field[x, y]]), Tail -> {x, y}], {x, -1.25, 1.25, 2.5/10}, {y, -1.25, 1.25, 2.5/10}];
Clear[x, y, t, solns];
endtime = 100;
solns = ParametricNDSolve[{
x'[t] == -0.036 x[t] E^x[t]^2 + 0.123 y[t],
y'[t] == 0.123 x[t] - 0.087 y[t] E^y[t]^2,
x[0] == a, y[0] == b}, {x, y}, {t, 0, endtime}, {a, b}]
Manipulate[
Show[fieldplot, ParametricPlot[{x[t] /. solns[[1]], y[t] /. solns[[1]]}, {t, 0, endtime}, PlotStyle -> {{Red, Thickness[0.015]}}], Graphics[{Red, PointSize[0.06], Point[{a, b}]}], Axes -> True, AxesLabel -> {"x", "y"}, PlotRange -> All],
{{a, -1, "x-start"}, -1, 1, Appearance -> "Labeled"}, {{b, -1, "y-start"}, -1, 1, Appearance -> "Labeled"}]
I am trying to use Manipulate
to change the values of a
and b
in my solns
equation, and then use those values as initial conditions to the differential equation that I am solving. However, the curve does not appear when I try plotting my function.
How can I have the Manipulate
function update the variables a
and b
in my solns
equation, and then plot that differential equation?