1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Fourth-order Runge–Kutta method? =(

  1. Sep 20, 2009 #1
    Hey guys, I'm a sophomore in a random engineering school, and just after I was finally getting used to the new school year, my professor decided to give us a little assignment about the 4th order Runge-Kutta methods..... and I am totally stuck, and I just don't understand the concept at all..

    The assignment is,
    (x)`=x^3, and the initial value is x(0) = 1

    I'm supposed to compute x(t) for two steps, when x(0.1) and when x(0.2)
    and Lastly, I'm to compare this to the Euler's method.

    I've been staring at my book for hours, and it says stuff like k and h and n+1 and stuff like that.. Can anyone shed some light into this weird method? The assignment seems simpler than most of the examples I found on the internet but I still can't quite get it..

    Thanks in advance =)
  2. jcsd
  3. Sep 20, 2009 #2
    RK-4 is a numerical method to solve ordinary differential equations. There are 4 k values that have to be computed. Hence the 4 in the name of the method.

    h is the step size.

    The subscript n+1 is the next step.

    The step size can help to control the accuracy of the solution. The smaller the step the more accurate the result will be, up to a certain point.

    Euler's method is the most simplistic of numerical methods to solve ODEs. It is not used to solve ODEs in the real world because it is not accurate enough. But it is taught because it is the easiest to understand.

    However, you have a simple seperable ODE, so just solve it subject to the initial values to find the analytic solution. Use that as a check against your RK-4 and Euler solution. Also, you can gauge the % error once you have both the analytic and numerical approximation to it.

    My ODE book is in my office so if you haven't figured it by Monday, I can give you some good examples.

  4. Sep 20, 2009 #3

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    First, do you understand Euler's method?

    One way to think of RK4 is that it consists of four Euler steps. The first step is particularly easy: It *is* an Euler step, with a step size equal to half of the overall interval. The second step is also a half step, but instead of using the derivative at the starting point you use the derivative at the end of the first step. The third and fourth steps are full steps. For the third step you use the derivative at the end of the second step, and for the fourth step you use a weighted average of the derivatives.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook