Second order non-linear difference equation solver.












0












$begingroup$


Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :



$nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $



with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.



Thank you.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :



    $nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $



    with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.



    Thank you.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :



      $nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $



      with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.



      Thank you.










      share|cite|improve this question









      $endgroup$




      Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :



      $nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $



      with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.



      Thank you.







      algorithms recurrence-relations






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 13 '18 at 15:30









      AlexC75AlexC75

      216




      216






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          Rewrite as
          $$
          u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
          $$



          If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.



          This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.



          In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
          bisection method.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Thank you very much, seems to work perfectly. Great method.
            $endgroup$
            – AlexC75
            Dec 13 '18 at 17:42












          • $begingroup$
            @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
            $endgroup$
            – Federico
            Dec 13 '18 at 17:48













          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: "69"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3038156%2fsecond-order-non-linear-difference-equation-solver%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









          1












          $begingroup$

          Rewrite as
          $$
          u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
          $$



          If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.



          This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.



          In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
          bisection method.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Thank you very much, seems to work perfectly. Great method.
            $endgroup$
            – AlexC75
            Dec 13 '18 at 17:42












          • $begingroup$
            @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
            $endgroup$
            – Federico
            Dec 13 '18 at 17:48


















          1












          $begingroup$

          Rewrite as
          $$
          u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
          $$



          If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.



          This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.



          In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
          bisection method.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Thank you very much, seems to work perfectly. Great method.
            $endgroup$
            – AlexC75
            Dec 13 '18 at 17:42












          • $begingroup$
            @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
            $endgroup$
            – Federico
            Dec 13 '18 at 17:48
















          1












          1








          1





          $begingroup$

          Rewrite as
          $$
          u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
          $$



          If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.



          This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.



          In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
          bisection method.






          share|cite|improve this answer











          $endgroup$



          Rewrite as
          $$
          u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
          $$



          If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.



          This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.



          In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
          bisection method.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Dec 13 '18 at 15:52

























          answered Dec 13 '18 at 15:47









          FedericoFederico

          5,124514




          5,124514












          • $begingroup$
            Thank you very much, seems to work perfectly. Great method.
            $endgroup$
            – AlexC75
            Dec 13 '18 at 17:42












          • $begingroup$
            @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
            $endgroup$
            – Federico
            Dec 13 '18 at 17:48




















          • $begingroup$
            Thank you very much, seems to work perfectly. Great method.
            $endgroup$
            – AlexC75
            Dec 13 '18 at 17:42












          • $begingroup$
            @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
            $endgroup$
            – Federico
            Dec 13 '18 at 17:48


















          $begingroup$
          Thank you very much, seems to work perfectly. Great method.
          $endgroup$
          – AlexC75
          Dec 13 '18 at 17:42






          $begingroup$
          Thank you very much, seems to work perfectly. Great method.
          $endgroup$
          – AlexC75
          Dec 13 '18 at 17:42














          $begingroup$
          @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
          $endgroup$
          – Federico
          Dec 13 '18 at 17:48






          $begingroup$
          @AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
          $endgroup$
          – Federico
          Dec 13 '18 at 17:48




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics 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%2fmath.stackexchange.com%2fquestions%2f3038156%2fsecond-order-non-linear-difference-equation-solver%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

          Bundesstraße 106

          Le Mesnil-Réaume

          Ida-Boy-Ed-Garten