Talk:Runge–Kutta methods

From Wikipedia, the free encyclopedia

"...on the order of h4" That's the first mention of h in the article. Perhaps it should be explained somewhere? --P3d0 03:28, 11 Jul 2004 (UTC)

Oops, my mistake. It's fine as-is. --P3d0 03:29, 11 Jul 2004 (UTC)


I just wanted to say that it's articles like this that make wikipedia great! It's completely mindboggling that a free encyclopedia can be this much better than many of the expensive dead-tree ones! I especially like the fact that you put up the equation for Runge Kutta-integration up front, and describe it without using unnecessary mathematics. This gives me the impression that you really want people to understand! Some paper encyclopedias seem more worried about fellow nitpicking scientists than getting the message across, so to speak.

Contents

[edit] Comparison

How much better actually is RK4 than Euler's method? For example, when numerically solving a system of linear ODEs, how much bigger can the step h be to give the same level of accuracy, how do they scale? If someone can post an informative answer, it would be appreciated and make the article more beneficial to those wanting to use these methods.


[edit] How to define K_1, K_2, etc -- with h or without h

I can't say if the equations given in the article are wrong, but there: http://search.netscape.com/ns/boomframe.jsp?query=runge+kutta+method&page=1&offset=0&result_url=redir%3Fsrc%3Dwebsearch%26requestId%3D98746ea48585333e%26clickedItemRank%3D1%26userQuery%3Drunge%2Bkutta%2Bmethod%26clickedItemURN%3Dhttp%253A%252F%252Fmathworld.wolfram.com%252FRunge-KuttaMethod.html%26invocationType%3D-%26fromPage%3DnsBrowserRoll%26amp%3BampTest%3D1&remove_url=http%3A%2F%2Fmathworld.wolfram.com%2FRunge-KuttaMethod.html

and in my books, they are a little bit different.

eg.:K3= f(ti+h/2,wi+k2/2) and not f(ti+h/2,wi+k2*h/2)

--anon forgot to sign

You see, you need to multiply by h sooner or later either way. Either you do
k_2 = f ( t_n + h/2, y_n + k_1*h/2)
k_3 = f ( t_n + h/2, y_n + k_2*h/2)
or you do:
k_2 = h*f ( t_n + h/2, y_n + k_1/2)
k_3 = h*f ( t_n + h/2, y_n + k_2/2)
Let me know if this needs more explanation. Oleg Alexandrov 22:34, 31 Mar 2005 (UTC)

[edit] Starting with RK4

I don't quite like the idea of starting with RK4 as it is rather complex, but I thought of starting with a simple two-stage RK method and application thereof, thus elucidating why RK4 is as it is. Does that sound okay? There is a large family of RK methods, we should be aiming to be rather general... Dysprosia 09:49, 15 May 2005 (UTC)

Good point; I agree. My edit of your previous contribution, in which you introduced the general formula, was perhaps too hasty, but I did not like your second-order example (it evaluates f outside the interval [tn,tn + h]) and you changed the definition of the k_i (if I remember correctly); I was further emboldened by Oleg's edit comment. One possible outline for the article is to start with Euler's method, then some second-order method which is still easy to understand, like the midpoint rule, then give the general formula for explicit RK, then some examples, including RK4, and then whatever else you'd like to mention. Also keep in mind that some people think that "Runge-Kutta method" means RK4, so it's probably best to mention very early where RK4 is described. But most importantly, don't listen to me and make any improvements to the article that you see fit. -- Jitse Niesen 13:09, 15 May 2005 (UTC)
Well, call me biased, but I like the article the way it is now. It does refer at the top to numerical ordinary differential equations for general background. Also, indeed, the name "Runge-Kutta method" means most often RK4, as the two-stage method is usually known as midpoint method, or otherwise there also is Heun's method, etc.
But I wonder which two-stage Runge-Kutta Dysprosia is referring to. Maybe there is indeed a way to start even simpler than what is now. However, the section on Explicit Runge-Kutta methods with all those formulas and undertermined coefficients, should indeed stay at the bottom where it is now. Oleg Alexandrov 14:54, 15 May 2005 (UTC)
(Jitse) I did indeed change the definition for the k_i -- it was the one I was more familiar with. It shouldn't be difficult to push the RK4 example to fit that definition, or vice versa.
(Oleg) We can start with any simple two-stage RK method, and a simple example of solving a simple DE with it 'on paper', so to speak.
Dysprosia 23:05, 15 May 2005 (UTC)
Dysprosia, thanks for adding the example (and also the examples in Lagrange polynomial and Newton polynomial). Unfortunately, the table does not look very nice on my laptop, where my screen is a mere 1000-and-a-bit pixels wide. It may also be nice to use a nonautonomous equation. Finally, I'm wondering why you are not using the midpoint method. Sorry for not being more constructive; I have little time now. -- Jitse Niesen 14:35, 21 Jun 2005 (UTC)
Sorry, I spaced out the table so it wouldn't look so cluttered and it would line up properly. I have a wide screen. I'll try and fiddle with it later.
I didn't use the midpoint method, so we would have a greater diversity of examples.
Dysprosia 04:49, 22 Jun 2005 (UTC)
I don't see greater diversity as a good thing, in this case, but fair enough. However, please use a decent method as an example, and not a method with c_i outside the interval [0,1]. You can use for instance
             0 |
           2/3 | 2/3
           ----+----------
               | 1/4  3/4
Of course, a plot would be very nice. Jitse Niesen 12:57, 22 Jun 2005 (UTC)
Sorry, my stupidity -- recalculated. Plot later. Dysprosia 12:05, 23 Jun 2005 (UTC)

[edit] Local error

I removed the last phrase of "The RK4 method is a fourth-order method, meaning that the total accumulated error is on the order of h4, and that it gives the exact integral for polynomials up to the fourth order." because it is not clear for somebody who does not know the subject. To make it clear, it should be explained that methods for solving ODEs can also be used for calculating integrals, that the error in solving ODEs is related to the error in calculating integrals, and that the latter is related to the degree of polynomials that can be integrated exactly. While all this can be done, I think it is not relevant for this article; perhaps it can be added to numerical ordinary differential equations. -- Jitse Niesen 00:03, 8 Jun 2005 (UTC)

[edit] implicit and explicit

This document mentions that Runge-Kutta methods include both implicit and explicit methods, however it doesn't describe the difference between either of these. This should be clarified.