Simulation of the Dynamics of Machinery