Design and optimal energy management of community microgrids with flexible renewable energy sources. (January 2022)