Errors in solving coupled pdes












1












$begingroup$


I am trying to solve following coupled PDEs:
enter image description here
I am not sure about suitable BCs.



 ClearAll[V, Rho, T]
gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
System = {D[V[x, t],t] == -1/gamma/exp[-x/H]*{D[Rho[x, t], x] + D[T[x,
t],x]} + Rho[x, t]/exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
D[Rho[x, t], t] == - D[{exp[-x/H]*V[x, t]}, x],
D[T[x, t], t] == D[{exp[-x/H]*V[x, t]}, x] - V[x, t]*Rho[x, t]*gpara -
gamma*exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
V[x, t] == 0 /. x -> 0,
V[x, t] == 0 /. x -> 1,
Rho[x, t] == 0 /. x -> 0,
Rho[x, t] == 0 /. x -> 1,
T[x, t] == 0 /. x -> 0,
T[x, t] == 0 /. x -> 1,
D[T[x, t], x] == 0 /. x -> 1,
V[x, 0] == Sin[Pi*x/L],
Rho[x, 0] == 0,
T[x, 0] == 0};
{V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]
Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


General::ivar: 3 is not a valid variable.
........
Also, how i can import variable gpara in .txt format to this code?










share|improve this question









New contributor




Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$

















    1












    $begingroup$


    I am trying to solve following coupled PDEs:
    enter image description here
    I am not sure about suitable BCs.



     ClearAll[V, Rho, T]
    gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
    System = {D[V[x, t],t] == -1/gamma/exp[-x/H]*{D[Rho[x, t], x] + D[T[x,
    t],x]} + Rho[x, t]/exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
    D[Rho[x, t], t] == - D[{exp[-x/H]*V[x, t]}, x],
    D[T[x, t], t] == D[{exp[-x/H]*V[x, t]}, x] - V[x, t]*Rho[x, t]*gpara -
    gamma*exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
    V[x, t] == 0 /. x -> 0,
    V[x, t] == 0 /. x -> 1,
    Rho[x, t] == 0 /. x -> 0,
    Rho[x, t] == 0 /. x -> 1,
    T[x, t] == 0 /. x -> 0,
    T[x, t] == 0 /. x -> 1,
    D[T[x, t], x] == 0 /. x -> 1,
    V[x, 0] == Sin[Pi*x/L],
    Rho[x, 0] == 0,
    T[x, 0] == 0};
    {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]
    Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


    General::ivar: 3 is not a valid variable.
    ........
    Also, how i can import variable gpara in .txt format to this code?










    share|improve this question









    New contributor




    Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$















      1












      1








      1





      $begingroup$


      I am trying to solve following coupled PDEs:
      enter image description here
      I am not sure about suitable BCs.



       ClearAll[V, Rho, T]
      gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
      System = {D[V[x, t],t] == -1/gamma/exp[-x/H]*{D[Rho[x, t], x] + D[T[x,
      t],x]} + Rho[x, t]/exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
      D[Rho[x, t], t] == - D[{exp[-x/H]*V[x, t]}, x],
      D[T[x, t], t] == D[{exp[-x/H]*V[x, t]}, x] - V[x, t]*Rho[x, t]*gpara -
      gamma*exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
      V[x, t] == 0 /. x -> 0,
      V[x, t] == 0 /. x -> 1,
      Rho[x, t] == 0 /. x -> 0,
      Rho[x, t] == 0 /. x -> 1,
      T[x, t] == 0 /. x -> 0,
      T[x, t] == 0 /. x -> 1,
      D[T[x, t], x] == 0 /. x -> 1,
      V[x, 0] == Sin[Pi*x/L],
      Rho[x, 0] == 0,
      T[x, 0] == 0};
      {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]
      Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


      General::ivar: 3 is not a valid variable.
      ........
      Also, how i can import variable gpara in .txt format to this code?










      share|improve this question









      New contributor




      Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      I am trying to solve following coupled PDEs:
      enter image description here
      I am not sure about suitable BCs.



       ClearAll[V, Rho, T]
      gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
      System = {D[V[x, t],t] == -1/gamma/exp[-x/H]*{D[Rho[x, t], x] + D[T[x,
      t],x]} + Rho[x, t]/exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
      D[Rho[x, t], t] == - D[{exp[-x/H]*V[x, t]}, x],
      D[T[x, t], t] == D[{exp[-x/H]*V[x, t]}, x] - V[x, t]*Rho[x, t]*gpara -
      gamma*exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
      V[x, t] == 0 /. x -> 0,
      V[x, t] == 0 /. x -> 1,
      Rho[x, t] == 0 /. x -> 0,
      Rho[x, t] == 0 /. x -> 1,
      T[x, t] == 0 /. x -> 0,
      T[x, t] == 0 /. x -> 1,
      D[T[x, t], x] == 0 /. x -> 1,
      V[x, 0] == Sin[Pi*x/L],
      Rho[x, 0] == 0,
      T[x, 0] == 0};
      {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]
      Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


      General::ivar: 3 is not a valid variable.
      ........
      Also, how i can import variable gpara in .txt format to this code?







      differential-equations






      share|improve this question









      New contributor




      Danial 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




      Danial 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 2 hours ago







      Danial













      New contributor




      Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 hours ago









      Danial Danial

      62




      62




      New contributor




      Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Danial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          4












          $begingroup$

          Here is a version that fixes the syntax errors but there is a warning message indicating instability you should look into:



          ClearAll[V, Rho, T]
          gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
          System = {
          D[V[x, t],
          t] == -1/gamma/Exp[-x/H]*(D[Rho[x, t], x] + D[T[x, t], x]) +
          Rho[x, t]/Exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
          D[Rho[x, t], t] == -D[Exp[-x/H]*V[x, t], x],
          D[T[x, t], t] ==
          D[Exp[-x/H]*V[x, t], x] - V[x, t]*Rho[x, t]*gpara -
          gamma*Exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
          V[0, t] == 0, V[1, t] == 0, V[x, 0] == Sin[Pi*x/L],
          Rho[0, t] == 0, Rho[1, t] == 0, Rho[x, 0] == 0,
          T[0, t] == 0, T[1, t] == 0, Derivative[1, 0][T][1, t] == 0,
          T[x, 0] == 0};
          {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]


          enter image description here



          Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


          enter image description here






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
            $endgroup$
            – Danial
            14 mins ago












          • $begingroup$
            @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
            $endgroup$
            – user21
            13 mins ago












          Your Answer








          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Danial 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%2f196892%2ferrors-in-solving-coupled-pdes%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4












          $begingroup$

          Here is a version that fixes the syntax errors but there is a warning message indicating instability you should look into:



          ClearAll[V, Rho, T]
          gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
          System = {
          D[V[x, t],
          t] == -1/gamma/Exp[-x/H]*(D[Rho[x, t], x] + D[T[x, t], x]) +
          Rho[x, t]/Exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
          D[Rho[x, t], t] == -D[Exp[-x/H]*V[x, t], x],
          D[T[x, t], t] ==
          D[Exp[-x/H]*V[x, t], x] - V[x, t]*Rho[x, t]*gpara -
          gamma*Exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
          V[0, t] == 0, V[1, t] == 0, V[x, 0] == Sin[Pi*x/L],
          Rho[0, t] == 0, Rho[1, t] == 0, Rho[x, 0] == 0,
          T[0, t] == 0, T[1, t] == 0, Derivative[1, 0][T][1, t] == 0,
          T[x, 0] == 0};
          {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]


          enter image description here



          Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


          enter image description here






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
            $endgroup$
            – Danial
            14 mins ago












          • $begingroup$
            @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
            $endgroup$
            – user21
            13 mins ago
















          4












          $begingroup$

          Here is a version that fixes the syntax errors but there is a warning message indicating instability you should look into:



          ClearAll[V, Rho, T]
          gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
          System = {
          D[V[x, t],
          t] == -1/gamma/Exp[-x/H]*(D[Rho[x, t], x] + D[T[x, t], x]) +
          Rho[x, t]/Exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
          D[Rho[x, t], t] == -D[Exp[-x/H]*V[x, t], x],
          D[T[x, t], t] ==
          D[Exp[-x/H]*V[x, t], x] - V[x, t]*Rho[x, t]*gpara -
          gamma*Exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
          V[0, t] == 0, V[1, t] == 0, V[x, 0] == Sin[Pi*x/L],
          Rho[0, t] == 0, Rho[1, t] == 0, Rho[x, 0] == 0,
          T[0, t] == 0, T[1, t] == 0, Derivative[1, 0][T][1, t] == 0,
          T[x, 0] == 0};
          {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]


          enter image description here



          Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


          enter image description here






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
            $endgroup$
            – Danial
            14 mins ago












          • $begingroup$
            @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
            $endgroup$
            – user21
            13 mins ago














          4












          4








          4





          $begingroup$

          Here is a version that fixes the syntax errors but there is a warning message indicating instability you should look into:



          ClearAll[V, Rho, T]
          gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
          System = {
          D[V[x, t],
          t] == -1/gamma/Exp[-x/H]*(D[Rho[x, t], x] + D[T[x, t], x]) +
          Rho[x, t]/Exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
          D[Rho[x, t], t] == -D[Exp[-x/H]*V[x, t], x],
          D[T[x, t], t] ==
          D[Exp[-x/H]*V[x, t], x] - V[x, t]*Rho[x, t]*gpara -
          gamma*Exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
          V[0, t] == 0, V[1, t] == 0, V[x, 0] == Sin[Pi*x/L],
          Rho[0, t] == 0, Rho[1, t] == 0, Rho[x, 0] == 0,
          T[0, t] == 0, T[1, t] == 0, Derivative[1, 0][T][1, t] == 0,
          T[x, 0] == 0};
          {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]


          enter image description here



          Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


          enter image description here






          share|improve this answer









          $endgroup$



          Here is a version that fixes the syntax errors but there is a warning message indicating instability you should look into:



          ClearAll[V, Rho, T]
          gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
          System = {
          D[V[x, t],
          t] == -1/gamma/Exp[-x/H]*(D[Rho[x, t], x] + D[T[x, t], x]) +
          Rho[x, t]/Exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
          D[Rho[x, t], t] == -D[Exp[-x/H]*V[x, t], x],
          D[T[x, t], t] ==
          D[Exp[-x/H]*V[x, t], x] - V[x, t]*Rho[x, t]*gpara -
          gamma*Exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
          V[0, t] == 0, V[1, t] == 0, V[x, 0] == Sin[Pi*x/L],
          Rho[0, t] == 0, Rho[1, t] == 0, Rho[x, 0] == 0,
          T[0, t] == 0, T[1, t] == 0, Derivative[1, 0][T][1, t] == 0,
          T[x, 0] == 0};
          {V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]


          enter image description here



          Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          user21user21

          21k55998




          21k55998












          • $begingroup$
            Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
            $endgroup$
            – Danial
            14 mins ago












          • $begingroup$
            @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
            $endgroup$
            – user21
            13 mins ago


















          • $begingroup$
            Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
            $endgroup$
            – Danial
            14 mins ago












          • $begingroup$
            @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
            $endgroup$
            – user21
            13 mins ago
















          $begingroup$
          Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
          $endgroup$
          – Danial
          14 mins ago






          $begingroup$
          Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors?
          $endgroup$
          – Danial
          14 mins ago














          $begingroup$
          @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
          $endgroup$
          – user21
          13 mins ago




          $begingroup$
          @Danial, works for me in V11.3. Try quiting your kernel, perhaps?
          $endgroup$
          – user21
          13 mins ago










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










          draft saved

          draft discarded


















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













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












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
















          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f196892%2ferrors-in-solving-coupled-pdes%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Ponta tanko

          Tantalo (mitologio)

          Erzsébet Schaár