A theoretical approach to the dynamics of granular materials