Marika and I have a dog of our own now, Lorna, and she does the exact same vigorous wagging I described before. Marika even gave her the nickname "Stubby Wigglekins", due to her stubbornness with me, and her crazy wagging for Marika. I'm missing the two of them here in France, but with a bit of mathematical modeling, maybe I can get a temporary Lorna stand-in!
We'll consider the dog in three parts: body, butt, and tail. The two joints connecting these parts act like springs, applying a force to bring them straight. The magnitude of the force depends on how much they're bent:
Lagrangian mechanics are entirely equivalent to Newton's approach, but are often easier to work with in cases where energy is conserved. The technique involves first defining the difference between kinetic and potential energy in the system:
Hamilton's principle says that the integral of this in time should be stationary in the parameters 𝜃1, 𝜃2, and their derivatives. Luckily, we don't actually need to do the integral, and can instead just plug into the general equations this leads to. For each 𝜃, we can write the equation
Much simpler than what I was doing last time, and all because we're working in terms of the angles, and not the x/y position! I decided to put together another HTML5 doodad to experiment with:
Fun to play with, but no substitute for the original!