Modeling and Analysis of a Photovoltaic System with a Distributed Energy Storage System