Computationally efficient Newton-Euler models for flexible manipulators with motors at the joints