An IMU tracking algorithm for 3D motion reconstruction using OpenSim dynamical models