Smart integration of renewable energy resources, electrical, and thermal energy storage in microgrid applications