OPTIMIZATION OF DISTRIBUTED ENERGY RESOURCES PLANNING AND BATTERY