alec-glisman / Swimming-in-Potential-Flow

Study dynamics of inertial active matter in a potential fluid (irrotational, incompressible).
https://doi.org/10.1017/jfm.2022.946
GNU General Public License v3.0
1 stars 0 forks source link

Add calculation of total energy and verify it is conserved #14

Closed alec-glisman closed 2 years ago

alec-glisman commented 2 years ago

TODO list:

alec-glisman commented 2 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?

alec-glisman commented 2 years ago

I looked at my old simulation repository (potential-swimmer-dynamics) and noticed similar behavior.

alec-glisman commented 2 years ago

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)..

Future work:

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.