# The condition for stability using the leapfrog method

I have the ODE below

$$\frac{d}{dt}\pmatrix{x\\ y} = \pmatrix{0 &1\\-a &0}\pmatrix{x\\ y} \enspace .$$

The $m=1$ leapfrog method is defined as:

$$y_{n+1} = y_{n-1} + 2f_nh \enspace .$$

For the $a<0$ state, how do I simply find the condition the solution must satisfy for the method to be successful? Further, how do I enforce this in practice?

All you need to do is find the stability criteria for whatever scheme (in this case Leap Frog Method) with respect to the simple model equation:

$$\frac{dz}{dt} = \lambda z$$

for complex $\lambda$. Once you have the stability criteria, you need to find the eigenvalues of the matrix you have in your ODE system. Then just make sure each eigenvalue satisfies the stability criteria. Assuming they do, then you know the method should work.

This is true because if you can diagonalize the ODE system, then you can solve each equation independently. Now that the equations are independent of each other, and since you diagonalized everything, the equations will have the form of the model equation. And so now you can easily check that each independent equation satisfies the stability criteria and ensure it can be integrated. If they can all be integrated individually using your scheme, then the whole system can be integrated with the same scheme (without needing it in a diagonalized form).

With respect to leap frog, keep in mind that it has a small set of $\lambda$ values you can have for it to be stable. This may not be the best scheme to use, if you have the ability to do something else.

A reference I found walking through some of the theory behind the method is located here.

• Thank you :) I think I was just very confused about what I was being asked to do. But yes, what you said makes sense. :) – SomePhysicsStudent Jan 9 '16 at 15:22