inertial system algorithm