Parametric plot from the results of NDSolve
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
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[0] == -1.33, y[0] == 0.88, x[0] == 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]
.
differential-equations
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
3
down vote
favorite
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[0] == -1.33, y[0] == 0.88, x[0] == 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]
.
differential-equations
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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[0] == -1.33, y[0] == 0.88, x[0] == 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]
.
differential-equations
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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[0] == -1.33, y[0] == 0.88, x[0] == 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]
.
differential-equations
differential-equations
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited yesterday


m_goldberg
82.6k869190
82.6k869190
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked yesterday


Logan Jacobs
161
161
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Logan Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
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][[1]]
.
For parametric plot, try this out,
ParametricPlot[solution[t][[1]], solution[t][[2]], t, 0, 10]
and then for 3D
ParametricPlot3D[solution[t][[1]], solution[t][[2]], solution[t][[3]], t, 0, 10]
add a comment |Â
up vote
2
down vote
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[0] == -1.33, y[0] == 0.88, x[0] == 0.33, q , y , x , t, 0,
10]] [[1]]
Now you can plot your results
Plot[Evaluate[ q[t], y[t] /. solution ], t, 0, 10]
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
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][[1]]
.
For parametric plot, try this out,
ParametricPlot[solution[t][[1]], solution[t][[2]], t, 0, 10]
and then for 3D
ParametricPlot3D[solution[t][[1]], solution[t][[2]], solution[t][[3]], t, 0, 10]
add a comment |Â
up vote
3
down vote
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][[1]]
.
For parametric plot, try this out,
ParametricPlot[solution[t][[1]], solution[t][[2]], t, 0, 10]
and then for 3D
ParametricPlot3D[solution[t][[1]], solution[t][[2]], solution[t][[3]], t, 0, 10]
add a comment |Â
up vote
3
down vote
up vote
3
down vote
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][[1]]
.
For parametric plot, try this out,
ParametricPlot[solution[t][[1]], solution[t][[2]], t, 0, 10]
and then for 3D
ParametricPlot3D[solution[t][[1]], solution[t][[2]], solution[t][[3]], t, 0, 10]
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][[1]]
.
For parametric plot, try this out,
ParametricPlot[solution[t][[1]], solution[t][[2]], t, 0, 10]
and then for 3D
ParametricPlot3D[solution[t][[1]], solution[t][[2]], solution[t][[3]], t, 0, 10]
edited yesterday
answered yesterday


zhk
8,50411433
8,50411433
add a comment |Â
add a comment |Â
up vote
2
down vote
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[0] == -1.33, y[0] == 0.88, x[0] == 0.33, q , y , x , t, 0,
10]] [[1]]
Now you can plot your results
Plot[Evaluate[ q[t], y[t] /. solution ], t, 0, 10]
add a comment |Â
up vote
2
down vote
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[0] == -1.33, y[0] == 0.88, x[0] == 0.33, q , y , x , t, 0,
10]] [[1]]
Now you can plot your results
Plot[Evaluate[ q[t], y[t] /. solution ], t, 0, 10]
add a comment |Â
up vote
2
down vote
up vote
2
down vote
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[0] == -1.33, y[0] == 0.88, x[0] == 0.33, q , y , x , t, 0,
10]] [[1]]
Now you can plot your results
Plot[Evaluate[ q[t], y[t] /. solution ], 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[0] == -1.33, y[0] == 0.88, x[0] == 0.33, q , y , x , t, 0,
10]] [[1]]
Now you can plot your results
Plot[Evaluate[ q[t], y[t] /. solution ], t, 0, 10]
answered yesterday
Ulrich Neumann
5,080413
5,080413
add a comment |Â
add a comment |Â
Logan Jacobs is a new contributor. Be nice, and check out our Code of Conduct.
Logan Jacobs is a new contributor. Be nice, and check out our Code of Conduct.
Logan Jacobs is a new contributor. Be nice, and check out our Code of Conduct.
Logan Jacobs is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183302%2fparametric-plot-from-the-results-of-ndsolve%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password