0

I am struggling with where the slopes in third order Runge Kutta are evaluated and want to replicate a diagram I found for RK4 shown here: RK4 visualization

However, I am mainly struggling with how to visualize the K3 term in RK3. Any tips would be greatly appreciated!

RK3 is given by: $$\dot y = f(t,y) $$ $$y_{n+1} = y_n + \frac{h}{6}(k_1 + 4k_2 + k_3)$$

where, $$k_1 = f(t_n, y_n) $$ $$k_2 = f(t_n + \frac{h}{2}, y_n + \frac{h}{2}k_1) $$ $$k_3 = f(t_n + h, y_n + 2hk_2 - hk_1) $$

Clark
  • 544
  • 2
  • 18
  • I essentially want to know where $k_3$ would be evaluated on the graph similar to how it is depicted in RK4. Basically, what is the $y$ location where $k_3$ is determined (x is $t_n + h$). How can $ y_n + 2hk_2 - hk_1$ be shown on the graph? – Clark Sep 18 '19 at 23:31
  • You could draw a zigzag line $(t,y)\to (t+h,y+hk_2)\to(t,y+hk_2-hk_1)\to (t+h,y+2hk_2-hk_1)$. There is really nothing graphical in the derivation of M. Wilhelm Kutta's methods. He (in the paper of 1901) established the scheme, computed Taylor expansions, found the order conditions, algebraically solved them and looked for solution examples having many zero coefficients or else some symmetry in the coefficients. – Lutz Lehmann Sep 19 '19 at 06:54
  • This graphical view of the method is more compatible with the approach of Karl Heun(1900). He basically took multiple slope fans in the RK4 fashion and then used a linear combination of the final slopes for the step. The intersection of Heun's and Kutta's methods with order 3 or larger is however rather small, in the third order one has the 3rd order Heun method with time increment $0,1/3,2/3$. – Lutz Lehmann Sep 19 '19 at 07:30
  • You should not worry so much about the visualization, because it won't give you any insight in why the method is accurate. It only shows you what the recipe is, though you never implement it graphically but by programming. The real thing is how the terms of the Taylor development cancel-out. –  Sep 19 '19 at 14:06

1 Answers1

2

My attempt to reproduce the cited RK4 visualization looks like this RK4 visualization

The structurally similar Heun3 method can be given a similar visualization $$\begin{array}{ccc} \text{Heun3}&\qquad&\text{RK4}\\ \begin{array}{l|lll} 0&\\ \frac13&\frac13\\ \frac23&0&\frac23\\ \hline &\frac14&0&\frac34 \end{array} && \begin{array}{l|llll} 0&\\ \frac12&\frac12\\ \frac12&0&\frac12\\ 1&0&0&1\\ \hline &\frac16&\frac13&\frac13&\frac16 \end{array} \end{array} $$ Heun3 visualization

For the RK3 method one would have to make sense of the term $2k_2-k_1$. One possibility is to show it as zigzag path $(t,y)\to (t+h,y+hk_2)\to(t,y+h(k_2-k_1))\to (t+h,y+h(2k_2-k_1))$ so that each segment has a previously seen slope.

enter image description here

Lutz Lehmann
  • 132,997