4
$\begingroup$

I consider certain partial differential equation (PDE). For example, let it be heat equation

$$u_t = u_{xx}$$

I want to apply numerical Runge-Kutta method for solving it. As a first step I approximate $u_{xx}$ with difference scheme of several order. Let it be

$$ u_{xx} \approx \frac{u_{i+2} - 2 u_{i+1} + u_i}{h^2} $$ Then I take $t$ as a continious value and want to solve ODE with Runge-Kutta method:

$$u_t = \frac{u_{i+2} - 2 u_{i+1} + u_i}{h^2}$$

Here we may know only $u_0$ and $u_{N}$ values (boundary conditions).

This way I should now replace $u_t$ with difference scheme, for example

$$u_t \approx \frac{u_{\alpha + 1} - u_\alpha}{\tau}$$ (greek indices stand for time-lattice points; all values are taken in given x-lattice point $x_j$). And now I may write the second equation:

$$u_{xx} = \frac{u_{\alpha + 1} - u_\alpha}{\tau} $$ where $x$ is treated as continious value.

So I have a system of ODEs:

$$u_t = \frac{u_{i+2} - 2 u_{i+1} + u_i}{h^2} $$ $$u_{xx} = \frac{u_{\alpha + 1} - u_\alpha}{\tau}$$ with some initial-boundary conditions.

And now the problem is finding a way to solve it numerically (Runge-Kutta method). How should I obtain values that are necessary for solving (e.g. $u_{\alpha+1}$ or $u_{i+2}$)? It's not clear for me because for finding $u_{\alpha+1}$ we should know $u_{i+2}$ and equations are engaging.

$\endgroup$
  • $\begingroup$ You're using a biased approximation for second derivative. The scheme would be unstable whatever time integrator you are using. Your numerical solution at $x_j$ depends only on the right part of the domain $x > x_j$, while the true solution depends on the whole domain. $\endgroup$ – uranix Jun 27 '15 at 12:49
3
$\begingroup$

Assuming you're using method of lines.

Let the original initial-boundary problem be $$ u_t = u_{xx}\\ u(0, x) = f(x)\\ u(t, 0) = a(t)\\ u(t, 1) = b(t). $$ Introduce a set of points $x_j = jh,\; j = 0,1,\dots, N,\;Nh = 1$. Let $u_j(t) = u(t, x_j)$. Note that $u_0(t) = a(t),\; u_N(t) = b(t)$ are already known. Unknown are $u_j(t),\; j = 1, 2, \dots, N-1$. Then $u_{xx}(t, x_j)$ can be approximated as $$ u_{xx}(t, x_j) \approx \frac{u_{j-1}(t) - 2u_j(t) + u_{j+1}(t)}{h^2}. $$ Plugging that into PDE gives $$ u'_j(t) = \frac{u_{j-1}(t) - 2u_j(t) + u_{j+1}(t)}{h^2} $$ a system of $N-1$ ODEs with initial conditions $u_j(0) = f(x_j)$. That could be solved using any RK method (provided that method is stable). For explicit Euler method that would be $$ \frac{u_j(t_{n+1}) - u_j(t_n)}{\tau} = \frac{u_{j-1}(t_n) - 2u_j(t_n) + u_{j+1}(t_n)}{h^2}, \; j = 1, 2, \dots, N-1\\ u_j(0) = f(t_j)\\ u_0(t) = a(t), \; u_N(t) = b(t). $$ This well known explicit scheme is stable when $\frac{\tau}{h^2} \leqslant \frac{1}{2}$.

$\endgroup$
  • $\begingroup$ Oh, thanks a lot. $\endgroup$ – newt Jun 27 '15 at 16:05
  • $\begingroup$ Works well with the Euler time stepping, but other Runge-Kutta methods are not applicable very well... $\endgroup$ – eimrek Nov 16 '15 at 23:27
  • $\begingroup$ The RK2 method I have been introduced to uses a $k_1$ and $k_2$ "Predictor-Corrector" formula. This just looks a lot like finite difference to me. How does it relate to RK? I have a similar question, perhaps even the same, but I can't understand your answer. $\endgroup$ – rocksNwaves Mar 2 '18 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.