Closed form Newton–Euler dynamic model of flexible manipulators