Imposing boundary condition and normalization on an ODE

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I want to use DSolve to solve a differential equation while imposing a boundary condition and normalization.



How can I do that?



Let's take for example a simple heat-equation: $y''[x]=a y[x]$.
Easy to solve:



DSolve[y''[x] == a y[x], y[x], x]


I can also impose a no-flux condition at position L, $nabla rho|_L=0$



DSolve[y''[x] == a y[x], y'[L] == 0, y[x], x]


but I cannot (or don't know how to) impose a normalization condition, $int_0^Lrho(x)dx=1$



DSolve[y''[x] == a y[x], y'[L] == 0, Integrate[y[x], x, 0, L] == 1,


When I evaluate the above expression, I obtain the following error:




There are fewer dependent variables than equations, so the system is overdetermined"




But that is something I can do by hand. What is the problem? Is it a bug or am I misunderstanding something?










share|improve this question









New contributor




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























    up vote
    4
    down vote

    favorite












    I want to use DSolve to solve a differential equation while imposing a boundary condition and normalization.



    How can I do that?



    Let's take for example a simple heat-equation: $y''[x]=a y[x]$.
    Easy to solve:



    DSolve[y''[x] == a y[x], y[x], x]


    I can also impose a no-flux condition at position L, $nabla rho|_L=0$



    DSolve[y''[x] == a y[x], y'[L] == 0, y[x], x]


    but I cannot (or don't know how to) impose a normalization condition, $int_0^Lrho(x)dx=1$



    DSolve[y''[x] == a y[x], y'[L] == 0, Integrate[y[x], x, 0, L] == 1,


    When I evaluate the above expression, I obtain the following error:




    There are fewer dependent variables than equations, so the system is overdetermined"




    But that is something I can do by hand. What is the problem? Is it a bug or am I misunderstanding something?










    share|improve this question









    New contributor




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





















      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I want to use DSolve to solve a differential equation while imposing a boundary condition and normalization.



      How can I do that?



      Let's take for example a simple heat-equation: $y''[x]=a y[x]$.
      Easy to solve:



      DSolve[y''[x] == a y[x], y[x], x]


      I can also impose a no-flux condition at position L, $nabla rho|_L=0$



      DSolve[y''[x] == a y[x], y'[L] == 0, y[x], x]


      but I cannot (or don't know how to) impose a normalization condition, $int_0^Lrho(x)dx=1$



      DSolve[y''[x] == a y[x], y'[L] == 0, Integrate[y[x], x, 0, L] == 1,


      When I evaluate the above expression, I obtain the following error:




      There are fewer dependent variables than equations, so the system is overdetermined"




      But that is something I can do by hand. What is the problem? Is it a bug or am I misunderstanding something?










      share|improve this question









      New contributor




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











      I want to use DSolve to solve a differential equation while imposing a boundary condition and normalization.



      How can I do that?



      Let's take for example a simple heat-equation: $y''[x]=a y[x]$.
      Easy to solve:



      DSolve[y''[x] == a y[x], y[x], x]


      I can also impose a no-flux condition at position L, $nabla rho|_L=0$



      DSolve[y''[x] == a y[x], y'[L] == 0, y[x], x]


      but I cannot (or don't know how to) impose a normalization condition, $int_0^Lrho(x)dx=1$



      DSolve[y''[x] == a y[x], y'[L] == 0, Integrate[y[x], x, 0, L] == 1,


      When I evaluate the above expression, I obtain the following error:




      There are fewer dependent variables than equations, so the system is overdetermined"




      But that is something I can do by hand. What is the problem? Is it a bug or am I misunderstanding something?







      differential-equations boundary-conditions






      share|improve this question









      New contributor




      user134414 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




      user134414 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 1 hour ago









      m_goldberg

      83.2k870191




      83.2k870191






      New contributor




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









      asked 1 hour ago









      user134414

      211




      211




      New contributor




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





      New contributor





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






      user134414 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

















          up vote
          5
          down vote













          You can solve your problem by introducing a second ode (defining the antiderivative):



          sol = 
          DSolve[y''[x] == a y[x], Y'[x] == y[x], y'[L] == 0, Y[L] == 1, y, Y, x][[1]]

          y ->
          Function[x,
          (E^(-Sqrt[a] x) (E^(2 Sqrt[a] L) + E^(2 Sqrt[a] x)) C[1])/(1 + E^(2 Sqrt[a] L))],
          Y ->
          Function[x,
          (E^(-Sqrt[a] x)
          (Sqrt[a] E^(Sqrt[a] x) +Sqrt[a] E^(2 Sqrt[a] L + Sqrt[a] x) -
          E^(2 Sqrt[a] L) C[1] + E^(2 Sqrt[a] x) C[1])) /
          (Sqrt[a] (1 + E^(2 Sqrt[a] L)))]





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



            );






            user134414 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%2f184459%2fimposing-boundary-condition-and-normalization-on-an-ode%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote













            You can solve your problem by introducing a second ode (defining the antiderivative):



            sol = 
            DSolve[y''[x] == a y[x], Y'[x] == y[x], y'[L] == 0, Y[L] == 1, y, Y, x][[1]]

            y ->
            Function[x,
            (E^(-Sqrt[a] x) (E^(2 Sqrt[a] L) + E^(2 Sqrt[a] x)) C[1])/(1 + E^(2 Sqrt[a] L))],
            Y ->
            Function[x,
            (E^(-Sqrt[a] x)
            (Sqrt[a] E^(Sqrt[a] x) +Sqrt[a] E^(2 Sqrt[a] L + Sqrt[a] x) -
            E^(2 Sqrt[a] L) C[1] + E^(2 Sqrt[a] x) C[1])) /
            (Sqrt[a] (1 + E^(2 Sqrt[a] L)))]





            share|improve this answer


























              up vote
              5
              down vote













              You can solve your problem by introducing a second ode (defining the antiderivative):



              sol = 
              DSolve[y''[x] == a y[x], Y'[x] == y[x], y'[L] == 0, Y[L] == 1, y, Y, x][[1]]

              y ->
              Function[x,
              (E^(-Sqrt[a] x) (E^(2 Sqrt[a] L) + E^(2 Sqrt[a] x)) C[1])/(1 + E^(2 Sqrt[a] L))],
              Y ->
              Function[x,
              (E^(-Sqrt[a] x)
              (Sqrt[a] E^(Sqrt[a] x) +Sqrt[a] E^(2 Sqrt[a] L + Sqrt[a] x) -
              E^(2 Sqrt[a] L) C[1] + E^(2 Sqrt[a] x) C[1])) /
              (Sqrt[a] (1 + E^(2 Sqrt[a] L)))]





              share|improve this answer
























                up vote
                5
                down vote










                up vote
                5
                down vote









                You can solve your problem by introducing a second ode (defining the antiderivative):



                sol = 
                DSolve[y''[x] == a y[x], Y'[x] == y[x], y'[L] == 0, Y[L] == 1, y, Y, x][[1]]

                y ->
                Function[x,
                (E^(-Sqrt[a] x) (E^(2 Sqrt[a] L) + E^(2 Sqrt[a] x)) C[1])/(1 + E^(2 Sqrt[a] L))],
                Y ->
                Function[x,
                (E^(-Sqrt[a] x)
                (Sqrt[a] E^(Sqrt[a] x) +Sqrt[a] E^(2 Sqrt[a] L + Sqrt[a] x) -
                E^(2 Sqrt[a] L) C[1] + E^(2 Sqrt[a] x) C[1])) /
                (Sqrt[a] (1 + E^(2 Sqrt[a] L)))]





                share|improve this answer














                You can solve your problem by introducing a second ode (defining the antiderivative):



                sol = 
                DSolve[y''[x] == a y[x], Y'[x] == y[x], y'[L] == 0, Y[L] == 1, y, Y, x][[1]]

                y ->
                Function[x,
                (E^(-Sqrt[a] x) (E^(2 Sqrt[a] L) + E^(2 Sqrt[a] x)) C[1])/(1 + E^(2 Sqrt[a] L))],
                Y ->
                Function[x,
                (E^(-Sqrt[a] x)
                (Sqrt[a] E^(Sqrt[a] x) +Sqrt[a] E^(2 Sqrt[a] L + Sqrt[a] x) -
                E^(2 Sqrt[a] L) C[1] + E^(2 Sqrt[a] x) C[1])) /
                (Sqrt[a] (1 + E^(2 Sqrt[a] L)))]






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 26 mins ago









                m_goldberg

                83.2k870191




                83.2k870191










                answered 1 hour ago









                Ulrich Neumann

                5,330413




                5,330413




















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









                     

                    draft saved


                    draft discarded


















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












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











                    user134414 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%2f184459%2fimposing-boundary-condition-and-normalization-on-an-ode%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    How to decode/decipher Mozilla Firefox proprietary .jsonlz4 format? (sessionstore-backups/recovery.jsonlz4)

                    White Anglo-Saxon Protestant

                    How to be valuable when automation & IT are stealing my job (and maybe my whole career)? [closed]