Numerical method for ODEs without frequency error











up vote
0
down vote

favorite












To solve an ODE numerically,

one usually use finite difference methods.



For example,

simple harmonic oscillator, i.e.
$$y''=-omega^2y$$



can be discretized by



$$frac{y_{n+1}-2y_n+y_{n-1}}{Delta x^2}=-omega^2y_n$$



However, if we use this formula to solve the equation,

the frequency of the numerical solution is different from

true frequency $omega$.



Then my question is,

is there any discretization method without frequency error?

For example, is Runge-Kutta method similarly suffer from frequency error?



EDIT

Simple harmonic oscillator is just an example.

My equation is actually PDE (Wave equation).










share|cite|improve this question




























    up vote
    0
    down vote

    favorite












    To solve an ODE numerically,

    one usually use finite difference methods.



    For example,

    simple harmonic oscillator, i.e.
    $$y''=-omega^2y$$



    can be discretized by



    $$frac{y_{n+1}-2y_n+y_{n-1}}{Delta x^2}=-omega^2y_n$$



    However, if we use this formula to solve the equation,

    the frequency of the numerical solution is different from

    true frequency $omega$.



    Then my question is,

    is there any discretization method without frequency error?

    For example, is Runge-Kutta method similarly suffer from frequency error?



    EDIT

    Simple harmonic oscillator is just an example.

    My equation is actually PDE (Wave equation).










    share|cite|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      To solve an ODE numerically,

      one usually use finite difference methods.



      For example,

      simple harmonic oscillator, i.e.
      $$y''=-omega^2y$$



      can be discretized by



      $$frac{y_{n+1}-2y_n+y_{n-1}}{Delta x^2}=-omega^2y_n$$



      However, if we use this formula to solve the equation,

      the frequency of the numerical solution is different from

      true frequency $omega$.



      Then my question is,

      is there any discretization method without frequency error?

      For example, is Runge-Kutta method similarly suffer from frequency error?



      EDIT

      Simple harmonic oscillator is just an example.

      My equation is actually PDE (Wave equation).










      share|cite|improve this question















      To solve an ODE numerically,

      one usually use finite difference methods.



      For example,

      simple harmonic oscillator, i.e.
      $$y''=-omega^2y$$



      can be discretized by



      $$frac{y_{n+1}-2y_n+y_{n-1}}{Delta x^2}=-omega^2y_n$$



      However, if we use this formula to solve the equation,

      the frequency of the numerical solution is different from

      true frequency $omega$.



      Then my question is,

      is there any discretization method without frequency error?

      For example, is Runge-Kutta method similarly suffer from frequency error?



      EDIT

      Simple harmonic oscillator is just an example.

      My equation is actually PDE (Wave equation).







      numerical-methods finite-differences finite-difference-methods






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 13 at 6:23

























      asked Nov 13 at 6:17









      Shu S

      184




      184



























          active

          oldest

          votes











          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',
          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%2f2996381%2fnumerical-method-for-odes-without-frequency-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2996381%2fnumerical-method-for-odes-without-frequency-error%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?