Optimal Management and Sizing of Energy Storage under Dynamic Pricing for the Efficient Integration of Renewable Energy