High penetration of PV generation is still a challenge predominantly due to the fact that it does not correlate with the normal peak residential demand. In order to address this issue storage is proposed in many cases. Distributed storage also provides an opportunity for customers to control their time of use and energy cost and provides an additional degree of freedom in the optimization of the feeder operation. The rapid expansion of small scale residential PV/storage requires that they become more visible and controllable on the network to avoid any power quality issues and for demand response management. This paper presents an improved algorithm for optimizing the size and cyclic operation of battery storage at a residential level for a grid connected PV/storage system using a hybrid genetic algorithm and pattern search method. The periodic daily or weekly battery state of charge profile is compactly represented by a vector of Fourier coefficients.