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

In summary, The conversation discusses the use of Lagrangian Mechanics to find the equations of motion for a double pendulum and the need for a numerical method to solve them. The equations for the system are given, and there is a discussion about the trade-off between implicit and explicit methods. The suggestion is made to use a 4th order explicit Runge-Kutta method for a simple and fast implementation of the double pendulum.
  • #1
MonkOfPhysics
1
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
  • #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.
 

1. What is a numerical method for solving a system of second order nonlinear ODE's?

A common numerical method for solving a system of second order nonlinear ODE's is the Runge-Kutta method. This method involves approximating the solution at each time step using a combination of previous solutions and the ODE itself.

2. How does the Runge-Kutta method work?

The Runge-Kutta method works by first evaluating the ODE at the initial conditions. Then, it calculates a slope at the initial point and uses it to estimate the solution at a midpoint. This midpoint value is then used to calculate a more accurate slope, which is used to estimate the solution at the next time step. This process is repeated until the desired time interval is reached.

3. What are the benefits of using a numerical method for solving ODE's?

Numerical methods offer a way to approximate solutions to complex systems of ODE's that may not have a closed-form solution. They also allow for the inclusion of nonlinear terms, making them more versatile than analytical methods.

4. Are there any limitations to using numerical methods for solving ODE's?

One limitation of numerical methods is that they rely on approximations and therefore may not always provide an exact solution. They also require a large number of computations, which can be time-consuming for complex systems.

5. How can I ensure accuracy when using a numerical method for solving ODE's?

To ensure accuracy, it is important to choose a suitable time step and a high-order numerical method. It is also recommended to compare the results with analytical solutions or solutions obtained using other numerical methods to check for consistency.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
668
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Differential Equations
Replies
1
Views
1K
  • Differential Equations
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
Replies
2
Views
552
Replies
2
Views
2K
  • Differential Equations
Replies
2
Views
884
Replies
14
Views
2K
Back
Top