NDsolve with ODE-PDE












3












$begingroup$


Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations



NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];


I have received the following messages




Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].



NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.











share|improve this question











$endgroup$








  • 1




    $begingroup$
    Functions must be defined in the whole area {t,0,3*Pi},{x,0,5}. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x], but then the problem loses its meaning
    $endgroup$
    – Alex Trounev
    Jan 15 at 12:23












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    Jan 15 at 17:38
















3












$begingroup$


Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations



NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];


I have received the following messages




Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].



NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.











share|improve this question











$endgroup$








  • 1




    $begingroup$
    Functions must be defined in the whole area {t,0,3*Pi},{x,0,5}. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x], but then the problem loses its meaning
    $endgroup$
    – Alex Trounev
    Jan 15 at 12:23












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    Jan 15 at 17:38














3












3








3


1



$begingroup$


Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations



NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];


I have received the following messages




Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].



NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.











share|improve this question











$endgroup$




Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations



NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];


I have received the following messages




Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].



NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.








differential-equations






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 15 at 11:55









b.gatessucks

18k23369




18k23369










asked Jan 15 at 11:54









EszaEsza

161




161








  • 1




    $begingroup$
    Functions must be defined in the whole area {t,0,3*Pi},{x,0,5}. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x], but then the problem loses its meaning
    $endgroup$
    – Alex Trounev
    Jan 15 at 12:23












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    Jan 15 at 17:38














  • 1




    $begingroup$
    Functions must be defined in the whole area {t,0,3*Pi},{x,0,5}. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x], but then the problem loses its meaning
    $endgroup$
    – Alex Trounev
    Jan 15 at 12:23












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    Jan 15 at 17:38








1




1




$begingroup$
Functions must be defined in the whole area {t,0,3*Pi},{x,0,5}. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x], but then the problem loses its meaning
$endgroup$
– Alex Trounev
Jan 15 at 12:23






$begingroup$
Functions must be defined in the whole area {t,0,3*Pi},{x,0,5}. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x], but then the problem loses its meaning
$endgroup$
– Alex Trounev
Jan 15 at 12:23














$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
Jan 15 at 17:38




$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
Jan 15 at 17:38










2 Answers
2






active

oldest

votes


















6












$begingroup$

You can solve for F and use that solution to solve for u:



solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
ff = F /. solF;
Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]


enter image description here



solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0, 
u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> {"t", "x", "u[t,x]"}]


enter image description here






share|improve this answer









$endgroup$













  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
    $endgroup$
    – Esza
    Jan 15 at 17:38



















3












$begingroup$

To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr



sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x], 
F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
5}];

{Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "F"],
Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "u"]}


fig1






share|improve this answer









$endgroup$













    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',
    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
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189522%2fndsolve-with-ode-pde%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    6












    $begingroup$

    You can solve for F and use that solution to solve for u:



    solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
    ff = F /. solF;
    Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]


    enter image description here



    solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0, 
    u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
    Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
    AxesLabel -> {"t", "x", "u[t,x]"}]


    enter image description here






    share|improve this answer









    $endgroup$













    • $begingroup$
      Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
      $endgroup$
      – Esza
      Jan 15 at 17:38
















    6












    $begingroup$

    You can solve for F and use that solution to solve for u:



    solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
    ff = F /. solF;
    Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]


    enter image description here



    solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0, 
    u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
    Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
    AxesLabel -> {"t", "x", "u[t,x]"}]


    enter image description here






    share|improve this answer









    $endgroup$













    • $begingroup$
      Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
      $endgroup$
      – Esza
      Jan 15 at 17:38














    6












    6








    6





    $begingroup$

    You can solve for F and use that solution to solve for u:



    solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
    ff = F /. solF;
    Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]


    enter image description here



    solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0, 
    u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
    Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
    AxesLabel -> {"t", "x", "u[t,x]"}]


    enter image description here






    share|improve this answer









    $endgroup$



    You can solve for F and use that solution to solve for u:



    solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
    ff = F /. solF;
    Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]


    enter image description here



    solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0, 
    u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
    Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
    AxesLabel -> {"t", "x", "u[t,x]"}]


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 15 at 12:17









    kglrkglr

    181k10200413




    181k10200413












    • $begingroup$
      Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
      $endgroup$
      – Esza
      Jan 15 at 17:38


















    • $begingroup$
      Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
      $endgroup$
      – Esza
      Jan 15 at 17:38
















    $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
    $endgroup$
    – Esza
    Jan 15 at 17:38




    $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
    $endgroup$
    – Esza
    Jan 15 at 17:38











    3












    $begingroup$

    To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr



    sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x], 
    F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
    Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
    D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
    u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
    5}];

    {Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
    AxesLabel -> Automatic, PlotLabel -> "F"],
    Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
    AxesLabel -> Automatic, PlotLabel -> "u"]}


    fig1






    share|improve this answer









    $endgroup$


















      3












      $begingroup$

      To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr



      sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x], 
      F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
      Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
      D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
      u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
      5}];

      {Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
      AxesLabel -> Automatic, PlotLabel -> "F"],
      Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
      AxesLabel -> Automatic, PlotLabel -> "u"]}


      fig1






      share|improve this answer









      $endgroup$
















        3












        3








        3





        $begingroup$

        To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr



        sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x], 
        F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
        Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
        D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
        u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
        5}];

        {Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
        AxesLabel -> Automatic, PlotLabel -> "F"],
        Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
        AxesLabel -> Automatic, PlotLabel -> "u"]}


        fig1






        share|improve this answer









        $endgroup$



        To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr



        sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x], 
        F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
        Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
        D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
        u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
        5}];

        {Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
        AxesLabel -> Automatic, PlotLabel -> "F"],
        Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
        AxesLabel -> Automatic, PlotLabel -> "u"]}


        fig1







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 15 at 19:01









        Alex TrounevAlex Trounev

        6,8481420




        6,8481420






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189522%2fndsolve-with-ode-pde%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

            How do I know what Microsoft account the skydrive app is syncing to?

            Grease: Live!

            When does type information flow backwards in C++?