# Phase Portrait to Differential Equation [closed]

I posted this question on Math.SE and have received a satisfactory answer in the context of that website. I am re-posting it here to get input from Mathematica users. Why would I receive a different answer here? Maybe there is some insight available through Mathematica or perhaps I am grappling at straws. I have previous anecdotal evidence that it is usually the former (Mathematica can reveal insightful solutions or quasi-solutions).

My minimum working example:

I solved the non-linear pendulum equation and drew its phase portrait. I was wondering, if given the phase portrait, I could recover its differential equation. This is being asked from the point that if I were given a phase portrait of a damped oscillatory nature, how can I recover the equation that "went with it"? Is there some way to do this in Mathematica (given data that made the phase portrait) or do I just have to compare a phase portrait with all the others that have been published?

My Mathematica code:

g = 1/10; q = 8; ω = -0.04; TMax = 40;
pSolNL = NDSolveValue[{y''[t] + (1/q) y'[t] + Sin[y[t]] ==
g Cos[ω t], y[0] == 0.0, y'[0] == 0}, y, {t, 0, TMax}]
ParametricPlot[{pSolNL[τ] /. τ -> t,
D[pSolNL[τ], τ] /. τ -> t}, {t, 0, TMax},
AspectRatio -> 1/2, PlotRange -> All]


Phase Portrait

• Curious to know why this received a "close" request? – dearN Feb 3 '16 at 14:57
• It's a little vauge to me what you want to do. Do you mean from an image? Or from something like a list of points? Asking "Can Mathematica do this?" is never a useful question. Mathematica can do whatever you are capable of programming. If your question is, "Is this easy to do in Mathematica?" the answer is no. It's not easy in general. But there are probably some tricks you might try. – Searke Feb 3 '16 at 17:12
• @Searke Good point. However, I do mention given data that made the phase portrait. – dearN Feb 3 '16 at 18:00

The phase portrait gives you $y'$ as a function of $y$ in multiple pieces (all those intervals where the former is actually a unique function). In each such piece, you can in principle find the functional form $dy/dt = y' = g(y)$ by inspection.

Next, how to get the time? Use

$$t-t_i = \int \frac{dy}{g(y)}$$

which is then solvable for $y(t-t_i)$ in that branch. Of course if you know the actual function $y(t-t_i)$, you can also construct a differential equation satisfied by it.

This answers your question because it is a differential equation satisfied by $y$.

This is of course quite boring, but if this is what you want then the only thing that remains if to chop up the phase portrait into the necessary intervals.

• The equation that was being used was non-autonomous; specifically, it was of the form $y' = g(y) + f(t)$. This can be seen by the fact that the trajectory intersects itself. I don't immediately see how this method could be extended to non-autonomous systems. – Michael Seifert Feb 3 '16 at 18:14
• @MichaelSeifert You're right, that doesn't seem to make sense globally. All it shows is that the solution isn't unique. You can get a differential equation, but not necessarily the one you expected... – Jens Feb 3 '16 at 18:28