Implicit Lagrangian equations and the mathematical modeling of physical systems