This post presents piston move animation according to Hamilton mechanics with full real-life physics support solved using C# and WPF. An in-depth derivation of motion equation has been published to help understanding of Hamiliton mechanics. This is tutorial is helpful start-on in various mechanical simulation. Full source code, executable and explanatory pictures are downloadable. As a result easy to use educational animation has been produced that facilitates understanding of piston work and movement.