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

Click For Summary
SUMMARY

The discussion focuses on selecting a numerical method for solving a system of second-order nonlinear ordinary differential equations (ODEs) derived from Lagrangian Mechanics for modeling a double pendulum in a Java application. The equations presented involve parameters such as masses (m1, m2), lengths (l1, l2), and gravitational acceleration (g). It is concluded that for a straightforward and efficient implementation, the 4th order explicit Runge-Kutta method is recommended due to its balance of simplicity and speed, despite potential long-term accuracy issues.

PREREQUISITES
  • Understanding of Lagrangian Mechanics
  • Familiarity with second-order nonlinear ordinary differential equations (ODEs)
  • Knowledge of numerical methods, specifically Runge-Kutta methods
  • Basic Java programming skills
NEXT STEPS
  • Research the implementation of the 4th order explicit Runge-Kutta method in Java
  • Study the stability and accuracy of implicit vs. explicit numerical methods
  • Explore advanced techniques for solving nonlinear ODEs
  • Learn about phase space analysis for dynamical systems
USEFUL FOR

Java developers, physicists, and engineers interested in modeling dynamic systems, particularly those working with nonlinear dynamics and numerical methods for ODEs.

MonkOfPhysics
Messages
1
Reaction score
0
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
 
Physics news on Phys.org
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
865
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K