# Help about the numerical computation on the following equations

1. Oct 17, 2007

### PRB147

Dear every memeber, I encountered the numerical computation on the following
differential equations. I use four-step Runge-Kutta methods to integrate, but
the result is not converge, even if I take the time step (t=0.0001).

$$i\frac{dy_1}{dt}=20.0y_2; \\ i\frac{dy_2}{dt}=20.0y_1$$

2. Oct 18, 2007

### HallsofIvy

Staff Emeritus
What do you mean by "converge"? Runge-Kutta gives a specific result, there is no "convegence" involved. Or do you mean "converge, as the time step gets smaller, to the answer I get by integrating directly"?

3. Oct 18, 2007

### J77

Why the "i"?

4. Oct 18, 2007

### PRB147

"i" is the imaginary unit.
I tried Runge-Kutta in IMSL, and code in the well-known book 'numerical recipe'.
They can not give the correct result. The original equations are 2500 differential equations looking like this
$$i\frac{dp_{ij}}{dt}=-50*(p_{i+1,j}+P_{i-1,j})+50*(p_{i,j-1}+P_{i,j+1})))-ip_{ij}/5$$
i,j=1,2,..50.

I can not obtained the correct numerical result.

5. Oct 19, 2007

### timur

Does not look very bad. I think you should first write the equations in the form that does not involve i-s.

6. Oct 19, 2007

### PRB147

Thank you, timur, J77 , Hallsofivy

+50 should be -50.
The problem is that it is high oscillatory, I can obtained the numerical result when
i=1,2,3, and j=1,2,3. when i is larger than 3, the numerical result start to diverge.
That is very tricky

the correct equations should be

$$i\frac{dp_{m,n}}{dt}=-50\times[(p_{m-1,n}+p_{m+1,n})+(p_{m,n-1}+p_{m,n+1})]-ip_{mn}/5$$

i is the the imaginary unit

7. Oct 19, 2007

### PRB147

I solved it.

Last edited: Oct 20, 2007