Modeling and simulation of nonlinear dynamics in a flexible robot arm