Is the Runge-Kutta Algorithm Equivalent to the Second-Order Taylor Expansion?

mjordan2nd
Messages
173
Reaction score
1

Homework Statement



We're supposed to prove that

[tex]y_{n+1} = y_n + \frac{k_1 + 2k_2 + 2k_3 + k_4}{6}[/tex]
[tex]k_1 = hf(t_n, y_n)[/tex]
[tex]k_2 = hf(t_n + \frac{h}{2}, y_n + \frac{k_1}{2})[/tex]
[tex]k_3 = hf(t_n + \frac{h}{2}, y_n + \frac{k_2}{2})[/tex]
[tex]k_4 = hf(t_n + h, y_n + k_3)[/tex]
[tex]f(t, y) = \frac{dy}{dt}[/tex]

is equivalent to the Taylor expansion up to the second order in step size, h:

[tex]y_{n+1} = y_n + h \frac{dy}{dt} + \frac{1}{2} h^2 \frac{d^2 y}{dt^2}[/tex].

Homework Equations



We can expand a function as follows:

[tex]g(x + \Delta x, y + \Delta y) = g(x,y) + \frac{\partial g}{\partial x} \Delta x + \frac{\partial g}{\partial y} \Delta y.[/tex]

Also, we can write the second time derivative of y as follows:

[tex]\frac{d^2 y}{dt^2} = \frac{df}{dt} = \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial t} = \frac{\partial f}{\partial y} f(t,y) + \frac{\partial f}{\partial t}[/tex].

The Attempt at a Solution



I will use these above equations to expand k2, k3, and k4. I will show all of my work for k2, and state my results for k3 and k4 since they are calculated similarly.

[tex]k_2 = h \left[ f(t_n, y_n) + \frac{df}{dt} \bigg|_n \frac{h}{2} + \frac{df}{dy} \bigg_n h \frac{f(t_n, y_n)}{2} \right][/tex]
[tex]= h \left[f(t_n, y_n) + \left( \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial t} \right)_n \frac{h}{2} + \frac{\partial f}{\partial y} \bigg|_n h \frac{f(t_n, y_n)}{2} \right][/tex]
[tex]= h \left[ f(t_n, y_n) + \frac{df}{dy} f(t_n, y_n) \bigg_n h + \frac{h}{2} \frac{\partial f}{\partial t}[/tex]
 
Physics news on Phys.org
\bigg|_n + \frac{\partial f}{\partial y} \bigg|_n h \frac{f(t_n, y_n)}{2} \right]For k3, we havek_3 = h \left[ f(t_n, y_n) + \frac{df}{dy} f(t_n + \frac{h}{2}, y_n + \frac{k_1}{2}) \bigg|_n h + \frac{h}{2} \frac{\partial f}{\partial t} \bigg|_n + \frac{\partial f}{\partial y} \bigg|_n h \frac{f(t_n + \frac{h}{2}, y_n + \frac{k_1}{2})}{2} \right]And for k4, we havek_4 = h \left[ f(t_n, y_n) + \frac{df}{dy} f(t_n + h, y_n + k_3) \bigg|_n h + \frac{h}{2} \frac{\partial f}{\partial t} \bigg|_n + \frac{\partial f}{\partial y} \bigg|_n h \frac{f(t_n + h, y_n + k_3)}{2} \right]Now, we add these three equations together and multiply by 6. We get 6(y_{n+1} - y_n) = h \left[ 6f(t_n, y_n) + 2 \frac{df}{dy} f(t_n, y_n) \bigg|_n h + 3\frac{h}{2} \frac{\partial f}{\partial t} \bigg|_n + \frac{\partial f}{\partial y} \bigg|_n h \left(3f(t_n, y_n) + f(t_n + \frac{h}{2}, y_n + \frac{k_1}{2}) + f(t_n + h, y_n + k_3) \right) \right].
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K