Text this: Model Analysis of Environmental and Economic Impacts of a Microgrid Based on the Optimization Method