Multi-distributed resource coordination based on GAMS (general algebraic modeling system)

To achieve the economic operation of distributed energy resources in the grid, a GAMS-based multi-distributed resource optimization and control method is proposed. Firstly, considering the coexistence of electricity load and heat load in the grid system, a virtual power plant structure involving heat generation from distributed energy is established. Secondly, the General Algebraic Modeling System (GAMS) is utilized to create a detailed mathematical model for the distributed resources within the virtual grid. Subsequently, considering the influence of various uncertain factors, the CLPEX solver is employed for optimization and solution. Research results indicate that during the operation of the virtual power plant, the introduction of system heat load significantly enhances the expected profit and improves the economic efficiency of the operation.


Introduction
In response to global environmental concerns about climate change, governments around the world are gradually shifting their focus towards reducing carbon emissions in the energy sector [1].Rapid development of renewable energy generation has emerged as a key measure for reducing carbon emissions in the power industry [2].Wind power and solar photovoltaics (PV) are the primary forms of renewable energy generation.However, due to the influence of natural conditions, the output of renewable energy sources exhibits fluctuations and uncertainties [3].This poses challenges to the stable operation of modern power systems, leading to issues such as low utilization rates and difficulties in integrating these sources [4][5][6].Consequently, to ensure grid stability and enhance the absorption capacity of renewable energy, the optimization and scheduling of Distributed Energy Resources (DERs) has become a research hotspot.
To address the optimization and scheduling challenges of integrating distributed energy resources into power systems, the concept of a Virtual Power Plant (VPP) was introduced in [7].A VPP does not alter the individual grid connection methods of various distributed generation systems.Instead, it employs advanced control, metering, and communication technologies to aggregate different DERs, such as distributed generation, energy storage systems, and controllable loads.This enables the coordinated optimization of multiple DERs, facilitating more effective resource allocation and utilization.In [8], an optimization scheduling method for VPPs was proposed, considering the impact of grid transmission characteristics.This method enhances feasibility by avoiding constraint violations, albeit without accounting for economic aspects.In order to enhance energy utilization efficiency and economic performance of VPPs, in [9], researchers presented a multi-objective two-stage optimization scheduling algorithm that simultaneously considers low-carbon dispatch strategies.This algorithm minimizes costs by optimizing the production and consumption of various energy sources.In [10], a bilayer optimization model was proposed considering incentive-based demand response (IDR) to optimize the operation scheduling of urban VPP.
Most of the aforementioned studies have largely overlooked the interplay of thermal energy exchange within the system despite the coexistence of electrical and thermal energies in practical systems [11].This paper considers the coexistence of electrical and thermal loads in the power grid system.Building upon the General Algebraic Modeling System (GAMS), a multi-Distributed Energy Resource (DER) model for virtual power networks is developed to account for the heat production from renewable sources.The model is then subjected to optimization and control processes, followed by simulation validation using the IEEE 33 bus system.

The structure of the virtual power plant.
The virtual power plant utilizes distributed resources to supply energy to the electrical and heat loads within the system.Additionally, energy exchange occurs between the electrical energy within the system and the main power grid.The energy management system of the virtual power plant is illustrated in Figure 1.

Mathematical model of the virtual power plant
The virtual power plant studied in this paper is comprised of wind power generation, photovoltaic power generation, combined heat and power systems, conventional generator units, photovoltaic-thermal systems, boilers, and energy storage systems.The objective function aims to optimize the scheduling of distributed resources within the system to maximize the benefits of the virtual power plant.The following section provides mathematical modeling for each distributed resource.

Wind power generation
Equation ( 1) represents the operational cost of wind power generation, where πWT is the generation cost coefficient.

Photovoltaic power generation
The output power of photovoltaic power generation is calculated using Equation ( 2) and is directly proportional to the received solar irradiance Gt,s in any time period and scenario.(2) where nPV, APV, and ηt,s,elec,PV, respectively, represent the quantity, area, and electrical efficiency of photovoltaic panels.
The cost of photovoltaic power generation output can be calculated using the known photovoltaic generation cost coefficient PV, as shown in Equation (3).

Conventional generator units
The output power pt,s,CG of conventional generator units is calculated using Equations ( 7) to (10).
∋ ( where pCG,min and pCG,max represent the minimum and maximum output power of the generator unit respectively.pCG,Ramp up and pCG,Ramp down denote the rate limits for load increase and load decrease of the unit.It,s,CG represents the binary variable indicating the unit's operational state.CG,su stands for start-up cost.
Then, a linearization study is conducted.

Photovoltaic-thermal system
The photovoltaic-thermal system is one of the components of the virtual power plant and can fulfill the balance between electrical and heat loads, as described in Equation (12).
, ,PVT PVT PVT , , , elec, PVT ts ts ts p nA γ < G (12) where pt,s,PVT represents the electrical energy output of the photovoltaic-thermal system.nPVT and APVT represent the quantity and area of the photovoltaic panels; ηt,s,elec,PVT represents the system's electrical efficiency.
Based on the operation and maintenance cost coefficient πPVT of the photovoltaic-thermal system, the operational cost Ct,s,PVT of the photovoltaic-thermal system can be determined.

Energy storage system
Energy storage systems can be utilized to reduce the fluctuations in the electrical output of distributed generation.In this study, battery units are considered as energy storage systems.The state-of-charge constraints for the energy storage system are shown in Equations ( 16) and ( 17), and the charge and discharge limitations are expressed in Equations ( 18) and ( 19).When the energy storage system is in a charging or discharging state, the state of charge S of the system will change as expected.Equation (20) ensures that the system cannot perform charging and discharging simultaneously.(20) where St,s,Battery, pt,s,Ch, and pt,s,Disch, respectively represent the state of charge, charging power, and discharging power in scenario sth and time period tth; Ch and Disch respectively represent the charging and discharging efficiency; pBattery,max stands for the maximum capacity of the energy storage system.Yt,s,Ch and Yt,s,Disch are binary variables representing the charging and discharging states of the energy storage system.

Objective function
The data extracted from the PDF may not accurately represent the actual wind speed model.To overcome this limitation and establish a more precise model, this paper proposes a Developed Wind PDF Reduced Scenario-Stochastic (DWP-RSS) approach.This method involves fitting long-term wind speed data to obtain the shape parameter k and scale parameter c of the Weibull distribution equation, as shown in Equation (21).
21) Modeling of the uncertainties in the DWP-RSS model: in this model, a conventional PDF assigns specific probabilities to each extracted data point.The mean of the conventional PDF represents characteristic values within each interval, assuming a standard deviation of 10% of the mean for the conventional PDF.

Input data
In this study, the simulated case of the virtual power plant is based on the IEEE 33-bus distribution system.The virtual power plant includes both electric loads and thermal loads.The predicted results of electric loads and thermal loads on each bus are shown in Figure 2. Additionally, data for electricity market prices, wind speed, weather temperature, and predicted electricity load ahead of time are presented in Figure 3.
From Figure 3, it can be observed that the peak electricity prices in the electricity market coincide with the peak electricity loads.The trend of temperature variation aligns with the trend of sunlight radiation variation.During a certain period, there is a complementary relationship between sunlight radiation and wind speed, which is of significant importance for meeting electricity demand.

Scheduling results
The scheduling results are shown in Figure 4. to Figure 6.The negative power exchange between the virtual power plant and the main grid represents power sold to the main grid, and the negative values of the energy storage system indicate that the energy storage system is in a charging state.
During the period from 1:00 to 6:00, when electricity prices are at their lowest, and neither photovoltaic nor photovoltaic-thermal systems are generating power, the virtual power plant purchases electricity from the grid.Wind power meets part of the demand, and the boiler fulfills the heat demand.The energy storage system is charged for peak demand periods.Distributed resource thermal energy scheduling results for virtual power plants considering photovoltaic photothermal systems.From 6:00 to 11:00, increasing electricity prices and electric heating load prompt load reduction.To maximize profits, the virtual power plant reduces load, activates traditional generating units, and discharges the energy storage system.The photovoltaic-thermal system provides heat, and the boiler is inactive.Thermal network capabilities ensure quality heat supply.From 12:00 to 16:00, with decreasing electricity demand and prices, the photovoltaic-thermal system economically satisfies heat demand.The boiler and cogeneration unit are on standby, and electricity demand is met by renewables and traditional units.From 17:00 to 18:00, declining solar irradiance leads to reduced photovoltaic system output.The cogeneration unit compensates for heat shortfall, and load shedding continues.From 18:00 to 22:00, peak electricity demand occurs.The virtual power plant sells more electricity as solar irradiance decreases and heat demand is met by the boiler and cogeneration units.From 23:00 to 24:00, electricity prices, electrical loads, and heat loads decrease.The virtual power plant purchases electricity, and traditional generating units operate at minimum levels.The energy storage system discharges before 0:00.
In summary, the proposed scheduling strategy aligns thermal power unit output with electrical load demand, offering an advanced plan for power balance and enabling renewable integration while reducing coal consumption.

Conclusion
Taking into full consideration the impact of thermal loads on the economic dispatch of distributed energy in the power system, this article establishes an energy management structure for a virtual power plant, which includes combined heat and power systems, photovoltaic-thermal systems, boilers, and more.It proposes an optimization dispatch method for multiple distributed resources within the virtual power plant using GAMS.Using the IEEE 33-bus system as a simulation case for the virtual power plant, during the optimization dispatch process, the economic efficiency of the virtual power plant dispatch is ensured, considering variations in both electrical and thermal loads, as well as electricity prices, while maintaining constraints such as system power flow security.
The results show that under this dispatch strategy, during the period from 12:00 to 16:00, when sunlight intensity reaches its peak, the photovoltaic-thermal system achieves peak power generation and heat production of 400 kW and 780 kW, respectively.This system can supply a portion of the electrical load and most of the thermal load during this time, replacing more expensive generation units and effectively increasing the revenue of the virtual power plant.

Figure 2 .
Figure 2. Prediction data for electrical load and thermal load for each bus bar.

Figure 3 .
Figure 3. Predictive data on electricity market prices, wind speeds, weather temperatures and daily electricity loads.

Figure 4 .
Figure 4. Electric energy scheduling results of distributed energy in virtual power plants considering photovoltaic photothermal systems.

Figure 5 .
Figure 5. Energy storage system and load reduction scheduling results.

Figure 6 .
Figure 6.Distributed resource thermal energy scheduling results for virtual power plants considering photovoltaic photothermal systems.From 6:00 to 11:00, increasing electricity prices and electric heating load prompt load reduction.To maximize profits, the virtual power plant reduces load, activates traditional generating units, and discharges the energy storage system.The photovoltaic-thermal system provides heat, and the boiler is inactive.Thermal network capabilities ensure quality heat supply.From 12:00 to 16:00, with decreasing electricity demand and prices, the photovoltaic-thermal system economically satisfies heat demand.The boiler and cogeneration unit are on standby, and electricity demand is met by renewables and traditional units.From 17:00 to 18:00, declining solar irradiance leads to reduced photovoltaic system output.The cogeneration unit compensates for heat shortfall, and load shedding continues.From 18:00 to 22:00, peak electricity demand occurs.The virtual power plant sells more electricity as solar irradiance decreases and heat demand is met by the boiler and cogeneration units.From 23:00 to 24:00, electricity

power plant energy managemen t system Wind Power Generation Photovoltaic Power Generation Combined Heat and Power System Conventional Generator Units Photovoltaic-Thermal System Boilers Power System Energy Storage System Electrical Load Thermal Load
The cost of combined heat and power output can be calculated using the known cost coefficient gas, as shown in Equation (6).
Boiler, Qt,s,Boiler and Boiler respectively represent the fuel consumption, thermal power output, and boiler efficiency of the boiler.By utilizing the price of natural gas πgas, Equation (15) yields the operational cost of the boiler.