Real-Time Optimization and Experimental Validation of Smart Polygeneration Grids With Thermal Storage Device