  The study of stochastic thermodynamic machines is one of the main topics in
nonequilibrium thermodynamics. In this study, within the framework of
Fokker-Planck equation, and using the method of characteristics of partial
differential equation as well as the variational method, performance of
stochastic thermodynamic machines is optimized according to the external
potential, with the irreversible work $W_{irr}$, or the total entropy
production $\Delta S_{\rm tot}$ equivalently, reaching its lower bound.
Properties of the optimal thermodynamic machines are discussed, with explicit
expressions of upper bounds of work output $W$, power $P$, and energy
efficiency $\eta$ are presented. To illustrate the results obtained, typical
examples with optimal protocols (external potentials) are also presented.
