# Adaptive High-Performance Optimization Tool for Real-Time Operation of Renewable-Based Virtual Power Plants

Oluwaseun Oladimeji, Álvaro Ortega, Lukas Sigrist, Bogdan Marinescu, Vinu Thomas

► To cite this version:

Oluwaseun Oladimeji, Álvaro Ortega, Lukas Sigrist, Bogdan Marinescu, Vinu Thomas. Adaptive High-Performance Optimization Tool for Real-Time Operation of Renewable-Based Virtual Power Plants. IEEE Access, 2025, 13, pp.11479 - 11493. 10.1109/access.2025.3528123. hal-05221627

HAL Id: hal-05221627

https://hal.science/hal-05221627v1

Submitted on 25 Aug 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Received 17 November 2024, accepted 2 January 2025, date of publication 10 January 2025, date of current version 21 January 2025.

Digital Object Identifier 10.1109/ACCESS.2025.3528123

RESEARCH ARTICLE

# Adaptive High-Performance Optimization Tool for Real-Time Operation of Renewable-Based Virtual Power Plants

OLUWASEUN OLADIMEJI<sup>1,2</sup>, (Graduate Student Member, IEEE),
ÁLVARO ORTEGA<sup>1</sup>, (Member, IEEE), LUKAS SIGRIST<sup>1</sup>, (Member, IEEE),
BOGDAN MARINESCU<sup>1,3</sup>, (Member, IEEE), AND VINU THOMAS<sup>1,3</sup>, (Member, IEEE)

Corresponding author: Oluwaseun Oladimeji (oenoch@comillas.edu)

This work was supported by European Union's Horizon 2020 Research and Innovation Programme under Grant 883985.

**ABSTRACT** This paper presents an adaptive high-performance optimization tool for the real-time operation of Renewable-based Virtual Power Plants (RVPPs). The increasing integration of Renewable Energy Sources (RESs) into power systems introduces challenges due to their intermittent nature. Aggregating RES units into RVPPs creates a more controllable and competitive entity for energy market participation. However, real-time operation, particularly for ancillary services like Frequency Containment Reserve and automatic Frequency Restoration Reserve, remains challenging since the offered delivery of such ancillary services needs to be guaranteed at all times. In this paper, the proposed Adaptive High-performance Optimal Real-time operation Algorithm (AHORA) addresses these challenges by executing re-dispatches every four seconds, mitigating internal and external disturbances while ensuring compliance with System Operator requirements. The framework supports both event-driven and periodic activation strategies, enabling dynamic adaptation to system changes. Real-time implementation of the operation framework is carried out using OPAL-RT real-time simulator, verifying the RVPP's ability to meet the demands of real-time applications effectively. Test results demonstrate that AHORA achieves a minimum of 85% of the required regulation in worst case disturbances and maintains service provision within a stringent 4-second window. The findings demonstrate AHORA's practical applicability in enhancing the reliability and efficiency of renewable energy integration into modern power grids, providing a robust solution for managing the complexities of RVPP real-time operation.

**INDEX TERMS** Ancillary service provision, automatic frequency restoration reserve, renewable energy sources, real-time optimal operation, real-time simulation, renewable-based virtual power plant.

# I. INTRODUCTION

## A. MOTIVATION

The growing presence of Renewable Energy Sources (RESs) in the power network has brought about several challenges in the management and control of the power system by System Operators (SOs). Non-dispatchable RES units, which are subject to intermittency, face particular difficulties as they become more vulnerable to penalties when they cannot ensure real-time delivery of the offers/bids they submitted in the

The associate editor coordinating the review of this manuscript and approving it for publication was Binit Lukose <sup>1</sup>.

energy and ancillary services markets.<fnref n="1" /> While some of the sanctions imposed on RESs for failure to fully provide offered services in real time are economic, others are exclusion from participating a posteriori in these services.

To address these issues, RES units can be aggregated into Virtual Power Plants (VPPs) to create a more controllable aggregated output, enhancing their competitiveness in the

<footnote n="1">¹Institute for Research in Technology, ICAI, Comillas Pontifical University, 28015 Madrid, Spain</footnote>

<footnote n="2">²Future Network, EirGrid, Dublin 4, Ireland</footnote>

<footnote n="3">³Nantes Université, École Centrale Nantes, UMR 6004, F-44000 Nantes, France</footnote>

<footnote n="1">¹In this work, and with some abuse of notation, real-time refers to the actual period for power delivery after the triggering event has occurred, and Real-Time Operation (RTO) involves operation planning with short horizons (up to 5 minutes in advance).</footnote>
energy market [1], [2], [3], [4]. In Switzerland, Fleco Hub's web platform<fnref n="2" /> integrates several renewable energies as a Virtual Power Plant (VPP) to participate in the Swiss electricity market. The Spanish Automatic Generation Control (AGC) allows VPPs which aggregates either generation units or demand units who can submit bids in the reserve market and subsequently contribute to secondary frequency control during operation [5]. Another example is Next Kraftwerke's VPP<fnref n="3" /> in Germany, one of the largest VPP operators in Europe. It connects over 10,000 decentralized energy units, including biogas plants, solar arrays, and small-scale hydroelectric plants, to create a flexible and reliable power system. The VPP participates in balancing and ancillary services to help stabilize the national grid. In the United States, Pacific Gas and Electric (PG&E)<fnref n="4" /> has also explored VPPs as part of its demand-side management strategy, integrating renewable energy, battery storage, and smart grid technologies.

## B. LITERATURE REVIEW

Different configurations of RESs with Battery Energy Storage Systems (BESSs) have been proposed for energy market participation [6], [7], [8]. However, BESS's relatively high capital and degradation costs present challenges. In contrast, the authors have introduced another VPP configuration, termed RVPP, which sources flexibility from other units while excluding BESS. This RVPP collects dispatchable and non-dispatchable RES units for energy market participation [9]. The study demonstrates the feasibility of such RVPPs to operate optimally through proper coordination of schedules and dispatches.

Besides participation in the energy market only, other studies have considered the co-optimization of energy and operating reserve for variable resources generation-based VPPs to help mitigate anticipated disturbances of the stochastic renewable sources [10]. In another work, a VPP comprising variable generation resources as well as demand response and energy storage systems for ancillary service market participation was presented to improve the market competitiveness of the VPP [11].

In studies carried out to facilitate more wind energy use while avoiding penalties during operation, a joint day-ahead and real-time market participation decision making framework for a VPP composing wind power plants was presented in [12]. In an extension of the same risk-aware decision-making framework, a virtual industrial power plant composed of RES and energy storage systems was proposed in [13]. The works underscore the importance of appropriate control during real time operation. The provision of ancillary service, in essence, requires not only the previous participation in the corresponding markets but also the continuous guaranteeing of the needed resources.

Following this, the effective management and coordination of the real-time operation for RVPPs still remains open. Forecasts available at the time of preparing market bids are typically made hours in advance [14] and addressing the differences between scheduled and real-time delivery and other unexpected disturbances that may affect power delivery poses a challenge. This becomes more complex when RVPPs must provide frequency-related and non-frequency-related ancillary services like Frequency Containment Reserve (FCR), automatic Frequency Restoration Reserve (aFRR), and voltage control [15], [16], [17]. A control framework which incorporated communication delays and coordination between the VPP and a thermal generator was presented in [17]. However, the VPP included BESS for service provision and the inherent delay between market gate closure and the potential activation of the service, releasing reserved power, together with the inherent variation of RES has not been accounted for. Guaranteeing the provision of these services by an RVPP after the market gate is closed remains a critical concern.

Ensuring timely and reliable ancillary service provision is essential for power system security. Prior research has explored RES participation in FCR [18], [19] and aFRR [20], [21], [22]. These studies concluded on the necessity of operating generating units at near-maximum rating for effective service provision. In various instances, however stochastic units have to be operated across a wide range of operation spectrum especially as power systems operation transitions to more stochastic-units-dominated systems. The operation could be in de-rated mode to pre-empt service provision, or in curtailment mode during periods of resource abundance.

Other considerations like local network congestion which affect service provision have not been sufficiently addressed. Aggregation of different resources across a local network has to be taken into account during service provision to ensure that effective compensation is achieved without violating power flow constraints. Additionally, the focus has been mainly on homogeneous RES-based VPPs (i.e., aggregation of a single type of unit, e.g., wind farms [22], [23]). The study of heterogeneous RES units aggregated as RVPPs has been largely overlooked. These factors are taken into consideration while developing the Real-Time Operation (RTO) algorithm for the RVPP presented in this paper.

Moreover, coordination with the SO has formed a large part of requirements contributing to energy delivery and service provision. Thus, RTO can be studied from the point of view of either the SO, the agent providing the service, or coordination between the two. These agents could be the stochastic units presented in the previous paragraphs (single type or a group of homogeneous units) or a heterogeneous grouping as presented in this paper. From the agents point of view, works presented in [22] and [23] focus on the possibility and capability of service provision by homogeneous units. Other studies (e.g., [24], [25]) analyze the aggregation of BESS with RES units to provide services.

<footnote n="2">²https://flecopower.ch/de/ueber-uns/unternehmen</footnote>

<footnote n="3">³https://www.next-kraftwerke.com</footnote>

<footnote n="4">⁴https://www.pge.com</footnote>
From the perspective of coordination between the SO and agents, [26], [27], [28] show the benefit of information sharing for more efficient service provision and system operation, hence contributing to minimal system losses, minimizing curtailment of stochastic units, and without sacrificing privacy. This is the approach used in this paper. However, going a step further, this work goes beyond a focus on service provision only but also includes short-term planning to guarantee the provision in real time. This involves the utilization of heterogeneous units in the RVPP, reacting in real-time to system changes, and ability to contribute to different ancillary services (as opposed to a single one).

To summarize, heterogeneous RES units have been largely ignored in the literature as opposed to homogeneous units for real-time service provision for power systems. In addition, the requirement for the homogeneous stochastic units to be operated around their maximum power rating in the literature poses a crippling challenge especially when real-time service provision requirements coincide with periods of resource scarcity. Furthermore, the coordination with the SOs, although beneficial also adds an additional layer of scrutiny to units contributing to service provision in real-time. Whereas stochastic units engaging in real-time service delivery have oftentimes been paired with BESS for service guarantees, heterogeneous units acting as flexibility sources for one another has been ignored.

## C. CONTRIBUTIONS

This paper addresses the optimal adaptive RTO of an RVPP. The proposed framework is generic, applicable to real-time operation challenges encountered by RVPPs. The operation can be formulated as an event-driven and/or periodic optimal re-dispatch executable every 4 seconds. It can thus adapt to changing conditions within the RVPP and ensure compliance with service provision requirements. Furthermore, the optimization algorithm is implemented in a non-specific manner such that it can be applied to any RVPP size and/or configuration.

This paper's contributions include:

* Proposal of a rolling, adaptive, and computationally efficient RTO framework for RVPPs, which operates with a re-dispatch algorithm named Adaptive High-performance Optimal Real-time operation Algorithm (AHORA).

* The AHORA algorithm incorporates dynamic response criteria and optimizes the operation by integrating scheduled market offers, available renewable energy outputs, and regulation requests from the Transmission System Operator (TSO).

* The framework is versatile, applicable to any RVPP size or configuration, and supports event-driven or periodic optimal re-dispatch every 4 seconds to cover both frequency-related and non-frequency-related ancillary services.

* The implementation demonstrates practical applicability by effectively minimizing the impact of internal and

external disturbances, maintaining service provision within the required time frames, and coping with real-time changes in realistically sized RVPPs and local networks.

This paper shows, through various test cases, that the RTO framework is able to minimize the impact of internal and external disturbances and follow set point changes within a 4 s window as utilized by some TSOs, thus effectively working in real-time applications. Finally, results obtained show that for realistically sized RVPP and local network, the RTO framework can cope with real-time changes and minimize deviations from expected operation.

Finally, unlike conventional economic dispatch problems, which primarily focus on planning and commitment, AHORA framework incorporates real-time adaptability and responsiveness to external operator commands and other events in the system. This enables the RVPP to actively participate in real-time control actions, adjusting dynamically to shifts in network conditions and enhancing robustness and flexibility in operational decision-making.

## D. PAPER ORGANIZATION

The remainder of the paper is organized as follows. In Section II, a general description of the optimal operation algorithm and its various applications are given. The mathematical formulation for the AHORA is presented in Section III. To demonstrate the effectiveness of the controller, test cases carried out in a real-time simulation environment (OPAL-RT) and results are presented and discussed in Section IV. Finally, the conclusions of the paper are given in Section V.

## II. RTO FRAMEWORK GENERAL DESCRIPTION

In this section, the description of the RVPP RTO framework is first given. A workflow of the proposed framework is thereafter presented. Two activation strategies have been considered, and are next described. Finally, a discussion of the RTO framework applications is presented.

### A. OVERVIEW OF THE OPTIMAL RTO FRAMEWORK

The objective of the RVPP real-time operation is ensuring the delivery of previously cleared offers while guaranteeing service execution, by responding to both external and internal disturbances (within its portfolio) and carrying out re-dispatch if necessary. RTO can be contextualized as being nestled between planning and control activities. On the one hand, its guarantee of service evacuation<fnref n="5" /> for Frequency Containment Reserve (FCR), for instance, can be understood as a very short-term planning problem. Whereas, its adaptation to changing aFRR set points and response to disturbances and external TSO commands mirrors a control problem.

An extension of the RTO framework is such that it can contribute to solving rather localized problems such as voltage control or congestion, and global problems such as

<footnote n="5">⁵In this paper, we do not refer to the actual provision of FCR, but rather, we attempt to ensure the reserve availability if FCR is required.</footnote>
<figure><img src="image_2.png" /><figcaption>FIGURE 1. Functional scheme of the RVPP RTO framework.</figcaption></figure>

frequency control. A description of this functional scheme is shown in Fig. 1. The inputs to the RTO framework come from different sources. These include external sources such as market clearance data from market operators (obtained prior to RTO) and real-time balancing commands from the grid operator. Balancing commands such as the TSO set-point are variables that need to be acted upon as soon as they are issued. Internal input information to the controller on the other hand includes the condition of the RVPP internal network, the state of the units, and internal disturbances such as a unit's slow response or lack of response to control signals. All internal input data are real-time information which the controller resolves *immediately* after issuance.

Embedded within the input and output is the core of the RTO framework, namely the AHORA, proposed in this work. AHORA operates as an internal re-dispatch function that carries out the optimal re-assignment of new/updated set-points for the RVPP units according to its pre-defined activation mechanism (event-driven and/or periodic). AHORA's outputs are the updated active and/or reactive power reference points of the individual RVPP units.

Finally, the RVPP Dynamic System Model block emulates the actual response of the RVPP, and contains the dynamic model of the RVPP implementation in the real-time simulation environment. The dynamics of the RVPP units as well as the external grid to which the RVPP is connected are represented here. This implementation serves to verify the applicability of the developed algorithm in real-world practical applications.

## B. WORKFLOW OF THE RTO FRAMEWORK

A simplified workflow of the RTO framework is shown by the flowchart in Fig. 2. At the start of operation, the RVPP parameters matching current time with cleared market offers<fnref n="6" /> are obtained and utilized in the following ways: i) power set

<figure><img src="image_3.png" /><figcaption>FIGURE 2. Flowchart of the RTO framework.</figcaption></figure>

points are used for initialization of the dynamic models in the real-time simulation environment, and ii) conversion to a GAMS Data eXchange (.gdx) file, which serves as input to the AHORA implemented in the General Algebraic Modeling System (GAMS) optimization environment, is done. During operation, information of the RVPP units states, the internal network, and from external sources (such as the TSO) is obtained. This needed input data is realistically (and readily) available to the tool user. No confidential or sensitive data is generally required, and they can be easily measured and transmitted.

<footnote n="6">⁶The interested reader can refer to [29] for a detailed description and formulation of the electricity market framework considered in this paper to generate the schedules from cleared market offers.</footnote>
<figure><img src="image_4.png" /><figcaption>FIGURE 3. Representation of the RTO framework.</figcaption></figure>

When changes occur in the system and re-dispatch or reschedule of units is necessary, AHORA is triggered. Event-driven and/or periodic activation modes can be used to detect such changes and activate the RTO framework as described later in Section II-C. Necessary input parameters and the current state of the system are passed to AHORA. New reference points for the units are returned and applied to the RVPP units (system) as updated set points (see Fig. 1).

A lower level representation of the RTO framework modeled with two subsystem blocks is shown in Fig. 3. The implementation in two *separate* blocks is to verify the applicability of the RTO algorithm within a realistic set-up. It has been designed to work on two different computers (targets). This mirrors reality where there is a command station from where an assets manager monitors and controls generation and consumption units from a console; whereas the actual units responding to these modifications are in the field.

The first block is the *Console Subsystem*, which takes the form of a graphical user interface where the model data is viewed and adjusted, and the simulator's start/stop sequences are controlled. Additionally, some model parameters can be modified from this block to generate different scenarios and conditions for the simulation environment. The *Console Subsystem* contains then the Inputs, Outputs and AHORA blocks of Fig. 1. Here, inputs to the RVPP units as well as internal network changes or external commands can be introduced/modified in real time. Additionally, evaluation of the output signals is done and further modifications are subsequently sent to the other target. Processed AGC signals from the TSO, for example, are sent from the Console to the second subsystem using communication blocks. This is to imitate the real operation of the system operators who send set point requirements to control areas during power delivery.

On the other target (*Computation Subsystem*), the real-time simulation of the dynamic RVPP system model is carried out as well as implementation of the modifications of the online parameters imposed by the user from the console [30]. These parameters include external set point commands from the TSO, RVPP unit loss or line disconnection, etc.

The *Computation Subsystem* includes the dynamic models of the individual RVPP generating units, lines, breakers, and loads. The external power system connected to the RVPP is represented by an equivalent scheme without loss

of generality. This equivalent scheme is implemented as an infinite source with a defined short-circuit capacity and X/R ratio [31]. Any other representation can be used based on the desired analysis. No user interaction with the *Computation Subsystem* (i.e., with the system dynamic model) is possible once the real-time simulation is started, again to better represent reality. Only power set points, either for initialization (i.e., start of the operation/simulation) or modification of previously issued commands, that enable the real-time execution of the model in this Computation side, can be communicated from the Console.

### C. ACTIVATION STRATEGIES

Two modes of activating the RTO framework are considered in this paper and they are shown in Fig. 4. In the event-driven mode (Fig. 4a), different unscheduled conditions could serve as the event that triggers the activation of the AHORA. Such events include loss of unit(s), severe stochastic resource changes etc., and can be detected by comparing the actual response with respect to thresholds. The lower and upper thresholds represented as *P* and *P̃* respectively are defined by the RVPP manager by using a combination of the availability and capacity of units in operation against the reference point *P*ref, i.e., expected delivery.

For periodic optimization, this entails running the control framework every *x* seconds or minutes as shown in Fig. 4b. The periodicity can follow standard periodic real-time balancing command issuance timescale (e.g., every 4 seconds used by the Spanish TSO or every 5 minutes following the PJM<fnref n="7" /> settlement).

The RTO framework is developed such that it can work in a hybridized fashion (in event-driven and/or periodic mode) and respond to single or multiple disturbances whenever they arise. The default mode used in this paper's test scenarios is the periodic optimization. However, the AHORA is designed to be triggered during other events as described above.

### D. APPLICATION OF THE RTO FRAMEWORK

The RTO algorithm is generic and can be applied to operation challenges facing RVPPs. In this paper, the developed RTO framework is applied to internal and external active power disturbances in general and for aFRR provision in particular due to its tighter constraints in terms of delivery and response requirements. Grid codes require maximum response time to active power set-point changes (external disturbances). Spanish aFRR, for example, requires that the RVPP responds in time to a step-like set point as a first-order system with a time constant of 100 s [5], [32]. This constraint is imposed by guaranteeing that, in the first 100 s, 63.2% of the new set point should have been attained by the responding unit(s) and up to 99% at 400 s. In this paper, moreover, the responses of the RVPP units are modeled to conform to the service requirement of the balancing service provision in Europe, i.e., Platform for the International Coordination

<footnote n="7">⁷PJM – Pennsylvania-New Jersey-Maryland market pool.</footnote>
<figure><img src="image_5.png" /><figcaption>FIGURE 4. Strategies for activating RTO framework.</figcaption></figure>

of Automated Frequency Restoration and Stable System Operation (PICASSO) [33]. In this respect, the priority of units that provide regulation is first resolved by using a merit order listing of balancing energy product bids [34]. Additionally, the AHORA is formulated as an adaptive optimal power flow model which can modify the merit-order framework to account for other constraints.

### III. AHORA MATHEMATICAL FORMULATION

This section formulates and discusses the Adaptive High-performance Optimal Real-time operation Algorithm (AHORA) in the RTO framework. The overall aim of the optimization problem is to re-allocate the reference points of the RVPP units participating in service provision at the lowest possible cost considering technical constraints of the units and the internal RVPP network configuration. The algorithm is generic and able to handle multi-objectives such as active and reactive power re-dispatch in a co-optimized way and also independently. However, only active power re-dispatches are considered for further discussion in this paper.

### NOMENCLATURE

#### INDEXES AND SETS

* $b \in \mathbb{B}/\mathbb{B}^g$ Network Buses / Buses Connected to main grid.

* $k \in \mathcal{K}/\mathcal{K}_b$ RVPP units / RVPP units at buses.

* $(m, n) \in \ell$ Sending- and Receiving-end of line.

* $t \in \mathcal{T}$ Time periods.

* $\Xi^{RTO}$ Set of AHORA variables.

#### PARAMETERS

* $C_b^\uparrow (C_b^\downarrow)$ Penalty cost for unmet up (down) regulation [€].

* $C_k^\uparrow (C_k^\downarrow)$ Up (down) regulation cost of RVPP unit $k$ [€].

* $C_k^{\uparrow, \prime}$ Updated regulation cost of RVPP unit $k$ [€].

* $p_{k,(t-1)}^*$ Optimal output of RVPP $k$ at time $(t-1)$ [MW].

* $P_{k,t}^{el}$ Measured electrical machine output of RVPP $k$ [MW].

* $P_t$ Aggregate offer of the RVPP [MW].

* $P_{k,t}$ Cleared production of RVPP $k$ [MW].

* $\bar{P}_k^\uparrow (\bar{P}_k^\downarrow)$ Maximum up (down) reserve of RVPP $k$ [MW].

* $P_t^{TSO}$ TSO command at time $t$ [MW].

* $\bar{R}_k (R_k)$ Maximum up (down) ramp rate of RVPP $k$ [MWs$^{-1}$].

* $U_{k,t}$ Cleared commitment status of RVPP $k$ [—].

* $x$ Cost multiplication factor for slow RVPP $k$ [—].

* $\Delta t$ Duration of time periods [min,s].

* $\gamma$ Expected coefficient of RVPP $k$ [—].

* $\lambda$ Factor to avoid simultaneous up & down regulation [—].

#### VARIABLES

* $p_{b,t}^{TSO}$ Share of regulation to be delivered at bus $b$ [MW].

* $p_{k,t}$ Active real time power generation of RVPP $k$ [MW].

* $p_{k,t}^\uparrow (p_{k,t}^\downarrow)$ Active power up(down) regulation of RVPP $k$ [MW].

* $p_{mn,t}$ Active power flow from bus $m$ to $n$ [MW].

* $p_{b,t}$ Aggregate unmet regulation at bus $b$ [MW].

* $p_{b,t}^\uparrow (p_{b,t}^\downarrow)$ Unmet up (down) regulation at bus $b$ [MW].

#### A. OBJECTIVE FUNCTION

The objective function (1) proposed for active power re-dispatch in general, and aFRR in particular, is minimization of the operation cost, $C_k p_{k,t}$, and up/down regulation cost of the RVPP assets, $C_k^\uparrow p_{k,t}^\uparrow + C_k^\downarrow p_{k,t}^\downarrow$, while avoiding simultaneous provision of both up and down regulation, $\lambda(p_{k,t}^\uparrow + p_{k,t}^\downarrow)$ for each RVPP unit, $k$. This formulation avoids the use of binary variables in describing the mutual exclusiveness of the up and down regulation. The regulation cost carries out prioritization function for regulation provision from different units with similar operation costs. In a case where all RVPP units have been exhausted but there remains a deficit at the main grid, a heavily penalized slack, $C_b^\uparrow p_{b,t}^\uparrow + C_b^\downarrow p_{b,t}^\downarrow$, is included in the objective to address such deficit. The
magnitude of $\lambda$ is thus greater than the units' operation costs but lower than the slack penalization cost, i.e., $C_k < \lambda < C_b^\uparrow$.

$$ \min_{\Xi^{\text{RTO}}} \sum_{t \in \mathcal{T}} \left[ \sum_{k \in \mathcal{K}} \left( C_k p_{k,t} + C_k^\uparrow p_{k,t}^\uparrow + C_k^\downarrow p_{k,t}^\downarrow + \lambda(p_{k,t}^\uparrow + p_{k,t}^\downarrow) \right) + \sum_{b \in \mathcal{B}^g} \left( C_b^\uparrow p_{b,t}^\uparrow + C_b^\downarrow p_{b,t}^\downarrow \right) \right] \Delta t \quad (1) $$

When comparing homogeneous assets with similar operation/technical characteristics, the choice of regulation cost might not pose much difficulties. However, aggregation of heterogeneous units with different technical, operation, and sometimes conflicting economic characteristics leads to challenges in choosing the regulation costs [35], [36]. In the case of an RVPP that comprises dispatchable and non-dispatchable units, as well as flexible loads, the assignment of these costs is substantially more intricate. The factors considered for assigning regulation costs in these study are: i) technical in terms of speed of response of unit and power loading capability; and ii) economic in terms of operating cost and regulation cost of the RVPP units. These factors could be parameterized [37] and thus ensure a tractable linear objective. For example, operation costs of RVPP units follow those assigned upon clearing the reserve markets [34].

## B. CONSTRAINTS

With the objective function set forth, the set of constraints needed to ensure that the RVPP operates within acceptable system parameters, although mostly well-known, is collected in the following subsections for the sake of completeness. A criterion to evaluate the dynamic performance of the aFRR provision by the RVPP is also proposed and discussed in this section.

### 1) POWER BALANCE CONSTRAINTS

The power balance during RTO at the nodes connected to the main grid includes unmet power commands, $p_{b,t}$, the TSO command, $p_{b,t}^{\text{TSO}}$, and the aggregate offer of the RVPP, $P_t$, as shown in (2a). The overall power command is a sum of the correction in both directions as shown in (2b). For aFRR provision, the TSO conceptually serves as the demand side $P_t^{\text{TSO}}$, i.e. the command to be met at the main grid is as shown in (2a) and (2c). Finally, the actual output of each RVPP unit shown in (2d) is a sum of its expected value and whichever of the regulation variables is active at the operation period.

$$ \sum_{k \in \mathcal{K}_b} p_{k,t} - \sum_{m=b} p_{mn,t} + \sum_{n=b} p_{nm,t} + p_{b,t} = P_t + p_{b,t}^{\text{TSO}}, \quad \forall b \in \mathcal{B}^g, \forall t \in \mathcal{T} \quad (2a) $$

$$ p_{b,t} = p_{b,t}^{\uparrow} - p_{b,t}^{\downarrow}, \quad \forall b \in \mathcal{B}^g, \forall t \in \mathcal{T} \quad (2b) $$

$$ \sum_{b \in \mathcal{B}^g} p_{b,t}^{\text{TSO}} = P_t^{\text{TSO}}, \quad \forall t \in \mathcal{T} \quad (2c) $$

$$ p_{k,t} = P_{k,t} + p_{k,t}^{\uparrow} - p_{k,t}^{\downarrow}, \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (2d) $$

For other buses not connected to the main grid, $p_{b,t}^{\text{TSO}}$ is excluded. Conversely, all the RVPP assets (generation and consumption units) serve as supply, i.e., they provide regulation over their individual cleared offers, $P_{k,t}$.

### 2) BOUNDS ON REGULATION QUANTITIES

For non-dispatchable units, the regulation is bounded by their availability whereas for dispatchable units, these bounds are additionally administered by their commitment status, $U_{k,t}$. The bounds for up and down regulation are shown in (3a) and (3b) respectively. $\bar{P}_k^\uparrow$ is the maximum up reserve capacity and $\bar{P}_k^\downarrow$ is the down reserve capacity.

$$ 0 \le p_{k,t}^\uparrow \le \bar{P}_k^\uparrow \cdot U_{k,t}, \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (3a) $$

$$ 0 \le p_{k,t}^\downarrow \le \bar{P}_k^\downarrow \cdot U_{k,t}, \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (3b) $$

### 3) RAMPS FOR RVPP UNITS

Up/down ramps are shown in (4a) and (4b) where $\bar{R}_k$ and $\underline{R}_k$ are the maximum up and down ramps respectively. In this regard, optimal value of active power generation, $p_{k,t}$, becomes the parameter $P_{k,(t-1)}$ in the next time step. (4c) ensures compliance with technical minimum, $P_k$, and maximum capacity, $\bar{P}_k$, of RVPP unit.

$$ p_{k,t} - P_{k,(t-1)} \le \bar{R}_k U_{k,(t-1)} \Delta t, \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (4a) $$

$$ P_{k,(t-1)} - p_{k,t} \le \underline{R}_k U_{k,t} \Delta t, \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (4b) $$

$$ \underline{P}_k U_{k,t} \le p_{k,t} \le \bar{P}_k U_{k,t}, \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (4c) $$

### 4) FLEXIBLE DEMANDS

A demand model presented in [38] is used within AHORA. The demand model has two levels of flexibility associated with its operation. The first is during the market schedule where different profiles are optimized and the best is selected. The second level, which concerns real-time service provision allows for a percentage of the overall demand to be regulated up or down based on the needs of the RVPP portfolio of which it is a part.

### 5) DYNAMIC PERFORMANCE CRITERION

As pointed out in the introduction, coordination between the RVPP and TSO has been shown to be beneficial and is the approach used in this work. It is worth noting, however, that TSOs differ in their resolution of aFRR (secondary frequency control). In the United Kingdom, the National Grid expects, in its ancillary services agreement, that a unit contributing to secondary frequency response will be fully available by 30 seconds from the time of the start of the frequency fail and be sustainable for at least a further 30 minutes [39]. In Ireland, secondary frequency control takes place in the time scale from 5 seconds up to 10 minutes after the change in frequency and is provided by a combination of automatic and manual actions [40]. The Spanish TSO, Red Eléctrica de España(REE), requires units to be available from 4 seconds up to 15 minutes and imposes an additional constraint of
a first order dynamic response by contributing balancing service providers [32]. It is thus essential to consider the ‘how’ of satisfying the requirement of the TSO during real-time service provision.

For the first two TSOs referenced above, a modeling framework is to ensure that the requested regulation is provided starting from the expected availability time (5 or 30 seconds) and achieved 100% before the maximum time window. The latter case is not as straightforward, mainly due to the expectation of the response to be within an operating envelope. Due to the added complication of this response constraint, the formulation utilised in resolving it is presented below.

When an RVPP received a power regulation signal from the TSO, the dynamic response of the new set point reaching a specified level and the response being within a prescribed operation threshold has to be modeled appropriately. For the Spanish system, the expected response is that of a first-order system with a time constant of 100 s. That is, for each RVPP unit, the new set point level must have reached a 63.2% threshold at time, $t = 100 + T^{TSO}$, where $T^{TSO}$ is the period of receipt of TSO signal.

Following the time resolution of the AHORA in the RTO framework, a conservative approximation is chosen such that after 60 s, the participating unit(s) must have reached 60% of the expected change with respect to the cleared offer ($\gamma = 0.6$). Failing this condition, the updated regulation cost (shown for up regulation provision), $C_k^{\uparrow,\prime}$, in (5) is increased by $\{x : x \gg 1\}$ such that other units in the RVPP portfolio start contributing. This change in regulation cost is neutralized once the power set point command changes direction.

$$C_k^{\uparrow,\prime} = x \cdot C_k^{\uparrow} \quad \text{if} \quad \left[ \begin{aligned} & |P_{k,t}^{el} - P_{k,(t-1)}| \\ & < \gamma \cdot |P_{k,(t-1)}^* - P_{k,(t-1)}| \end{aligned} \right], \quad \forall k \in \mathcal{K}, \forall t \in \mathcal{T} \quad (5)$$

This is, however, a conservative approach as it is the RVPP that should comply with the response requirement and not the units specifically. The penalization could also be done at the RVPP level, but this afterwards boils down to the individual unit(s) carrying out the regulation function. Thus, (5) is a good approximation to the path the RVPP would utilize in complying with the dynamic response criteria.

## 6) NETWORK REPRESENTATION

A usual simplification in VPP studies is modeling the overall power system as a single bus to which all the VPP units are connected. In cases where the units are not located in a well-connected, meshed network, the network constraints can (and often, should) be modeled. The widely-used DC-Power Flow (PF) formulation is arguably a good first candidate for the network model. This is largely due to its robustness and simple formulation and implementation. It simplifies the power flow problem by only looking at the active power and other aspects such as voltage support can be analysed post factum. However, the simplifications it utilizes (mainly

the neglect of reactive power flows) can sometimes lead to unsubstantiated end results. This is increasingly true in modern power systems with power flow controlling devices being installed to address current challenges of massive renewable energy penetration [41]. Due to these and the DC-PF's inability to give a full picture of the system status at real-time, a complete model of the power flow formulation is desired.

Since the other constraints in the model are linear, rather than choose the more accurate, non-linear, non-convex AC-PF formulation [42], a linearized version of the AC-PF model is implemented within AHORA. Asides giving a relatively accurate depiction of the internal network in real-time and factoring in system losses, the linearized version of the full AC-PF model is additionally fast and can be utilized in responding within the time frame required by the grid operator. In this work, a branch flow approximation called Logarithmic Transform Voltage Magnitude (LTVM) is used to linearize the AC-PF equations [43].

LTVM expresses the voltage magnitude at bus $m$, $V_m$, through a transform: $v_m = \ln|V_m|$, $\forall m \in \mathcal{B}$, where $\mathcal{B}$ is the set of buses of the power grid. It is a branch flow formulation with each line modeled as a series admittance $G_{mn} + jB_{mn}$ of the line with sending end $m$ and receiving end $n$. The version of LTVM with power losses on the branches is reproduced in (6). The model is implemented in two iterations where the first iteration computes the power flow and the second iteration approximates the power loss ((6e) and (6f)) and then recomputes the power flow in the network. Standard line and voltage limits complete the network model.

$$p_{mn} = p'_{mn} + 0.5q_{mn}^{loss}, \quad \forall m, n \in \mathcal{B} \quad (6a)$$

$$q_{mn} = q'_{mn} + 0.5q_{mn}^{loss}, \quad \forall m, n \in \mathcal{B} \quad (6b)$$

$$p'_{mn} = G_{mn}(v_m - v_n) - B_{mn}(\delta_m - \delta_n), \quad \forall m, n \in \mathcal{B} \quad (6c)$$

$$q'_{mn} = -B_{mn}(v_m - v_n) - G_{mn}(\delta_m - \delta_n), \quad \forall m, n \in \mathcal{B} \quad (6d)$$

$$p_{mn}^{loss} = G_{mn}[(V_m - V_n)^2 + (\Delta_m - \Delta_n)^2], \quad \forall m, n \in \mathcal{B} \quad (6e)$$

$$q_{mn}^{loss} = -B_{mn}[(V_m - V_n)^2 + (\Delta_m - \Delta_n)^2], \quad \forall m, n \in \mathcal{B} \quad (6f)$$

From (6), it can be shown that the DC-PF can be derived from the linearized AC-PF by setting $v_m = v_n = 1.0$, and neglecting $G_{mn}$ for the active power loss calculation in (6e).

## IV. RESULTS AND DISCUSSIONS

In this section, the test cases used to access the RTO framework's robustness to various events in system response and the system impact(s) are described and the obtained results are highlighted and discussed. Additionally, the scenarios presented in the following sections are analyzed generally in the context and timescale of aFRR provision.
## A. TEST CASES

In this paper, the RTO framework is utilized to re-dispatch and re-allocate the unbalanced power due to internal and external disturbances. At each sampling time, the updated optimal set point is sent from the AHORA to the RVPP dynamic model by solving an optimization problem with system constraints. For the *Computation Subsystem*, which comprises the RVPP dynamic model (see Section II-B), Matlab Simscape Electrical library components are utilized. Balanced, fundamental-frequency transient stability models in the *dq*-reference frame, widely used for dynamic analyses such as the ones considered in this paper, have been used for all power system components, including synchronous generators and converter-interfaced devices [44], [45]. For this subsystem, the step size is 50µs.

For the *Console Subsystem*, the period of re-optimization (see Fig. 4b) is 4s, which is the typical update rate of aFRR signals from TSOs.

For evaluating the developed framework, test cases are set up such that different aspects of the control algorithm can be investigated, as follows.

* **7-bus system:** under this system, the response of the RVPP to internal and external disturbances is evaluated. Additionally, the robustness against non responsiveness of unit or unit delays is tested. First, the RVPP's response to multiple, continuous TSO commands is evaluated. Then, extending this scenario, the Photo-Voltaic Plant (PV) regulation units in the RVPP portfolio are affected by cloud cover and an assessment of the RVPP response is thereafter done.

* **IEEE feeders:** Standard IEEE test systems of different sizes [46] are utilized to evaluate the computational cost and scalability of the RTO algorithm. One of the main questions considered in this case is an evaluation of the algorithm response time with a large number of RES units scattered across a large network. A description of the test feeders including the network topology, line, load, and transformer data can be found in the IEEE PES Test Feeder website.

Finally, unit regulation and other costs for the objective function in this paper are shown in Table 1. The regulation costs in the table were assigned based on the ramp rates and balancing energy provision reported by the Spanish transmission system operator, REE, in [47]. These costs can be similarly defined for other units or systems, provided that equivalent information is available. The slack penalization cost is set to a very high value and is the least favorable option for regulation provision.

## B. 7-BUS SYSTEM

Figure 5 illustrates the RVPP setup with distributed units across a 7-bus network. This single-voltage system includes a Wind Power Plants (WPPs) at bus B2 and PVs at buses B5 and B6. Flexible demands are located at buses B3 and B7, while the demand at bus B4 is outside the RVPP portfolio.

<table><caption>TABLE 1. Regulation costs for aFRR objective.</caption><thead><tr><th>Unit</th><th>Cost<br>[€/MW]</th><th>Others</th><th>Cost<br>[€/MW]</th></tr></thead><tbody><tr><td>Wind Power Plant</td><td>12</td><td>λ</td><td>25</td></tr><tr><td>Photo-Voltaic Plant</td><td>13</td><td>Penalty cost</td><td>50</td></tr><tr><td>Industrial load</td><td>22</td><td></td><td></td></tr></tbody></table>

<figure><img src="image_6.png" /><figcaption>FIGURE 5. 7-bus test network.</figcaption></figure>

The RVPP is connected to the main grid through the Point of Common Coupling (PCC). Each generating unit has a capacity of 50 MW, and each demand can consume up to a maximum of 30 MW. In terms of regulation costs, the WPP is the most economical, followed by the PV units and then the flexible demands, as detailed in Table 1. Line characteristics are also provided in Fig 5.

Under normal operating conditions, the RVPP meets its demand by drawing from its renewable sources while ensuring adherence to power flow and other operating constraints. Any surplus power generated is sold to the grid through the PCC, while any shortfall is covered by purchasing power from the grid. A full description of the system and the cleared energy offers and reserve quantities can be found in the online compendium [48].

The scenarios presented here are in response to external active power disturbances. As introduced in Section III-B5, one of the operation constraints ensures that the RVPP approximates a first order system with a time constant of 100 s in its response to any external active power command. This means that, after 60 s, the RVPP should have reached 60% of the updated set point. This helps ensure that the response constraint is fulfilled faster and thus avoid penalties associated with slow response ramps.

In this section, the investigated test scenarios will seek to address the following points:

* Turnaround time of RVPP RTO optimization (AHORA) to multiple, sequential TSO signals; and

* Robustness of RVPP to internal disturbances within its portfolio.

For the test scenarios described in the following sub-sections, the initial generation of the WPP, and PVs at
<figure><img src="image_7.png" /><figcaption>FIGURE 6. RVPP response to sequential TSO commands.</figcaption></figure>

buses B5 and B6 are 10.3 MW, 33 MW, and 34.1 MW respectively. The demands at buses B3 and B7 are 30 MW and 18 MW respectively. However, for these test cases, the demand units have not been cleared to provide regulation reserves, hence, they are not active units in the provision of regulation and responding to disturbances within the RVPP. Regulation provision from demands is nevertheless supported by the RVPP. If the cost of regulation by flexible demands is cheap, relative to other units, then they can be activated before other units. However, with the current statuesque, regulation by flexible demands is not economically efficient when compared to other units, thus, their exclusion from these services in this study.

## 1) RVPP RESPONSE TO EXTERNAL COMMANDS

This test case evaluates the overall response of the RVPP and its units to varying TSO command parameters. Additionally, the turnaround time of the AHORA to several alternating, non-symmetrical up and down regulations issued to the RVPP is tested. The TSO command is introduced starting from $t = 20$ s and the RVPP response is assessed. In some instances, the cheapest unit has the capacity to deliver the total regulation while in other cases, the deficit is supplemented by other units. In any case, the aggregate response of the RVPP, $\sum_k(P_{k,t}^{el} - P_{k,t})$, is first shown in Fig. 6. In this figure and subsequent figures, the time responses are the results of the moving horizon optimization problem, which is solved every 4 s. Recall that $P_{k,t}^{el}$ is the measured electrical output of the units, while $P_{k,t}$ represents the market-cleared quantity. The sequence of the TSO commands that trigger the underlying responses is shown as $P_t^{TSO}$.

The latency of 1.8 s on average that can be observed between the TSO commands and the activation of the regulations is the turnaround time of receiving the command, converting to.gdx format for use by the AHORA in GAMS and processing the output and sending to the dynamic model. As shown in the figure, the algorithm can follow the set point change commands and also stay within the first-order system response time constraint.

With respect to individual units, their response to the sequence of signals and actual generation are shown in Figs. 7a and 7b (the WPP is on the left axis whereas the PVs are on the right axis). The WPP and PV1 participate almost

<figure><img src="image_8.png" /></figure>

<figure><img src="image_9.png" /></figure>

<figure><img src="image_10.png" /><figcaption>FIGURE 7. RVPP unit responses and unit generation.</figcaption></figure>

exclusively in the provision of up and down regulation. The differentiating factor that determines this dispatch priority is the regulation cost presented in Table 1. Since the WPP is the cheapest unit, it is dispatched first until 100% of its reserve offer. The remainder is then undertaken by the other units. The relative absence of PV2 in regulation provision is merely coincidental due to the availability of the two active units and the TSO commands matching each other. Test cases with larger TSO commands or other disturbances like the loss of one of the active units brings the PV2 much into focus for regulation provision. The dynamic behavior of the RVPP to respond to the TSO signals as a first order system is also followed as shown in the figures. The RVPP actually reaches 79% of the new value 100 s after receipt of the set point change instead of the required 63.2% (see $P_t^{Expected}$ in Fig 6) as noted in Section III-B5. Finally, Fig 7c represents the aggregate RVPP power generation compared to the target
<figure><img src="image_11.png" /><figcaption>(a) RVPP overall response</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>(b) Unit set-point response</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>(c) Unit generation</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>(d) RVPP aggregate</figcaption></figure>

<caption>**FIGURE 8.** RVPP, unit responses and unit generation during cloud cover event.</caption>

power set by the TSO. The response of the RVPP follows the dynamic response requirement by the TSO.

## 2) RVPP RESPONSE TO CLOUD COVER EVENT DURING aFRR PROVISION

Normally for aFRR provision, all individual participating units have to respond following the direction of the regulation

request. However, with the RVPP, only the aggregate response is monitored and the internal dynamics can be different dependent on the prevailing conditions of the RVPP units. In this test case, the effect of cloud cover on the performance and response of the RVPP is investigated for the same TSO commands as in the previous section. The cloud cover comes into effect at time $t = 60$ s which leads to a loss of 10% of the available capacity of both PV units.

The dynamic performance criterion for this test scenario is shown in Fig 8a and the units' responses are shown in Fig. 8b.

The period where the event happens is shown with the reduction in the availability of the PV units while the WPP unit gradually increases its output to counteract the loss of generation from other units as shown in Fig. 8c.

This scenario reveals an inherent advantage of the RVPP in utilizing its aggregation effect to provide services in the face of internal challenges.

The RVPP response between $t = 60$ s and $t = 120$ s follows the TSO command as shown previously in Fig 6. This event is not immediately apparent in the overall RVPP response, though, since it coincides with a period of down regulation provision as shown in Fig 8d. However, when the direction of provision of regulation is reversed starting from time $t = 136$ s, all the units start ramping up to their maximum possible availability.

There is still some deficit with respect to the up regulation provision, hence the dip in the RVPP output. This deficit is small and the cost of regulation provision increased by 30% when compared to normal operation in Section IV-B1 above due to the penalty incurred by the RVPP.

## 3) RVPP RESPONSE TO SLOW UNIT IN ITS PORTFOLIO

In this test case, an evaluation of the RVPP's dynamic performance criteria (see eq. (5)) is carried out. In order words, how the operation framework is adjusted to accommodate slow units that cannot meet the time-constant response stipulation of the TSO. Using the same initial generation quantities of units as described above, TSO up regulation command of 5 MW was introduced at $t = 20$ s whereas a down regulation of same magnitude was issued at $t = 240$ s as shown in Fig 9a. Then, the WPP unit was made to respond slowly to its share of the regulation request such that the RVPP has to make amendments to the regulation provision.

As shown in Fig. 9b, the electrical output of the WPP is slower than the required time response. In the graph, the periods when $\Delta p_t^{wpp,el}$ and $\bar{P}_t^{wpp}$ overlap ($t = 80$ and $t = 320$ depict the period where the WPP is not providing any regulation due to the RVPP's action of switching regulation provision to another unit. As described earlier, 60 s after the regulation request, if the unit has not reached at least 60% of its new set point, then other units take its place and start contributing. This is the case as shown in Fig. 9b where the faster unit, (PV1), compensates by absorbing the overall regulation request of the TSO. Though the WPP is the cheapest unit in terms of cost of regulation, it fails in terms
<figure><img src="image_15.png" /><figcaption>FIGURE 9. RVPP response to slow unit.</figcaption></figure>

of speed of regulation and another unit in the RVPP takes its place.

To show that the approximation works for both directions of regulation, a 5 MW down regulation was issued to the RVPP at $t = 240$ s. At the point of receiving the regulation request, the WPP is: i) the cheapest unit for the down regulation provision, ii) has enough reserve to provide all the down regulation, and is thus prioritised initially. However, when it's discovered to be slow in response when compared to the time response requirement of the TSO, PV1 takes over the regulation provision. The period when the response action is taken over by one unit (as opposed to two) is visible in both figures because the units' ramp rates are different. Additionally, though it's costlier to provide the regulation using the PV, speed of response is also parametrized and also a factor the RVPP considers in providing the required regulation. As shown in Fig. 9a, the aggregate response requirement of the RVPP is met with minor violations. In the worst case scenario within the 400 s window, 85% of the required regulation was achieved.

### 4) REMARKS ON PENALTY PAYMENTS

This section summarizes the response of RVPP during normal operation and when it is impacted by disturbances. Using the costs presented earlier in Table 1, the final regulation cost for each of the cases discussed above is shown in Table 2. Cases IV-B1 and IV-B2 are directly comparable since both follow the same sequence of TSO commands. In the former, all units were available to deliver market schedules and real-time regulation. In the latter, with a 20% loss of PV capacity,

<table><caption>TABLE 2. Cost of regulation provision for test cases.</caption><thead><tr><th>Cases</th><th>Normal Operation<br>[€/MW]</th><th>Disturbed Operation<br>[€/MW]</th><th>Penalty Proportion<br>[%]</th></tr></thead><tbody><tr><td>IV-B1</td><td>14.31</td><td>14.31</td><td>0</td></tr><tr><td>IV-B2</td><td>14.31</td><td>23.33</td><td>61.97</td></tr><tr><td>IV-B3</td><td>12.70</td><td>15.15</td><td>54.40</td></tr></tbody></table>

it became challenging for the RVPP to deliver regulation. The cloud cover period coincided with the down regulation, which benefited the RVPP. However, when the regulation direction changed, the RVPP exhausted its WPP reserve and had to rely on the grid. The penalty for unmet regulation was 62% of the overall cost, reflecting the scale of the regulation costs in Table 1.

In the case of a slow unit in the RVPP, the penalty cost is lower than in the previous case. This is due to two factors: i) the TSO command trajectory was simpler, involving only one direction change, and ii) the RVPP's monitoring mechanism allowed for a quick response to the discrepancy. Unmet energy in this case was 15%, with a penalty cost of 54%.

Penalties serve as an internal signal for the RVPP when it fails to meet regulation requirements. This aligns with the RVPP's goal of minimizing internal disturbances in real-time by adjusting the cost of non-compliant units. This helps the RVPP meet its dynamic response criteria and refine its reserve submissions for future market participation.

### C. AHORA'S COMPUTATIONAL COST AND SCALABILITY

This section assesses the algorithm's scalability and computational cost using standard test systems of different sizes. It also compares the linearized AC-PF formulation used in this paper with other Power Flow (PF) methodologies, while keeping other constraints unchanged. Note that computational times of time domain simulations are not considered in this section, as these are not affected by the AHORA algorithm, but rather, by the dynamic models used for the system components. Moreover, the main observations made from the analyses of the dynamic studies presented in Section IV-B would also apply in this case, regardless of the grid and RVPP sizes.

The systems considered are: i) the 7-bus system used in the case studies discussed above; ii) the IEEE 13-bus feeder with 14 RVPP units and ii) the IEEE 34-bus feeder with 31 RVPP units. In the latter systems, the feeders are connected to the main grid through a PCC, similar to the 7-bus system in Fig. 5.

The results from 1000 instances of the RTO algorithm, presented in Fig. 10, show how the RTO framework responds to various disturbances, such as continuous TSO balancing commands, loss of generation due to weather conditions, network disconnections, and more, either individually or in combination. The computational cost is measured as the time
<figure><img src="image_16.png" /></figure>

<figure><img src="image_17.png" /></figure>

<figure><img src="image_18.png" /><figcaption>FIGURE 10. RTO computation time for different PF solver methods.</figcaption></figure>

from receipt of a set point change by AHORA to the update in the dynamic model.

The figure shows that computation time increases from the DC-PF to the linearized AC-PF (AC-LTVM), and finally to the full AC-PF. The reduced complexity of the linearized PF methods leads to lower computational cost. The optimized RTO algorithm ensures that the time taken to activate the proposed RVPP AHORA is only a few seconds. This allows RVPPs with up to 34 buses to optimally re-dispatch a TSO signal within the 4-second requirement using available resources. Fig. 10c shows this 4-second limit for comparison with other figures, justifying the use of the linearized ACPF (Fig. 10b). For larger systems, delays may occur, but the DC-PF can be used for faster response, sacrificing some accuracy.

Table 3 presents the active power losses ($p^{loss}$) for each PF methodology using a 25 MW external up regulation request. As expected, the DC-PF shows no surplus/deficit since it does not account for losses. In contrast, both AC power

<table><caption>TABLE 3. Active power losses using different PF methods.</caption><thead><tr><th rowspan="2">Test system</th><th colspan="2">$p^{loss}$ [MW]</th></tr><tr><th>AC-LTVM</th><th>Full AC-PF</th></tr></thead><tbody><tr><td>7-bus</td><td>0.1704</td><td>0.1968</td></tr><tr><td>IEEE 13-bus</td><td>0.1396</td><td>0.0752</td></tr><tr><td>IEEE 34-bus</td><td>0.1492</td><td>0.1826</td></tr></tbody></table>

flow methods show comparable losses. The linearized AC-PF approximates system losses with a small difference compared to the full AC-PF.

## V. CONCLUDING REMARKS AND FUTURE WORK

An adaptive high-performance optimal framework for real-time operation of heterogeneous RVPPs has been presented in this paper. The operation framework has been developed in a generic way such that it can be utilized for different operation challenges such as service evacuation guarantees and ancillary service provision. To verify the applicability of the framework, a fast, scalable algorithm (AHORA) for managing disturbances and reallocating set point imbalances has been developed and executed through GAMS+Matlab/Simulink. This has been tested in a real-time simulation environment (OPAL-RT) to establish the framework's response to service requests.

Illustrative (yet detailed) examples are given to show the robustness of the operation framework to different internal and external disturbances, its computational power, turnaround time and scalability.

Results obtained demonstrate AHORA's potential to enhance real-time operation of heterogeneous RVPPs. AHORA ensures reliable service provision by effectively mitigating power imbalances caused by both internal and external disturbances, achieving regulation of a minimum of 85% of the required regulation even in the worst-case scenarios.

The test cases further validate the system's responsiveness, particularly in maintaining service provision within the constrained 4-second window typically required by System Operators. Moreover, the test networks used in the study with up to several tens of units and dozens of buses in the RVPP portfolio and its internal network, respectively, are reflective of potential RVPP sizes in the near future.

In addition to performance efficiency, the RTO framework proved to be computationally feasible, capable of processing real-time data and executing redispatches without significant delay. For operation scenarios that require both active and reactive power re-dispatch, the AC-LTVM power flow model is suitable. Results obtained show that the LTVM is 1.3x faster than the full AC-PF model on the average and the approximated power losses only differ by 15% on the average. For systems that require only active power compensation, the DC power flow model is sufficient while being twice as fast.

Future extensions of this work include voltage control service provision by reactive power re-dispatch. Moreover,
considering the observed turnaround time for larger systems, another method of optimizing online updated set-points is under investigation. Model Predictive Control (MPC) with the embedded constraints of the system have been shown to have utility in online optimization problems. In that vein, the underlying AHORA using MPC is currently being investigated.

## ACKNOWLEDGMENT

The authors would like to thank the Universitat Politècnica de Catalunya team working on the POSYTYF Project and especially Dr. Vinicius Lacerda for their work on the dynamic models simulated in this manuscript.

## REFERENCES

[1] B. Marinescu, O. Gomis-Bellmunt, F. Dörfler, H. Schulte, and L. Sigrist, "Dynamic virtual power plant: A new concept for grid integration of renewable energy sources," *IEEE Access*, vol. 10, pp. 104980-104995, 2022.

[2] L. Baringo and M. Rahimiyan, *Virtual Power Plants and Electricity Markets: Decision Making Under Uncertainty*, 1st ed., Cham, Switzerland: Springer, 2020.

[3] H. Pandžić, I. Kuzle, and T. Capuder, "Virtual power plant mid-term dispatch optimization," *Appl. Energy*, vol. 101, pp. 134-141, Jan. 2013.

[4] S. R. Dabbagh and M. K. Sheikh-El-Eslami, "Risk assessment of virtual power plants offering in energy and reserve markets," *IEEE Trans. Power Syst.*, vol. 31, no. 5, pp. 3572-3582, Sep. 2016.

[5] I. Egido, F. Fernandez-Bernal, and L. Rouco, "The Spanish AGC system: Description and analysis," *IEEE Trans. Power Syst.*, vol. 24, no. 1, pp. 271-278, Feb. 2009.

[6] M. Shabanzadeh, M.-K. Sheikh-El-Eslami, and M.-R. Haghifam, "A medium-term coalition-forming model of heterogeneous DERs for a commercial virtual power plant," *Appl. Energy*, vol. 169, pp. 663-681, May 2016.

[7] N. Naval, R. Sánchez, and J. M. Yusta, "A virtual power plant optimal dispatch model with large and small-scale distributed renewable generation," *Renew. Energy*, vol. 151, pp. 57-69, May 2020.

[8] M. Khalid, M. AlMuhaini, R. P. Aguilera, and A. V. Savkin, "Method for planning a wind-solar-battery hybrid power plant with optimal generation-demand matching," *IET Renew. Power Gener.*, vol. 12, no. 15, pp. 1800-1806, Nov. 2018.

[9] O. Oladimeji, Á. Ortega, L. Sigrist, L. Rouco, P. Sánchez-Martín, and E. Lobato, "Optimal participation of heterogeneous, RES-based virtual power plants in energy markets," *Energies*, vol. 15, no. 9, p. 3207, Apr. 2022.

[10] X. Yan, C. Gao, M. Song, T. Chen, J. Ding, M. Guo, X. Wang, and D. Abbes, "An IGDT-based day-ahead co-optimization of energy and reserve in a VPP considering multiple uncertainties," *IEEE Trans. Ind. Appl.*, vol. 58, no. 3, pp. 4037-4049, May 2022.

[11] S. Mei, Q. Tan, Y. Liu, A. Trivedi, and D. Srinivasan, "Optimal bidding strategy for virtual power plant participating in combined electricity and ancillary services market considering dynamic demand response price and integrated consumption satisfaction," *Energy*, vol. 284, Dec. 2023, Art. no. 128592.

[12] D. Xiao, H. Chen, W. Cai, C. Wei, and Z. Zhao, "Integrated risk measurement and control for stochastic energy trading of a wind storage system in electricity markets," *Protection Control Mod. Power Syst.*, vol. 8, no. 4, pp. 1-11, Dec. 2023.

[13] D. Xiao, Z. Lin, H. Chen, W. Hua, and J. Yan, "Windfall profit-aware stochastic scheduling strategy for industrial virtual power plant with integrated risk-seeking/averse preferences," *Appl. Energy*, vol. 357, Mar. 2024, Art. no. 122460.

[14] K. Mayer and S. Trück, "Electricity markets around the world," *J. Commodity Markets*, vol. 9, pp. 77-100, Mar. 2018.

[15] J. P. Chaves-Ávila and C. Fernandes, "The Spanish intraday market design: A successful solution to balance renewable generation?" *Renew. Energy*, vol. 74, pp. 422-432, Feb. 2015.

[16] D. E. Ochoa, F. Galarza-Jimenez, F. Wilches-Bernal, D. A. Schoenwald, and J. I. Poveda, "Control systems for low-inertia power grids: A survey on virtual power plants," *IEEE Access*, vol. 11, pp. 20560-20581, 2023.

[17] A. Oshnoei, M. Kheradmandi, F. Blaabjerg, N. D. Hatziargyriou, S. M. Muyeen, and A. Anvari-Moghaddam, "Coordinated control scheme for provision of frequency regulation service by virtual power plants," *Appl. Energy*, vol. 325, Nov. 2022, Art. no. 119734.

[18] I. Erlich and M. Wilch, "Primary frequency control by wind turbines," in *Proc. IEEE PES Gen. Meeting*, Jul. 2010, pp. 1-8.

[19] U. Bose, S. K. Chattopadhyay, C. Chakraborty, and B. Pal, "A novel method of frequency regulation in microgrid," *IEEE Trans. Ind. Appl.*, vol. 55, no. 1, pp. 111-121, Jan. 2019.

[20] L.-R. Chang-Chien, C.-C. Sun, and Y.-J. Yeh, "Modeling of wind farm participation in AGC," *IEEE Trans. Power Syst.*, vol. 29, no. 3, pp. 1204-1211, May 2014.

[21] K. Chen, J. Lin, Y. Qiu, F. Liu, and Y. Song, "Deep learning-aided model predictive control of wind farms for AGC considering the dynamic wake effect," *Control Eng. Pract.*, vol. 116, Nov. 2021, Art. no. 104925.

[22] K. Doenges, L. Sigrist, I. Egido, E. Lobato, and L. Rouco, "Wind farms in AGC: Modelling, simulation and validation," *IET Renew. Power Gener.*, vol. 16, no. 1, pp. 139-147, Jan. 2022.

[23] J. Morren, S. W. H. de Haan, W. L. Kling, and J. A. Ferreira, "Wind turbines emulating inertia and supporting primary frequency control," *IEEE Trans. Power Syst.*, vol. 21, no. 1, pp. 433-434, Feb. 2006.

[24] G. Mohy-Ud-Din, K. M. Muttaqi, and D. Sutanto, "Adaptive and predictive energy management strategy for real-time optimal power dispatch from VPPs integrated with renewable energy and energy storage," *IEEE Trans. Ind. Appl.*, vol. 57, no. 3, pp. 1958-1972, May 2021.

[25] G. Mohy-Ud-Din, K. M. Muttaqi, and D. Sutanto, "A hierarchical service restoration framework for unbalanced active distribution networks based on DSO and VPP coordination," *IEEE Trans. Ind. Appl.*, vol. 58, no. 2, pp. 1756-1770, Mar. 2022.

[26] M. Moradzadeh, R. Boel, and L. Vandevelde, "Voltage coordination in multi-area power systems via distributed model predictive control," *IEEE Trans. Power Syst.*, vol. 28, no. 1, pp. 513-521, Feb. 2013.

[27] L. Xi, J. Wu, Y. Xu, and H. Sun, "Automatic generation control based on multiple neural networks with actor-critic strategy," *IEEE Trans. Neural Netw. Learn. Syst.*, vol. 32, no. 6, pp. 2483-2493, Jun. 2021.

[28] X. Ke, N. Samaan, J. Holzer, R. Huang, B. Vyakaranam, M. Vallem, M. Elizondo, N. Lu, X. Zhu, B. Werts, Q. Nguyen, A. Huang, and Y. V. Makarov, "Coordinative real-time sub-transmission volt-var control for reactive power regulation between transmission and distribution systems," *IET Gener., Transmiss. Distribution*, vol. 13, no. 11, pp. 2006-2014, Jun. 2019.

[29] H. Nemati, Á. Ortega, P. Sánchez, L. Sigrist, and L. Rouco. (2022). *Deliverable D5.2—Tool for the Optimal Operation of DVPPs Under Uncertainty of Non-Dispatchable RES*. H-2020 Project POSYTYF-Eur. Commission. [Online]. Available: https://posytyf-h2020.eu/english-version/deliverables-1

[30] (2022). *OPAL-RT User Documentation Hub—Confluence* [Online]. Available: https://opal-rt.atlassian.net/wiki/spaces/PODLP/overview

[31] *Documentation on Controller Tests in Test Grid Configurations*, ENTSO-E Syst. Protection Dyn. Subgroup, Belgium, 2013. [Online]. Available: https://eepublicdownloads.entsoe.eu/clean-documents/pre2015/publications/entsoe/RG_SOC_CE/131127_Ctrler_Test_Report.pdf

[32] Red Eléctrica de España (REE). (2022). *Regulación Secundaria*. [Online]. Available: https://www.ree.es/sites/default/files/01_ACTIVIDADES/Documentos/ProcedimientosOperacion/BOE-A-2022-4969.pdf

[33] M. Backer, D. Keles, and E. Kraft, "The economic impacts of integrating European balancing markets: The case of the newly installed aFRR energy market-coupling platform PICASSO," *Energy Econ.*, vol. 128, Dec. 2023, Art. no. 107124.

[34] ENTSO.E. (2018). All TSOs' Proposal for the Implementation Framework for the Exchange of Balancing Energy From FRR With Automatic Activation Establishing a Guideline on Electricity Balancing. [Online]. Available: https://eepublicdownloads.entsoe.eu/clean-documents/

[35] A. F. A. Raab, "Operational planning, modeling and control of VPPs with electric vehicles," Technische Universitaet, Berlin, Germany, Tech. Rep. 537, 2018.

[36] S. You, "Developing VPPs for optimized distributed energy resources operation and integration," Dept. Elect. Eng., Tech. Univ. Denmark, Kongens Lyngby, Denmark, Tech. Rep. 4, 2010.
[37] E. L. Da Silva, J. J. Hedgecock, J. C. O. Mello, and J. F. da Luz, “Practical cost-based approach for the voltage ancillary service,” *IEEE Trans. Power Syst.*, vol. 16, no. 4, pp. 806–812, Apr. 2001.

[38] O. Oladimeji, Á. Ortega, L. Sigrist, P. Sánchez-Martín, E. Lobato, and L. Rouco, “Modeling demand flexibility of RES-based virtual power plants,” in *Proc. IEEE PES Gen. Meeting*, Jul. 2022, pp. 1–5.

[39] Nat. Grid ESO. (2023). *Frequency Response Obligation: Statutory, Code and Operational Standards*. [Online]. Available: https://www.nationalgrideso.com/document/10411/download

[40] EirGrid. (2024). *Eirgrid Grid Code*. [Online]. Available: https://cms.eirgrid.ie/sites/default/files/publications/Grid-Code-Version-14.pdf

[41] D. Van Hertem, J. Verboomen, K. Purchala, R. Belmans, and W. L. Kling, “Usefulness of DC power flow for active power flow analysis with flow controlling devices,” in *Proc. 8th IEEE Int. Conf. AC DC Power Transmiss.*, Mar. 2006, pp. 58–62.

[42] A. Gómez-Expósito, A. J. Conejo, and C. A. Cañizares, *Electric Energy Systems: Analysis and Operation*. Boca Raton, FL, USA: CRC Press, 2018.

[43] Z. Li, J. Yu, and Q. H. Wu, “Approximate linear power flow using logarithmic transform of voltage magnitudes with reactive power and transmission loss consideration,” *IEEE Trans. Power Syst.*, vol. 33, no. 4, pp. 4593–4603, Jul. 2018.

[44] P. W. Sauer and M. A. Pai, *Power System Dynamics and Stability*. Upper Saddle River, NJ, USA: Prentice-Hall, 1998.

[45] F. Milano, *Power System Modelling and Scripting*. London, U.K.: Springer, 2010.

[46] K. P. Schneider, B. A. Mather, B. C. Pal, C.-W. Ten, G. J. Shirek, H. Zhu, J. C. Fuller, J. L. R. Pereira, L. F. Ochoa, L. R. de Araujo, R. C. Dugan, S. Matthias, S. Paudyal, T. E. McDermott, and W. Kersting, “Analytic considerations and design basis for the IEEE distribution test feeders,” *IEEE Trans. Power Syst.*, vol. 33, no. 3, pp. 3181–3188, May 2018.

[47] (2022). *Red Eléctrica De España (REE)*. [Online]. Available: https://www.ree.es/en/datos/balance

[48] O. Oladimeji. (2023). *Dataset and Tool for Real-Time Operation of RVPP*. [Online]. Available: https://github.com/oluwaseunenoc/RVPP_RTO.git

<figure><img src="image_19.png" /></figure>

**OLUWASEUN OLADIMEJI** (Graduate Student Member, IEEE) received the B.Sc. degree in electrical and electronics engineering from the University of Ibadan, Nigeria, in 2016, and the master's degree in energy systems from the Skolkovo Institute of Science and Technology, in 2020. He is currently pursuing the Ph.D. degree in electrical power systems with Comillas Pontifical University.

His research interests include impact of renewable sources on modern power systems operation and energy and power systems optimization tools.

<figure><img src="image_20.png" /></figure>

**ÁLVARO ORTEGA** (Member, IEEE) received the Graduate degree from The Higher Technical School of Industrial Engineering, University of Castilla, La Mancha, Spain, in 2013, and the Ph.D. degree in electrical engineering from University College Dublin, Ireland, in 2017.

He has been an Assistant Professor in power and energy systems with the ICAI School of Engineering, Comillas Pontifical University, since September 2021. Previously, he was with LOY-

OLATech, University Loyola Andalucia, and with the School of Electrical and Electronic Engineering, University College Dublin. His current research interests include modeling, control and stability of energy storage systems connected to transmission and distribution systems, frequency estimation, control, and stability in low-inertia systems.

<figure><img src="image_21.png" /></figure>

**LUKAS SIGRIST** (Member, IEEE) received the M.Sc. degree in electrical and electronics engineering from the École Polytechnique Fédérale de Lausanne (EPFL), Switzerland, in 2007, and the Ph.D. degree from the Universidad Pontificia Comillas de Madrid, Spain, in 2010. He is currently a Research Associate Professor and the Secretary General of the Instituto de Investigación Tecnológica (IIT), Universidad Pontificia Comillas, Madrid. He has been involved in a large

number of research projects related to power system operation, stability, control, and protection in low-inertia power systems. His research interests include modeling, analysis, control of power systems, and modeling and optimization of energy systems.

<figure><img src="image_22.png" /></figure>

**BOGDAN MARINESCU** (Member, IEEE) was born in Bucharest, Romania, in 1969. He received the Engineering degree from the Polytechnic Institute of Bucharest, in 1992, the Ph.D. degree from Université Paris Sud-Orsay, France, in 1997, and the Habilitation á Diriger des Recherches degree from the Ecole Normale Supérieure de Cachan, France, in 2010.

He is currently a Professor with the Ecole Centrale Nantes, where he is also the Head of the Chair “Analysis and Control of Power Grids” (http://chairerte.ec-nantes.fr/home/), from 2014 to 2024, and the Coordinator of the POSYTYF H2020 RIA Project, (https://posytyf-h2020.eu/), from 2020 to 2023. In the first part of his carrier, he was active in research and development divisions of industry (EDF and RTE) and as a part-time Professor (especially from 2006 to 2012 with the Ecole Normale Supérieure de Cachan). His main research interests include theory and applications of linear systems, robust control, and power systems engineering.

<figure><img src="image_23.png" /></figure>

**VINU THOMAS** (Member, IEEE) received the B.Tech. degree in electrical and electronics engineering from the University of Calicut, India, in 2006, the M.Tech. degree in energy systems engineering from Indian Institute of Technology, Bombay, India, in 2008, and the Ph.D. degree from the National Institute of Technology, Calicut, India, in 2020. Currently, he is an Associate Professor with the École Centrale de Nantes, France. His research interests include grid-connected inverters and renewable energy-based power systems.

<figure><img src="image_24.png" /></figure>