Numerical modeling of mechanical systems