# How to use Runge-Kutta 4th order method without direct dependence between variables

Following equation shall be solved using Runge-Kutta method of 4th order: $$\frac{\partial E(z,t)}{\partial z} = \frac{\partial P(t)}{\partial t}$$ $P(t)$ is given as an array, so that the derivative has to be computed numerical.

According to Runge-Kutta method $$f(E,z,t) = \frac{\partial P(t)}{\partial t}$$

The 4th order Runge-Kutta formula is in this case $$E_{i+1}=E_i + \frac{dt}{6}(k_1 + 2k_2 + 2k_3 + k_4)$$ where $$k_1 = f(E,z,t) = \frac{\partial P(t)}{\partial t}$$

In which way are $k_2, k_3, k_4$ formulated and how is $f$ applied in those cases? Is Runge-Kutta a good choice for this kind of problem?

• Please give more context. Is this a partial differential equation or an ordinary differential equation with parameter $t$? What are the initial conditions? – Lutz Lehmann Jan 18 '16 at 19:06

This is trivial to solve, no Runge-Kutta needed: $$E(z,t)=E(z_0,t)+\frac{∂P(t)}{∂t}·(z-z_0)$$ for every fixed parameter $t$.
• These are ODEs. We know $P(t)$ and $E(z_0,t)$ and want $E(z_0+1,t)$. Hereby $E$ has no dependence on $z$ or $z_0$. It behaves like an index. This is why I do not know how to apply your first posted solution. – George713 Jan 18 '16 at 20:29