Optimal Control of Mechanical Oscillations by