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

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.
 
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...
Back
Top