The principle of virtual work well known in statics of mechanical systems is a master model for all variational principles of classical physics. I will state a simple version of this principle. The analogue of the principle in Lagrangian formulation of the dynamics will be presented. I will also discuss the Legendre transformation for systems with viscosity and friction forces. Convex analysis will be strongly involved. Contact geometry will not be involved.