Optimizing Daily Operation of Battery Energy Storage Systems