# Plotting the image of a curve under a flow

I have some explicit time-independent vector field on the plane, and I would like to study how points evolve under the flow generated by this vector field. The flow is rather complicated and cannot be solved explicitly.

For my purposes, it is important to analyze how a "curve" of initial conditions end up after a fixed time, say $t=1$. Is there any command in Mathematica that would do this job? I have read much documentation but could not find anything like this. Any help will be greatly appreciated.

To be concrete,

s =
NDSolve[
{x'[t] == -y[t] + x[t]*Log[x[t]], y'[t] == x[t] + y[t]*Log[x[t]],
x[0] == 1, y[0] == 0},
{x, y}, {t, 1}]

and I would like to plot the image of the line segment $1<x<2,\,y=0$ after time 1.

• Welcome to Mathematica.SE! I suggest the following: 0) Browse the common pitfalls question 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Feb 19, 2016 at 18:35
• Thank you very much for your comments! Feb 19, 2016 at 18:48

s = ParametricNDSolveValue[{x'[t] == -y[t] + x[t]*Log[x[t]],
y'[t] ==  x[t] + y[t]*Log[x[t]],
x[0] == x0, y[0] == 0}, {x, y}, {t, 1}, x0]
f[x0_, t_] := Through[Through[s@x0]@t]

pts = Table[f[x0, t], {x0, 1, 2, .2}, {t, 0, 1, .1}];
Show[Graphics[{Green, Arrow /@ pts, Black, Point /@ pts},
Axes -> True, AxesOrigin -> {0, -1}],
ParametricPlot[f[x0, 1], {x0, 1, 2}, PlotStyle -> {Thick, Red}],
ParametricPlot[f[x0, 0], {x0, 1, 2}, PlotStyle -> {Thick, Blue}]]

Or.

pts = Table[f[x0, t], {x0, 1, 2, .2}, {t, 0, 1, .1}];
ptsind = Transpose[{(Range@Length@# - 1)/(Length@# - 1), #} &@Transpose@pts];

Graphics[
{Green, Arrow /@ pts,
{Thick, Blend[{Blue, Red}, #[[1]]], Line@#[[2]]} & /@ ptsind},
Axes -> True, AxesOrigin -> {0, -1}]

• Thank you very much! This is perfect for my purposes. It will be very useful in my studies. Feb 19, 2016 at 18:30

Make the position along the curve be another parameter of the differential equation.

s = NDSolve[{D[x[t, x0], t] == -y[t, x0] + x[t, x0]*Log[x[t, x0]],
D[y[t, x0], t] == x[t, x0] + y[t, x0]*Log[x[t, x0]],
x[0, x0] == x0, y[0, x0] == 0}, {x, y}, {t, 1}, {x0, 1, 2}];
ParametricPlot[
Table[{x[t, x0], y[t, x0]} /. s, {t, 0, 1, 0.1}], {x0, 1, 2}]

• Thank you very much! This was exactly what I was looking for; my apologies for not being able to accept multiple answers. Feb 19, 2016 at 18:31