Analyzis Syzing and Optmization of Energy Storage Systems