Simulation of mechanical systems an introduction