1

Consider the following solution of NDSolve

tf = 100;
sol = NDSolve[{x'[t] == -x[t] + 0.1 y[t] + x[t]^2 y[t], 
    y'[t] == 0.5 - 0.1 y[t] - x[t]^2 y[t], x[0] == 0.5, y[0] == 1.5},
   {x, y}, {t, 0, tf}];
xFunc = x /. First@sol;
Plot[xFunc[t], {t, 0, tf}]

The plot produces enter image description here

How can I obtain the inverse function of xFunc[t], such that the plot will produce

enter image description here

jarhead
  • 2,065
  • 12
  • 19

1 Answers1

3

Maybe like so:

tf = 100;
sol = NDSolve[{x'[t] == -x[t] + 0.1 y[t] + x[t]^2 y[t], 
y'[t] == 0.5 - 0.1 y[t] - x[t]^2 y[t], x[0] == 0.5, 
y[0] == 1.5}, {x, y}, {t, 0, tf}];
xFunc = x /. First@sol;
ParametricPlot[{xFunc[t], t}, {t, 0, tf}, AspectRatio -> 1]

enter image description here

Thanks to a good suggestion of user Michael E2

 ParametricPlot[{xFunc[t], -t}, {t, 0, tf}, AspectRatio -> 1, 
 Ticks -> {Automatic, Charting`ScaledTicks[{-# &, -# &}]}]
 Rotate[Plot[xFunc[t], {t, 0, tf}], -90 Degree](*and  My try :P *)
Mariusz Iwaniuk
  • 13,841
  • 1
  • 25
  • 41