Dynamical systems and variational inequalities