Optimal control law for lot-sizing in a single production facility