2.1. Stochastic Model
Stochastic programming is one of the techniques used to optimise decisions, taking uncertainty into consideration. These kinds of uncertainties usually evolve according to a multivariate stochastic process that can be estimated by a scenario tree.
The proposed model enables the participation of Combined Heat and Power–District Heating (CHP-DH) units and renewable energy sources (RESs) in the electricity market, while also allowing for the evaluation of different bidding strategies for Virtual Power Plants. By utilizing the operational flexibility of CHP-DH systems, the model can mitigate the uncertainties associated with day-ahead price fluctuations, imbalance costs, and renewable generation forecasts [
14]. It is a mathematical computation tool that works to optimise marketing and production problems considering uncertainty [
4]. The portfolio strategy is modelled to maximise or minimise the expectation of the function of decisions under the prevailing of uncertain variables. Several factors affecting the supply of electricity are evaluated using a mathematical formula that returns the most optimal combination of strategies [
6].
The DER portfolio is faced with uncertainty in forecasting the required market output and the electricity prices. Our task is to come up with a strategy that will provide the maximum profit based on market evaluation and future predictions. Commercial aggregation of DERs with output uncertainty is now a reality in the power supply grid [
6]. The system is facing uncertainty in its operations due to frequent power outages, the variability of the primary sources of energy and a functional pattern characterised by non-electricity output requirements. Stochastic programming helps to settle the imbalance using a system sell price for those who are willing to take a long-term engagement in the UK energy markets [
7]. A commercial Virtual Power Plant (CVPP) consolidates the operational characteristics and cost structure of a distributed energy resource (DER) portfolio into an aggregated profile. Within the wholesale energy market, a CVPP facilitates trading, portfolio balancing, and service provision by submitting bids and offers to the system operator [
8]. The CVPP operator—often an energy supplier or a third-party aggregator with market access—collects and integrates information such as marginal costs, metering records, load forecasts, operational parameters, market data, and locational inputs. This aggregation supports the formulation of forward contracts, system balancing activities, and the scheduling of distributed generation (DG), demand, and technical virtual power plant (TVPP) parameters [
9].
One of the most widely used stochastic programming models is a two-stage linear program (
Figure 1). In this model, the decision sets can be divided into two stages: In the first stage, the decision should be made based on a deterministic approach. These decisions are normally called “here and now decisions.” However, decisions at the second stage must be made after the random event occurs, and the decision from the first stage should be considered [
10]. The approach applies a linear programming model that incorporates forecasted prices for both the spot and balancing markets, which are accessible to the portfolio operator. These forecasts provide the anticipated price trajectories for each half-hourly interval, including the minimum expected values at every time step [
6].
A basic linear programming formulation, widely used for two-stage stochastic programming problems, is given below (1)–(4):
In this formulation,
x denotes the first-stage decision variable, with the associated vectors and matrices
s,
b, and
A. In the second stage, multiple random outcomes may occur. For each realisation of
w, the parameters
,
, and
are revealed, where
q,
h, and
T represent random variables capturing the underlying uncertainty. The parameter
is dependent on
w and represents the mathematical expectation. The parameter
is a second-stage decision which should be considered to determine the resource decisions. The
is a second-stage objective expectation and
is a deterministic term [
10].
The second-stage function for a given w is formulated as (5):
The formulation of a deterministic linear programming approach is given below (6)–(8):
Generally speaking, stochastic optimisation provides better solutions in comparison to the expectation-based approach by considering random events. In most cases, the expected profit from the stochastic approach is higher than the deterministic one when all uncertainties are considered [
6].
The proposed approach applied to the case studies to calculate the expected profit function is formulated as shown in (9):
where
,
, and
are the market price (MP), system sell price (SSP), and system buy price (SBP), respectively.
and
are energy surplus and energy shortage, and
and
are the generation cost and output of the individual generator. The
i,
t, and
s indicate the generator, time, and scenarios, respectively.
Equation (
10) sets the upper bound of generation output:
The upper bounds of available capacity are also applied to intermittent renewable generators (e.g., wind), representing the available wind power output in scenario
s. The relationships among energy surplus, shortage, generator outputs, and the offered quantities are defined by the energy balance constraint (11):
2.3. Robust Model
Robust optimisation (RO) has been widely employed to address profit-maximisation problems in areas such as electricity markets and portfolio management. By carefully tuning the control parameters, this method ensures feasibility across all possible realisations of uncertain variables within specified confidence bounds, while also guaranteeing optimality under their worst-case outcomes [
14]. Furthermore, RO has been applied to various power system challenges, including the development of offering strategies under uncertainty [
11]. In the proposed RO framework, different control parameters are introduced to represent the degree of conservatism in the solution, such that the optimisation focuses on the worst-case scenario corresponding to a chosen robustness level.
Using the standard robust model, we obtain the following model for the robust optimisation for the electricity market bidding strategy using wind generation as an example:
where
is the day-ahead market price,
is the offered quantity,
and
are imbalance prices for SSP and SBP,
and
are parameters to control the robustness of the model, and
and
are dual variables related to uncertainty in market prices and generation.
The objective function (12) is designed to maximise profit under the worst-case bidding scenario. To account for uncertainty in both prices and generation, the non-negative robustness parameters , , , and are introduced. These parameters capture deviations from the mean values of the corresponding uncertain variables. Specifically, , , and can take values within the interval , where 0 corresponds to a non-robust solution and to the most conservative one. In contrast, ranges between 0 and 1, thereby controlling the robustness level against renewable generation uncertainty.
The first three constraints (13)–(15) address the uncertainty in market prices that directly influence the objective function. The subsequent constraints (16)–(18) ensure that both wind and conventional generation remain within their available capacity limits, under the condition that no more than uncertain coefficients deviate from their mean values within the forecasted confidence interval.
After obtaining the bidding strategy from the robust model, we run the obtained offer in the stochastic model to obtain expected profit considering all price scenarios and generation states/levels. The robust models in [
11,
12] are used to formulate the above model.
2.4. Generic Storage Model
Energy storage can provide various benefits to the energy industry and services to support grid operation. Thus, the integration of energy storage technologies will increase the efficiency of the system and provide a level of adaptability against the uncertainty and variability characteristic to energy systems with a high integration of intermittent renewable generation and supplying demand at peak times to decrease generation costs [
13]. Energy storage refers to types of technologies which can store electricity for later use. In addition to providing cost-effective usage of electricity, storage is also used to improve power reliability. Usually, the energy storage facilities are defined by three parameters: efficiency, rated capacity and charging/discharging power [
14]. Below, the storage parameters used in this work are shown:
The main challenge of adding storage to the model is to decide how to choose an optimal bid for the day-ahead market, considering market price uncertainty, and how to plan the charging and discharging schedule for the storage. In our model, we are considering a generic energy storage facility which makes it possible to store energy at non-peak times and discharge at peak times—energy arbitrage as shown in
Table 1. The operation of energy storage is modelled by the following constraints (19)–(21):
The objective function to be maximised is the expected profit that results from buying energy to charge the storage plant during low price periods and to later sell in periods with high market prices. A binary variable is used to model the charging (
) and discharging (
) state of the storage. The following constraints (22) and (23) are used to balance the stored energy in each period due to the charge and discharge actions and to bound the stored energy in each period to the capacity limit:
The roundtrip efficiency factor
represents the energy losses during the conversion of energy in the storage plant during charging periods. To integrate the storage operation model into the existing model, we must consider that the offered quantity must now represent the injected power from the storage plant (24).
All models were simulated in the Fico Xpress-Mosel software, version 9.0.