  We treat the vakonomic dynamics with general constraints within a new
geometric framework which will be appropriate to study optimal control
problems. We compare our formulation with Vershik-Gershkovich one in the case
of linear constraints. We show how nonholonomic mechanics also admits a new
geometrical description wich enables us to develop an algorithm of comparison
between the solutions of both dynamics. Some examples illustrating the theory
are treated.
