NDSolve:PDE system, initial-boundary value problem:warning:NDSolve::mconly: For the method NDSolve`IDA, only...











up vote
1
down vote

favorite












I tried to NDSolve the PDE system
$$partial_t w =xcdot wquadquadpartial_z x=w$$
for
$$(t,z)in[0,1]times[0,pi]$$
with boundary conditions
$$x(t,0)=w(t,0)=w(t,pi)=0$$
and initial conditions
$$w(0,z)=sin zquadquad x(0,z)=1-cos z$$
Here's my code:



s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
D[x[t, z], z] == w[t, z], w[0, z] == Sin[z], x[0, z] == 1 - Cos[z],
w[t, 0] == 0, w[t, π] == 0, x[t, 0] == 0}, {w , x}, {t, 0,
1}, {z, 0, π}]


Mathematica displays the following warning:




"NDSolve::mconly: For the method NDSolve`IDA, only machine real code
is available. Unable to continue with complex values or beyond
floating-point exceptions."




I would appreciate any help on how to overcome this error or solve numerically this kind of PDE system anyway.










share|improve this question




























    up vote
    1
    down vote

    favorite












    I tried to NDSolve the PDE system
    $$partial_t w =xcdot wquadquadpartial_z x=w$$
    for
    $$(t,z)in[0,1]times[0,pi]$$
    with boundary conditions
    $$x(t,0)=w(t,0)=w(t,pi)=0$$
    and initial conditions
    $$w(0,z)=sin zquadquad x(0,z)=1-cos z$$
    Here's my code:



    s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
    D[x[t, z], z] == w[t, z], w[0, z] == Sin[z], x[0, z] == 1 - Cos[z],
    w[t, 0] == 0, w[t, π] == 0, x[t, 0] == 0}, {w , x}, {t, 0,
    1}, {z, 0, π}]


    Mathematica displays the following warning:




    "NDSolve::mconly: For the method NDSolve`IDA, only machine real code
    is available. Unable to continue with complex values or beyond
    floating-point exceptions."




    I would appreciate any help on how to overcome this error or solve numerically this kind of PDE system anyway.










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I tried to NDSolve the PDE system
      $$partial_t w =xcdot wquadquadpartial_z x=w$$
      for
      $$(t,z)in[0,1]times[0,pi]$$
      with boundary conditions
      $$x(t,0)=w(t,0)=w(t,pi)=0$$
      and initial conditions
      $$w(0,z)=sin zquadquad x(0,z)=1-cos z$$
      Here's my code:



      s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
      D[x[t, z], z] == w[t, z], w[0, z] == Sin[z], x[0, z] == 1 - Cos[z],
      w[t, 0] == 0, w[t, π] == 0, x[t, 0] == 0}, {w , x}, {t, 0,
      1}, {z, 0, π}]


      Mathematica displays the following warning:




      "NDSolve::mconly: For the method NDSolve`IDA, only machine real code
      is available. Unable to continue with complex values or beyond
      floating-point exceptions."




      I would appreciate any help on how to overcome this error or solve numerically this kind of PDE system anyway.










      share|improve this question















      I tried to NDSolve the PDE system
      $$partial_t w =xcdot wquadquadpartial_z x=w$$
      for
      $$(t,z)in[0,1]times[0,pi]$$
      with boundary conditions
      $$x(t,0)=w(t,0)=w(t,pi)=0$$
      and initial conditions
      $$w(0,z)=sin zquadquad x(0,z)=1-cos z$$
      Here's my code:



      s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
      D[x[t, z], z] == w[t, z], w[0, z] == Sin[z], x[0, z] == 1 - Cos[z],
      w[t, 0] == 0, w[t, π] == 0, x[t, 0] == 0}, {w , x}, {t, 0,
      1}, {z, 0, π}]


      Mathematica displays the following warning:




      "NDSolve::mconly: For the method NDSolve`IDA, only machine real code
      is available. Unable to continue with complex values or beyond
      floating-point exceptions."




      I would appreciate any help on how to overcome this error or solve numerically this kind of PDE system anyway.







      differential-equations numerical-integration error boundary-conditions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 at 15:45

























      asked Nov 27 at 13:29









      user61386

      467




      467






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          This is a quasilinear hyperbolic system of equations. Not all initial data is valid, w=0 should be excluded from the initial data. An example of solving the problem



          s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
          D[x[t, z], z] == w[t, z], w[0, z] == 1, x[0, z] == 1 - Cos[z],
          w[t, 0] == 1, w[t, [Pi]] == 1, x[t, 0] == 0}, {w, x}, {t, 0,
          1}, {z, 0, [Pi]},
          Method -> {"MethodOfLines",
          "SpatialDiscretization" -> {"TensorProductGrid",
          "MinPoints" -> 80, "MaxPoints" -> 100,
          "DifferenceOrder" -> "Pseudospectral"}}];
          {ContourPlot[Evaluate[w[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "w",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic],
          ContourPlot[Evaluate[x[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "x",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic]}


          fig1






          share|improve this answer





















          • Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
            – user61386
            Nov 27 at 15:05










          • @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
            – Alex Trounev
            Nov 27 at 15:22










          • My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
            – user61386
            Nov 27 at 20:59












          • Sorry, where does this equation come from?
            – Alex Trounev
            Nov 27 at 21:12






          • 1




            Initial and boundary conditions must be consistent.
            – Alex Trounev
            Nov 28 at 10:28











          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: 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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186777%2fndsolvepde-system-initial-boundary-value-problemwarningndsolvemconly-for%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








          up vote
          3
          down vote



          accepted










          This is a quasilinear hyperbolic system of equations. Not all initial data is valid, w=0 should be excluded from the initial data. An example of solving the problem



          s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
          D[x[t, z], z] == w[t, z], w[0, z] == 1, x[0, z] == 1 - Cos[z],
          w[t, 0] == 1, w[t, [Pi]] == 1, x[t, 0] == 0}, {w, x}, {t, 0,
          1}, {z, 0, [Pi]},
          Method -> {"MethodOfLines",
          "SpatialDiscretization" -> {"TensorProductGrid",
          "MinPoints" -> 80, "MaxPoints" -> 100,
          "DifferenceOrder" -> "Pseudospectral"}}];
          {ContourPlot[Evaluate[w[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "w",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic],
          ContourPlot[Evaluate[x[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "x",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic]}


          fig1






          share|improve this answer





















          • Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
            – user61386
            Nov 27 at 15:05










          • @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
            – Alex Trounev
            Nov 27 at 15:22










          • My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
            – user61386
            Nov 27 at 20:59












          • Sorry, where does this equation come from?
            – Alex Trounev
            Nov 27 at 21:12






          • 1




            Initial and boundary conditions must be consistent.
            – Alex Trounev
            Nov 28 at 10:28















          up vote
          3
          down vote



          accepted










          This is a quasilinear hyperbolic system of equations. Not all initial data is valid, w=0 should be excluded from the initial data. An example of solving the problem



          s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
          D[x[t, z], z] == w[t, z], w[0, z] == 1, x[0, z] == 1 - Cos[z],
          w[t, 0] == 1, w[t, [Pi]] == 1, x[t, 0] == 0}, {w, x}, {t, 0,
          1}, {z, 0, [Pi]},
          Method -> {"MethodOfLines",
          "SpatialDiscretization" -> {"TensorProductGrid",
          "MinPoints" -> 80, "MaxPoints" -> 100,
          "DifferenceOrder" -> "Pseudospectral"}}];
          {ContourPlot[Evaluate[w[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "w",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic],
          ContourPlot[Evaluate[x[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "x",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic]}


          fig1






          share|improve this answer





















          • Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
            – user61386
            Nov 27 at 15:05










          • @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
            – Alex Trounev
            Nov 27 at 15:22










          • My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
            – user61386
            Nov 27 at 20:59












          • Sorry, where does this equation come from?
            – Alex Trounev
            Nov 27 at 21:12






          • 1




            Initial and boundary conditions must be consistent.
            – Alex Trounev
            Nov 28 at 10:28













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          This is a quasilinear hyperbolic system of equations. Not all initial data is valid, w=0 should be excluded from the initial data. An example of solving the problem



          s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
          D[x[t, z], z] == w[t, z], w[0, z] == 1, x[0, z] == 1 - Cos[z],
          w[t, 0] == 1, w[t, [Pi]] == 1, x[t, 0] == 0}, {w, x}, {t, 0,
          1}, {z, 0, [Pi]},
          Method -> {"MethodOfLines",
          "SpatialDiscretization" -> {"TensorProductGrid",
          "MinPoints" -> 80, "MaxPoints" -> 100,
          "DifferenceOrder" -> "Pseudospectral"}}];
          {ContourPlot[Evaluate[w[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "w",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic],
          ContourPlot[Evaluate[x[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "x",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic]}


          fig1






          share|improve this answer












          This is a quasilinear hyperbolic system of equations. Not all initial data is valid, w=0 should be excluded from the initial data. An example of solving the problem



          s = NDSolve[{D[w[t, z], t] == w[t, z]*x[t, z], 
          D[x[t, z], z] == w[t, z], w[0, z] == 1, x[0, z] == 1 - Cos[z],
          w[t, 0] == 1, w[t, [Pi]] == 1, x[t, 0] == 0}, {w, x}, {t, 0,
          1}, {z, 0, [Pi]},
          Method -> {"MethodOfLines",
          "SpatialDiscretization" -> {"TensorProductGrid",
          "MinPoints" -> 80, "MaxPoints" -> 100,
          "DifferenceOrder" -> "Pseudospectral"}}];
          {ContourPlot[Evaluate[w[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "w",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic],
          ContourPlot[Evaluate[x[t, z] /. s], {t, 0, 1}, {z, 0, [Pi]},
          Contours -> 20, ColorFunction -> Hue, PlotLabel -> "x",
          FrameLabel -> {"t", "z"}, PlotLegends -> Automatic]}


          fig1







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 27 at 14:44









          Alex Trounev

          5,5951419




          5,5951419












          • Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
            – user61386
            Nov 27 at 15:05










          • @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
            – Alex Trounev
            Nov 27 at 15:22










          • My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
            – user61386
            Nov 27 at 20:59












          • Sorry, where does this equation come from?
            – Alex Trounev
            Nov 27 at 21:12






          • 1




            Initial and boundary conditions must be consistent.
            – Alex Trounev
            Nov 28 at 10:28


















          • Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
            – user61386
            Nov 27 at 15:05










          • @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
            – Alex Trounev
            Nov 27 at 15:22










          • My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
            – user61386
            Nov 27 at 20:59












          • Sorry, where does this equation come from?
            – Alex Trounev
            Nov 27 at 21:12






          • 1




            Initial and boundary conditions must be consistent.
            – Alex Trounev
            Nov 28 at 10:28
















          Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
          – user61386
          Nov 27 at 15:05




          Thanks for great help! Also: how can I see that boundary condition $w(t,0)=0$ is invalid?
          – user61386
          Nov 27 at 15:05












          @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
          – Alex Trounev
          Nov 27 at 15:22




          @user61386 It is necessary to bring the system to a second order equation using $x=w_t/w$ and then $x_z=w=(w_t/w)_z$
          – Alex Trounev
          Nov 27 at 15:22












          My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
          – user61386
          Nov 27 at 20:59






          My only problem is that with the initial conditions used above, i.e. $w(0,z)=1$ and $x(0,z)=1-cos z$, the PDE system equation $partial_t x =w$ seems to fail for $t=0$.
          – user61386
          Nov 27 at 20:59














          Sorry, where does this equation come from?
          – Alex Trounev
          Nov 27 at 21:12




          Sorry, where does this equation come from?
          – Alex Trounev
          Nov 27 at 21:12




          1




          1




          Initial and boundary conditions must be consistent.
          – Alex Trounev
          Nov 28 at 10:28




          Initial and boundary conditions must be consistent.
          – Alex Trounev
          Nov 28 at 10:28


















          draft saved

          draft discarded




















































          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


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


          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%2f186777%2fndsolvepde-system-initial-boundary-value-problemwarningndsolvemconly-for%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

          Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

          ComboBox Display Member on multiple fields

          Is it possible to collect Nectar points via Trainline?