Generalized solutions of variational problems and applications