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 4 & N-body problem

  1. Aug 27, 2009 #1
    Hello ppl,
    I'm new here.

    I'm trying to compute RK4 for N-body problem. But after computing I'm getting strange numbers. So here are the formulas for these problem.

    Start from two differential equations of first order:

    [1] d[tex]\vec{r}[/tex]/dt = [tex]\vec{v_i}[/tex]

    [2] [tex]\frac{d\vec{v_i}}{dt}[/tex] = [tex]\gamma[/tex] [tex]\sum\frac{m_k}{r_i^{3}}[/tex] * [tex]\vec{r_i}[/tex]

    So steps are:

    [tex]\vec{k1}[/tex] = [tex]\gamma[/tex] [tex]\sum \frac{m}{\left|r_ - r_[j]\right|^2}[/tex] * dt

    [tex]\vec{l_{1}}[/tex] = [tex]\vec{v_{i}} * dt[/tex]

    [tex]\vec{k_{2}}[/tex] = [tex]\gamma[/tex] * [tex]\sum[/tex] [tex]\frac{m_{}}{\vec{(r_{} + \frac{\vec{l_{1}}}{2}}) - (r_{[j]} + \frac{\vec{l_{1}}}{2})} ^2 [/tex] *dt

    [tex]\vec{l_{2}}[/tex] = ( [tex]\vec{v_{i}} *\frac{\vec{k_{1}}}{2}[/tex]) * dt

    [tex]\vec{k_{3}}[/tex] = [tex]\gamma[/tex] * [tex]\sum[/tex] [tex]\frac{m_{}}{\vec{(r_{} + \frac{\vec{l_{2}}}{2}}) - (r_{[j]} + \frac{\vec{l_{2}}}{2})} [/tex] * dt

    [tex]\vec{l_{3}}[/tex] = ( [tex]\vec{v_{i}} *\frac{\vec{k_{2}}}{2}[/tex]) * dt


    [tex]\vec{k_{4}}[/tex] = [tex]\gamma[/tex] * [tex]\frac{m_{}{|(\vec{r_{} + \vec{l_{3}})}) - \vec{r_{} + \vec{l_{3}})} [/tex]

    [tex]\vec{l_{4}}[/tex] = ( [tex]\vec{v_{i}} *\vec{k_{3}}[/tex]) * dt
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Runge kutta 4 & N-body problem
  1. N body problem (Replies: 1)

  2. N-Body Problem - ideas? (Replies: 18)

Loading...