  We propose an optimization strategy to control the dynamics of a stochastic
system transferred from one thermal equilibrium to another and apply it
experimentally to a Brownian particle in an optical trap under compression.
Based on a variational principle that treats the transfer duration and the
expended work on an equal footing, our strategy leads to a family of protocols
that are either optimally cheap for a given duration or optimally fast for a
given energetic cost. This approach unveils a universal relation $\Delta
t\,\Delta W \ge (\Delta t\,\Delta W)_{\rm opt}$ between the transfer duration
and the expended work. We verify experimentally that the lower bound is reached
only with the optimized protocols.
