Optimal periodic control of lumped parameter systems