Results 1 to 2 of 2

Math Help - Fourth-order Runge-Kutta for this equation.

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    6

    Question Fourth-order Runge-Kutta for this equation.

    Hi,

    For my 3rd year project I'm meant to code different O.D.E solving algorithms and run them on GPU and compare the results to running them on CPU.

    The first algorithm I am meant to code is the fourth order Runge-Kutta for a O.D.E in the form:
    dx/dt = ax(t), x0 = 0 (I think that is how it is written)

    It's solution is meant to be in the form of x = e^(at)x0 (again, I think)

    Could someone show me how to set up the runge kutta algorithm? I am totally confused about the t and the x in the Runge-Kutta equation.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by kenny View Post
    Hi,

    For my 3rd year project I'm meant to code different O.D.E solving algorithms and run them on GPU and compare the results to running them on CPU.

    The first algorithm I am meant to code is the fourth order Runge-Kutta for a O.D.E in the form:
    dx/dt = ax(t), x0 = 0 (I think that is how it is written)

    It's solution is meant to be in the form of x = e^(at)x0 (again, I think)

    Could someone show me how to set up the runge kutta algorithm? I am totally confused about the t and the x in the Runge-Kutta equation.
    We have an ODE of the form:

    \frac{dx}{dt}=f(x)

    Because t does not appear explicitly on the right-hand-side of the ODE the equations for the 4-order RK algorithm become:

    x_{n+1}=x_n+\frac{h}{6}(k_1+2k_2+2k_3+k_4)

    with:

    k_1=f(x_n)
    k_2=f(x_n+hk_1/2)
    k_3=f(x_n+hk_2/2)
    k_4=f(x_n+hk_3)

    Where x_n=x(nh), so we start from x_0=x(0)=0 and step forward from there.

    The full equations for 4-order RK can be found on the Wikipedia page.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: July 20th 2011, 03:04 PM
  2. Fourth Order Runge-Kutta for two-simultaneous 1st ODE
    Posted in the Math Software Forum
    Replies: 1
    Last Post: November 2nd 2010, 03:43 PM
  3. MATLAB System of ODEs Runge Kutta Fourth order
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: October 6th 2010, 12:33 AM
  4. Fourth-Order Runge-Kutta Method
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: March 4th 2009, 05:32 AM
  5. 4th Order Runge Kutta help
    Posted in the Calculus Forum
    Replies: 0
    Last Post: April 2nd 2008, 08:12 AM

Search Tags


/mathhelpforum @mathhelpforum