Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab Finite difference numerical integration or ode45?

  1. May 17, 2016 #1
    I'm trying to numerically solve the time dependent Schrödinger equation and I've been told that the best approach is to numerically integrate using a finite difference method, however I don't understand why I couldn't just use ode45 to solve it?! Is the finite difference (interpolation) method simply more accurate than ode45 in this case or are there other reasons?
  2. jcsd
  3. May 17, 2016 #2
    The time dependent Schrödinger equation is a partial differential equation, not an ordinary differential equation. One of the more commonly used finite difference schemes for numerically evolving the dynamics of a wavepacket is the Crank-Nicolson method.
  4. May 17, 2016 #3
    Yes, I appreciate that, but if one is solving it for the one-dimensional case it can be treated as an ODE. I was just wondering if in general certain cases are better suited to using ode45 (or other Runge-Kutta like methods), or using interpolation techniques to numerically integrate (using finite difference methods)?!
  5. May 17, 2016 #4


    User Avatar

    Staff: Mentor

    Not the time-dependent Schrödinger equation.

    You can use ODE methods with the TDSE if you express it in terms of a basis set, since you then get a set of coupled ODEs for the basis coefficients.
  6. May 17, 2016 #5
    Technically you can still use RK4 (or related schemes) for the temporal evolution (while discretising the spatial Laplacian part of the Schrodinger equation via finite differences). For the same time step size, this will be faster than implicit methods such as Crank-Nicolson, but it is less stable and in general requires smaller step sizes in order to achieve sufficient accuracy, which is why the Crank-Nicolson method is still largely preferred in most cases.
  7. May 17, 2016 #6
    Is it more efficient to use a finite difference method to integrate in this case then?

    In general, are there cases where it is better to use a finite difference (interpolation) method than using an ODE solver such as ode45?

    Is this because the the time dependent Schrödinger equation is a so-called "stiff" equation? Is this why finite difference techniques are preferred over ODE solvers in certain situations, as the latter can be much less stable?
  8. May 17, 2016 #7


    User Avatar

    Staff: Mentor

    Unless the number of discrete states of the system is small, grid methods are usually more efficient (fewer grid points are needed than basis functions for a similar problem).

    Personally, I prefer the split-operator method, where the kinetic energy operator is dealt with in momentum space, using FFTs.
  9. May 17, 2016 #8
    Why not use PDEPE?
  10. May 18, 2016 #9
    Is that a PDE solver in matlab?
  11. May 18, 2016 #10
    Sorry, I should have linked this the first time: pdepe

    If you post the actual equation (and (b/i)c) you are trying to solve I might be able to help you cast it into the correct form.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Discussions: Finite difference numerical integration or ode45?
  1. Numerical Integration (Replies: 3)

  2. Numerical integration (Replies: 1)