Optimal Control Of Commercial Office Battery Systems, And Grid Integrated Energy Resources On Distribution Networks