Closed alec-glisman closed 3 years ago
It seems that my total energy fluctuates quite a bit. However, both the PF-free and Udwadia-Kalaba schemes give the same fluctuations over the articulation period and match the leading order Taylor expansion for locater point motion. I think I may be calculating the energy wrong?
I looked at my old simulation repository (potential-swimmer-dynamics) and noticed similar behavior.
After doing some research, I remember why this behavior was observed, and why I was not troubled by it.
Total energy (the Hamiltonian) is only conserved when the Lagrangian is not an explicit function of time. As we are enforcing kinematic constraints on the system, the velocity components are an explicit function of time, and therefore the kinetic energy is an explicit function of time. The swimmer has the same energies at the beginning and end of 1 articulation period but varies widely over the period.
For a rigorous derivation, see this StackExchange post (Lagrangian and conservation of energy)..
If I abstract internal dynamics and give each swimmer a given orientation and swimming magnitude, then the Lagrangian is time-independent and I should have a well-defined, time-independent Hamiltonian.
TODO list:
SystemData
PotentialHydrodynamics
GSDUtil