Analysis and design of photovoltaic battery energy storage problem