Integrated simulation of mechanical structures and their control system