{'fraction_non_alphanumeric': 0.05369096744612563, 'fraction_numerical': 0.01178358551123338, 'mean_word_length': 4.2379923150816525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Grid-forming frequency shaping control

As power systems transit to a state of high renewable penetration, little or no presence of synchronous generators makes the prerequisite of well-regulated frequency for grid-following inverters unrealistic. Thus, there is a trend to resort to grid-forming inverters which set frequency directly. We propose a novel grid-forming frequency shaping control that is able to shape the aggregate system frequency dynamics into a first-order one with the desired steady-state frequency deviation and Rate of Change of Frequency (RoCoF) after a sudden power imbalance. The no overshoot property resulting from the first-order dynamics allows the system frequency to monotonically move towards its new steady-state without experiencing frequency Nadir, which largely improves frequency security. We prove that our grid-forming frequency-shaping control renders the system internally stable under mild assumptions. The performance of the proposed control is verified via numerical simulations on a modified Icelandic Power Network test case.


I. INTRODUCTION
Power system frequency control by storage units has been a topic of extensive research over the last decade, especially under the circumstances of the increasing penetration of renewable generation. Compared to conventional synchronous generators, storage units have outstanding ramping capabilities, which makes them an ideal choice for provision of various types of frequency control services. At present, special policies for storage participation in frequency control services are being developed by system operators around the world [1], [2]. For instance, the existing rules of the Enhanced Frequency Response -program introduced by National Grid in Great Britain-already assume the powerfrequency response with a gain of up to 100 p.u. [3], far exceeding typical capabilities of synchronous generators (15-25 p.u.). Thus, with the fall of the power system inertia and primary frequency reserves due to the increased penetration of renewables, energy storage systems have a potential to become the major providers of frequency control services in the future power systems.
So far, synthetic inertia and droop response by storage dominate the scientific literature. These two services are supposed to compensate for the falling system inertia and primary reserves, and seem to be a logical solution under existing grid codes. Typically, the storage units are supposed to realize the power-frequency type of response while being in the so-called grid-following mode. That is, inverters of the This work was supported by any organization storage units measure the grid frequency and then inject (or consume) power based on a particular control strategy. Such an approach seems to be effective, yet the fact that there are certain delays associated with inverter control systems poses a threat to the frequency security. These delays are originated from the frequency measurement system -typically a phaselocked-loop (PLL), and also from inverter current control and pulse-width modulation (PWM) systems. It is foreseeable that, in the future low-inertia grid, these delays (from several decades of milliseconds to hundreds of milliseconds) can become fatal to frequency security. As an example, during the already famous South Australian blackout of 2016, the Rate of Change of Frequency (RoCoF) has hit the values as high as 6 Hz s −1 [4]. Clearly, it becomes vital to develop new methods for storage participation in frequency control so as to minimize any possible response delays.
Grid-forming inverters [5] have recently attracted a lot of attention from the research community, mainly in the context of autonomous microgrids. Beneficially, this type of inverters bring a broad range of new options for frequency control. First, they naturally adjust power almost with no delays (apart from some electro-magnetic transients in filters). Second, new control options become available. For instance, inertial response can be realized without any low-pass filters (hence, even less delays), since in the grid-forming mode this type of control becomes strictly causal. Third, inverters in the grid-forming mode are much less susceptible to grid voltage variations that often accompany frequency transients, which provides more reliability to the system. In the present manuscript, we explore a new approach for frequency control realized by grid-forming inverters -a topic that is not yet studied sufficiently by both power and control communities.
We propose a novel grid-forming frequency shaping control that is inspired by its grid-following counterpart proposed in [6]. We first show that the proposed control is able to fashion the aggregate system frequency dynamics, a.k.a. Center of Inertia (CoI) Frequency, into a first-order one with the desired steady-state frequency deviation and RoCoF (following a sudden power imbalance). Notably, a first-order system frequency evolution naturally avoids overshoot so that the frequency deviation moves towards its steady-state incrementally without experiencing frequency Nadir, which is what we mean by "Nadir elimination" hereafter. Nadir elimination largely improves the frequency security since it reduces the risk of under-frequency load shedding. We then show that the proposed control ensures the internal stability of the overall system under mild conditions by using the decentralized stability criterion developed in [7], where the crux of the matter is to check a positive realness (PR) [8]  requirement. We finally confirm the good performance of the proposed controller through numerical simulations on the modified Icelandic Power Network test case [9].

II. POWER SYSTEM MODEL
We consider a power network composed of n buses indexed by i ∈ N := {1, . . . , n} and transmission lines denoted by unordered pairs {i, j} ∈ E ⊂ {{i, j} : i, j ∈ N , i = j}. As illustrated by the block diagram in Fig. 1, the system dynamics are modeled as a feedback interconnection of bus dynamics and network dynamics. The input signals p in := (p in,i , i ∈ N ) ∈ R n represent power injection changes and the output signals ω := (ω i , i ∈ N ) ∈ R n represent the bus frequency deviations from its nominal value. We now discuss the dynamic elements in more detail.
1) Bus Dynamics: The set of buses N is a disjoint union of the set of generator buses G and the set of inverter buses I, i.e., N = G I. The bus dynamics that map net power bus imbalances u P := (u P,i , i ∈ N ) ∈ R n to frequency deviations ω can be described by the transfer function matrix H(s) := diag(ĥ i (s), i ∈ N ), whereĥ i (s) is the transfer function of either generator or inverter depending on whether i ∈ G or i ∈ I. a) Generator Dynamics: We consider generator dynamics that are composed of the standard swing dynamics with turbine droop, i.e., where m i > 0 denotes the aggregate generator inertia, d i > 0 the aggregate generator damping, τ i > 0 the turbine time constant, and r t,i > 0 the turbine droop coefficient. b) Inverter Dynamics: We consider grid-forming inverters, which set local grid frequency deviations ω i directly as a function of their power output variation q r,i = −u P,i . The detailed function depends on the control lawĥ i (s) employed to map u P,i to ω i for buses with i ∈ I.
2) Network Dynamics: The network power fluctuations p e := (p e,i , i ∈ N ) ∈ R n are given by a linearized model of the power flow equations [10]: wherep e (s) andω(s) denote the Laplace transforms of p e and ω, respectively. 1 The matrix L B is an undirected weighted Laplacian matrix of the network with elements Here, θ := (θ i , i ∈ N ) ∈ R n denotes the angle deviation from its nominal, θ 0 := (θ 0,i , i ∈ N ) ∈ R n are the equilibrium angles, |V i | is the (constant) voltage magnitude at bus i, and b ij is the line {i, j} susceptance.
3) Closed-Loop Dynamics: We are interested in the closed-loop response of the system in Fig. 1 from the power injection changes p in to frequency deviations ω, which can be described by the transfer function matrix It is in general tough to analyze or tune the performance ofT ωp (s). Nevertheless, when the system is tightlyconnected [11], all buses exhibit a coherent response approximated byT where 1 n ∈ R n is the vector of all ones and Henceforth, we refer toĥ c (s) in (5) as the coherent dynamics of the network.

III. GRID-FORMING FREQUENCY SHAPING CONTROL
Motivated by (4), we focus in this paper on shaping the responseĥ c (s), instead of (3). Thus, given generator dynamicsĥ i (s) for buses with i ∈ G, our goal is to design inverter dynamicsĥ i (s) for buses with i ∈ I such that the coherent dynamicsĥ c (s) is a first-order transfer function with two degrees of freedom. Such a coherent dynamics actually naturally ensures Nadir elimination as well as tunable steady-state frequency deviation and RoCoF, as the following theorem formally states.
Theorem 1 (Grid-forming frequency shaping control). Consider generator dynamicsĥ i (s), i ∈ G, as in (1). Then, the grid-forming inverter control laŵ with m I,i , d I,i > 0, renders a first-order coherent dynamicŝ with a, b > 0 given by if and only if i∈Iĝ In this case, the frequency deviations will experience no Nadir and the steady-state frequency deviations ω(∞) and the RoCoF |ω| ∞ will be determined by when the system undergoes step power injection changes, i.e., p in = u 0 1 t≥0 ∈ R n with u 0 ∈ R n being any arbitrary vector direction and 1 t≥0 being the unit-step function.
Proof. Applying the desired coherent dynamics given by (7) and the generator transfer function given by (1) to the definition of coherent dynamics given by (5) yields Thus, the desired inverter control law should satisfy i∈Iĥ −1 It is straightforward that the control law determined by (6), (8), and (9) guarantees that the above condition hold. This concludes the proof of the first statement. Next, combining (3) and (4), we can see that the frequency deviationsω(s) of the systemT ωp in response to step power injection changesp in (s) = u 0 /s is given bŷ which can be interpreted as that the frequency deviation on each bus reacts to the aggregate step power injection change of size n i=1 u 0,i with the coherent dynamicsĥ c (s). Now, applying initial and final value theorems to (11) withĥ c (s) given by (7), we find that a and b satisfy the following relations: which concludes the proof of (10).
Clearly, given specific requirements on steady-state frequency and RoCoF, there are infinite ways of choosing m I,i and d I,i to satisfy (8). A straightforward choice is to set where |I| denotes the cardinality of I. Similarly, we propose the following two strategies to meet (9).
• Matching individual turbine dynamics by individual inverters: Assume the cardinality of I is no less than that of G, i.e., |I| ≥ |G|. Let I t ⊂ I such that there is a bijection between I t and G that maps each j ∈ G to distinct i ∈ I t by the following relation ∀i ∈ I \ I t , simply setĝ I,i (s) = 0. • Distributing the first-order reduced order model of the aggregate turbine dynamics [12] over inverters: Let z i ≥ 0, ∀i ∈ I, be weighting parameters satisfying Tuningĝ I,i (s) by distributing the first-order reduced order model of the aggregate turbine dynamics over inverters seems to be a more practical choice for two reasons. First, it gets rid of the need to accurately estimate droop coefficients and time constants of all individual turbines. Second, it relaxes the cardinality assumption |I| ≥ |G|. (10)). Choosing a and b to meet frequency specifications (10) naturally asks for knowledge of the current network composition via (8) and (9). The estimation of dynamic parameters, including but not limited to inertia, is currently an active research area [12]- [14]. This endorses our utilization of (10) for safety specification. Arguably, whether (8) holds rigorously for chosen a and b is not of major concern. We highlight that the proposed control always improve RoCoF for any positive m I,i and steady-state for large enough d I,i , ∀i ∈ I.

Remark 1 (Meeting frequency specifications
Remark 2 (Steady-state power output from grid-forming frequency shaping control inverters). It is easy to show from (1), (5), (6), and (8) that the steady-state power output from the proposed inverters depends on the relation between d i for i ∈ I and r −1 t,i for i ∈ G. Note that, if I = ∅, thenĥ c (0) = 1/ i∈G d i + r −1 t,i ; otherwiseĥ c (0) = 1/ i∈G d i + i∈I d I,i . Hence, as long as i∈I d I,i > i∈G r −1 t,i , the collection of inverters will provide power in steady-state since the steady-state frequency deviation will be reduced.

Remark 3 (Freedom of resources allocation).
The coherent dynamicsĥ c (s) depends merely on the summation of the inverse of grid-forming frequency shaping control transfer functionsĥ i (s) over i ∈ I, but not on the way of how these control resources are distributed across the network. Although, in our discussion above, control resources are mainly equally distributed over inverters, there are actually many other possibilities. Thus, a promising future research direction will be the exploration of how to optimally allocate control resources based on additional performance metrics that may be of interest.
Considering the two choices ofĝ I,i (s) suggested before, we make the following assumption on the form ofĝ I,i (s).

IV. STABILITY ANALYSIS
In this section, we show that the grid-forming frequency shaping control given by (6) and (14) ensures internal stability of the overall system in Fig. 1 under mild conditions compatible with (9). To this end, we first review some standard concepts that play a role in our stability analysis.
Definition 1 (H ∞ space [15]). H ∞ is the Hardy space of functionsF (s) that are analytic in the open righthalf complex plane C + with a bounded norm F ∞ := sup s∈C+ |F (s)|.

Definition 2 (Positive real [8]). A proper rational transfer function matrixF (s) is called positive real (PR) if:
• Poles of all elements ofF (s) are in the closed left-half complex plane C − . • For any ν ∈ R such that jν is not a pole of any element ofF (s), the matrixF (jν) +F T (−jν) is positive semidefinite. • For any ν ∈ R such that jν is a pole of some element ofF (s), the pole jν is simple and the residue matrix lim s→jν (s − jν)F (s) is positive semidefinite Hermitian. Here, j represents the imaginary unit that satisfies j 2 = −1.
Remark 4 (Real rational subspace of H ∞ ). The real rational subspace of H ∞ consists of all proper real rational stable transfer matrices. Thus, in order to check whether a proper real rational transfer function belongs to H ∞ or not, it is sufficient to check whether it is stable or not.
Remark 5 (Applications of positive realness). The positive realness was originally introduced in electrical network synthesis [16] and recently extended to mechanical network synthesis [17]. Moreover, it has been applied a lot to stability analysis for both linear and nonlinear systems.
We are now ready to conduct a stability analysis.
Proof. According to the decentralized stability criterion proposed in [7], the systemT ωp is internally stable if ∃τ α , > 0 such that with where V i and V j denote the maximum allowable voltage magnitudes at endpoints of the line {i, j}. Thus, the key is to check whether the condition in (15) holds forĥ i (s), ∀i ∈ N .
Combining (6) and (14), we know that ∀i ∈ I, We begin with the later case, from which we get First, it is well-known that a second-order transfer function is stable if all coefficients of its denominator have the same sign. Thus, m I,i , d I,i , σ i > 0, and d I,i > ρ i , ∀i ∈ I, guarantee the stability of (16), i.e., γ iĥi (s) ∈ H ∞ . Second, it is trivial to check that γ iĥi (0) = γ i / (d I,i − ρ i ) = 0. Last but not least, we need to show that ∃τ α , > 0 such that which is equivalent to with We now show that (17) holds by performing the algebraic test for positive realness proposed in [18]. That is, for the nondegenerate case, i.e., (ξ 0,i , ξ 1,i , ξ 2,i , ξ 3,i ) T ∈ R 4 ≥0 and (η 0,i , η 1,i , η 2,i , η 3,i ) T ∈ R 4 ≥0 \ 0 4 with 0 4 being the zero vector of size 4, the condition (17) holds if and only if We check the nonnegativity of all coefficients in (17) first. Suppose τ α > 0 and 0 < < 1. Clearly, it follows directly from m I,i , d I,i , σ i > 0, and d I,i > ρ i , ∀i ∈ I, that ξ 3,i , η 0,i , η 1,i , η 2,i , η 3,i > 0. Also, for any given τ α > 0, ξ 0,i , ξ 1,i , ξ 2,i > 0 if is sufficiently small. Now we are ready to check whether (19) holds or not. Applying (18) to the left hand side of (19) yields Applying (18) to the right hand side of (19) yields Through standard algebra, using (20) and (21), we get for any sufficiently small , which means (19) holds. Thus, the required positive realness in (17) has been proved. Therefore, γ iĥi (s) ∈ Q in this case.
We then turn to the simple case where First, the stability of (22), i.e., γ iĥi (s) ∈ H ∞ , follows from the fact that the only pole of it is −d I,i /m I,i < 0. Second, γ iĥi (0) = γ i /d I,i = 0. As for the required positive realness, (22) can be considered as a special case of (16) with ρ i = 0 and σ i = 0. Plugging ρ i = 0 and σ i = 0 into (18) gives for any sufficiently small , which lead to the required positive realness. Therefore, γ iĥi (s) ∈ Q in this case. Finally, from (1), we know that ∀i ∈ G, Observe that (23) and (16) have the same form except for some minor sign differences. Thus, the proof of γ iĥi (s) ∈ Q follows from a similar argument on (16). This concludes the proof that the systemT ωp is internally stable.

V. NUMERICAL ILLUSTRATIONS
In this section, we present simulation results that compare the novel grid-forming frequency shaping control with the popular grid-forming virtual inertia control [19]. The simulations are conducted on the Icelandic Power Network available in the Power Systems Test Case Archive [9]. Instead of the linearized network model used in the analysis, the simulations are built upon a nonlinear setup including nonlinear power flows and line losses. The original dynamic model contains 35 generator buses and 83 load buses, whose union is denoted as N . To mimic a low-inertia scenario, we only keep 6 generator buses that are equipped with turbines out of original 35 generator buses. Each of above 6 generator buses is distinctly indexed by some i ∈ {1, . . . , 6} := G here. We then randomly pick 6 buses from the set N \G as inverter buses. Each of above 6 inverter buses is distinctly indexed by some i ∈ {7, . . . , 12} := I here. The remaining buses are left as load buses denoted by L := N \ (G ∪ I).
For every generator bus i ∈ G, the aggregate generator inertia m i , the turbine time constant τ i , and the turbine droop coefficient r t,i are directly obtained from the dataset. In addition, turbine governor deadbands are taken into account such that turbines are only responsive to frequency deviations exceeding ±0.036 Hz [20]. Given that the values of generator damping coefficients are not provided by the dataset, we set d i = 1 p.u.. For every load buses i ∈ L, the damping coefficient is chosen as 1/20 of the mean of all generator damping coefficients, i.e.,d := ( i∈G d i )/|G|.
The inverter control law on buses i ∈ I is either gridforming virtual inertia (GF-VI) or grid-forming frequency shaping (GF-FS). The GF-VI is modelled aŝ where m v,i > 0 is the virtual inertia constant and d v,i > 0 is the virtual damping constant. ∀i ∈ I, we set m v,i = m := ( i∈G m i )/|G| and d v,i =d. As for the GF-FS in (6), we only test the more practical tuning method suggested in Section III, whereĝ I,i (s) is obtained by distributing the first-order reduced model of the aggregate turbine dynamics over inverters. Thus, ∀i ∈ I, we set m I,i =m, which ensures that the RoCoF and steady-state frequency deviations under GF-VI and GF-FS are the same so as to provide a fair comparison. Note that, with this setting, the stability condition required in Theorem 2 is satisfied since d I,i =d +r −1 t /6 >r −1 t /6 = ρ i , ∀i ∈ I. For the purpose of comparison, the frequency deviation of the system without inverters when there is a step change of −0.3 p.u. in power injection at a randomly picked bus at time t = 1 s is provided in Fig. 2(a). The performances of the system under the two inverter control laws are given in Fig. 2(b) and Fig. 2(c). Some observations can be made. First, the system under GF-FS almost exhibits a first-order coherent dynamics as predicted by Theorem 1, while the system under GF-VI experiences a deep Nadir. Second, Nadir elimination via GF-FS only requires an acceptable amount of control effort.

VI. CONCLUSIONS AND FUTURE WORK
A novel grid-forming frequency shaping control has been proposed for inverter-based frequency control in low-inertia power systems. The proposed control is able to force the system frequency to exhibit first-order coherent dynamics with specified steady-state frequency deviations and RoCoF in response to sudden power injection changes. The key benefit of a first-order frequency response is that the frequency deviations gradually evolve towards the final equilibrium without experiencing Nadir so as to improve frequency security. The internal stability of the system is guaranteed by the proposed control under mild conditions. The performance of the proposed control is verified through numerical simulations.
Future work include: (i) developing a more advanced control to achieve a second-order coherent dynamics with desired steady-state frequency deviations, RoCoF, and tunable Nadir; (ii) investigating the problem of optimal allocation of the proposed control resources over the network; (iii) considering a more detailed inverter model to throw light to device-level execution of the proposed control.