Modelling of mechanical systems.Volume 1,Discrete systems