Optimal Sizing and Operation of Energy Storage Systems to Mitigate Intermittency of Renewable Energy Resources