Dynamics of Connected Rigid Bodies in a Perfect Fluid
  This paper presents an analytical model and a geometric numerical integrator for a system of rigid bodies connected by ball joints, immersed in an irrotational and incompressible fluid. The rigid bodies can translate and rotate in three-dimensional space, and each joint has three rotational degrees of freedom. This model characterizes the qualitative behavior of three-dimensional fish locomotion. A geometric numerical integrator, refereed to as a Lie group variational integrator, preserves Hamiltonian structures of the presented model and its Lie group configuration manifold. These properties are illustrated by a numerical simulation for a system of three connected rigid bodies. 
Taeyoung Lee, Melvin Leok, N. Harris McClamroch