4

I'd like to implement the Numerov scheme for solving an ODE (Scroedinger Eq time-independent) with NDSolve. I tried in analogy with the Runge Kutta example in the documentation:

Numerovv[]["Step"[rhs_, h_, t_, x_]] := Module[{},
  -x[t - h] (2 (12 + 5 h^2 rhs[t - h]) )/(-12 + h^2 rhs[t]) + 
   x[t - 2 h] (12 - h^2 rhs[t - 2 h]) /(-12 + h^2 rhs[t])
  ];
Numerovv[___]["StepInput"] = {"F"["T"], "H", "T", "X"};
Numerovv[___]["StepOutput"] = "X";
Numerovv[___]["StepMode"] := Fixed;
Numerovv[___]["DifferenceOrder"] := 4;

But when I select Method -> "Numerovv", I get

The value of the option Method -> Numerovv is not a known built-in method, a symbol that could be a user-defined method, or a list with a name followed by method options. >>

Do I miss something?

Jason B.
  • 68,381
  • 3
  • 139
  • 286
jset
  • 41
  • 1
  • This is not the error I get when I use your code. I get an error about the step function not returning an acceptable form. This is the code I use, and the error message I get is ""The Step function for Method -> Numerovv returned {-1.\
    {1.,0.}[-0.0472329]+2.\ {1.,0.}[-0.0236164],-1.\
    {1.,0.}[-0.0472329]+1.99944\ {1.,0.}[-0.0236164]}, which is not an
    acceptable form.""
    – Jason B. Mar 03 '16 at 10:19
  • In your specification of "StepInput", you define the function to take one variable, which matches the step function, but you don't define "X" to be a variable with an argument. That is one issue, but fixing it doesn't solve the problem. The documentation on user-defined NDSolve methods is scarce. If someone can find more info than that linked in the question I'd be interested to read it. – Jason B. Mar 03 '16 at 10:23
  • 2
    The problem is that the built-in method framework is setup for $\mathbf y^\prime=\mathbf f(x,\mathbf y)$, while Numerov is a method specialized for second order conservative equations, $y^{\prime\prime}=f(x,y)$. An "adapter" would be needed, but I'm drawing a blank on how to write one. – J. M.'s missing motivation Mar 03 '16 at 11:13
  • 1
    Maybe this helps https://www.physics.wisc.edu/~tgwalker/448-9Mathematica/448%20Mathematica/MatrixNumerov.pdf and http://k2.chem.uh.edu/quantum/Supplement/Numerov/ – Mariusz Iwaniuk Mar 03 '16 at 11:51
  • @jset Have you solved the "not an acceptable form" problem?If you do,PLEASE post it.Many thanks. – Turgon Mar 13 '16 at 08:44
  • @J.M. I noticed that Adams method,which is a multistep method,can also be implanted manually into NDSolve.The example is listed along with the Classical RungeKutta example mentioned above.Is it possible to solve this Numerov problem using the same way? – Turgon Mar 14 '16 at 04:52
  • 2
    As I said, the sticking point is not that the method is single- or multistep; it's that NDSolve[]'s framework assumes that methods plugged into it are for $\mathbf y^\prime=\mathbf f(x, \mathbf y)$. Numerov is not a method in that format, so adaptation is necessary. That you might need to figure out. – J. M.'s missing motivation Mar 14 '16 at 05:39

0 Answers0