davidbrown3 : Analytical Dynamics

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:

X¨=a+M1/2(AM1/2)+(bAa) \ddot X = a + M^{-1/2}(AM^{-1/2})^{+}(b-Aa)

Variable Description
aa Unconstrained acceleration of each particle
X¨\ddot X Constrained acceleration of each particle
XX Vector of positions
MM Mass bmatrix
A,bA, b Equality constraint variables
(  )+(~~)^{+} Moore Penrose Psudo-Inverse

The Fundamental equation transforms a complex constrained dynamics problem into two simple sub-problems:

  1. Determine the unconstrained acceleration of the system. This is typically achieved using Newtons law:

a=M1F a = M^{-1}F

  1. Express the constraints of the system as an equality constraint:

AX¨=b A \cdot \ddot X = b

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.

a=[00g]T a = \begin{bmatrix} 0 & \quad 0 & \quad -g \end{bmatrix}^T

For the second sub-problem, the position constraints for each mass of the double-pendulum are written:

x12+y12+z12L12=0 x_{1}^{2} +y_{1}^{2} + z_{1}^{2}- L_{1}^{2} = 0

(x2x1)2+(y2y1)2+(z2z1)2L22=0 (x_{2} -x_{1})^{2} + (y_{2} - y_{1})^{2} + (z_{2} -z_{1})^{2}- L_{2}^{2} =0

Through differentiation (remember your chain-rule!), these can be made to relate the constrained acceleration of the system to its position:

2x1¨x1+2y1¨y1+2z1¨z1+2x1˙2+2y1˙2+2z1˙2=0 2 \ddot{x_1} x_{1} + 2 \ddot{y_1} y_{1} + 2 \ddot{z_1} {z_{1}} + 2 \dot{x_1}^{2} + 2 \dot{y_1}^{2} + 2 \dot{z_1}^{2}=0

2(x1¨x2¨)(x1x2)+2(y1¨y2¨)(y1y2)+2(z1¨z2¨)(z1z2)+2(x1˙x2˙)2+2(y1˙y2˙)2+2(z1˙z2˙)2=0 2 (\ddot{x_1} - \ddot{x_2}) (x_{1} - {x_{2}}) + 2 (\ddot{y_1} - \ddot{y_2}) (y_{1} - {y_{2}}) + 2 (\ddot{z_1} - \ddot{z_2}) ({z_{1}} - {z_{2}}) + \ldots 2 (\dot{x_1} - \dot{x_2})^{2} + 2 (\dot{y_1} - \dot{y_2})^{2} + 2 (\dot{z_1} - \dot{z_2})^{2}=0

This can be expressed in bmatrix form to identify the AA & bb terms required for the fundamental equation.

[2x12y12z10002x12x22y12y22z12z22x1+2x22y1+2y22z1+2z2][x¨1,y¨1,z¨1,x¨2,y¨2,z¨2]T=[2x1˙22y1˙22z1˙22x1˙2+4x1˙x2˙2x2˙22y1˙2+4y1˙y2˙2y2˙22z1˙2+4z1˙z2˙2z2˙2] \begin{bmatrix}2 x_{1} & 2 y_{1} & 2 z_{1} & 0 & 0 & 0\\2 x_{1} - 2 x_{2} & 2 y_{1} - 2 y_{2} & 2 z_{1} - 2 z_{2} & - 2 x_{1} + 2 x_{2} & - 2 y_{1} + 2 y_{2} & - 2 z_{1} + 2 z_{2}\end{bmatrix} \cdot \begin{bmatrix} \ddot x_1, \quad \ddot y_1, \quad \ddot z_1, \quad \ddot x_2, \quad \ddot y_2, \quad \ddot z_2 \end{bmatrix}^T = \begin{bmatrix}- 2 \dot{x_1}^{2} - 2 \dot{y_1}^{2} - 2 \dot{z_1}^{2}\\- 2 \dot{x_1}^{2} + 4 \dot{x_1} \dot{x_2} - 2 \dot{x_2}^{2} - 2 \dot{y_1}^{2} + 4 \dot{y_1} \dot{y_2} - 2 \dot{y_2}^{2} - 2 \dot{z_1}^{2} + 4 \dot{z_1} \dot{z_2} - 2 \dot{z_2}^{2}\end{bmatrix}

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.