# Plotting Two Components of NDSolve using Parametric Plot

Right now, I'm using this set-up to calculate one part of my differential equation function.

Manipulate[
s = NDSolve[{p''[t] - 3 Sqrt[8*Pi*(p[t]*p[t] + p'[t]*p'[t])/6.0]*p'[t]
- p[t]*p[t] == 0, p == po, p' == ppo}, p, {t, 0, ttop}];
Plot[Evaluate[p'[t] /. s], {t, 0, ttop}], {{po, 0},0, .1},
{{ppo, 0}, 0, .001}, {{ttop, 1}, 0, 3}]


And that works fine, however I want to use parametric plot to plot $p'[t]$ against $p[t]$ over {t,0,ttop}. Or really I wouldn't mind specifying the range as {t,0,3} and removing the variable. However, I can't figure out how to plot two functions from the NDSolve on the parametric plot.

Currently, I'm trying this:

Manipulate[
s = NDSolve[{p''[t] -
3 Sqrt[8*Pi*(p[t]*p[t] + p'[t]*p'[t])/6.0]*p'[t] - p[t]*p[t] ==
0, p == po, p' == ppo}, p, {t, 0, ttop}];
ParametricPlot[Evaluate[{p'[t], p[t]} /. s], {t, 0, ttop}], {{po, 0},
0, .1}, {{ppo, 0}, 0, .001}, {{ttop, 1}, 0, 3}]


But this isn't working. Does anyone know how I could use parametric plot to plot $p'[t]$ against $p[t]$ for a given range of $t$ $(0,3)$?

• Welcome to Mathematica StackExchange. In ParametricPlot use {p'[t],p[t]} rather than (p'[t],p[t]). – Dunlop May 12 '18 at 19:05

Change this

s=NDSolve[{p''[t]-3 Sqrt[8*Pi*(p[t]*p[t]+p'[t]*p'[t])/6.0]*p'[t]-p[t]*p[t]==0,
p==po, p'==ppo}, p, {t,0,ttop}];


to this

s=NDSolve[{p''[t]-3 Sqrt[8*Pi*(p[t]*p[t]+p'[t]*p'[t])/6.0]*p'[t]-p[t]*p[t]==0,
p==po, p'==ppo}, p, {t,0,ttop}][];


And I believe you will get your desired ParametricPlot.

Look carefully, the change might be easily missed, perhaps look at the value of s from each of those to more easily spot it. Once you find it then study why this makes the difference and why the original version worked with Plot, but not with ParametricPlot.