Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Runge-Kutta method for ut = f(x,y)?

  1. Apr 22, 2013 #1

    I am trying to solve something similar to ut = f(x,y), and ut = f(t,x,y) using RK4. I asked a few friends, and nobody knew for sure how to go about it. I've also looked online, without much success. Can anyone give me a hint on this one?

    In reality, it is probably preferable to derive a scheme from the first principle, but if I could avoid this, that would be nice. :smile:

  2. jcsd
  3. Apr 22, 2013 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Sorry, I don't understand your notation.

    R-K algorithms are for solving differential equations, is that what you have?
  4. Apr 22, 2013 #3
    Sorry, how about something like the following?

    [itex]\frac{du}{dt} = x^2 + sin(y)[/itex]
  5. Apr 23, 2013 #4
    Isn't this solved by using simultaneous RK4's?

    I think it's supposed to be u'(t) = f(x,y) and u'(t) = f(t,x,y)? I don't understand the question clearly :eek:
  6. Apr 23, 2013 #5


    User Avatar

    Staff: Mentor

  7. Apr 23, 2013 #6
    ^Thanks, I think that is probably what I was looking for!

    One bonus question, while we're at it. Is there still value to using the RK method for the differential equation I listed in my previous post? That is, one with f(x,y), rather than f(t,x,y)?
  8. Apr 23, 2013 #7


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    If u, x, & y are all functions of t, then I'm pretty sure you need 3 differential equations to solve it. So additionally you need expressions for dx/dt and dy/dt. You can't solve a single differential equation with all those variables, by RK4 or any other means -- unless there is some relation between u, x, & y that you have omitted, or x and y are specified functions of t.

    And if x and y are being treated as dependent variables, so u is supposed to be a function of x, y, & t, then RK4 won't work there either. In that case you need to go to a multivariable method, such as using difference equations or perhaps finite element methods.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook