
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 clouds of doubt rising in your mind, it may create a beautiful sunset of insights. 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” mentality.
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 achieve optimal economic operation.
Numerous scholars have conducted extensive research on this topic, establishing a day-ahead scheduling model with the objectives of minimizing operating costs, maximizing the proportion of renewable energy consumption, and maximizing user satisfaction, based on the correlation between electricity prices and load response. 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. Additionally, a microgrid day-ahead scheduling model can be established with the objective 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 for Economic Scheduling of Microgrids
Objective Function
The objective function of the economic scheduling problem of microgrids is naturally to minimize the total operating cost of the microgrid.
The state of charge of the battery must 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 cost of purchasing electricity from wind power, 
is the price of purchasing electricity from photovoltaic sources, 
is a state variable that is 0 when the microgrid sells electricity to the main grid and 1 when it purchases electricity. 
is the price of electricity purchased by the microgrid from the main grid, and 
is the price of electricity sold by the microgrid to the main grid. The term 
represents the cost of the battery transitioning from charging to discharging state.
Constraints
The power balance constraint and inequality constraints are as follows:








02

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


