Simulation of mechanical gear