# Parametric plot from the results of NDSolve

I'm having a bit of trouble making a ParametricPlot from two curves, At fisrt I was having difficulty solving my systems of autonomous ODEs, but then finally got a way to solve it. However, I am now not able to figure out how to get the parametric plot.

solution[t_] =
With[{n = 1.5},
NDSolve[
{q'[t] ==
((q[t]^2)/3)*(3 - n)*x[t]^2 - ((q[t]^2)/3)*n*(y[t] - 1) - ((q[t]^2)/3) + (q[t]*x[t]/3)*(3 - n)*x[t]^2 - (q[t]*x[t]/3)*n*(y[t] - 1) + (q[t]*x[t]/3) + (1/3)*x[t]^2 - (1/3) + (1/3)*((n*y[t]/(n - 1))),
y'[t] ==
((2*y[t]*x[t]^2)/3)*(3 - n)*(x[t] + q[t]) + (2*x[t]*y[t]/3)*((n^2 - 2*n + 2)/(n - 1)) - (2*x[t]*y[t]/3)*n*y[t] + (2*q[t]*n*y[t]*((1 - y[t])/3)),
x'[t] ==
((x[t]^3)/3)*(3 - n)*(q[t] + x[t]) + ((x[t]^2)/3)*n*(2 - y[t]) - 5*((x[t]^2)/3) + (q[t]*x[t]/3)* n*(1 - y[t]) - (q[t]*x[t]) + (1/3)*((n*(n - 2)*y[t])/(n - 1)) - (1/3)*n + 2/3,
q == -1.33, y == 0.88, x == 0.33},
{q[t], y[t],  x[t]}, {t, 0, 10}]][[1, All, 2]]

Plot[solution[t], {t, 0, 10}]


I want to get a parametric plot of q[t] and y[t]. And eventually a 3D plot of q[t], y[t], x[t].

## 2 Answers

The issue you are facing is to correctly call out the desired dependent variables. So, you need to specify the position of the output. For example, you want to have q[x] then you need to use solution[t][].

For parametric plot, try this out,

ParametricPlot[{solution[t][], solution[t][]}, {t, 0, 10}]


and then for 3D

ParametricPlot3D[{solution[t][], solution[t][], solution[t][]}, {t, 0, 10}]


Redefine your solution a little bit to

solution :=
With[{n = 1.5},
NDSolve[{q'[t] == ((q[t]^2)/3)*(3 - n)*x[t]^2 - ((q[t]^2)/3)*
n*(y[t] - 1) - ((q[t]^2)/3) + (q[t]*x[t]/3)*(3 - n)*
x[t]^2 - (q[t]*x[t]/3)*n*(y[t] - 1) + (q[t]*x[t]/3) + (1/3)*
x[t]^2 - (1/3) + (1/3)*((n*y[t]/(n - 1))),
y'[t] == ((2*y[t]*x[t]^2)/3)*(3 - n)*(x[t] + q[t]) + (2*x[t]*
y[t]/3)*((n^2 - 2*n + 2)/(n - 1)) - (2*x[t]*y[t]/3)*n*
y[t] + (2*q[t]*n*y[t]*((1 - y[t])/3)),
x'[t] == ((x[t]^3)/3)*(3 - n)*(q[t] + x[t]) + ((x[t]^2)/3)*
n*(2 - y[t]) -
5*((x[t]^2)/3) + (q[t]*x[t]/3)*
n*(1 - y[t]) - (q[t]*
x[t]) + (1/3)*((n*(n - 2)*y[t])/(n - 1)) - (1/3)*n + 2/3,
q == -1.33, y == 0.88, x == 0.33}, {q , y , x }, {t, 0,
10}]] []


Now you can plot your results

Plot[Evaluate[ {q[t], y[t]} /. solution ], {t, 0, 10}] • Thank you so much for the assist! – Logan Jacobs Oct 10 '18 at 9:51