A quick and dirty introduction to calculus of variations
Piecewise Constant Velocity Advection
hamiltonian