Dynamics of nonlinear dispersive and fluid mechanics equations