Parametric plot from the results of NDSolve

The name of the pictureThe name of the pictureThe name of the pictureClash 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].










share|improve this question









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.























    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].










    share|improve this question









    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.





















      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].










      share|improve this question









      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






      share|improve this question









      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.











      share|improve this question









      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.









      share|improve this question




      share|improve this question








      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.




















          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]





          share|improve this answer





























            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]


            enter image description here






            share|improve this answer




















              Your Answer




              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("mathjaxEditing", function ()
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
              );
              );
              , "mathjax-editing");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "387"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Logan Jacobs is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              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






























              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]





              share|improve this answer


























                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]





                share|improve this answer
























                  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]





                  share|improve this answer














                  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]






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited yesterday

























                  answered yesterday









                  zhk

                  8,50411433




                  8,50411433




















                      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]


                      enter image description here






                      share|improve this answer
























                        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]


                        enter image description here






                        share|improve this answer






















                          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]


                          enter image description here






                          share|improve this answer












                          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]


                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered yesterday









                          Ulrich Neumann

                          5,080413




                          5,080413




















                              Logan Jacobs is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              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.













                               


                              draft saved


                              draft discarded














                              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













































































                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Displaying single band from multi-band raster using QGIS

                              How many registers does an x86_64 CPU actually have?