How to apply Runge Kutta method to this equation

40 Views Asked by At

I'm trying to solve three dimensional heat equation. I use the method of lines to discretize the spatial part,and choose five point stencil. I got the following equation:

$$ \frac{\mathrm{d} U}{\mathrm{d} t}= \alpha\left [ \frac{-U_{i-2,j,k}+16U_{i-1,j,k}-30U_{i,j,k}+16U_{i+1,j,k}-U_{i+2,j,k}}{12(\Delta x)^{2}} +\frac{-U_{i,j-2,k}+16U_{i,j-1,k}-30U_{i,j,k}+16U_{i,j+1,k}-U_{i,j+2,k}}{12(\Delta y)^{2}} +\frac{-U_{i,j,k-2}+16U_{i,j,k-1}-30U_{i,j,k}+16U_{i,j,k+1}-U_{i,j,k+2}}{12(\Delta z)^{2}} \right ] $$

I am trying to apply Runge-kutta method of fourth order. Knowing that this is defined as:

$$y_{n+1}= y_{n}+ \frac{1}{6} (k_{1}+ 2k_{2}+2k_{3}+k_{4})\Delta t$$

Being $k_{1}, k_{2},k_{3}$ and $k_{4}$ equal to:

$$k_{1}=f(t_{n},y_{n}), $$

$$k_{2}=f(t_{n}+ \frac{\Delta t}{2},y_{n}+ \frac{\Delta t}{2}k_{1}), $$

$$k_{3}=f(t_{n}+ \frac{\Delta t}{2},y_{n}+ \frac{\Delta t}{2}k_{2}),$$

$$ k_{4}= f(t_{n}+\Delta t, y_{n}+k_{3}\Delta t)$$

Since I have presented the Runge-kutta method in a general way, I would like to understand how to apply it to the problem that I am trying to solve with the method of lines.

I would appreciate your help.