# Finding the inverse function of an interpolating function given by NDSolve

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

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

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]


Thanks to a good suggestion of user Michael E2

 ParametricPlot[{xFunc[t], -t}, {t, 0, tf}, AspectRatio -> 1,
Ticks -> {Automatic, ChartingScaledTicks[{-# &, -# &}]}]
Rotate[Plot[xFunc[t], {t, 0, tf}], -90 Degree](*and  My try :P *)

• I've tried that, but in this manner, ScalingFunctions can not be used in parametric plot, and the plot can not be reversed. – jarhead May 6 '18 at 9:52
• @jarhead. What ScalingFunctions do you need? – Mariusz Iwaniuk May 6 '18 at 10:34
• It needs to be reversed as In the figure in the question. In any case the inverse function is needed as well. – jarhead May 6 '18 at 11:33
• @jarhead The function does not have inverse function (not one-to-one/injective). Please clarify. – Michael E2 May 6 '18 at 11:57
• ParametricPlot[{xFunc[t], -t}, {t, 0, tf}, AspectRatio -> 1, Ticks -> {Automatic, ChartingScaledTicks[{-# &, -# &}]}] gives the desired graphics, I think. – Michael E2 May 6 '18 at 11:59