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

A basic ODE where Runge Kutta doesn't work?

  1. Dec 29, 2011 #1
    From a cubic function where y(0)=1, y(1)=0, and where there is a local max at y(5/13) I created a basic separable differential equation problem. I wanted to analyze how well different ordered Runge Kutta methods works in an interval [0,1]. Here it is:

    dy/dt=-6(6/13)1/3(y-343/468)2/3 , y(0)=1

    This ODE yields the cubic solution of

    y=1/468(-12t+5)3+343/468

    Now it is clear that y(1)=0

    But using the several Runge Kutta programs with various computer software (mathematica, ti-nspire cas, mathstudio, etc.) yields a complex solutions for y(1). For example, using the classical RK4 with h=.1 yields
    y(1)=0.718779+.005811i.

    I don't see how the programs get a complex solution when all the functions have no even roots. Does anyone what is going on with these programs?
     
  2. jcsd
  3. Dec 29, 2011 #2

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    You have negative numbers in that root for y<343/468. All of the mentioned programs are wont to go to complex numbers ASAP. Those programs will take the principal root. For example, the principal root of (-1)2/3 is (-1+i√3)/2, not 1.
     
    Last edited: Dec 30, 2011
  4. Dec 29, 2011 #3

    I like Serena

    User Avatar
    Homework Helper

    Yep.

    Try dy/dt=-6 (6/13)1/3 ((y-343/468)(y-343/468))1/3 instead.

    By multiplying (y-343/468) with itself first, you make sure that the argument to the power (1/3) is non-negative.
    This way it will do what you intended.
     
  5. Dec 29, 2011 #4
    Thanks that works. I tried ((y-343/468)2)1/3 and that works too.
    Didn't know the programs calculated the principle cube root of negatives by default even if they were complex.
     
  6. Dec 30, 2011 #5

    I like Serena

    User Avatar
    Homework Helper

    Well, basically they don't have a choice.

    What do you think (-1)^0.667 is?
     
  7. Dec 30, 2011 #6

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Nice trick.

    h1a8, this works because of the identity (ab)c=abc.

    This identity is valid if a is positive and b and c are real. It is not valid in general. (The same goes with a lot of other exponentiation identities.)
     
    Last edited: Dec 30, 2011
  8. Dec 30, 2011 #7

    I like Serena

    User Avatar
    Homework Helper

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: A basic ODE where Runge Kutta doesn't work?
  1. Runge kutta (Replies: 4)

Loading...