Introduction
I have recently been recommended the textbook Analytical Dynamics: A New Approach, written by Firdaus Udwadia & Robert Kalaba which teaches the most intuitive and versatile method that I have come across for modelling constrained dynamic systems. In this blog post I will give a brief overview of the method and provide a quick demonstration of how it can be used to model a Double Spherical Pendulum problem.
The main innovation presented in the book is the so-called 'Funamdental equation of Analytical Dynamics' which can be simply expressed as:
Variable | Description |
---|---|
Unconstrained acceleration of each particle | |
Constrained acceleration of each particle | |
Vector of positions | |
Mass bmatrix | |
Equality constraint variables | |
Moore Penrose Psudo-Inverse |
The Fundamental equation transforms a complex constrained dynamics problem into two simple sub-problems:
- Determine the unconstrained acceleration of the system. This is typically achieved using Newtons law:
- Express the constraints of the system as an equality constraint:
Through knowledge of Moore-Penrose pseudo-inverse properties, the fundamental equation can be solved symbolically, allowing for a very CPU-efficient expression for the constrained acceleration of the system. However, the problem can also be solved numerically using commands like Matlab's pinv
and Scipy's fractional_bmatrix_power
.
Demonstration
As promised, I will demonstrate how this method can be used to model the dynamics of a Double Spherical Pendulum. This is a system which is very messy to express using Lagrangian Mechanics due to the difficulty in deriving the kinetic energy for a system described using Euler angles, and presumably even harder to solve using Classical Mechanics.
The first sub-problem for this system is trivial to solve since the only external force is from gravity, which can be expressed directly as an acceleration.
For the second sub-problem, the position constraints for each mass of the double-pendulum are written:
Through differentiation (remember your chain-rule!), these can be made to relate the constrained acceleration of the system to its position:
This can be expressed in bmatrix form to identify the & terms required for the fundamental equation.
The Fundamental equation can now be solved and the system simulated using an ODE
That's all that is needed! See below for a quite hypnotic animation of the solution.