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









New contributor




Esza 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$
    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
    19 hours ago












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    14 hours ago
















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









New contributor




Esza 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$
    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
    19 hours ago












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    14 hours ago














3












3








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









New contributor




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







$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









New contributor




Esza 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




Esza 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 19 hours ago









b.gatessucks

18k23269




18k23269






New contributor




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









asked 19 hours ago









EszaEsza

161




161




New contributor




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





New contributor





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






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








  • 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
    19 hours ago












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    14 hours ago














  • 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
    19 hours ago












  • $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that
    $endgroup$
    – Esza
    14 hours ago








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
19 hours ago






$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
19 hours ago














$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago




$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago










2 Answers
2






active

oldest

votes


















4












$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
    14 hours ago



















2












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


    }
    });






    Esza 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%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









    4












    $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
      14 hours ago
















    4












    $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
      14 hours ago














    4












    4








    4





    $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 19 hours ago









    kglrkglr

    179k9198410




    179k9198410












    • $begingroup$
      Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
      $endgroup$
      – Esza
      14 hours ago


















    • $begingroup$
      Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
      $endgroup$
      – Esza
      14 hours ago
















    $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
    $endgroup$
    – Esza
    14 hours ago




    $begingroup$
    Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
    $endgroup$
    – Esza
    14 hours ago











    2












    $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$


















      2












      $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$
















        2












        2








        2





        $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 12 hours ago









        Alex TrounevAlex Trounev

        6,4401419




        6,4401419






















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










            draft saved

            draft discarded


















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













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












            Esza 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%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

            Сан-Квентин

            Алькесар

            Josef Freinademetz