using NDEigensystem to solve the Mathieu equation Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to correctly use DSolve when the force is an impulse (dirac delta) and initial conditions are not zeroIndexing of Large Autonomous System of Equations for Use in NDSolveFEM Solution desired for “Plate with orifice” deflection: Application of Boundary Conditions and use of RegionsSolving an ODE using shooting methodHow to rescale the independent variable?Trouble with shooting method for a 4th-order stiff ODEFinding eigenvalues for Laplacian operator for 3D shape with Neumann boundary conditionsHow do you find the eigenvalues of a PDE (Dynamic Euler-Bernoulli beam)?How to evaluate the PDE solution dependent on the `RegionMarkers"?Using NDEigensystem to solve coupled eigenvalue problem

TV series episode where humans nuke aliens before decrypting their message that states they come in peace

Why isPrototypeOf() returns false?

Why did Europeans not widely domesticate foxes?

Suing a Police Officer Instead of the Police Department

What is /etc/mtab in Linux?

Does a Draconic Bloodline sorcerer's doubled proficiency bonus for Charisma checks against dragons apply to all dragon types or only the chosen one?

What's the difference between using dependency injection with a container and using a service locator?

What does the black goddess statue do and what is it?

Page Layouts : 1 column , 2 columns-left , 2 columns-right , 3 column

Can gravitational waves pass through a black hole?

Coin Game with infinite paradox

What to do with someone that cheated their way though university and a PhD program?

What happened to Viserion in Season 7?

Why do people think Winterfell crypts is the safest place for women, children and old people?

Stretch a Tikz tree

Why did Israel vote against lifting the American embargo on Cuba?

Was Objective-C really a hindrance to Apple software development?

How would it unbalance gameplay to rule that Weapon Master allows for picking a fighting style?

In search of the origins of term censor, I hit a dead end stuck with the greek term, to censor, λογοκρίνω

Where can I find how to tex symbols for different fonts?

Processing ADC conversion result: DMA vs Processor Registers

Israeli soda type drink

Bright yellow or light yellow?

Like totally amazing interchangeable sister outfit accessory swapping or whatever



using NDEigensystem to solve the Mathieu equation



Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How to correctly use DSolve when the force is an impulse (dirac delta) and initial conditions are not zeroIndexing of Large Autonomous System of Equations for Use in NDSolveFEM Solution desired for “Plate with orifice” deflection: Application of Boundary Conditions and use of RegionsSolving an ODE using shooting methodHow to rescale the independent variable?Trouble with shooting method for a 4th-order stiff ODEFinding eigenvalues for Laplacian operator for 3D shape with Neumann boundary conditionsHow do you find the eigenvalues of a PDE (Dynamic Euler-Bernoulli beam)?How to evaluate the PDE solution dependent on the `RegionMarkers"?Using NDEigensystem to solve coupled eigenvalue problem










4












$begingroup$


To be able to apply the differentialequation capabilities of Mathematica to my graduate thesis, I am trying to apply NDEigensystem to an eigenproblem whose solution I know, but I am having some trouble doing so.



As a test problem, I am using an algebraic version of the Mathieu equation,



$$(1-zeta^2)w^primeprime-zeta w^prime+left(a+2q-4qzeta^2right)w=0$$



For this example I set $q=4/3$ and take only the first three eigenpairs:



m = 3; q = 4/3;
op = -(1 - ζ^2) u''[ζ] + ζ u'[ζ] + 2 q (2 ζ^2 - 1) u[ζ];
bc = DirichletCondition[u[ζ] == 0, True];
λ, fl = NDEigensystem[op, bc, u, ζ, 0, 1, m];


I chose the Mathieu equation as a nontrivial example as Mathematica already has a function for it's evaluation:



λt = Table[MathieuCharacteristicB[2 k, q], k, m];
flt = Table[With[j = j,
MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];


The problem is, I do not get the expected eigenvalues!



λ
(* 4.0708, 17.3259, 39.1877 *)
N[λt]
(* 3.85298, 16.0581, 36.0254 *)


And of course, plotting shows that the eigenequation is not satisfied at all:



With[u = fl[[1]], b = λ[[1]],
Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]
With[u = flt[[1]], b = λt[[1]],
Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]


What was wrong with my attempt? If I can get this example to work, I should be able to apply it to my actual, more complicated problem, so any Good Ideas would be welcome.










share|improve this question









New contributor




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







$endgroup$
















    4












    $begingroup$


    To be able to apply the differentialequation capabilities of Mathematica to my graduate thesis, I am trying to apply NDEigensystem to an eigenproblem whose solution I know, but I am having some trouble doing so.



    As a test problem, I am using an algebraic version of the Mathieu equation,



    $$(1-zeta^2)w^primeprime-zeta w^prime+left(a+2q-4qzeta^2right)w=0$$



    For this example I set $q=4/3$ and take only the first three eigenpairs:



    m = 3; q = 4/3;
    op = -(1 - ζ^2) u''[ζ] + ζ u'[ζ] + 2 q (2 ζ^2 - 1) u[ζ];
    bc = DirichletCondition[u[ζ] == 0, True];
    λ, fl = NDEigensystem[op, bc, u, ζ, 0, 1, m];


    I chose the Mathieu equation as a nontrivial example as Mathematica already has a function for it's evaluation:



    λt = Table[MathieuCharacteristicB[2 k, q], k, m];
    flt = Table[With[j = j,
    MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];


    The problem is, I do not get the expected eigenvalues!



    λ
    (* 4.0708, 17.3259, 39.1877 *)
    N[λt]
    (* 3.85298, 16.0581, 36.0254 *)


    And of course, plotting shows that the eigenequation is not satisfied at all:



    With[u = fl[[1]], b = λ[[1]],
    Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]
    With[u = flt[[1]], b = λt[[1]],
    Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]


    What was wrong with my attempt? If I can get this example to work, I should be able to apply it to my actual, more complicated problem, so any Good Ideas would be welcome.










    share|improve this question









    New contributor




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







    $endgroup$














      4












      4








      4





      $begingroup$


      To be able to apply the differentialequation capabilities of Mathematica to my graduate thesis, I am trying to apply NDEigensystem to an eigenproblem whose solution I know, but I am having some trouble doing so.



      As a test problem, I am using an algebraic version of the Mathieu equation,



      $$(1-zeta^2)w^primeprime-zeta w^prime+left(a+2q-4qzeta^2right)w=0$$



      For this example I set $q=4/3$ and take only the first three eigenpairs:



      m = 3; q = 4/3;
      op = -(1 - ζ^2) u''[ζ] + ζ u'[ζ] + 2 q (2 ζ^2 - 1) u[ζ];
      bc = DirichletCondition[u[ζ] == 0, True];
      λ, fl = NDEigensystem[op, bc, u, ζ, 0, 1, m];


      I chose the Mathieu equation as a nontrivial example as Mathematica already has a function for it's evaluation:



      λt = Table[MathieuCharacteristicB[2 k, q], k, m];
      flt = Table[With[j = j,
      MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];


      The problem is, I do not get the expected eigenvalues!



      λ
      (* 4.0708, 17.3259, 39.1877 *)
      N[λt]
      (* 3.85298, 16.0581, 36.0254 *)


      And of course, plotting shows that the eigenequation is not satisfied at all:



      With[u = fl[[1]], b = λ[[1]],
      Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]
      With[u = flt[[1]], b = λt[[1]],
      Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]


      What was wrong with my attempt? If I can get this example to work, I should be able to apply it to my actual, more complicated problem, so any Good Ideas would be welcome.










      share|improve this question









      New contributor




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







      $endgroup$




      To be able to apply the differentialequation capabilities of Mathematica to my graduate thesis, I am trying to apply NDEigensystem to an eigenproblem whose solution I know, but I am having some trouble doing so.



      As a test problem, I am using an algebraic version of the Mathieu equation,



      $$(1-zeta^2)w^primeprime-zeta w^prime+left(a+2q-4qzeta^2right)w=0$$



      For this example I set $q=4/3$ and take only the first three eigenpairs:



      m = 3; q = 4/3;
      op = -(1 - ζ^2) u''[ζ] + ζ u'[ζ] + 2 q (2 ζ^2 - 1) u[ζ];
      bc = DirichletCondition[u[ζ] == 0, True];
      λ, fl = NDEigensystem[op, bc, u, ζ, 0, 1, m];


      I chose the Mathieu equation as a nontrivial example as Mathematica already has a function for it's evaluation:



      λt = Table[MathieuCharacteristicB[2 k, q], k, m];
      flt = Table[With[j = j,
      MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];


      The problem is, I do not get the expected eigenvalues!



      λ
      (* 4.0708, 17.3259, 39.1877 *)
      N[λt]
      (* 3.85298, 16.0581, 36.0254 *)


      And of course, plotting shows that the eigenequation is not satisfied at all:



      With[u = fl[[1]], b = λ[[1]],
      Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]
      With[u = flt[[1]], b = λt[[1]],
      Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], ζ, 0, 1]]


      What was wrong with my attempt? If I can get this example to work, I should be able to apply it to my actual, more complicated problem, so any Good Ideas would be welcome.







      differential-equations finite-element-method






      share|improve this question









      New contributor




      宮川園子 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




      宮川園子 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 49 mins ago









      user21

      21k55998




      21k55998






      New contributor




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









      asked 2 hours ago









      宮川園子宮川園子

      211




      211




      New contributor




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





      New contributor





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






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




















          2 Answers
          2






          active

          oldest

          votes


















          3












          $begingroup$

          If you refine the mesh, you will get closer:



          m = 3; q = 4/3;
          op = -(1 - [Zeta]^2) u''[[Zeta]] + [Zeta] u'[[Zeta]] +
          2 q (2 [Zeta]^2 - 1) u[[Zeta]];
          bc = DirichletCondition[u[[Zeta]] == 0, True];
          [Lambda], fl =
          NDEigensystem[op, bc, u, [Zeta], 0, 1, m,
          Method -> "PDEDiscretization" -> "FiniteElement", "MeshOptions"
          -> "MaxCellMeasure" -> 0.00001];

          [Lambda]
          3.855, 16.074, 36.064

          [Lambda]t = Table[MathieuCharacteristicB[2 k, q], k, m];
          flt = Table[
          With[j = j,
          MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];

          [Lambda]t // N
          3.852, 16.058, 36.025





          share|improve this answer









          $endgroup$




















            2












            $begingroup$

            It looks to me like NDEigensystem is struggling with the singularity at $zeta=1$, as does the method that I'm going to show. But perhaps it'll be useful for you, at least as a cross-check.



            I have a package for numerically calculating solutions of eigenvalue problems using the Evans function via the method of compound matrices, which is hosted on github. See my answers to other questions, the example notebook on the github or this introduction for some more details.



            First we install the package (only need to do this the first time):



            Needs["PacletManager`"]
            PacletInstall["CompoundMatrixMethod",
            "Site" -> "http://raw.githubusercontent.com/paclets/Repository/master"]


            Then we first need to turn the ODEs into a matrix form $mathbfy'=mathbfA cdot mathbfy$, using my function ToMatrixSystem:



            Needs["CompoundMatrixMethod`"]
            sys[ζend_] = ToMatrixSystem[op == a u[ζ], u[0] == 0, u[ζend] == 0, u, ζ, 0, ζend, a]


            Now the function Evans will calculate the Evans function (also known as the Miss-Distance function) for any given value of $a$ and $zeta_end$; this is an analytic function whose roots coincide with eigenvalues of the original equation.



            Plugging in $zeta_end = 1$ fails due to the singularity, but you can try moving the endpoint slightly away:



            FindRoot[Evans[a, sys[1 - 10^-3]], a, 3]
            (* a -> 4.00335 *)


            Moving the endpoint closer approaches the correct value, but I can't get the exact value with this method.



            FindRoot[Evans[a, sys[1 - 10^-10], WorkingPrecision -> 30], a, 3, 
            WorkingPrecision -> 30] // Quiet
            (* a -> 3.85301 *)


            You can see the same effect for the other roots.






            share|improve this answer









            $endgroup$













              Your Answer








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



              );






              宮川園子 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%2f196891%2fusing-ndeigensystem-to-solve-the-mathieu-equation%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









              3












              $begingroup$

              If you refine the mesh, you will get closer:



              m = 3; q = 4/3;
              op = -(1 - [Zeta]^2) u''[[Zeta]] + [Zeta] u'[[Zeta]] +
              2 q (2 [Zeta]^2 - 1) u[[Zeta]];
              bc = DirichletCondition[u[[Zeta]] == 0, True];
              [Lambda], fl =
              NDEigensystem[op, bc, u, [Zeta], 0, 1, m,
              Method -> "PDEDiscretization" -> "FiniteElement", "MeshOptions"
              -> "MaxCellMeasure" -> 0.00001];

              [Lambda]
              3.855, 16.074, 36.064

              [Lambda]t = Table[MathieuCharacteristicB[2 k, q], k, m];
              flt = Table[
              With[j = j,
              MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];

              [Lambda]t // N
              3.852, 16.058, 36.025





              share|improve this answer









              $endgroup$

















                3












                $begingroup$

                If you refine the mesh, you will get closer:



                m = 3; q = 4/3;
                op = -(1 - [Zeta]^2) u''[[Zeta]] + [Zeta] u'[[Zeta]] +
                2 q (2 [Zeta]^2 - 1) u[[Zeta]];
                bc = DirichletCondition[u[[Zeta]] == 0, True];
                [Lambda], fl =
                NDEigensystem[op, bc, u, [Zeta], 0, 1, m,
                Method -> "PDEDiscretization" -> "FiniteElement", "MeshOptions"
                -> "MaxCellMeasure" -> 0.00001];

                [Lambda]
                3.855, 16.074, 36.064

                [Lambda]t = Table[MathieuCharacteristicB[2 k, q], k, m];
                flt = Table[
                With[j = j,
                MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];

                [Lambda]t // N
                3.852, 16.058, 36.025





                share|improve this answer









                $endgroup$















                  3












                  3








                  3





                  $begingroup$

                  If you refine the mesh, you will get closer:



                  m = 3; q = 4/3;
                  op = -(1 - [Zeta]^2) u''[[Zeta]] + [Zeta] u'[[Zeta]] +
                  2 q (2 [Zeta]^2 - 1) u[[Zeta]];
                  bc = DirichletCondition[u[[Zeta]] == 0, True];
                  [Lambda], fl =
                  NDEigensystem[op, bc, u, [Zeta], 0, 1, m,
                  Method -> "PDEDiscretization" -> "FiniteElement", "MeshOptions"
                  -> "MaxCellMeasure" -> 0.00001];

                  [Lambda]
                  3.855, 16.074, 36.064

                  [Lambda]t = Table[MathieuCharacteristicB[2 k, q], k, m];
                  flt = Table[
                  With[j = j,
                  MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];

                  [Lambda]t // N
                  3.852, 16.058, 36.025





                  share|improve this answer









                  $endgroup$



                  If you refine the mesh, you will get closer:



                  m = 3; q = 4/3;
                  op = -(1 - [Zeta]^2) u''[[Zeta]] + [Zeta] u'[[Zeta]] +
                  2 q (2 [Zeta]^2 - 1) u[[Zeta]];
                  bc = DirichletCondition[u[[Zeta]] == 0, True];
                  [Lambda], fl =
                  NDEigensystem[op, bc, u, [Zeta], 0, 1, m,
                  Method -> "PDEDiscretization" -> "FiniteElement", "MeshOptions"
                  -> "MaxCellMeasure" -> 0.00001];

                  [Lambda]
                  3.855, 16.074, 36.064

                  [Lambda]t = Table[MathieuCharacteristicB[2 k, q], k, m];
                  flt = Table[
                  With[j = j,
                  MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], k, m];

                  [Lambda]t // N
                  3.852, 16.058, 36.025






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 45 mins ago









                  user21user21

                  21k55998




                  21k55998





















                      2












                      $begingroup$

                      It looks to me like NDEigensystem is struggling with the singularity at $zeta=1$, as does the method that I'm going to show. But perhaps it'll be useful for you, at least as a cross-check.



                      I have a package for numerically calculating solutions of eigenvalue problems using the Evans function via the method of compound matrices, which is hosted on github. See my answers to other questions, the example notebook on the github or this introduction for some more details.



                      First we install the package (only need to do this the first time):



                      Needs["PacletManager`"]
                      PacletInstall["CompoundMatrixMethod",
                      "Site" -> "http://raw.githubusercontent.com/paclets/Repository/master"]


                      Then we first need to turn the ODEs into a matrix form $mathbfy'=mathbfA cdot mathbfy$, using my function ToMatrixSystem:



                      Needs["CompoundMatrixMethod`"]
                      sys[ζend_] = ToMatrixSystem[op == a u[ζ], u[0] == 0, u[ζend] == 0, u, ζ, 0, ζend, a]


                      Now the function Evans will calculate the Evans function (also known as the Miss-Distance function) for any given value of $a$ and $zeta_end$; this is an analytic function whose roots coincide with eigenvalues of the original equation.



                      Plugging in $zeta_end = 1$ fails due to the singularity, but you can try moving the endpoint slightly away:



                      FindRoot[Evans[a, sys[1 - 10^-3]], a, 3]
                      (* a -> 4.00335 *)


                      Moving the endpoint closer approaches the correct value, but I can't get the exact value with this method.



                      FindRoot[Evans[a, sys[1 - 10^-10], WorkingPrecision -> 30], a, 3, 
                      WorkingPrecision -> 30] // Quiet
                      (* a -> 3.85301 *)


                      You can see the same effect for the other roots.






                      share|improve this answer









                      $endgroup$

















                        2












                        $begingroup$

                        It looks to me like NDEigensystem is struggling with the singularity at $zeta=1$, as does the method that I'm going to show. But perhaps it'll be useful for you, at least as a cross-check.



                        I have a package for numerically calculating solutions of eigenvalue problems using the Evans function via the method of compound matrices, which is hosted on github. See my answers to other questions, the example notebook on the github or this introduction for some more details.



                        First we install the package (only need to do this the first time):



                        Needs["PacletManager`"]
                        PacletInstall["CompoundMatrixMethod",
                        "Site" -> "http://raw.githubusercontent.com/paclets/Repository/master"]


                        Then we first need to turn the ODEs into a matrix form $mathbfy'=mathbfA cdot mathbfy$, using my function ToMatrixSystem:



                        Needs["CompoundMatrixMethod`"]
                        sys[ζend_] = ToMatrixSystem[op == a u[ζ], u[0] == 0, u[ζend] == 0, u, ζ, 0, ζend, a]


                        Now the function Evans will calculate the Evans function (also known as the Miss-Distance function) for any given value of $a$ and $zeta_end$; this is an analytic function whose roots coincide with eigenvalues of the original equation.



                        Plugging in $zeta_end = 1$ fails due to the singularity, but you can try moving the endpoint slightly away:



                        FindRoot[Evans[a, sys[1 - 10^-3]], a, 3]
                        (* a -> 4.00335 *)


                        Moving the endpoint closer approaches the correct value, but I can't get the exact value with this method.



                        FindRoot[Evans[a, sys[1 - 10^-10], WorkingPrecision -> 30], a, 3, 
                        WorkingPrecision -> 30] // Quiet
                        (* a -> 3.85301 *)


                        You can see the same effect for the other roots.






                        share|improve this answer









                        $endgroup$















                          2












                          2








                          2





                          $begingroup$

                          It looks to me like NDEigensystem is struggling with the singularity at $zeta=1$, as does the method that I'm going to show. But perhaps it'll be useful for you, at least as a cross-check.



                          I have a package for numerically calculating solutions of eigenvalue problems using the Evans function via the method of compound matrices, which is hosted on github. See my answers to other questions, the example notebook on the github or this introduction for some more details.



                          First we install the package (only need to do this the first time):



                          Needs["PacletManager`"]
                          PacletInstall["CompoundMatrixMethod",
                          "Site" -> "http://raw.githubusercontent.com/paclets/Repository/master"]


                          Then we first need to turn the ODEs into a matrix form $mathbfy'=mathbfA cdot mathbfy$, using my function ToMatrixSystem:



                          Needs["CompoundMatrixMethod`"]
                          sys[ζend_] = ToMatrixSystem[op == a u[ζ], u[0] == 0, u[ζend] == 0, u, ζ, 0, ζend, a]


                          Now the function Evans will calculate the Evans function (also known as the Miss-Distance function) for any given value of $a$ and $zeta_end$; this is an analytic function whose roots coincide with eigenvalues of the original equation.



                          Plugging in $zeta_end = 1$ fails due to the singularity, but you can try moving the endpoint slightly away:



                          FindRoot[Evans[a, sys[1 - 10^-3]], a, 3]
                          (* a -> 4.00335 *)


                          Moving the endpoint closer approaches the correct value, but I can't get the exact value with this method.



                          FindRoot[Evans[a, sys[1 - 10^-10], WorkingPrecision -> 30], a, 3, 
                          WorkingPrecision -> 30] // Quiet
                          (* a -> 3.85301 *)


                          You can see the same effect for the other roots.






                          share|improve this answer









                          $endgroup$



                          It looks to me like NDEigensystem is struggling with the singularity at $zeta=1$, as does the method that I'm going to show. But perhaps it'll be useful for you, at least as a cross-check.



                          I have a package for numerically calculating solutions of eigenvalue problems using the Evans function via the method of compound matrices, which is hosted on github. See my answers to other questions, the example notebook on the github or this introduction for some more details.



                          First we install the package (only need to do this the first time):



                          Needs["PacletManager`"]
                          PacletInstall["CompoundMatrixMethod",
                          "Site" -> "http://raw.githubusercontent.com/paclets/Repository/master"]


                          Then we first need to turn the ODEs into a matrix form $mathbfy'=mathbfA cdot mathbfy$, using my function ToMatrixSystem:



                          Needs["CompoundMatrixMethod`"]
                          sys[ζend_] = ToMatrixSystem[op == a u[ζ], u[0] == 0, u[ζend] == 0, u, ζ, 0, ζend, a]


                          Now the function Evans will calculate the Evans function (also known as the Miss-Distance function) for any given value of $a$ and $zeta_end$; this is an analytic function whose roots coincide with eigenvalues of the original equation.



                          Plugging in $zeta_end = 1$ fails due to the singularity, but you can try moving the endpoint slightly away:



                          FindRoot[Evans[a, sys[1 - 10^-3]], a, 3]
                          (* a -> 4.00335 *)


                          Moving the endpoint closer approaches the correct value, but I can't get the exact value with this method.



                          FindRoot[Evans[a, sys[1 - 10^-10], WorkingPrecision -> 30], a, 3, 
                          WorkingPrecision -> 30] // Quiet
                          (* a -> 3.85301 *)


                          You can see the same effect for the other roots.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 26 mins ago









                          KraZugKraZug

                          3,49821130




                          3,49821130




















                              宮川園子 is a new contributor. Be nice, and check out our Code of Conduct.









                              draft saved

                              draft discarded


















                              宮川園子 is a new contributor. Be nice, and check out our Code of Conduct.












                              宮川園子 is a new contributor. Be nice, and check out our Code of Conduct.











                              宮川園子 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%2f196891%2fusing-ndeigensystem-to-solve-the-mathieu-equation%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

                              Oświęcim Innehåll Historia | Källor | Externa länkar | Navigeringsmeny50°2′18″N 19°13′17″Ö / 50.03833°N 19.22139°Ö / 50.03833; 19.2213950°2′18″N 19°13′17″Ö / 50.03833°N 19.22139°Ö / 50.03833; 19.221393089658Nordisk familjebok, AuschwitzInsidan tro och existensJewish Community i OświęcimAuschwitz Jewish Center: MuseumAuschwitz Jewish Center

                              Valle di Casies Indice Geografia fisica | Origini del nome | Storia | Società | Amministrazione | Sport | Note | Bibliografia | Voci correlate | Altri progetti | Collegamenti esterni | Menu di navigazione46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)Sito istituzionaleAstat Censimento della popolazione 2011 - Determinazione della consistenza dei tre gruppi linguistici della Provincia Autonoma di Bolzano-Alto Adige - giugno 2012Numeri e fattiValle di CasiesDato IstatTabella dei gradi/giorno dei Comuni italiani raggruppati per Regione e Provincia26 agosto 1993, n. 412Heraldry of the World: GsiesStatistiche I.StatValCasies.comWikimedia CommonsWikimedia CommonsValle di CasiesSito ufficialeValle di CasiesMM14870458910042978-6

                              Typsetting diagram chases (with TikZ?) Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to define the default vertical distance between nodes?Draw edge on arcNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to place nodes in an absolute coordinate system in tikzCommutative diagram with curve connecting between nodesTikz with standalone: pinning tikz coordinates to page cmDrawing a Decision Diagram with Tikz and layout manager