
Gift to Readers

Conducting research involves a profound system of thought, requiring researchers to be logical, meticulous, and earnest. However, effort alone is not enough; often leveraging resources is more important than sheer hard work. Additionally, one must have innovative ideas and inspirations that look up to the stars. It is recommended that readers browse through the content in order to avoid suddenly falling into a dark maze without finding their way back. This article may not reveal all the answers to your questions, but if it can clarify the doubts rising in your mind, it may create a beautiful sunset of colors. If it brings you a storm in your spiritual world, then take the opportunity to brush off the dust that has settled on your “lying flat” state.
Perhaps, after the rain, the sky will be clearer…




01

Overview





The economic scheduling problem of microgrids refers to the optimization of the operation of microgrids considering time-of-use electricity prices, predicting conventional loads, photovoltaic output, and wind turbine output for the next day (the next 24 hours), and making full use of controllable means such as energy storage in the microgrid to optimize the economic operation of the microgrid.
Many scholars have conducted extensive research on this topic. Based on the correlation between electricity prices and load response, they have established a day-ahead scheduling model aimed at minimizing operating costs, maximizing the proportion of renewable energy consumption, and maximizing user satisfaction. To address the uncertainty of new energy output in microgrids, a two-stage day-ahead optimization scheduling framework is proposed from the perspective of grid-connected microgrid operators to reduce system operating costs and risks. Considering the uncertainty of wind power and renewable energy outages, a risk-aware day-ahead stochastic optimization scheduling method for microgrids is proposed. An optimization model for day-ahead scheduling of microgrids can also be proposed with the goal of minimizing operating costs while considering energy storage.
1.1 Microgrid Model
The microgrid model discussed in this article includes: wind turbines, photovoltaic solar panels, grid power interconnection lines, diesel generators, energy storage batteries, and electrical loads.
1.2 Mathematical Model of Economic Scheduling for Microgrids
Objective Function
The objective function of the economic scheduling problem for microgrids is naturally to minimize the total operating cost of the microgrid.
The state of charge of the battery should meet upper and lower limit constraints, and the charging and discharging power of the battery per unit time also has upper and lower limits. There are constraints on the power exchange between the microgrid and the main grid, and wind and solar power can be curtailed. In this case, the objective function is as follows:

Where: 
is the purchase cost of wind power, 
is the purchase price of photovoltaic power, 
is a state variable, which is 0 when the microgrid sells electricity to the main grid and 1 when it purchases electricity. 
is the purchase price of electricity from the main grid for the microgrid, and 
is the selling price of electricity from the microgrid to the main grid. In this equation: 
is the cost from the battery’s charging state to its discharging state.
Constraints
The power balance constraint and inequality constraints are as follows:








02

Operating Results






Note: The example data for Python and Matlab are different, so the results are also different.




03

Partial Code


Download Part 5.


04

References


Some content in this article is sourced from the internet, and references will be noted. If there are any inaccuracies, please feel free to contact us for removal.




05

Matlab|Python Code|Data Download


