Short Communication Daniel Lemire, DOT-Lab Research Center, Université du
Québec (TELUQ), Montreal, Quebec, H2S 3L5, Canada<EMAIL_ADDRESS>Natural
Sciences and Engineering Research Council of Canada, Grant Number:
RGPIN-2017-03910

# Fast Number Parsing Without Fallback

Noble Mushtak  Daniel Lemire

###### Abstract

In recent work, Lemire (2021) presented a fast algorithm to convert number
strings into binary floating-point numbers. The algorithm has been adopted by
several important systems: e.g., it is part of the runtime libraries of GCC
12, Rust 1.55, and Go 1.16. The algorithm parses any number string with a
significand containing no more than 19 digits into an IEEE floating-point
number. However, there is a check leading to a fallback function to ensure
correctness. This fallback function is never called in practice. We prove that
the fallback is unnecessary. Thus we can slightly simplify the algorithm and
its implementation.

###### keywords:

Parsing, IEEE-754, Floating-Point Numbers

##  1 Introduction

Current computers typically support 32-bit and 64-bit IEEE-754 binary
floating-point numbers in hardware [1]. Real numbers are approximated by
binary floating-point numbers: a fixed-width integer $m$ (the _significand_)
multiplied by 2 raised to an integer exponent $p$: $m\times 2^{p}$. Numbers
are also frequently exchanged as strings in decimal form (e.g., 3.1416,
1.0e10, 4E3). Given decimal numbers in a string, we must find efficiently the
nearest available binary floating-point numbers when loading data from text
files (e.g., CSV, XML or JSON documents).

A 64-bit binary floating-point number relies on a 53-bit significand $m$. A
32-bit binary floating-point number has 24-bit significand $m$. Given a string
representing a non-zero number (e.g., -3.14E+12), we represent it as a sign
(e.g., -), an integer $w\in[1,2^{64})$ (e.g., $w=314$) and a decimal power
(e.g., 10): $-314\times 10^{10}$. The smallest positive value that can be
represented using a 64-bit floating-point number is $2^{-1074}$. We have that
$w\times 10^{-343}<2^{-1074}$ for all $w<2^{64}$. Thus if the decimal exponent
is smaller than -342, then the number must be considered to be zero. If the
decimal exponent is greater than 308, the result must be infinite (beyond the
range).

In the simplest terms, to represent a decimal number into a binary floating-
point number, we need to multiply the decimal significand by a power of five:
$m\times 10^{q}=(m\times 5^{q})\times 2^{q}$. Or, conversely, divide it by a
power of five. For large powers, an exact computation is impractical thus we
use truncated tables.

Lemire’s approach to compute the binary significand is given in Algorithm 1
[2]: the complete algorithm needs to compute the binary exponent, handle
subnormal numbers, and rounding. The algorithm effectively multiplies the
64-bit decimal significand with a 128-bit truncated power of five, or the
reciprocal of a power of five, conceptually producing a 192-bit product but
truncating it to its most significant 128 bits. When the last 102 bits of the
128-bit product (for 32-bit floating-point numbers) or the last 73 bits of the
128-bit product (for 64-bit floating-point numbers) is made entirely of 1
bits, a more accurate computation (e.g., relying on the full power of five)
may produce a different result. Thus the algorithm may sometimes fail and
require a fallback (line 6). However, Lemire did not produce an example where
a fallback is needed. We want to show that it never happens for 32-bit and
64-bit floating-point numbers and that the algorithm always succeeds. Hence,
the check and fallback are unnecessary. The check represents a small
computational cost. Table 1 presents the number of instructions and cycles per
number in one dataset for two
systems.111https://github.com/lemire/simple_fastfloat_benchmark By removing
the check, we reduce the number of instructions and CPU cycles per number
parsed by 5% on one system (Intel) and by slightly over 1% on another (Apple).

| Intel Ice Lake, GCC 11 | Apple M2, LLVM 14
---|---|---
base instructions per number | 271 | 299
improved instructions per number | 257 | 295
CPU cycles per number | 57.2 | 44.6
improved CPU cycles per number | 55.5 | 43.0
Table 1: Performance comparison while parsing the numbers of the canada
dataset [2] using CPU performance counters. The reference is the fast_float
library (version 3.2.0). We estimate a 2% error margin on the cycle/number
metric while the instruction count is nearly error-free. We get the improved
numbers by removing the unnecessary check.

1:an integer $w\in[1,2^{64})$ and an integer exponent $q\in(-342,308)$

2:a table $T$ containing 128-bit reciprocals and powers of five for powers
from $-342$ to $308$ $\triangleright$ [2, Appendix B]

3:$l\leftarrow$ the number of leading zeros of $w$ as a 64-bit (unsigned) word

4:$v\leftarrow 2^{l}\times w$ $\triangleright$ We normalize the significand.

5: Compute the 128-bit truncated product $z\leftarrow(T[q]\times v)\div
2^{64}$.

6:if ($z\bmod 2^{73}=2^{73}-1$ for 64-bit numbers or $z\bmod
2^{102}=2^{102}-1$ for 32-bit numbers) and $q\notin[-27,55]$ then

7: Fallback needed $\triangleright$ [2, Remark 1]

8:end if

9:Return $m\leftarrow$ the most significant 55 bits (64-bit) or 26 bits
(32-bit) of the product $z$

Algorithm 1 Algorithm to compute the binary significand from a positive
decimal floating-point number $w\times 10^{q}$ for the IEEE-754 standard. We
compute more bits to allow for exact rounding and to account for a possible
leading zero bit. We use the convention that $a\bmod b$ is the remainder of
the integer division of $a$ by $b$.

##  2 Related Work

Clinger [3, 4] was maybe earliest in describing accurate and efficient
decimal-to-binary conversion techniques. He proposed a fast path using the
fact that small powers of 10 can be represented exactly as floats. His fast
path is still useful today. Gay [5] implemented a fast general decimal-to-
binary implementation that is still popular. Gay’s strategy is to first find
quickly a close approximation, and then to refine it with exact big-integer
arithmetic.

The reverse problem, binary-to-decimal conversion, has received much attention
[6]. Adams [7, 8] bound the maximum and minimum of $ax\bmod b$ over an
interval starting at zero, to show that powers of five truncated to 128 bits
are sufficient to convert 64-bit binary floating-point numbers into equivalent
decimal numbers.

##  3 Continued Fractions

Given a sequence of integers $a_{0},a_{1},\ldots$, the expression
$a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}+\frac{1}{\cdots}}}$ is a _continued
fraction_. We can write a rational number $n/d$ where $n$ and $d>0$ are
integers as a continued fraction by computing $a_{0},a_{1},\ldots$. A
continued fraction represents a sequence of converging values
$c_{0}=a_{0},c_{1}=a_{0}+\frac{1}{a_{1}},c_{2}=a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}}},c_{3}=a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}+\frac{1}{a_{3}}}},\ldots$
We call each such value ($c_{0},c_{1},c_{2},\ldots$) a _convergent_. Each
convergent is a rational number: we can find integers $p_{n}$ and $q_{n}$ such
that $c_{n}=p_{n}/q_{n}$. We are interested in computing the convergents
quickly. We can check that $p_{0}=a_{0},q_{0}=1$,
$p_{1}=a_{1}p_{0}+1,q_{1}=a_{1}q_{0}$, and
$p_{2}=a_{2}p_{1}+p_{0},q_{2}=a_{2}q_{1}+q_{0}$. We have the general formulas
$p_{n}=a_{n}p_{n-1}+p_{n-2},q_{n}=a_{n}q_{n-1}+q_{n-2}$. These recursion
formulas were known to Euler. Rational numbers that are close to a value $x$
are also convergents according to the following theorem due to Legendre [9,
10].

######  Theorem 3.1.

For $q>0$ and $p,q$ integers, if the fraction $p/q$ is such that
$|p/q-x|<\frac{1}{2q^{2}}$, then $p/q$ is a convergent of $x$.

##  4 Ruling Out Fallback Cases

Let $w$ and $q$ be the decimal significand and the decimal exponent,
respectively, of the decimal number to be converted into a binary floating-
point number. We require that the decimal significand is a positive 64-bit
number. We multiply $w$ by a power of two to produce $v\in[2^{63},2^{64})$.
Let $T[q]$ be the 128-bit number representing a truncated power of five or the
reciprocal of a power of five. The fallback condition may be needed when the
least significant 73 bits of the most significant 128 bits of the product of
$v$ and $T[q]$ are all 1 bits. When parsing 32-bit floating-point numbers, we
have a more generous margin (102 bits instead of 73 bits), so it is sufficient
to review the 64-bit case.

Assume that the least significant 73 bits of the most significant 128 bits of
the product of $v$ and $T[q]$ are all 1 bits. It is equivalent to requiring
that the number made of the least significant 137 bits of the product,
$r=(T[q]\times v)\bmod 2^{137}$, is larger than or equal to $2^{137}-2^{64}$:
$r\geq 2^{137}-2^{64}$. By the next lemma, we have that $v$ is the denominator
of a convergent of $T[q]/2^{137}$.

######  Lemma 4.1.

Given positive integers $T[q]<2^{128}$ and $v<2^{64}$, we have that
$(T[q]\times v)\bmod 2^{137}\geq 2^{137}-2^{64}$ implies that $n/v$, for
$n=1+\lfloor T[q]\times v/2^{137}\rfloor$, is a convergent of $T[q]/2^{137}$.

######  Proof 4.2.

By definition, we have that $a=b\lfloor a/b\rfloor+(a\bmod b)$ given two
integers $a,b$ when $b>0$. Thus, given $r=(T[q]\times v)\bmod 2^{137}$, we
have that $(T[q]\times v)=2^{137}\lfloor T[q]\times v/2^{137}\rfloor+r.$
Substracting $r$ from both sides, we get $(T[q]\times v)-r=2^{137}\lfloor
T[q]\times v/2^{137}\rfloor.$ Adding $2^{137}$ on both sides, we get
$(T[q]\times v)+2^{137}-r=2^{137}+2^{137}\lfloor T[q]\times
v/2^{137}\rfloor=2^{137}n.$ Let $x=2^{137}-r$, then we have $(T[q]\times
v)+x=2^{137}n$. And because $v$ is non-zero we can divide by $v\times 2^{137}$
throughout to get $\frac{T[q]}{2^{137}}+\frac{x}{v\times 2^{137}}=n/v.$

Because $(T[q]\times v)\bmod 2^{137}\geq 2^{137}-2^{64}$, we have that $r\geq
2^{137}-2^{64}$, and so $2^{137}-r\leq 2^{64}$ or $x\leq 2^{64}$.

Finally, we have

$\displaystyle\left|\frac{T[q]}{2^{137}}-\frac{n}{v}\right|$
$\displaystyle=\frac{x}{v\times 2^{137}}$ $\displaystyle\Rightarrow$
$\displaystyle\leq\frac{1}{v\times 2^{73}}$ because $x\leq 2^{64}$
$\displaystyle\Rightarrow$ $\displaystyle<\frac{1}{2v^{2}}$ because
$v<2^{64}$.

Hence, we have that $n/v$ is a convergent of the rational number
$T[q]/2^{137}$ by Theorem 3.1. $\Box$

Thus, if the fallback condition is triggered by some decimal significand $v$
and some decimal scale $q$, the significand $v$ must be the denominator of a
convergent of $T[q]/2^{137}$.

It remains to show that it suffices to check the convergent as simple
fractions. If $n/v$ is a convergent, then $(n/d)/(v/d)$ where $d=\gcd(n,d)$ is
the simple counterpart. If $v<2^{64}$, then $v/d<2^{64}$. We want to show that
if $(T[q]\times v)\bmod 2^{137}\geq 2^{137}-2^{64}$ then
$(T[q]\times\frac{v}{d})\bmod 2^{137}\geq 2^{137}-2^{64}$.

Consider the following technical lemma which relates $a\times\frac{v}{d}\bmod
2^{137}$ and $(a\times v)\bmod 2^{137}$.

######  Lemma 4.3.

Given positive integers $a$ and $v$, we have that
$\left(a\times\frac{v}{d}\right)\bmod 2^{137}=2^{137}+\frac{(a\times v)\bmod
2^{137}-2^{137}}{d}$ where $d=\gcd(v,1+\lfloor a\times v/2^{137}\rfloor)$.

######  Proof 4.4.

We have that $a\times v=2^{137}(1+\lfloor a\times v/2^{137}\rfloor)+((a\times
v)\bmod 2^{137})-2^{137}$. Given $d=\gcd(v,1+\lfloor a\times
v/2^{137}\rfloor)$, then $(1+\lfloor a\times v/2^{137}\rfloor)/d$ and $v/d$
are integers. We have that $a\times v/d=2^{137}(1+\lfloor a\times
v/2^{137}\rfloor)/d+((a\times v)\bmod 2^{137}-2^{137})/d$. Thus it follows
that $(a\times v/d)\bmod 2^{137}=2^{137}+((a\times v)\bmod
2^{137}-2^{137})/d$. $\Box$

Suppose that $(T[q]\times v)\bmod 2^{137}\geq 2^{137}-2^{64}$, then by Lemma
4.3, we have

$\displaystyle\left(T[q]\times\frac{v}{d}\right)\bmod 2^{137}$
$\displaystyle=2^{137}+\frac{(T[q]\times v)\bmod 2^{137}-2^{137}}{d}$
$\displaystyle\geq 2^{137}+\frac{2^{137}-2^{64}-2^{137}}{d}$
$\displaystyle\geq 2^{137}-2^{64}/d.$

Hence we have that if $(1+\lfloor T[q]\times v/2^{137}\rfloor)/v$ is a
convergent such that $(T[q]\times v)\bmod 2^{137}\geq 2^{137}-2^{64}$, then
the simplified convergent, $v^{\prime}\leftarrow v/d$, also satisfies
$(T[q]\times v^{\prime})\bmod 2^{137}\geq 2^{137}-2^{64}$ since $d\geq 1$.
Thus it is sufficient to check the convergents in simplified form. We have
proven the following proposition.

######  Proposition 4.5.

Given a positive integer $T[q]$, we have that there exists a positive integer
$v<2^{64}$ such that $(T[q]\times v)\bmod 2^{137}\geq 2^{137}-2^{64}$ if and
only if there is a continued-fraction convergent $p^{\prime}/q^{\prime}$ of
$T[q]/2^{137}$ such that $p^{\prime}/q^{\prime}$ is a simple fraction
($\gcd(p^{\prime},q^{\prime})=1$), $q^{\prime}<2^{64}$ and $(T[q]\times
q^{\prime})\bmod 2^{137}\geq 2^{137}-2^{64}.$

For any decimal exponent $q$, to check whether there exists a decimal
significand $1\leq v<2^{64}$ which triggers the fallback condition, it
suffices to examine all convergents of $T[q]/2^{137}$ with a denominator less
than $2^{64}$ and check whether $(T[q]\times v)\bmod 2^{137}\geq
2^{137}-2^{64}$. We can convert $T[q]/2^{137}$ into a continued fraction and
compute the coefficients $a_{0},a_{1},a_{2},\ldots$. We can then use the
recursive formulas for computing convergents to enumerate all convergents as
simple fractions [9]. Given convergents as simple fraction
$p_{0}/q_{0},p_{1}/q_{1},\ldots$, we check whether $(T[q]\times q_{i})\bmod
2^{137}\geq 2^{137}-2^{64}$ for $i=0,1,\ldots$ It is enough to check the
convergents with a denominator smaller than $2^{64}$. We implement this
algorithm with a Python script: the script reports that no fallback is needed.
Hence no fallback is required for 64-bit significands in the number-parsing
algorithm described by Lemire [2].

## References

  * 307 [1985] IEEE Standard for Binary Floating-Point Arithmetic.  ANSI/IEEE Std 754-1985 1985;p. 1–20.
  * Lemire [2021] Lemire D.  Number parsing at a gigabyte per second.  Software: Practice and Experience 2021;51(8):1700–1727.  https://doi.org/10.1002/spe.2984.
  * Clinger [1990] Clinger WD.  How to Read Floating Point Numbers Accurately.  SIGPLAN Not 1990 Jun;25(6):92–101.  https://doi.org/10.1145/93548.93557.
  * Clinger [2004] Clinger WD.  How to Read Floating Point Numbers Accurately.  SIGPLAN Not 2004 Apr;39(4):360–371.  https://doi.org/10.1145/989393.989430.
  * Gay [1990] Gay DM, Correctly rounded binary-decimal and decimal-binary conversions; 1990.  AT&T Bell Laboratories Numerical Analysis Manuscript 90-10.
  * Steele and White [2004] Steele GL, White JL.  How to Print Floating-Point Numbers Accurately.  SIGPLAN Not 2004 Apr;39(4):372–389.  https://doi.org/10.1145/989393.989431.
  * Adams [2018] Adams U.  Ryū: Fast Float-to-String Conversion.  In: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation PLDI 2018, New York, NY, USA: Association for Computing Machinery; 2018. p. 270–282.  https://doi.org/10.1145/3192366.3192369.
  * Adams [2019] Adams U.  Ryu Revisited: Printf Floating Point Conversion.  Proc ACM Program Lang 2019 Oct;3(OOPSLA).  https://doi.org/10.1145/3360595.
  * Hardy et al. [1979] Hardy GH, Wright EM, et al.  An introduction to the theory of numbers.  Oxford university press; 1979.
  * Legendre [1808] Legendre AM.  Essai sur la theorie des nombres.  chez Courcier, imprimeur-libraire pour les mathematiques, quai des Augustins; 1808.


# On Stability Analysis of Power Grids with Synchronous Generators and Grid-
Forming Converters under DC-side Current Limitation

Sayan Samanta1 and Nilanjan Ray Chaudhuri1 1Sayan Samanta and Nilanjan Ray
Chaudhuri are with The School of Electrical Engineering & Computer Science,
The Pennsylvania State University, University Park, PA 16802, USA.
<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

Stability of power grids with synchronous generators (SGs) and renewable
generation interfaced with grid-forming converters (GFCs) under dc-side
current limitation is studied. To that end, we first consider a simple 2-bus
test system and reduced-order models to highlight the fundamental difference
between two classes of GFC controls – (A) droop, dispatchable virtual
oscillator control (dVOC) and virtual synchronous machine (VSM), and (B)
matching control. Next, we study Lyapunov stability and input-output stability
of the dc voltage dynamics of class-A GFCs for the simple system and extend it
to a generic system. Next, we provide a sufficiency condition for input-to-
state stability of the 2-bus system with a class-B GFC and extend it for a
generic system. Finally, time-domain simulations from a reduced-order averaged
model of the simple test system and a detailed switched model of the GFC
validate the proposed conditions.

##  I Introduction

Although a lot of intellectual capital has been invested towards research on
prospective grids with 100% converter-based generation – it is of the authors’
opinion that such systems may not become a reality as far as bulk power
systems are concerned. Bulk power grids of the near and even distant future
are expected to have SGs in them, since hydro, solar thermal, and nuclear
power are all here to stay. Indeed, many studies have been performed on the
penetration of converter-based resources in presence of SGs, e.g. [1, 2] and
references therein, which in spite of their obvious merit, lack analytical
insights that are fundamental to identifying major challenges in modeling and
control of such systems and develop new theories in solving them.

It is only in the recent past that these gaps and challenges were summarized
in a comprehensive manner by Milano et-al [3]. Among the multitude of fertile
areas of research that can be pursued to solve these challenges, we focus on
the dynamics, stability, and control of the real power channel in such systems
that primarily affects the dc-link voltages of converter-based renewable
generation and frequency of the ac system. To that end, we consider the GFC
technology and it’s interaction with SGs in a bulk power grid, where two
classes of GFC controls – (1) droop, dVOC and VSM [4, 5, 6] – we call it
class-A, and (2) matching control [7] – we term it class-B, are compared.

Our research is motivated by two relatively new papers on this topic [8, 9].
In [8], modeling adequacy of such systems is established through singular
perturbation theory – our paper follows similar modeling guidelines. However,
the control law assumed for governor action in SGs in [8] is not quite
realistic. A more realistic turbine-governor dynamics is considered in a
follow up paper [9]. This paper showed some interesting findings on frequency
of ac system and dc voltage dynamics of GFCs in presence of dc-side and ac
current limitations. It was demonstrated that in presence of dc-side current
limit, the dc voltages of class-A GFCs can become unstable under large
increase in load, while class-B GFCs demonstrate increased robustness in
stability, since regulation of their ac side angle dynamics takes into account
the dc voltage dynamics. However, analytical treatment of stability guarantees
in presence of dc-side current limitations was reserved for future research.
In addition, we feel that there is a need to complement the efforts in
contrasting the basics of class-A and class-B GFCs in these papers by
presenting the characteristics of class-A GFCs in the converter power– dc
voltage plane and also bringing more clarity on their fundamental difference
with the class-B counterpart.

Thus motivated, the objectives of this paper are twofold – (1) develop an
understanding of the fundamental difference between the two classes of GFC
controls; and (2) provide analytical guarantees of stability (for class-A and
-B) and sufficiency conditions of instability (for class-A) in presence of dc-
side current limitation, when such converters are connected to a power system
with SG-based conventional generation. Presence of both ac and dc-side current
limitations is considered out of scope for this work and will be reported in a
future paper. Nevertheless, we have presented a discussion on this topic in
Section III.C.

##  II  Classes of GFC Controls: Reduced-Order Model

A typical circuit diagram of a GFC interfacing renewable resources is shown in
Fig. 1 whose dc bus is connected for example, to a PV solar unit or the dc
side of ac-dc converter of a Type-4 wind turbine. Therefore, we restrict our
focus to the dc to ac unidirectional power flow scenario, i.e. energy storage
is excluded from our analysis. The notations associated with parameters and
variables mentioned in this figure are standard and self-explanatory, see [10]
for example.

Figure 1: Circuit diagram of GFC.

The GFC is controlled in a synchronously rotating $d-q$ reference frame whose
angular frequency $\omega_{c}$ is imposed by the converter. The standard inner
current control, albeit without any limits and voltage control loops, common
across class-A and class-B, are shown in Fig. 2. It is the outer loops where
the GFC control strategies differ – for further details on class-A and class-B
outer loops, the readers are referred to [8, 9].

Figure 2: Block diagram of voltage and current control loops.

First, we consider a simple test system shown in Fig. 3 with one SG and one
GFC. Based upon modeling adequacy study presented in [8], we assume that the
control loops shown in Fig. 2 track the references instantaneously, and the
transmission dynamics and losses can be neglected. Moreover, since our focus
is on the dynamics of the real power channel, we represent the dc-link
dynamics of the GFC and the swing dynamics of the SG along with corresponding
turbine-governor dynamics. Also, SGs are assumed to have adequate headroom to
deliver any load change and a dc power flow assumption is made. Next, we
present the reduced-order model of this system based on the time-scale
separation of ac and dc dynamics [8, 9].

###  II-A Reduced-order Model of Class-A GFCs

Neglecting the time constant $\tau_{c}$ of the dc energy source in Fig. 1, we
can derive the test system model with class-A GFC shown in Fig. 5(a):

$\displaystyle\dot{v}_{dc}=\frac{1}{{C_{c}}}\left[{-G_{c}v_{dc}+sat\left({k_{c}\left({v_{dc}^{*}-v_{dc}}\right),i_{dc}^{max}}\right)-\frac{{P_{c}}}{{v_{dc}}}}\right]$
(1a)
$\displaystyle\dot{\phi}=\underline{\omega}_{c}-\underline{\omega}_{g};~{}~{}\underline{\omega}_{c}=-d_{pc}\left({P_{c}-P_{c}^{*}}\right);~{}~{}~{}\underline{\omega}_{g}=\omega_{g}-\omega_{g}^{*}$
(1b)
$\displaystyle\dot{\underline{\omega}_{g}}=\frac{1}{{2H_{g}}}\left[{P_{\tau
g}-P_{g}}\right]\approx\frac{1}{{2H_{g}}}\left[{P_{\tau g}+b\phi-
P_{Lg}}\right]$ (1c) $\displaystyle\dot{P}_{\tau
g}=\frac{1}{{\tau_{g}}}\left[{P_{g}^{*}-d_{pg}\underline{\omega}_{g}-P_{\tau
g}}\right]$ (1d)

where, $c,g,\tau g$: subscripts corresponding to GFC, SG, and turbine-
governor, $*$: superscript for reference quantities, $v_{dc}$: dc-link
voltage, $C_{c}$: dc-link capacitance, $G_{c}$: conductance representing dc-
side losses, $k_{c}$: dc voltage droop constant, $i_{dc}^{max}$: dc-side
current limit reflecting the capacity of the renewable resource, $P,~{}P_{L}$:
real power output, load, $\phi$: angle difference between bus voltages of GFC
and SG, i.e., $\phi=\theta_{c}-\theta_{g}$, $d_{pc}$: coefficient of
droop/dVOC/VSM control, $\omega$: angular frequency, $H_{g}$: SG inertia
constant, $\tau_{g}$: turbine time constant, $d_{pg}$: SG inverse governor
droop, and $b$: transmission line susceptance.

Figure 3: Single-line diagram of the test system. Figure 4: $\omega_{g}$ and
$\omega_{c}$ for class-B GFC Figure 5: Block diagram of simplified
mathematical models of the test system in Fig. 3 for: (a) Class-A GFCs (droop,
dVOC, VSM control) and (b) Class-B GFCs (matching control): feedback path from
GFC to grid is highlighted.

###  II-B Reduced-order Model of Class-B GFCs

Modifying (1a) by including the feedforward terms considered in matching
control as in [9], we can write:

$\small
C_{c}\dot{v}_{dc}=-G_{c}v_{dc}+sat\left({G_{c}v_{dc}+\frac{{P_{c}^{*}}}{{v_{dc}^{*}}}+k_{c}\left({v_{dc}^{*}-v_{dc}}\right),i_{dc}^{\max}}\right)-\frac{{P_{c}}}{{v_{dc}}}$
(2)

With matching control law $k_{m}v_{dc}=\omega_{c}$ and
$k_{m}v_{dc}^{*}=\omega^{*}=1$ pu, we can modify (2) and (1)(b)-(d) to derive
the test system model with class-B GFC, which is shown in Fig. 5(b). In
presence of matching control, as the angle dynamics is very fast compared to
the machine dynamics, a reasonable assumption is
$\omega_{c}\approx\omega_{g}\Rightarrow\underline{\omega}_{c}\approx\underline{\omega}_{g}=\omega_{g}-\omega^{*}$
[9]. This can be shown through time-domain simulation of Fig. 5(b) following a
step change in $P_{Lc}$, which is highlighted in Fig. 4. Since
$\underline{\omega}_{c}$ and $\underline{\omega}_{g}$ are indistinguishable
with step change in $P_{Lg}$, it is not shown. With this approximation, we can
write:

$\normalsize\begin{array}[]{l}\frac{{C_{c}}}{{k_{m}^{2}}}\underline{\dot{\omega}}_{g}=sat\left({-\frac{{k_{c}}}{{k_{m}^{2}}}\underline{\omega}_{g},\underline{P}_{c}^{\max}}\right)+P_{c}^{*}-P_{c}\frac{{\omega^{*}}}{{\omega_{g}}}\\\
~{}~{}~{}~{}~{}~{}\approx
sat\left({-d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max}}\right)-\underline{P}_{c}\end{array}$
(3)

With $\frac{{C_{c}}}{{k_{m}^{2}}}\approx 0$ as assumed in [9], we can write:

$\underline{P}_{c}=-sat\left({d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max}}\right)$
(4)

where,
$d_{pc}=\frac{{k_{c}}}{{k_{m}^{2}}},\underline{P}_{c}^{\max}=v_{dc}^{*}i_{dc}^{\max}-G_{c}{v_{dc}^{*}}^{2}-P_{c}^{*},\underline{P}_{c}=P_{c}-P_{c}^{*}.$
With total load in the system $P_{L}=P_{Lg}+P_{Lc}$ and power balance under
nominal condition, i.e. $-P_{g}^{*}-P_{c}^{*}+P_{L}^{*}=0$, we can write:

$\begin{array}[]{l}\underline{\dot{\omega}}_{g}=\frac{1}{{2H_{g}}}\left({\underline{P}_{\tau
g}-sat\left({d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max}}\right)-\underline{P}_{L}}\right)\\\
\underline{\dot{P}}_{\tau g}=\frac{1}{{\tau_{g}}}\left({-\underline{P}_{\tau
g}-d_{pg}\underline{\omega}_{g}}\right)\end{array}$ (5)

where, $\underline{P}_{\tau g}=P_{\tau g}-P_{g}^{*}$ and
$\underline{P_{L}}=P_{L}-P_{L}^{*}$.

###  II-C Discussion on Fundamental Difference between Class-A and Class-B
GFCs

The model of class-A GFCs in (1) is shown in a block diagram form in Fig.
5(a). The most striking aspect of this class of control is that it merely acts
as a buffer to adjust the frequency of its terminal voltage in order to
deliver the power $P_{c}$ demanded by the system, which in turn affects the
dc-link voltage dynamics. The converter has no direct control over $P_{c}$ and
the dc-link dynamics does not have any ‘feedback mechanism’ to alter it.
Therefore, the stability of the dc-link voltage of class-A GFCs described by
(1a) can be analyzed in isolation. Let, $v_{dc}=x>0$, $v_{dc}^{*}=x^{*}$,
$P_{c}=u>0$, and $(\bar{x},\bar{u})$, $\bar{x}>0,\bar{u}>0$ be the equilibrium
point. Also, assume $x^{*}$ is chosen such that the allowable maximum value of
$x$ is $\tilde{x}^{*}=\frac{k_{c}}{(k_{c}+G_{c})}x^{*}$, i.e. when
$x\rightarrow\tilde{x}^{*}$, protective circuits will kick in and limit the dc
voltage. Define, $y=x-\bar{x}\Rightarrow x=y+\bar{x},v=u-\bar{u}\Rightarrow
u=v+\bar{u}$. Now, (1a) can be written as:

$\dot{y}=\frac{1}{C_{c}}[-G_{c}(y+\bar{x})+sat(k_{c}(x^{*}-y-\bar{x}),i_{dc}^{max})-\frac{v+\bar{u}}{y+\bar{x}}]$
(6)

This equation is in the form $\dot{y}=f(y,v),~{}y=h(y)$, where $f:D_{y}\times
D_{v}\to\mathbb{R}$ is locally Lipschitz in $(y,v)$, $h:D_{y}\to D_{y}$ is
continuous in $(y,v)$, $f(0,0)=0$, and domains
$D_{y}=(-\bar{x},~{}\tilde{x}^{*}-\bar{x})\subset\mathbb{R},D_{v}\subset\mathbb{R}$
contain the origin. The equilibrium $(\bar{x},\bar{u})$ satisfies the
following equation:

$\bar{u}=\begin{cases}f_{1}:-G_{c}\bar{x}^{2}+k_{c}\bar{x}(x^{*}-\bar{x}),~{}~{}if~{}~{}|k_{c}(x^{*}-\bar{x})|\leq
i_{dc}^{max}&\\\
f_{2}:-G_{c}\bar{x}^{2}+\bar{x}i_{dc}^{max},~{}~{}otherwise\end{cases}$

Depending upon the value of $x$ where the maxima of $\bar{u}$ is found, we can
get four types of characteristics in $x-u$ plane as shown in Fig. 6. Out of
these, the typical case is that in Fig. 6(a) – going forward, unless otherwise
mentioned, we will consider this characteristic. We note that for any given
$\bar{u}$, there exists two equilibria
$\bar{x}_{1}\in\Omega_{1}=\left[{x_{m},\tilde{x}^{*}}\right)$ and
$\bar{x}_{2}\in\Omega_{2}=\left({0,\left.{x_{m}}\right]}\right.$, where
$x_{m}=x^{*}-\frac{i_{dc}^{max}}{k_{c}}$.

Figure 6: Four possible $u$ vs $x$ characteristics.

In contrast, the model of class-B GFCs before reduction to the form in (5) is
shown in Fig. 5(b). The most important difference with respect to its class-A
counterpart is that it has a ‘feedback mechanism’ from the dc-link voltage
dynamics to the rest of the system that can alter the power $P_{c}$ demanded
from the GFC. Thus, the stability of dc-link voltage can not be analyzed in
isolation and a reduced-order model in (5) is used for this purpose. Assuming
$z=\left[{\underline{\omega}_{g}~{}~{}\underline{P}_{\tau
g}}\right]^{T},~{}~{}w=-\underline{P}_{L}$, (5) can be expressed as
$\dot{z}=g(z,w),~{}g:\mathbb{R}^{2}\times\mathbb{R}\rightarrow\mathbb{R}^{2}$,
where $g$ is locally Lipschitz in $(z,w)$, and $g(0,0)=0$. From a control
design point of view, the fundamental difference between class-A and B can
also be perceived as their dependency on either the ac or dc quantities [11,
12].

##  III Stability Analysis in Presence of dc-side Current Limits

We focus on stability analysis of $v_{dc}$ in presence of dc-side current
limits. To that end, we establish the following: (1) Lyapunov stability and
region of attraction (ROA) for class-A and class-B GFCs, (2) Sufficiency
condition for input-output stability for class-A GFCs, (3) Sufficiency
condition for instability of class-A GFCs, and (4) Sufficiency condition for
input-to-state stability for class-B GFCs.

###  III-A Stability Analysis of Class-A GFC

We first focus on the reduced model of the 2-bus test system in Fig. 3 and
present the following Theorems and Lemmas.

######  Theorem III.1.

For class-A GFCs, the equilibrium $\bar{x}_{1}$ is asymptotically stable with
ROA $\mathcal{R_{A}}=\left({\bar{x}_{2},\left.{\tilde{x}^{*}}\right)}\right.$.

###### Proof.

Corresponding to the domain $\Omega_{1}$ for $x$, (6) can be rewritten as:

$\dot{y}=\frac{1}{{C_{c}}}\left[{-G_{c}y-k_{c}y+\frac{{\bar{u}}}{{\bar{x}_{1}}}\frac{y}{{y+\bar{x}_{1}}}-\frac{v}{{y+\bar{x}_{1}}}}\right]$
(7)

where,
$y\in\tilde{D}_{y}=[x_{m}-\bar{x}_{1},~{}\tilde{x}^{*}-\bar{x}_{1})\subset
D_{y},~{}v\in D_{v}$. Choosing a Lyapunov function
$V_{1}=\frac{{C_{c}}}{2}y^{2},y\in\tilde{D}_{y}$, we can write for the
unforced system:
$\dot{V}_{1}=\left[{-\left({G_{c}+k_{c}}\right)+\frac{{\bar{u}}}{{\bar{x}_{1}}}\frac{1}{{y+\bar{x}_{1}}}}\right]y^{2}$.
It can be shown that $\dot{V}_{1}$ is negative definite, if
$y>\tilde{x}^{*}-2\bar{x}_{1}$. In the most typical case as in Fig. 6(a),
$\bar{x}_{1}>x_{m}>\frac{\tilde{x}^{*}}{2}$, which satisfies this condition.
Therefore, $\bar{x}_{1}$ is asymptotically stable $\forall x\in\Omega_{1}$.

To establish the ROA of $\bar{x}_{1}$, we analyze Lyapunov stability of
$\bar{x}_{2}\in\Omega_{2}$ shown in Fig. 6(a) with the same $\bar{u}$. To that
end, we can rewrite (6) with $v=0$ as:
$\dot{y}=\frac{1}{{C_{c}}}\left[{-G_{c}\left({y+\bar{x}_{2}}\right)+i_{dc}^{\max}-\frac{{\bar{u}}}{{y+\bar{x}_{2}}}}\right],~{}~{}y\in\bar{D}_{y}=(-\bar{x}_{2},x_{m}-\bar{x}_{2}]$.
Choosing a continuously differentiable function
$V_{2}=\frac{{C_{c}}}{2}\left[{\bar{x}_{2}^{2}-\left({y+\bar{x}_{2}}\right)^{2}}\right],~{}~{}y\in\bar{D}_{y}$,
s.t. $V_{2}\left(0\right)=0$. We choose a ball
$B_{r}=\left\\{{y~{}\in\mathbb{R}~{}~{}|~{}~{}|y|\leq r}\right\\}$ and define
set $U=\left\\{{y~{}\in B_{r}~{}~{}|~{}~{}V_{2}>0}\right\\}$ – note that
$U\subseteq\left({-\bar{x}_{2},\left.0\right)}\right.$. Therefore, we can
choose $y(0)=y_{0}\in U$ arbitrarily close to the origin s.t.
$V_{2}(y_{0})>0$. Also, $\dot{V}_{2}>0,\forall y~{}\in U$, if
$y<\frac{{i_{dc}^{\max}}}{G_{c}}-2\bar{x}_{2}$. Taking into account the
typical characteristics in Fig. 6(a) and analyzing local maxima of $f_{2}$, we
can write $\frac{{i_{dc}^{\max}}}{{2G_{c}}}>\bar{x}_{2}$. Therefore,
$\dot{V}_{2}>0,\forall y~{}\in U$, which provides a sufficiency condition for
instability of $\bar{x}_{2}$ following Chetaev’s theorem [13]. This implies
that $x(t)$ with any initial value
$x(0)=x_{0}\in\left({0,\left.{\bar{x}_{2}}\right)}\right.\subset\Omega_{2}$
will move away from $\bar{x}_{2}$ and reach $0$.

Next, choosing a continuously differentiable function
$V_{3}=\frac{{C_{c}}}{2}\left[{\left({y+\bar{x}_{2}}\right)^{2}-\bar{x}_{2}^{2}}\right],~{}~{}y\in\bar{D}_{y}$,
s.t. $V_{3}\left(0\right)=0$ – it is easy to follow similar arguments and show
that $V_{3}>0,\forall
y\in\left({0,\left.x_{m}-\bar{x}_{2}\right]}\right.\subset\bar{D}_{y}$. This
implies that $x(t)$ with any initial value
$x_{0}\in\bar{\Omega}_{2}=\left({\bar{x}_{2},\left.{x_{m}}\right]}\right.\subset\Omega_{2}$
will move away from $\bar{x}_{2}$ and reach $x_{m}$.

We define
$\mathcal{R_{A}}=\bar{\Omega}_{2}\bigcup\Omega_{1}=\left({\bar{x}_{2},\left.{\tilde{x}^{*}}\right)}\right.$,
which is the largest open, connected, invariant set in
$\Omega_{2}\bigcup\Omega_{1}$, such that
$\mathop{\lim}\limits_{t\to\infty}x(t)=\bar{x}_{1},\forall
x\left(0\right)\in\mathcal{R_{A}}$. This implies $\mathcal{R_{A}}$ is the ROA
for equilibrium $\bar{x}_{1}$ of class-A GFCs. ∎

######  Corollary III.1.1.

For class-A GFCs, the equilibrium $\bar{x}_{1}$ is exponentially stable in
$\Omega_{1}$.

###### Proof.

As mentioned in Theorem III.1, the chosen Lyapunov function is
$V_{1}=\frac{{C_{c}}}{2}y^{2}=\frac{{C_{c}}}{2}|y|^{2},y\in\tilde{D}_{y}$.
Also,
$\dot{V}_{1}\leq\left[{-\left({G_{c}+k_{c}}\right)+\frac{{\bar{u}}}{{\bar{x}_{1}}}\frac{1}{{x_{m}}}}\right]|y|^{2},y\in\tilde{D}_{y}$.
Since,
$m=-\left({G_{c}+k_{c}}\right)+\frac{{\bar{u}}}{{\bar{x}_{1}}}\frac{1}{{x_{m}}}<0$,
it satisfies all conditions in Theorem $4.10$ in [13], and therefore
$\bar{x}_{1}$ is exponentially stable in $\Omega_{1}$. ∎

######  Theorem III.2.

The dc voltage dynamics of class-A GFCs described in (6) is small-signal
finite-gain $\mathcal{L}_{p}$ stable $\forall p\in[1,\infty]$, if
$y(0)=y_{0}\in\left\\{{|y|\leq r}\right\\}\subset\tilde{D}_{y},~{}r>0$. Also,
for a $r_{v}>0$, s.t. $\left\\{{|v|\leq r_{v}}\right\\}\subset
D_{v},~{}r_{v}>0,\forall v\in\mathcal{L}_{pe}$ with
$\mathop{\sup|v|}\limits_{0\leq
t\leq\tau}\leq\min\left\\{{r_{v},|m|x_{m}r}\right\\}$, the output $y(t)$ is
bounded by the following relation $\left\lVert
y_{\tau}\right\rVert_{\mathcal{L}_{p}}\leq\frac{\left\lVert
v_{\tau}\right\rVert_{\mathcal{L}_{p}}}{|m|x_{m}}+\beta~{}~{}\forall\tau\in[0,\infty)$,
where $\beta=|y_{0}|,~{}~{}if~{}~{}p=\infty,$ and
$\left({\frac{C_{c}}{{p|m|}}}\right)^{\frac{1}{p}}|y_{0}|,~{}~{}if~{}~{}p\in\left[{1,\left.\infty\right)}.\right.$

###### Proof.

We proved that $y=0$ is exponentially stable in $\tilde{D}_{y}$ in Corollary
III.1.1. With Lyapunov function
$V_{1}=\frac{{C_{c}}}{2}y^{2}=\frac{{C_{c}}}{2}|y|^{2}$, we have
$\dot{V}_{1}\leq-|m||y|^{2},~{}\left|{\frac{{\partial V_{1}}}{{\partial
y}}}\right|=C_{c}\left|y\right|,~{}\forall y\in\tilde{D}_{y}$. Also,
$\left|{f\left({y,v}\right)-f\left({y,0}\right)}\right|\leq\frac{1}{{C_{c}x_{m}}}\left|v\right|,\left|{h\left({y,v}\right)}\right|=\left|y\right|,~{}\forall
y\in\tilde{D}_{y},~{}\forall v\in D_{v}$. This satisfies all conditions in
Theorem $5.1$ in [13] and proves the conditions for input-output stability and
bound on output. ∎

######  Theorem III.3.

For class-A GFCs, the equilibrium $\bar{x}_{1}\in\Omega_{1}$ of (6) with $v=0$
is unstable if
$\bar{u}>-G_{c}(y+\bar{x}_{1})^{2}+(y+\bar{x}_{1})sat(k_{c}(x^{*}-y-\bar{x}_{1}),i_{dc}^{max})$
for any $y\in[-r,~{}0)$, where
$r=\min\left\\{{\bar{x}_{1},\tilde{x}^{*}-\bar{x}_{1}}\right\\}$.

###### Proof.

The unforced system can be expressed as
$\dot{y}=\frac{1}{C_{c}}[-G_{c}(y+\bar{x_{1}})+sat(k_{c}(x^{*}-y-\bar{x_{1}}),i_{dc}^{max})-\frac{\bar{u}}{y+\bar{x_{1}}}],~{}\forall
y\in D_{y}\subset\mathbb{R}$. Define a continuously differentiable function,
$V_{4}:D_{y}\rightarrow\mathbb{R}$,
$V_{4}(y)=\frac{1}{2}C_{c}[\bar{x}_{1}^{2}-(y+\bar{x}_{1})^{2}]$ such that
$V_{4}(0)=0$. Choose
$r\in(0,\min\left\\{{\bar{x}_{1},\tilde{x}^{*}-\bar{x}_{1}}\right\\}]$ such
that the ball $B_{r}=\\{y\in\mathbb{R}|~{}|y|\leq r\\}$, $B_{r}\subset D_{y}$.
Define, $U=\\{y\in B_{r}|V_{4}(y)>0\\}$, implying $U=[-r,~{}0)$. Choose
$y_{0}$ in the interior of $U$ $\implies$ $y_{0}<0$. Hence, $V_{4}(y_{0})>0$
for any such $y_{0}$ arbitrarily close to the origin. Now, derivative of
$V_{4}$ along the trajectory of $y$ is:

$\dot{V_{4}}=G_{c}(y+\bar{x}_{1})^{2}-(y+\bar{x}_{1})sat(k_{c}(x^{*}-y-\bar{x}_{1}),i_{dc}^{max})+\bar{u}$

According to Chetaev’s theorem [13], the sufficiency condition for instability
is $\dot{V}_{4}>0,~{}\forall y\in U$, which proves the theorem. ∎

Now, we extend these proofs for a generic system with $m_{1}$ SGs and $n_{1}$
class-A GFCs, and introduce the following Corollary.

######  Corollary III.3.1.

Theorems III.1,III.2,III.3 and Corollary III.1.1 hold for any generic system.

###### Proof.

Discussions from Section II-C establish that the stability properties
investigated in these theorems are independent of the systems as long as the
GFC-level assumptions taken in Section II hold. Therefore, these theorems and
the corollary hold individually for each of the $n_{1}$ class-A GFCs. ∎

###  III-B Stability Analysis of Class-B GFC

In this section, we first analyze the stability of class-B GFCs for the 2-bus
system shown in Fig. 3 and present the following lemma and theorem.

######  Lemma III.4.

For class-B GFCs, the equilibrium $z=0$ is globally asymptotically stable
$\forall\;d_{pg},d_{pc}$ $>0$.

###### Proof.

For unforced system, $w=-\underline{P}_{L}=0$. Choose Lyapunov function with
$d_{pg}>0$,
$V_{5}=H_{g}\underline{\omega}_{g}^{2}+\frac{\tau_{g}}{2d_{pg}}\underline{P}_{\tau
g}^{2}$.

$\Rightarrow\dot{V}_{5}=-\frac{\underline{P}_{\tau
g}^{2}}{d_{pg}}-\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max})$

Here,
$\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max})>0~{}~{}\forall\;\underline{\omega}_{g}\in\mathbb{R}-\left\\{{0}\right\\},d_{pc}>0$.
Thus, $\dot{V}_{5}$ is negative definite and radially unbounded
$\forall\;d_{pg},d_{pc}>0$. Therefore, the origin is globally asymptotically
stable when this condition is satisfied. ∎

######  Remark.

We observe that the ROA for $y=0$ corresponding to the equilibrium
$\bar{x}_{1}$ of class-A GFCs is limited to
$y\in(\bar{x}_{2}-\bar{x}_{1},\tilde{x}^{*}-\bar{x}_{1})$, while the same for
$z=0$ of class-B GFCs is $\mathbb{R}^{2}$. Also, equilibrium $\bar{x}_{2}$ of
class-A GFCs is unstable.

######  Theorem III.5.

The reduced-order model (5) is input-to-state stable with class $\mathcal{KL}$
function $\beta$ and class $\mathcal{K}$ function
$\gamma\left({\left|w\right|}\right)=c\max\left\\{{\chi_{1}\left({\left|w\right|}\right),\chi_{2}\left({\left|w\right|}\right)}\right\\},~{}c>0$
for piecewise continuous $w(t)$ that is bounded in $t,~{}\forall t\geq 0$
implying
$\left\|{z(t)}\right\|\leq\beta\left({\left\|{z(t_{0})}\right\|,t-t_{0}}\right)+\gamma\left({\mathop{\sup}\limits_{\tau\geq
t_{0}}|{w\left(\tau\right)}|}\right),\forall t\geq t_{0}$ – where,
$\chi_{1}\left({\left|w\right|}\right)=\frac{{\underline{P}_{c}^{\max}}}{{d_{pc}}}\tanh^{-1}\left({\frac{{|w|}}{{\theta\underline{P}_{c}^{\max}}}}\right)$
and
$\chi_{2}\left({\left|w\right|}\right)=\left[{\frac{|w|d_{pg}}{{\theta}}\chi_{1}\left({\left|w\right|}\right)}\right]^{\frac{1}{2}}$,
$~{}\forall
w\in(-\theta\underline{P}_{c}^{\max},~{}\theta\underline{P}_{c}^{\max}),~{}\underline{P}_{c}^{\max}\in\mathbb{R}_{>0},~{}0<\theta<1$,
$\mathbb{R}_{>0}$ : positive real space.

###### Proof.

In Lemma III.4, it is shown that $\dot{z}=g(z,0)$ is globally asymptotically
stable. It can be shown that the Lyapunov function $V_{5}(z)$ satisfies the
following inequalities:
$\lambda_{\min}\left(Q\right)\left\|z\right\|_{2}^{2}\leq
V_{5}\left(z\right)\leq\lambda_{\max}\left(Q\right)\left\|z\right\|_{2}^{2}$,
which implies $\alpha_{1}\left({\left\|z\right\|}\right)\leq
V_{5}\left(z\right)\leq\alpha_{2}\left({\left\|z\right\|}\right)$, where
$\alpha_{1}$ and $\alpha_{2}$ are class $\mathcal{K_{\infty}}$ functions and
$Q=\begin{bmatrix}H_{g}&0\\\ 0&\frac{\tau_{g}}{2d_{pg}}\end{bmatrix}$. For
$0<\theta<1$, we can write:

$\dot{V_{5}}=-\frac{\underline{P}_{\tau
g}^{2}}{d_{pg}}-\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max})+w\underline{\omega}_{g}\\\
\leq-(1-\theta)\left(\frac{\underline{P}_{\tau
g}^{2}}{d_{pg}}+\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max})\right)\\\
-\theta\left(\frac{\underline{P}_{\tau
g}^{2}}{d_{pg}}+\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max})\right)+\left|w\right|\left|\underline{\omega}_{g}\right|$

Let us define, $W=(1-\theta)\left(\frac{\underline{P}_{\tau
g}^{2}}{d_{pg}}+\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max})\right)$,
which is a positive definite function in $\mathbb{R}^{2}$. Now, define
$\Gamma=-\theta(\frac{\underline{P}_{\tau
g}^{2}}{d_{pg}}+\underline{\omega}_{g}sat(d_{pc}\underline{\omega}_{g},\underline{P}_{c}^{\max}))+\left|w\right|\left|\underline{\omega}_{g}\right|$.
The term $\Gamma$ will be $\leq$ 0 if
$\left|\underline{\omega}_{g}\right|\geq\frac{{\underline{P}_{c}^{\max}}}{{d_{pc}}}\tanh^{-1}\left({\frac{{|w|}}{{\theta\underline{P}_{c}^{\max}}}}\right)=\chi_{1}\left({\left|w\right|}\right)$
or
$\left|\underline{\omega}_{g}\right|\leq\chi_{1}\left({\left|w\right|}\right)$
and $\left|\underline{P}_{\tau
g}\right|\geq\left[{\frac{|w|d_{pg}}{{\theta}}\chi_{1}\left({\left|w\right|}\right)}\right]^{\frac{1}{2}}=\chi_{2}\left({\left|w\right|}\right)$.
This condition implies
$\left\|z\right\|_{\infty}\geq\max\left\\{{\chi_{1}\left({\left|w\right|}\right),\chi_{2}\left({\left|w\right|}\right)}\right\\}=\rho\left({\left|w\right|}\right)$.
So,

$\dot{V_{5}}\leq-W,~{}~{}\forall\left\lVert
z\right\rVert_{\infty}\geq\rho(|w|)$

Here, $\rho(|w|)$ is a class $\mathcal{K}$ function with
$w\in(-\theta\underline{P}_{c}^{\max},~{}\theta\underline{P}_{c}^{\max})$.
Since, $\underline{P}_{c}^{\max}\in\mathbb{R}_{>0}$, we contend that the above
holds $\forall(z,w)\in\mathbb{R}^{2}\times\mathbb{R}$. Therefore, we have
satisfied all conditions of input-to-state stability per Theorem $4.19$ in
[13].

Now, we need to define class $\mathcal{K}$ function
$\gamma=\alpha_{1}^{-1}\circ\alpha_{2}\circ\rho$. It can be shown that
$\gamma\left({\left|w\right|}\right)=\sqrt{\frac{{\lambda_{\max}\left(Q\right)}}{{\lambda_{\min}\left(Q\right)}}}\rho\left({\left|w\right|}\right)=c\rho\left({\left|w\right|}\right)$.

∎

Next, we extend these proofs for a generic system with $m_{1}$ SGs, $n_{1}$
class-B GFCs, and $p_{1}$ load buses. We assume that the center-of-inertia
(COI) of this system is representative of its average frequency dynamics and
the corresponding frequency $\omega_{COI}\approx\omega_{ci},~{}\forall
i=1,2,\dots,n_{1}$. Following the same approach as in Section II-B, we can
present the reduced-order model of this system:

$\begin{array}[]{l}\underline{\dot{\omega}}_{COI}=\frac{1}{2{H_{T}}}\left[{\underline{P}_{\tau
gT}-\sum\limits_{i=1}^{n_{1}}{sat\left({d_{pci}\underline{\omega}_{COI},\underline{P}_{ci}^{\max}}\right)-\underline{P}_{LT}}}\right]\\\
\underline{\dot{P}}_{\tau gT}=\frac{1}{{\tau_{gT}}}\left[{-\underline{P}_{\tau
gT}-d_{pgT}\underline{\omega}_{COI}}\right]\\\ \end{array}$ (8)

Here, $H_{T}=\sum\limits_{i=1}^{m_{1}}{H_{gi}},~{}P_{\tau
gT}=\sum\limits_{i=1}^{m_{1}}{P_{\tau
gi}},~{}P_{gT}^{*}=\sum\limits_{i=1}^{m_{1}}{P_{gi}^{*}},~{}d_{pgT}=\sum\limits_{i=1}^{m_{1}}{d_{pgi}},~{}\tau_{gi}=\tau_{gT}\forall
i,~{}P_{LT}=\sum\limits_{i=1}^{p_{1}}{P_{Li}},~{}\underline{\omega}_{COI}=\omega_{COI}-\omega^{*},~{}\underline{P}_{\tau
gT}=P_{\tau gT}-P_{gT}^{*},~{}\underline{P}_{LT}=P_{LT}-P_{LT}^{*}$. Assuming
$z_{1}=\left[{\underline{\omega}_{COI}~{}~{}\underline{P}_{\tau
gT}}\right]^{T},~{}~{}w_{1}=-\underline{P}_{LT}$, (8) can be expressed as
$\dot{z_{1}}=g_{1}(z_{1},w_{1}),~{}g_{1}:\mathbb{R}^{2}\times\mathbb{R}\rightarrow\mathbb{R}^{2}$,
where $g_{1}$ is locally Lipschitz in $(z_{1},w_{1})$, and $g_{1}(0,0)=0$. We
present the following lemma to analyze Lyapunov stability of this system.

######  Lemma III.6.

For class-B GFCs, the equilibrium $z_{1}=0$ is globally asymptotically stable
$\forall\;d_{pgT},d_{pci}$ $>0$,$\forall i$.

###### Proof.

It is a simple extension of Lemma III.4. We use the Lyapunov function
$V_{6}=H_{T}\underline{\omega}_{COI}^{2}+\frac{\tau_{gT}}{2d_{pgT}}\underline{P}_{\tau
gT}^{2}$ with $d_{pgT}>0$ and notice that
$\sum\limits_{i=1}^{n_{1}}{\underline{\omega}_{COI}sat(d_{pci}\underline{\omega}_{COI},\underline{P}_{ci}^{\max})}>0~{}~{}\forall\;\underline{\omega}_{COI}\in\mathbb{R}-\left\\{{0}\right\\},d_{pci}>0~{}\forall
i$, which proves the Lemma. ∎

Next, we present a corollary relating the input-to-state stability of this
system.

######  Corollary III.6.1.

Theorem III.5 can be extended for establishing the input-to-state stability of
(8) with the following modifications: (1) $\underline{P}_{c}^{\max}$ and
$d_{pc}$ correspond to the minimum value of
${\underline{P}_{ci}^{\max}\tanh\left({\left|{\frac{{d_{pci}}}{{\underline{P}_{ci}^{\max}}}\underline{\omega}_{COI}}\right|}\right)},\forall
i=1:n_{1}$, (2)
$\chi_{1}\left({\left|w_{1}\right|}\right)=\frac{{\underline{P}_{c}^{\max}}}{{d_{pc}}}\tanh^{-1}\left({\frac{{|w_{1}|}}{{\theta
n_{1}\underline{P}_{c}^{\max}}}}\right)$ and
$\chi_{2}\left({\left|w_{1}\right|}\right)=\left[{\frac{|w_{1}|d_{pgT}}{{\theta}}\chi_{1}\left({\left|w_{1}\right|}\right)}\right]^{\frac{1}{2}}$,
$~{}\forall w_{1}\in(-\theta n_{1}\underline{P}_{c}^{\max},~{}\theta
n_{1}\underline{P}_{c}^{\max})$.

###### Proof.

Assuming $V_{6}$ as the Lyapunov function, this can be easily proved following
same steps as in Theorem III.5. ∎

###  III-C Remarks on Assumptions

1\. Network model: It was shown in [14] that network dynamics introduces both
positive and negative effects on stability in systems with GFCs and SGs.
Although algebraic representation of the network gives a conservative
stability estimate, the inclusion of network dynamics imposes strict upper
bounds on droop feedback gains for ensuring voltage and frequency stability.

2\. AC current limits: The ac current limits are used to constrain GFC current
during faults. We point out that following a fault, typically the reactive
component of current increases significantly [15] compared to the real
component. As a result, this might not lead to dc-side current saturation. On
the other hand, the problem of generation loss leads to increase in real power
output and hence dc-side current limit is reached first. Assuming that the
available headroom $(i_{dc}^{max}-i_{dc})$ is not very large (which is
typical), the ac current limit might not be hit in this condition. If, however
this is not the case, then ac-side constraints need to be taken into account
in stability analysis, which is outside the scope of the present paper.

3\. Frequency of class-B GFCs: For class-B GFCs, the working assumption in the
$2$-bus test system is $\omega_{c}\approx\omega_{g}$, whereas in the
multimachine system, we assume $\omega_{COI}\approx\omega_{ci},~{}\forall
i=1,2,\dots,n_{1}$. In reality, this may not be true. Also, such models cannot
capture the oscillatory electromechanical dynamics present in practical
multimachine systems that reflects the angle stability issues.

4\. DC voltage filtering in class-B GFC: In reality, switching ripple in dc-
link voltage can propagate to angle reference through $\omega_{c}$ of class-B
GFCs. If a low pass filter is used to mitigate this issue, it needs to be
considered in the stability analysis.

##  IV Results & Discussions

For validating the proposed lemmas and theorems, we consider the test system
shown in Fig. 3. To that end, the averaged models shown in Fig. 5 are built in
Matlab Simulink and a detailed switched model of a standalone GFC connected to
a constant power load $P_{LC}$ is developed in EMTDC/PSCAD including the
control loops shown in Fig.2.

Figure 7: Class-A GFC: unforced response from PSCAD model.

We validate the ROAs for both classes of GFCs using the PSCAD model by
switching the dc bus capacitor voltage to a value $x_{0}$ at $t=0.2$ s while
operating at equilibrium $(\bar{x}_{1},\bar{u})$. In Fig. 7, it is shown that
for class-A GFC, $v_{dc}$ collapses if $x_{0}<\bar{x}_{2}$, whereas it is
stable if $x_{0}>\bar{x}_{2}$ by slight margin, which validates the ROA
defined in Theorem III.1. Figure 8 shows that $v_{dc}$ returns back to
$\bar{x}_{1}$ even if it is switched below $\bar{x}_{2}$ for class-B GFC.

Figure 8: Class-B GFC: unforced response from PSCAD model.

Next, we validate the ROAs using the average models that capture the dynamics
of both SG and GFC. Figure 9 shows the unforced response of these models by
initializing $v_{dc}$ at different values while operating at equilibrium
$(\bar{x}_{1},\bar{u})$. Here, the class-B GFC is stable even when the initial
voltage state is significantly lower than $\bar{x}_{2}$.

Figure 9: Unforced response from averaged models.

To validate Theorem III.2, a small step change is given in the load from
$\bar{u}=175$ kW to $\bar{u}_{m}=177$ kW in PSCAD model of class-A GFC (see,
Fig. 10(a)). It can be seen from Fig. 10(b), that the dc voltage is stable. In
Fig. 10 (c,d), it is shown that when $u=\bar{u}_{m}$, the unforced response
becomes unstable when the initial value of $x$ is less than $x_{m}$, which
proves Theorem III.3.

Figure 10: Class-A GFC PSCAD model: (a),(b): Forced response; (c),(d):
Unforced response.

For class-B GFC, a large step change is given in the load from $\bar{u}=165$
kW to $\bar{u}_{m}=177$ kW – Fig. 11 confirms the input to state stability per
Theorem III.5.

Figure 11: Power and DC voltage plot for class-B GFC.

##  V Conclusion

Stability analysis of power systems consisting of SGs and GFCs with dc-side
current limitation showed that the ROA of class-A GFC is a subset of its
class-B counterpart. We established the conditions for small-signal finite
gain $\mathcal{L}_{p}$ stability of class-A GFC and input-to-state state
stability of class-B GFC following a bounded variation in the load of the
system, and validated the results through simulation studies.

## Appendix

$k_{c}$ | 1.6e3 $\mho$ | $v_{dc}^{*}$ | 2.44 kV | $C_{c}$ | 8 mF
---|---|---|---|---|---
$G_{c}$ | 0.83 $\mho$ | $P_{c}^{*}$ | 150 kW | $P_{g}^{*}$ | 150 kW
b | 5e3 p.u. | $H_{g}$ | 3.7 s | $\tau_{g}$ | 5 s
$k_{m}$ | 128.75 $V^{-1}$ | $\omega^{*}$ | 314.16 rad/s | $d_{pg}$ | 7 p.u.
$d_{pc}$ | 1e-3 p.u. | $i_{dc}^{max}$ | 75 A | $P_{c}^{max}$ | 178 kW

## References

  * [1] N.. Miller, M. Shao, S. Pajic and R. D’Aquila  “Western wind and solar integration study phase 3-frequency response and transient stability”  In _National Renewable Energy Lab.(NREL), Golden, CO (United States); GE Energy Management, Schenectady, NY (United States), Tech. Rep._ , 2014
  * [2] EirGrid and Soni  “DS3: System Services Review TSO Recommendations”  In _EirGrid, Tech. Rep_ , 2012
  * [3] F. Milano et al.  “Foundations and Challenges of Low-Inertia Systems (Invited Paper)”  In _2018 Power Systems Computation Conference (PSCC)_ , 2018, pp. 1–25
  * [4] M.. Chandorkar, D.. Divan and R. Adapa  “Control of parallel connected inverters in standalone AC supply systems”  In _IEEE Transactions on Industry Applications_ 29.1, 1993, pp. 136–143
  * [5] Q. Zhong and G. Weiss  “Synchronverters: Inverters That Mimic Synchronous Generators”  In _IEEE Transactions on Industrial Electronics_ 58.4, 2011, pp. 1259–1267
  * [6] G. Seo et al.  “Dispatchable Virtual Oscillator Control for Decentralized Inverter-dominated Power Systems: Analysis and Experiments”  In _2019 IEEE Applied Power Electronics Conference and Exposition (APEC)_ , 2019, pp. 561–566
  * [7] Catalin Arghir, Taouba Jouini and Florian Dörfler  “Grid-forming control for power converters based on matching of synchronous machines”  In _Automatica_ 95, 2018, pp. 273–282
  * [8] S. Curi, D. Groß and F. Dörfler  “Control of low-inertia power grids: A model reduction approach”  In _2017 IEEE 56th Annual Conference on Decision and Control (CDC)_ , 2017, pp. 5708–5713
  * [9] A. Tayyebi et al.  “Frequency Stability of Synchronous Machines and Grid-Forming Power Converters”  In _IEEE Journal of Emerging and Selected Topics in Power Electronics_ 8.2, 2020, pp. 1004–1018
  * [10] A. Yazdani and R. Iravani  “Voltage-Sourced Converters in Power Systems: Modeling, Control, and Applications”, Wiley - IEEE  Wiley, 2010
  * [11] Yuan Gao, Hai-Peng Ren and Jie Li  “Grid-Forming Converters control based on DC voltage feedback”, 2020  arXiv:2009.05759 [eess.SY]
  * [12] Ali Tayyebi, Adolfo Anta and Florian Dörfler  “Hybrid Angle Control and Almost Global Stability of Grid-Forming Power Converters”, 2020  arXiv:2008.07661 [math.OC]
  * [13] Hassan K Khalil  “Nonlinear systems; 3rd ed.”  Prentice-Hall, 2002
  * [14] Uros Markovic et al.  “Understanding Stability of Low-Inertia Systems”, 2019  DOI: 10.31224/osf.io/jwzrq
  * [15] M.. Taul, X. Wang, P. Davari and F. Blaabjerg  “Current Limiting Control With Enhanced Dynamics of Grid-Forming Converters During Fault Conditions”  In _IEEE Journal of Emerging and Selected Topics in Power Electronics_ 8.2, 2020, pp. 1062–1073