Optimal control of mechanical systems subjected to periodic loading via chebyshev polynomials