Numerical solution of robot arm inverse kinematics and dynamics