# Runge Kutta method help

1. Dec 10, 2007

### Cinimod

1. The problem statement, all variables and given/known data
I really am desperate for help on this one.
I need to use the runge kutta method to approximate the motion of an electron in the potential below. The T.I.S.E is known, and I have to try and use the runge kutta method to find the wavefunction of the particle.

$$V(x) = infinity$$ for |x|>1
$$V(x) = 0$$ for 0.2<|x|<1
$$V(x) = 50$$ for |x|<0.2

2. Relevant equations
The time independant schrodinger equation.

3. The attempt at a solution
I don't even know where to start. Any form of help would be appreciated. I have found examples of its implementation from google, but all of the websites found only involve first order differential equations.

2. Dec 10, 2007

### Marco_84

I have made last year a program to solve diff equations, if u want i can send it to u.
But i firts suggest u to start with eulers method than it would be easier to get the runge kutta one.

3. Dec 10, 2007

### Cinimod

I would be very very grateful to have a look at your program, I will study euler's method, see if that helps. I understand the principle of how the ruger kutta method works, but all the examples I have involve 1st order differential equations, I have a second order, and I'm not sure how you deal with coupled differential equations. If I understood that, then the task wouldnt be any where as difficult.

4. Dec 10, 2007

### siddharth

You can reduce higher order diff eqns to a system of first order eqns by an appropriate change of variables. For example, if the equation is,

$$\psi '' + A(x) \psi = B \psi$$

set ,

$$\psi = x1$$
$$\psi ' = x2$$

So that, your system of equations is now

$$x1'=x2$$
$$x2' = \left(B-A(x)\right)x1$$

If,

$$X = \left(\begin{array}{c}x1 \\ x2\end{array}\right)$$

You need to solve,

$$\frac{d}{dt} \left(\begin{array}{c}x1 \\ x2\end{array}\right) = \left(\begin{array}{cc} 0&1 \\ B-A(x)&0\end{array}\right) \left( \begin{array}{c}x1 \\ x2\end{array}\right)$$

If you know the initial values $$\psi(0)$$ and $$\psi'(0)$$, you can use any runge kutta method to the above system. The only difference is that, in this case the values of k1,k2,etc in the rk schemes will be matrices.

Last edited: Dec 10, 2007
5. Dec 11, 2007

### Cinimod

Siddharth. Once again, you have no idea how useful your posts have been. Thank you. That cleared up alot of problems I had.