Boundary optimal constant control versus periodic operation