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

Numerical method to use on a system of second order nonlinear ODE's

  1. May 21, 2013 #1
    I'm trying to create a java application that models the path of a double pendulum. To do so I have been attempting to use Lagrangian Mechanics to find the equation's of motion for the system. The problem is that I have never seen a set of equations like the one yielded by this method and need help choosing a numerical method to use to solve it. I do not have much experience with numerical methods so please be descriptive in your response. Thank you very much to anyone who reads this and or replies. The equations are

    (m1 + m2) * l1 * (second derivative of θ1) + m2 * l2 * (second derivative of θ2) * cos(θ1-θ2) + m2 * l2 * (derivative of θ2)^2 * sin(θ1 - θ2) + g * (m1 + m2) * sin(θ1) = 0

    m2 * l2 * (second derivative of θ1) + m2 * l1 * (second derivative of θ1) * cos(θ1 - θ2) - m2 * l1 * (derivative of θ1)^2 * sin(θ1 - θ2) + m2 * g * sin(θ2) = 0
  2. jcsd
  3. May 21, 2013 #2
    Here is the trade-off:
    implicit methods are usually more stable and stay accurate for a longer time
    explicit methods are usually less complicated, hence easier to implement and faster

    When you want to have a simple and fast double-pendulum implementation where it doesn't matter that much that after a while it will run out of phase with a real pendulum under the same starting conditions, I'd say that a 4th order explicit Runge-Kutta method is a safe choice for you.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook