######  Conjecture 6.2.

Let $\Sigma$ denote $\Sigma_{\mathrm{Quat}}$ or $\Sigma_{E^{2}}$ and let
$C\subset\mathcal{A}_{2}$ denote an irreducible Hodge generic algebraic curve.
Let $L$ be a finitely generated subfield of $\mathbb{C}$ over which $C$ is
defined.

There exist positive constants $c_{47}$ and $c_{48}$ such that, for any point
$s\in C\cap\Sigma$, if we let $Z$ denote the (unique) special curve containing
$s$, then

$\\#\operatorname{Aut}(\mathbb{C}/L)\cdot s\geq c_{\ref*{c:GOSh-
mult}}\Delta(Z)^{c_{\ref*{c:GOSh-exp}}}.$

###  6.4. The fixed data

We write $\Gamma$ for the subgroup
$\mathbf{Sp}_{4}(\mathbb{Z})\subset\mathbf{G}(\mathbb{Q})$. We let
$\pi:\mathcal{H}_{2}\to\mathcal{A}_{2}$ denote the (transcendental)
uniformisation map. We choose a Siegel set
$\mathfrak{S}\subset\mathbf{G}(\mathbb{R})^{+}$ (associated with the standard
Siegel triple) such that, for some finite set
$C\subset\mathbf{G}(\mathbb{Q})$, $\mathcal{F}_{\mathbf{G}}=C\mathfrak{S}$ is
a fundamental set for $\Gamma$ in $\mathbf{G}(\mathbb{R})^{+}$. We write
$\mathcal{F}$ for $\mathcal{F}_{\mathbf{G}}x_{0}$, where
$x_{0}\in\mathcal{H}_{2}$ is the point whose stabiliser in
$\mathbf{G}(\mathbb{R})^{+}$ is the maximal compact subgroup appearing in the
definition of $\mathcal{F}_{\mathbf{G}}$.

By Proposition 5.1, we can fix a finitely generated, free $\mathbb{Z}$-module
$\Lambda$, a representation
$\rho:\mathbf{G}\rightarrow\mathbf{GL}(\Lambda_{\mathbb{Q}})$ such that
$\Lambda$ is stabilised by $\rho(\Gamma)$, an element $v_{0}\in\Lambda$, and
positive constants $c_{49}$ and $c_{50}$ such that

  1. (i)

$\operatorname{Stab}_{\mathbf{G},\rho}(v_{0})=\mathbf{H}_{0}$;

  2. (ii)

the orbit $\rho(\mathbf{G}(\mathbb{R}))v_{0}$ is closed in
$\Lambda_{\mathbb{R}}$;

  3. (iii)

for each $u\in\mathbf{G}(\mathbb{R})$, if the group
$\mathbf{H}_{u}=u\mathbf{H}_{0,\mathbb{R}}u^{-1}$ is defined over
$\mathbb{Q}$, then there exists
$v_{u}\in\operatorname{Aut}_{\rho(\mathbf{G})}(\Lambda_{\mathbb{R}})v_{0}$
such that $\rho(u)v_{u}\in\Lambda$ and

$\lvert v_{u}\rvert\leq c_{\ref*{c:eff-alg-
mult}}\lvert\operatorname{disc}(R_{u})\rvert^{c_{\ref*{c:eff-alg-exp}}},$

where $R_{u}$ denotes the order
$\operatorname{End}_{\mathbf{H}_{u}}(\mathbb{Z}^{4})$ of the quaternion
algebra $\operatorname{End}_{\mathbf{H}_{u}}(\mathbb{Q}^{4})$.

By Theorem 1.2, we can then fix positive constants $c_{51}$ and $c_{52}$ with
the following property: for every $u\in\mathbf{G}(\mathbb{R})$, if
$\mathbf{H}_{u}=u\mathbf{H}_{0,\mathbb{R}}u^{-1}$ is defined over
$\mathbb{Q}$, then there exists a fundamental set for
$\Gamma\cap\mathbf{H}_{u}(\mathbb{R})$ in $\mathbf{H}_{u}(\mathbb{R})$ of the
form

$B_{u}C\mathfrak{S}u^{-1}\cap\mathbf{H}_{u}(\mathbb{R}),$

where $B_{u}\subset\Gamma$ is a finite set such that

$\lvert\rho(b^{-1}u)v_{u}\rvert\leq c_{\ref*{c:eff-red-mult}}\lvert
v_{u}\rvert^{c_{\ref*{c:eff-red-exp}}}$

for every $b\in B_{u}$.

Choosing a basis, we obtain $\Lambda=\mathbb{Z}^{d}$ and we may refer to the
height $\mathrm{H}(v)$ of any $v\in\Lambda$ (defined as the maximum of the
absolute values of the coordinates). For any $v\in\Lambda_{\mathbb{R}}$, we
write $\mathbf{G}(v)=\operatorname{Stab}_{\mathbf{G}_{\mathbb{R}},\rho}(v)$.

######  Proposition 6.3.

Let $P\in\Sigma_{\mathrm{Quat}}\cup\Sigma_{E^{2}}$. Then there exists
$z\in\pi^{-1}(P)\cap\mathcal{F}$ and
$v\in\operatorname{Aut}_{\rho(\mathbf{G})}(\Lambda_{\mathbb{R}})\rho(\mathbf{G}(\mathbb{R}))v_{0}\cap\Lambda$
such that $z(\mathbb{S})\subset\mathbf{G}(v)$ and

$\displaystyle\mathrm{H}(v)\leq c_{\ref*{c:eff-red-mult}}c_{\ref*{c:eff-alg-
mult}}^{c_{\ref*{c:eff-red-
exp}}}\lvert\operatorname{disc}(R)\rvert^{c_{\ref*{c:eff-alg-
exp}}c_{\ref*{c:eff-red-exp}}},$

where $R$ denotes the ring
$\operatorname{End}_{\mathbf{G}(v)}(L)\subset\mathrm{M}_{4}(\mathbb{Z})$.

###### Proof.

Let $z\in\pi^{-1}(P)\cap\mathcal{F}$ and let $Y$ denote the smallest pre-
special subvariety of $\mathcal{H}_{2}$ containing $z$. Then $\pi(Y)$ is an
$E^{2}$ or quaternionic curve and so

$Y=g\mathbf{H}_{0}^{\mathrm{der}}(\mathbb{R})x_{0}=g\mathbf{H}_{0}^{\mathrm{der}}(\mathbb{R})g^{-1}\cdot
gx_{0}=\mathbf{H}^{\mathrm{der}}(\mathbb{R})\cdot gx_{0},$

where $g\in\mathbf{G}(\mathbb{R})$, $\mathbf{H}$ is a $\mathbb{Q}$-subgroup of
$\mathbf{G}$ isomorphic to $\mathbf{H}_{B}$ for some quaternion algebra $B$,
as above, and $\mathbf{H}_{\mathbb{R}}=g\mathbf{H}_{0,\mathbb{R}}g^{-1}$.
Since $\mathbf{H}$ is the Mumford-Tate group of $Y$ (that is, the smallest
$\mathbb{Q}$-subgroup of $\mathbf{G}$ containing $x(\mathbb{S})$ for all $x\in
Y$), we have $z(\mathbb{S})\subset\mathbf{H}(\mathbb{R})$. By Proposition 5.1,
we obtain
$v\in\operatorname{Aut}_{\rho(\mathbf{G})}(\Lambda_{\mathbb{R}})v_{0}$ such
that $\rho(g)v\in\Lambda$ and

$|v|\leq c_{\ref*{c:eff-alg-
mult}}\lvert\operatorname{disc}(R)\rvert^{c_{\ref*{c:eff-alg-exp}}},$

where $R=\operatorname{End}_{\mathbf{H}}(L)$. Note that

$\mathbf{G}(\rho(g)v)=g\mathbf{G}(v)g^{-1}=g\mathbf{G}(v_{0})g^{-1}=\mathbf{H}_{\mathbb{R}}.$

By Theorem 1.2 (with $u=g$), we obtain a finite set $B_{g}\subset\Gamma$ such
that

$\mathcal{F}_{\mathbf{H}}=B_{g}C\mathfrak{S}g^{-1}\cap\mathbf{H}(\mathbb{R})$

is a fundamental set for
$\Gamma_{\mathbf{H}}=\Gamma\cap\mathbf{H}(\mathbb{R})$ in
$\mathbf{H}(\mathbb{R})$, and

$|\rho(b^{-1}g)v|\leq c_{\ref*{c:eff-red-mult}}|v|^{c_{\ref*{c:eff-red-exp}}}$

for all $b\in B_{g}$. In particular, since $z\in\mathbf{H}(\mathbb{R})gx_{0}$,
we can write

$z=\gamma bsx_{0}$

for some $\gamma\in\Gamma_{\mathbf{H}}$, $b\in B_{g}$, and $s\in
C\mathfrak{S}$. Hence,

$z^{\prime}:=b^{-1}\gamma^{-1}z\in\mathcal{F}\cap\pi^{-1}(P).$

Furthermore, we have

$z^{\prime}(\mathbb{S})\subset\mathbf{G}(\rho(b^{-1}\gamma^{-1}g)v)=\mathbf{G}(\rho(b^{-1}g)v)=b^{-1}\mathbf{H}_{\mathbb{R}}b,$

where we use the fact that
$\gamma\in\mathbf{H}(\mathbb{R})=\mathbf{G}(\rho(g)v)(\mathbb{R})$. Finally,
from the above, we have

$\lvert\rho(b^{-1}g)v\rvert\leq c_{\ref*{c:eff-red-mult}}\lvert
v\rvert^{c_{\ref*{c:eff-red-exp}}}\leq c_{\ref*{c:eff-red-
mult}}(c_{\ref*{c:eff-alg-
mult}}\lvert\operatorname{disc}(R)\rvert^{c_{\ref*{c:eff-alg-
exp}}})^{c_{\ref*{c:eff-red-exp}}}=c_{\ref*{c:eff-red-mult}}c_{\ref*{c:eff-
alg-mult}}^{c_{\ref*{c:eff-red-
exp}}}\lvert\operatorname{disc}(R)\rvert^{c_{\ref*{c:eff-alg-
exp}}c_{\ref*{c:eff-red-exp}}}$

and

$R=\operatorname{End}_{\mathbf{H}}(L)=\operatorname{End}_{b^{-1}\mathbf{H}b}(b^{-1}L)=\operatorname{End}_{b^{-1}\mathbf{H}b}(L)=\operatorname{End}_{\mathbf{G}(\rho(b^{-1}g)v)}(L).$

Therefore, since $\rho(b^{-1}g)v\in\Lambda$, we conclude that $z^{\prime}$ and
$\rho(b^{-1}g)v$ satisfy the conditions of the proposition. ∎

######  Corollary 6.4.

Let $b\in\mathbb{R}$. The set of $E^{2}$ or quaternionic curves $Z$ satisfying
$\Delta(Z)\leq b$ is finite.

###### Proof.

Let $Z$ be an $E^{2}$ or quaternionic curve satisfying $\Delta(Z)\leq b$ and
let $P\in Z$ be a Hodge generic point on $Z$. Therefore,
$P\in\Sigma_{\mathrm{Quat}}\cup\Sigma_{E^{2}}$ and, applying Proposition 6.3
and the first paragraph of its proof, we obtain $v\in\Lambda$ satisfying

$\displaystyle\mathrm{H}(v)\leq c_{\ref*{c:eff-red-mult}}c_{\ref*{c:eff-alg-
mult}}^{c_{\ref*{c:eff-red-exp}}}b^{c_{\ref*{c:eff-alg-exp}}c_{\ref*{c:eff-
red-exp}}}$

such that $Z$ is the image in $\mathcal{A}_{2}$ of an orbit of
$\mathbf{G}(v)^{\mathrm{der}}(\mathbb{R})$. As in the proof of Lemma 6.1,
there is only one Shimura subdatum of $(\mathbf{G},X)$ associated with
$\mathbf{G}(v)$ and so the result follows. ∎

###  6.5. Proof of Theorem 1.3 for quaternionic curves

Let $\mathcal{C}=\pi^{-1}(C)\cap\mathcal{F}$ – a set definable in the
o-minimal structure $\mathbb{R}_{\rm an,exp}$ (see [KUY16] for more details).
Let $L$ be a finitely generated field of definition for $C$. Let $P\in
C\cap\Sigma_{\mathrm{Quat}}$. Varying over
$\sigma\in\operatorname{Aut}(\mathbb{C}/L)$, we obtain points $\sigma(P)\in
C\cap\Sigma_{\mathrm{Quat}}$ and, for each $\sigma$, we let
$z_{\sigma}\in\mathcal{F}\cap\pi^{-1}(\sigma(P))$ and we let
$v_{\sigma}\in\operatorname{Aut}_{\rho(\mathbf{G})}(\Lambda_{\mathbb{R}})\rho(\mathbf{G}(\mathbb{R}))v_{0}\cap\Lambda$
be the elements afforded to us by Proposition 6.3. That is,
$z_{\sigma}(\mathbb{S})\subset\mathbf{G}(v_{\sigma})$ and

$\displaystyle\mathrm{H}(v_{\sigma})\leq c_{\ref*{c:eff-red-
mult}}c_{\ref*{c:eff-alg-mult}}^{c_{\ref*{c:eff-red-
exp}}}\lvert\operatorname{disc}(R_{\sigma})\rvert^{c_{\ref*{c:eff-alg-
exp}}c_{\ref*{c:eff-red-exp}}},$

where $R_{\sigma}$ denotes the ring
$\operatorname{End}_{\mathbf{G}(v_{\sigma})}(L)\subset\mathrm{M}_{4}(\mathbb{Z})$.
As above, $\lvert\operatorname{disc}(R_{\sigma})\rvert=\Delta(\sigma(Z))$.
Note that we also have $z_{\sigma}\in\mathcal{C}$.

We obtain a set $\Theta$ of tuples
$(v_{\sigma},z_{\sigma})\in\Lambda\times\mathcal{C}$ belonging to the
definable set

$D=\\{(v,z)\in\Lambda_{\mathbb{R}}\times\mathcal{C}:v\in\operatorname{Aut}_{\rho(\mathbf{G})}(\Lambda_{\mathbb{R}})\rho(\mathbf{G}(\mathbb{R}))v_{0},\
z(\mathbb{S})\subset\mathbf{G}(v)\\}.$

Let $\pi_{1}:D\rightarrow\Lambda_{\mathbb{R}}$ and let
$\pi_{2}:D\rightarrow\mathcal{C}$ denote the projection maps. By Conjecture
6.2, we have

$\displaystyle A:=\\#\pi_{2}(\Theta)=\\#\operatorname{Aut}(\mathbb{C}/L)\cdot
P$ $\displaystyle=\\#\operatorname{Aut}(\mathbb{C}/L)\cdot\sigma(P)$
$\displaystyle\geq c_{\ref*{c:GOSh-
mult}}\lvert\operatorname{disc}(R_{\sigma})\rvert^{c_{\ref*{c:GOSh-exp}}}\geq
c_{53}H(v_{\sigma})^{c_{\ref*{c:GOSh-exp}}/c_{\ref*{c:eff-alg-
exp}}c_{\ref*{c:eff-red-exp}}}.$

Applying [DR18, Theorem 9.1] (a variant of [HP16, Corollary 7.2]), in the case
$l=0$, $k=1$, $T=(1/c_{54}A)^{c_{\ref*{c:eff-alg-exp}}c_{\ref*{c:eff-red-
exp}}/c_{\ref*{c:GOSh-exp}}}$, and $\varepsilon<c_{\ref*{c:GOSh-
exp}}/c_{\ref*{c:eff-alg-exp}}c_{\ref*{c:eff-red-exp}}$, we conclude that
either

  1. (1)

$A=\\#\pi_{2}(\Theta)$ is bounded, hence $\Delta(Z)$ is bounded and the
theorem holds, or

  2. (2)

there exists a continuous definable function

$\beta:[0,1]\rightarrow D$

such that $\beta_{1}=\pi_{1}\circ\beta$ is semi-algebraic,
$\beta_{2}=\pi_{2}\circ\beta$ is non-constant, $\beta(0)\in\Theta$, and
$\beta_{|(0,1)}$ is real analytic.

Therefore, it suffices to rule out the latter possibility. To that end,
suppose that we have such a function. By definable choice, there exists a
semi-algebraic function

$\tilde{\beta}_{1}:[0,1]\rightarrow\operatorname{Aut}_{\rho}(\Lambda_{\mathbb{R}})\rho(\mathbf{G}(\mathbb{R}))$

such that $\tilde{\beta}_{1}(t)\cdot v_{0}=\beta_{1}(t)$ for all $t\in[0,1]$.
We let $v_{t}=\beta_{1}(t)$, $g_{t}=\tilde{\beta}_{1}(t)$, and
$z_{t}=\beta_{2}(t)$. Since $z_{t}(\mathbb{S})\subset\mathbf{G}(v_{t})$ and
$g_{t}\in\operatorname{Aut}_{\rho(\mathbf{G})}(\Lambda_{\mathbb{R}})\rho(\mathbf{G}(\mathbb{R}))$,
we have

$(g^{-1}_{t}z_{t})(\mathbb{S})\subset
g^{-1}_{t}\mathbf{G}(v_{t})g_{t}=\mathbf{G}(g^{-1}_{t}v_{t})=\mathbf{G}(v_{0})=\mathbf{H}_{0}(\mathbb{R}).$

We conclude that $g^{-1}_{t}z_{t}$ lies on the unique pre-special subvariety
of $\mathcal{H}_{2}$ associated with
$\mathbf{H}_{0}^{\mathrm{der}}(\mathbb{R})$, namely, $X_{0}$.

On the one hand, there exists $0<t_{1}\leq 1$ such that $\beta_{2}([0,t_{1}])$
is contained in a single irreducible analytic component $\tilde{C}$ of
$\pi^{-1}(C)$. By [UY18, Theorem 1.3] (the inverse Ax–Lindemann conjecture),
$\mathcal{H}_{2}$ is the smallest algebraic subset of $\mathcal{H}_{2}$
containing $\tilde{C}$.

Let $B\subset\Lambda_{\mathbb{C}}$ denote the Zariski closure of
$\beta_{1}([0,t_{1}])\subset\Lambda_{\mathbb{R}}$. By definable choice, there
exists a complex algebraic set
$\tilde{B}\subset\operatorname{Aut}_{\rho}(\Lambda_{\mathbb{C}})\rho(\mathbf{G}(\mathbb{C}))$
of dimension at most $1$ whose image under the algebraic map $g\mapsto g\cdot
v_{0}$ is $B$. Using the superscript ∨ to denote the compact dual of a
hermitian symmetric domain, we obtain a complex algebraic set $\tilde{B}\times
X_{0}^{\vee}$ of dimension at most $2$. Note that
$\tilde{B}\cdot\mathcal{H}_{2}^{\vee}=\mathcal{H}_{2}^{\vee}$. Hence,
$\tilde{B}\cdot X_{0}^{\vee}\subset\mathcal{H}^{\vee}_{2}$ is algebraic of
dimension at most $2$.

On the other hand, $\tilde{C}$ is an irreducible complex analytic curve having
an uncountable intersection with $\tilde{B}\cdot X_{0}^{\vee}$ (in particular,
it includes $\beta_{2}([0,t_{1}])$ because $g^{-1}_{t}z_{t}\in X_{0}$ and
$z_{t}\in\tilde{C}$ for all $t\in[0,t_{1}]$). Therefore, $\tilde{C}$ is
contained in $\tilde{B}\cdot X_{0}^{\vee}$, hence, so is
$\mathcal{H}^{\vee}_{2}$. However, $\dim\mathcal{H}^{\vee}_{2}=3$, and we
arrive at a contradiction.

###  6.6. Proof of Theorem 1.3 for $E^{2}$ curves

The proof is the same as in the previous section, working with
$\Sigma_{E^{2}}$ instead of $\Sigma_{\mathrm{Quat}}$.

###  6.7. Proof of Theorem 1.4

If $C$ is an algebraic curve over a number field and $\mathfrak{A}\to C$ is an
abelian scheme of relative dimension $2$, we say that $s\in
C(\overline{\mathbb{Q}})$ is a quaternionic point if the endomorphism algebra
of the fiber $\mathfrak{A}_{s}$ is a quaternion algebra over $\mathbb{Q}$ not
isomorphic to $\mathrm{M}_{2}(\mathbb{Q})$.

We claim that it suffices to prove the following theorem.

######  Theorem 6.5.

Let $C$ be an irreducible algebraic curve and let $\mathfrak{A}\rightarrow C$
be a principally polarised non-isotrivial abelian scheme of relative dimension
$2$ such that $\operatorname{End}(\mathfrak{A}_{\overline{\eta}})=\mathbb{Z}$,
where $\overline{\eta}$ denotes a geometric generic point of $C$.

Suppose that $C$ and $\mathfrak{A}$ are defined over a number field $L$ and
that there exist a curve $C^{\prime}$, a semiabelian scheme
$\mathfrak{A}^{\prime}\to C^{\prime}$ and an open immersion $\iota\colon C\to
C^{\prime}$, all defined over $\overline{\mathbb{Q}}$, such that
$\mathfrak{A}\cong\iota^{*}\mathfrak{A}^{\prime}$ and there is a point
$s_{0}\in C^{\prime}(\overline{\mathbb{Q}})\setminus C(\overline{\mathbb{Q}})$
for which the fibre $\mathfrak{A}^{\prime}_{s_{0}}$ is a torus.

Then there exist positive constants $c_{55}$ and $c_{56}$ such that, for any
quaternionic point $s\in C$,

$\\#\operatorname{Aut}(\mathbb{C}/L)\cdot s\geq c_{\ref*{c:GOE2-scheme-
mult}}\lvert\operatorname{disc}(\operatorname{End}(\mathfrak{A}_{s}))\rvert^{c_{\ref*{c:GOE2-scheme-
exp}}}.$

To see that Theorem 6.5 implies Theorem 1.4, consider $C$ as in Theorem 1.4.
Then $C$ is defined over a number field $L$ and, furthermore, we can construct
a curve $\tilde{C}^{\prime}$, a finite surjective morphism
$q:\tilde{C}\rightarrow C$, $s_{0}\in\tilde{C}^{\prime}$, and a semiabelian
scheme $\mathfrak{A}^{\prime}\to\tilde{C}^{\prime}$ as in [DO, Proposition
9.4]. We can find a finite extension $\tilde{L}/L$ such that
$\tilde{C}^{\prime}$, $q:\tilde{C}\rightarrow C$, $s_{0}$ and
$\mathfrak{A}^{\prime}$ are all defined over $\tilde{L}$. The abelian scheme
$\mathfrak{A}^{\prime}_{|\tilde{C}}\to\tilde{C}$ and the point
$s_{0}\in\tilde{C}^{\prime}(\overline{\mathbb{Q}})$ satisfy the conditions of
Theorem 6.5 and so, for any quaternionic point $\tilde{s}\in\tilde{C}$,

$\\#\operatorname{Aut}(\mathbb{C}/\tilde{L})\cdot\tilde{s}\geq
c_{\ref*{c:GOE2-scheme-
mult}}\lvert\operatorname{disc}(\operatorname{End}(\mathfrak{A}^{\prime}_{\tilde{s}}))\rvert^{c_{\ref*{c:GOE2-scheme-
exp}}}.$

If $s\in C\cap\Sigma_{\mathrm{Quat}}$, then we can find a quaternionic point
$\tilde{s}\in\tilde{C}$ such that $q(\tilde{s})=s$, and since $q$ is finite,

$\\#\operatorname{Aut}(\mathbb{C}/L)\cdot s\geq
c_{57}\\#\operatorname{Aut}(\mathbb{C}/\tilde{L})\cdot\tilde{s}.$

Let $Z$ denote the unique special curve in $\mathcal{A}_{2}$ containing $s$.
Since $s$ is a Hodge generic point of $Z$, the endomorphism ring of the
associated abelian surface $A_{s}$ is isomorphic to the generic endomorphism
ring of $Z$ and so
$\Delta(Z)=\lvert\operatorname{disc}(\operatorname{End}(A_{s}))\rvert$. Since
also $A_{s}=\mathfrak{A}^{\prime}_{\tilde{s}}$, we can combine the above
inequalities to obtain

$\\#\operatorname{Aut}(\mathbb{C}/L)\cdot s\geq c_{\ref*{c:GOE2-scheme-
mult}}c_{\ref*{c:GOE2-scheme2-mult}}\Delta(Z)^{c_{\ref*{c:GOE2-scheme-exp}}},$

that is, Conjecture 6.2.

Therefore, it remains to prove Theorem 6.5.

###### Proof of Theorem 6.5.

After a finite extension, we may assume that $C^{\prime}$,
$\mathfrak{A}^{\prime}\to C^{\prime}$, $\iota\colon C\to C^{\prime}$, and
$s_{0}$ are all defined over $L$. Since
$\operatorname{End}(\mathfrak{A}_{\overline{\eta}})=\mathbb{Z}$ and
$\dim(\mathfrak{A}_{\overline{\eta}})=2$, the Mumford–Tate group of
$\mathfrak{A}_{\overline{\eta}}$ is $\mathbf{GSp}_{4,\mathbb{Q}}$ (see [DO,
Section 2.F]). Thus $\mathfrak{A}\to C$ satisfies the conditions of [DO,
Theorem 8.1], as modified in [DO, Remark 8.6].

Let $s\in C$ be a quaternionic point. The image of $s$ under the map
$C\rightarrow\mathcal{A}_{2}$ induced by $\mathfrak{A}\to C$ is in the
intersection between the image of $C$ and a quaternionic curve. We deduce that
$s\in C(\overline{\mathbb{Q}})$.

Now $\operatorname{End}(\mathfrak{A}_{s})\otimes\mathbb{Q}$ is a non-split
quaternion algebra, so cannot inject into $\mathrm{M}_{2}(\mathbb{Q})$. Hence,
$A_{s}$ is exceptional in the sense of [DO, Section 8]. Therefore, by [DO,
Theorem 8.1], $h(s)$ is polynomially bounded in terms of $[L(s):L]$, where $h$
denotes a Weil height on $C^{\prime}$. Let $h_{F}$ denote the stable Faltings
height. As proved in [Fal83, p. 356],

$\lvert h_{F}(\mathfrak{A}_{s})-h(s)\rvert=\mathrm{O}(\log h(s)).$

We conclude that $h_{F}(\mathfrak{A}_{s})$ is polynomially bounded in terms of
$[L(s):L]$.

In order to deduce a bound for
$\operatorname{disc}(\operatorname{End}(A_{s}))$, we use the following theorem
of Masser and Wüstholz.

######  Theorem 6.6.

[MW94, p. 641] Given positive integers $n$, $d$ and $\delta$, there are
constants $c_{58}=c_{\ref*{c:mw-ends-multiplier}}(n,d,\delta)$ and
$c_{59}=c_{\ref*{c:mw-ends-exponent}}(n)$, with the following property. Let
$A$ be an abelian variety of dimension $n$ defined over a number field $k$ of
degree $d$, equipped with a polarisation of degree $\delta$. Let ${\dagger}$
be the Rosati involution of $\operatorname{End}(A)$ associated with this
polarisation and let $\phi^{\dagger}$ be the bilinear form on
$\operatorname{End}(A)$ defined by (12). Then
$\operatorname{disc}(\operatorname{End}_{k}(A),\phi^{\dagger})$ is at most
$c_{\ref*{c:mw-ends-multiplier}}\max(1,h_{F}(A))^{c_{\ref*{c:mw-ends-
exponent}}}$.

As remarked in [MW94] immediately following the statement of this theorem, one
can replace $\operatorname{End}_{k}(A)$ by
$\operatorname{End}_{\mathbb{C}}(A)$ (the endomorphism ring which appears in
the statement of Theorem 6.5) because one can find a finite extension $K/k$ of
degree bounded only in terms of $n$ such that
$\operatorname{End}_{K}(A)=\operatorname{End}_{\mathbb{C}}(A)$. Furthermore,
as stated near the bottom of [MW94, p. 650], the constant $c_{\ref*{c:mw-ends-
multiplier}}(n,d,\delta)$ is polynomial in $d$ and $\delta$, for a polynomial
which depends only on $n$. Using also Lemma 5.6 to see that
$\lvert\operatorname{disc}(\operatorname{End}(A),\phi^{\dagger})\rvert=\lvert\operatorname{disc}(\operatorname{End}(A))\rvert$,
we conclude that there are constants $c_{60}$, $c_{61}$ depending only on $n$
such that, for all $A$ as in the theorem, we have

$\lvert\operatorname{disc}(\operatorname{End}(A))\rvert\leq c_{\ref*{c:mw-
ends2-multiplier}}\max(\delta,d,h_{F}(A))^{c_{\ref*{c:mw-ends2-exponent}}}.$
(17)

In our case, we have always $n=2$ and $\delta=1$. So applying (17) together
with the fact that $h_{F}(A_{s})$ is polynomially bounded in terms of
$[L(s):L]$ completes the proof of Theorem 6.5. ∎

### Acknowledgements

Both authors are grateful to the anonymous referees for their suggestions
which have improved the paper. They would also like to thank the Universities
of Reading, Oxford and Warwick.

### Funding

This work was supported by the Engineering and Physical Sciences Research
Council [EP/S029613/1 to C.D., EP/T010134/1 to M.O.].

## References

  * [AMRT10] A. Ash, D. Mumford, M. Rapoport, and Y.-S. Tai, _Smooth compactifications of locally symmetric varieties_ , second ed., Cambridge Mathematical Library, Cambridge University Press, Cambridge, 2010, With the collaboration of Peter Scholze.
  * [And89] Y. André, _$G$ -functions and geometry_, Aspects of Mathematics, E13, Friedr. Vieweg & Sohn, Braunschweig, 1989.
  * [BDR] M. Borovoi, C. Daw, and J. Ren, _Conjugation of semisimple subgroups over real number fields of bounded degree_ , to appear in Proc. Amer. Math. Soc., available at arXiv:1802.05894.
  * [BHC62] A. Borel and Harish-Chandra, _Arithmetic subgroups of algebraic groups_ , Ann. of Math. (2) 75 (1962), 485–535.
  * [Bla48] H. Blaney, _Indefinite quadratic forms in $n$ variables_, J. London Math. Soc. 23 (1948), 153–160.
  * [Bor69] A. Borel, _Introduction aux groupes arithmétiques_ , Publications de l’Institut de Mathématique de l’Université de Strasbourg, XV. Actualités Scientifiques et Industrielles, No. 1341, Hermann, Paris, 1969.
  * [BT65] A. Borel and J. Tits, _Groupes réductifs_ , Inst. Hautes Études Sci. Publ. Math. (1965), no. 27, 55–150.
  * [Cas78] J. W. S. Cassels, _Rational quadratic forms_ , London Mathematical Society Monographs, vol. 13, Academic Press, Inc., London-New York, 1978.
  * [Che58] C. Chevalley, _Classification des groupes de Lie algébriques_ , vol. 1, Secrétariat mathématique, Paris, 1958, Séminaire C. Chevalley 1956–1958.
  * [Del79] P. Deligne, _Variétés de Shimura: interprétation modulaire, et techniques de construction de modèles canoniques_ , Automorphic forms, representations and $L$-functions (Part 2), Proc. Sympos. Pure Math., XXXIII, AMS, Providence, R.I., 1979, pp. 247–289.
  * [Del82] by same author, _Hodge cycles on abelian varieties_ , Hodge cycles, motives, and Shimura varieties, Lecture Notes in Mathematics, vol. 900, Springer-Verlag, 1982, Notes by J. S. Milne, pp. 9–100.
  * [DO] C. Daw and M. Orr, _Unlikely intersections with $E\times$CM curves in $\mathcal{A}_{2}$_, to appear in Ann. Sc. Norm. Super. Pisa Cl. Sci., available at arXiv:1902.10483.
  * [DR18] C. Daw and J. Ren, _Applications of the hyperbolic Ax–Schanuel conjecture_ , Compos. Math. 154 (2018), 1843–1888.
  * [Ebe14] Patrick Eberlein, _Growth estimates for orbits of self-adjoint groups_ , Geom. Dedicata 170 (2014), 87–117.
  * [Fal83] G. Faltings, _Endlichkeitssätze für abelsche Varietäten über Zahlkörpern_ , Invent. Math. 73 (1983), no. 3, 349–366.
  * [GR14] É. Gaudron and G. Rémond, _Polarisations et isogénies_ , Duke Math. J. 163 (2014), no. 11, 2057–2108.
  * [GS80] F. Grunewald and D. Segal, _Some general algorithms. I. Arithmetic groups_ , Ann. of Math. (2) 112 (1980), no. 3, 531–583.
  * [HP16] P. Habegger and J. Pila, _O-minimality and certain atypical intersections_ , Ann. Sci. Éc. Norm. Supér. (4) 49 (2016), no. 4, 813–858.
  * [KMRT98] M.-A. Knus, A. Merkurjev, M. Rost, and J.-P. Tignol, _The book of involutions_ , American Mathematical Society Colloquium Publications, vol. 44, American Mathematical Society, Providence, RI, 1998.
  * [KUY16] B. Klingler, E. Ullmo, and A. Yafaev, _The hyperbolic Ax-Lindemann-Weierstrass conjecture_ , Publications mathématiques de l’IHÉS 123 (2016), no. 1, 333–360.
  * [LM16] H. Li and G. A. Margulis, _Effective estimates on integral quadratic forms: Masser’s conjecture, generators of orthogonal groups, and bounds in reduction theory_ , Geom. Funct. Anal. 26 (2016), no. 3, 874–908.
  * [Mil86] J. S. Milne, _Abelian varieties_ , Arithmetic geometry (Storrs, Conn., 1984), Springer, New York, 1986, pp. 103–150.
  * [Mil05] by same author, _Introduction to Shimura varieties_ , Harmonic analysis, the trace formula, and Shimura varieties, Clay Math. Proc., vol. 4, Amer. Math. Soc., Providence, RI, 2005, pp. 265–378.
  * [Mos55] G. D. Mostow, _Self-adjoint groups_ , Ann. of Math. (2) 62 (1955), 44–55.
  * [Mum74] D. Mumford, _Abelian varieties_ , second ed., Oxford University Press, 1974\.
  * [MW94] D. W. Masser and G. Wüstholz, _Endomorphism estimates for abelian varieties_ , Math. Z. 215 (1994), no. 4, 641–653. MR 1269495
  * [Orr15] M. Orr, _Families of abelian varieties with many isogenous fibres_ , J. Reine Angew. Math. 705 (2015), 211–231.
  * [Orr17] by same author, _On compatibility between isogenies and polarizations of abelian varieties_ , Int. J. Number Theory 13 (2017), no. 3, 673–704.
  * [Orr18] by same author, _Height bounds and the Siegel property_ , Algebra & Number Theory 12 (2018), no. 2, 455–478.
  * [Orr21] by same author, _Unlikely intersections with Hecke translates of a special subvariety_ , J. Eur. Math. Soc. 23 (2021), no. 1, 1–28.
  * [Pin05] R. Pink, _A common generalization of the conjectures of André–Oort, Manin–Mumford, and Mordell–Lang_ , preprint, available at http://www.math.ethz.ch/~pink/ftp/AOMMML.pdf, 2005.
  * [PR94] V. Platonov and A. Rapinchuk, _Algebraic groups and number theory_ , Pure and Applied Mathematics, vol. 139, Academic Press, Inc., Boston, MA, 1994, Translated from the 1991 Russian original by R. Rowen.
  * [PT13] J. Pila and J. Tsimerman, _The André–Oort conjecture for the moduli space of abelian surfaces_ , Compos. Math. 149 (2013), no. 2, 204–216.
  * [RS90] R. W. Richardson and P. J. Slodowy, _Minimum vectors for real reductive algebraic groups_ , J. London Math. Soc. (2) 42 (1990), no. 3, 409–429.
  * [Sch85] W. Scharlau, _Quadratic and Hermitian forms_ , Grundlehren der Mathematischen Wissenschaften, vol. 270, Springer-Verlag, Berlin, 1985.
  * [UY18] E. Ullmo and A. Yafaev, _Algebraic flows on Shimura varieties_ , Manuscripta Math. 155 (2018), no. 3-4, 355–367. MR 3763410
  * [Wey40] H. Weyl, _Theory of reduction for arithmetical equivalence_ , Trans. Amer. Math. Soc. 48 (1940), 126–164.


# An equidistribution involving invisible inversions

Michael Coopman  Department of Mathematics, University of Florida,
Gainesville, FL 32601<EMAIL_ADDRESS>and  Martin Rubey  Fakultät für
Mathematik and Geoinformation, TU Wien, Austria<EMAIL_ADDRESS>
###### Abstract.

We provide two explicit bijections demonstrating that, among permutations, the
number of invisible inversions is equidistributed with the number of
occurrences of the vincular pattern $13\mathchar 45\relax 2$ after sorting the
set of runs.

Martin Rubey was supported by the Austrian Science Fund (FWF): P 29275.

##  1\. Introduction

The set of _visible inversions_ , a certain subset of the usual inversion set
of a permutation, was introduced by Z. Hamaker, E. Marberg and P. Pawlowski in
[3] to describe the rank function of the restriction of the Bruhat order to
involutions.

In this note we are concerned with the complementary set of _invisible
inversions_ 111www.findstat.org/St001727 $\widecheck{\mathrm{Inv}}(\pi)$ of a
permutation $\pi$. This is the set of pairs $(i,j)$ such that $i<j$ and
$\pi(i)>\pi(j)>i$. Querying the database of combinatorial statistics
www.findstat.org suggested that the number of invisible inversions is
equidistributed with the number of occurrences of the vincular pattern
$13\mathchar 45\relax 2$ after sorting the set of runs. Our goal is to prove a
refinement of this guess. We note that the map sorting the set of runs of a
permutation appears to have some remarkable properties, as recently
demonstrated by P. Alexandersson and O. Nabawanda in [1].

An _ascending run_ of $\pi$ is a maximal consecutive subsequence of $\pi$ in
its one-line notation that is increasing. Let _$runsort(\pi)$_ be the
permutation obtained by rearranging the set of ascending runs in increasing
order of their minimal elements222www.findstat.org/Mp00223. Furthermore, let
_$13\mathchar 45\relax 2(\pi)$_ 333www.findstat.org/St000356 be the set of
pairs $(i,j)$ such that $i<j$ and $\pi(i)<\pi(j)<\pi(i+1)$. Then, it turns out
that

$\sum_{\pi\in\mathfrak{S}_{n}}q^{|\widecheck{\mathrm{Inv}}(\pi)|}=\sum_{\pi\in\mathfrak{S}_{n}}q^{|13\mathchar
45\relax 2(runsort(\pi))|}.$

In fact, this result can be refined significantly. To state the refinement,
let _$31\mstar 2(\pi)$_ be the set of pairs $(i,j)$ such that
$\pi(i)>\pi(j)>\pi(i+1)$ and the minimal element of the descending run
containing $\pi(i)$ and $\pi(i+1)$ is smaller than the minimal element of the
descending run containing $\pi(j)$. In this case we call $\pi(j)$ a _descent
view_.

Thus, $|31\mstar 2(\pi)|=|13\mathchar 45\relax 2(runsort(reverse(\pi)))|$.
Furthermore, recall that a _global ascent_ of a permutation $\pi$ is an index
$m$ such that $\pi$ restricted to $[m]$ is a permutation. Finally, a _left-to-
right maximum_ of $\pi$ is a value $v=\pi(j)$ such that $\pi(i)<v$ for all
$i<j$.

######  Theorem 1.1.

There is an explicit bijection $\chi:\mathfrak{S}_{n}\to\mathfrak{S}_{n}$ such
that, setting $\sigma=\chi(\pi)$,

  * •

the multiset $\\{\\{\pi(j)\mid(i,j)\in 31\mstar 2(\pi)\\}\\}$ of descent views
is the multiset
$\\{\\{\sigma(j)\mid(i,j)\in\widecheck{\mathrm{Inv}}(\sigma)\\}\\}$ of
invisible inversion bottoms,

  * •

the set of maximal elements of the descending runs of $\pi$ is the set of
positions of the weak deficiencies of $\sigma$,

  * •

the set of minimal elements of the descending runs of $\pi$ is the set of
values of the weak deficiencies of $\sigma$,

  * •

the sets of global ascents of $\pi$ and $\sigma$ are the same, and

  * •

the set of left-to-right maxima of $\pi$ is the set of maximal elements in the
cycles of $\sigma$.

We will show in Section 3 that $\chi(\pi)$ is uniquely determined on its set
of exceedances by the requirements of Theorem 1.1. We will then present two
slightly different ways to define $\chi(\pi)$ on the set of weak deficiences,
the first variant, www.findstat.org/%****␣invisible-
inversions.tex␣Line␣125␣****Mp00235, in Section 4.1, and the second variant,
www.findstat.org/Mp00237, in Section 4.2.

We remark that, for both bijections, the preimage of the set of involutions is
the set of permutations whose descending runs all have length at most two and
increasing maximal elements. Restricting $\chi$ to this set we obtain the
classical (inverse) fundamental transformation444www.findstat.org/Mp00086 due
to Rényi, and Foata and Schützenberger.

It may be interesting to explore whether further bijections satisfying some of
the requirements of Theorem 1.1 can be found. One might speculate that
encoding permutations in terms of labelled Motzkin paths with two types of
horizontal steps, using the Foata-Zeilberger bijection or one of its variants,
could be helpful. Doing so, the exceedances of $\chi(\pi)$ and their values
would carry the same information as the Motzkin path itself and its labels on
the up steps and the horizontal steps of one kind.

One variant of the Foata-Zeilberger bijection, between involutions and Motzkin
paths with only one kind of horizontal steps and labels only on the down
steps, was in fact used by Z. Hamaker and the first author [2] to give a
visual interpretation of the number of visible inversions in involutions.

##  2\. Definitions

A _(descending) run_ of $\pi$ is a maximal consecutive decreasing subsequence
of $\pi$ in its one-line notation. From now on, we will only consider
descending runs. We denote the set of runs of $\pi$ with $R(\pi)$. A _run
top/run bottom_ is the largest/smallest element of a run.

An _exceedance/weak deficiency_ of $\pi$ is a position $i\in[n]$ such that
$\pi(i)$ is strictly greater/weakly less than $i$. An _inversion_ of $\pi$ is
a pair $(i,j)$ such that $i<j$ and $\pi(i)>\pi(j)$. We call $\pi(j)$ the
_inversion bottom_. An _invisible inversion_ additionally satisfies
$i<\pi(j)$.

##  3\. The exceedances of $\chi(\pi)$

We define the bijection $\chi:\mathfrak{S}_{n}\to\mathfrak{S}_{n}$ in two
steps. First we describe the exceedances of $\sigma=\chi(\pi)$. The following
is our key lemma.

######  Lemma 3.1.

Let $RB$ and $RT$ be the set of run bottoms, respectively run tops, of $\pi$.
There exists a unique bijection $\sigma_{e}=\chi_{e}(\pi):[n]\setminus
RT\to[n]\setminus RB$ whose multiset of inversion bottoms is the multiset of
descent views of $\pi$ which are not run bottoms. Moreover, $\sigma_{e}(i)>i$
for all $i\in[n]\setminus RT$.

###### Proof.

Let $d_{\pi}(v)$ be the number of $\pi(i)$’s that make $v$ a descent view,
that is, the multiplicity of $v$ in the multiset of descent views. Let
$v\in[n]\setminus RB$. Thus, $d_{\pi}(v)$ is the number of positions $i$ such
that $\pi(i+1)<v<\pi(i)$ and the run containing $\pi(i+1)$ and $\pi(i)$ has a
smaller run bottom than the run containing $v$. Therefore, if $R$ is the set
of runs of $\pi$ and $b$ is the run bottom of the run containing $v$,

$d_{\pi}(v)=\\#\\{r\in R\mid\min(r)<v<\max(r)\text{ and }\min(r)<b\\}.$

We now define $\sigma_{e}$ iteratively. Let $S=[n]\setminus RT$. For
$v\in[n]\setminus RB$, beginning with the smallest, we let
$\sigma_{e}^{-1}(v)$ be the $(d_{\pi}(v)+1)$-st element in $S$ and then remove
this element from $S$.

When defining $\sigma_{e}^{-1}(v)$, there are $|[n]\setminus
RB|-\\#\\{w\in[n]\setminus RB\mid w<v\\}$ elements in $S$, which is at least
$d_{\pi}(v)+1$ because

$d_{\pi}(v)+1\leq\\#\\{w\in[n]\setminus RB\mid w>v\\}+1\\\ =|[n]\setminus
RB|-\\#\\{w\in[n]\setminus RB\mid w<v\\},$

which ensures that $\sigma_{e}$ is well-defined.

Uniqueness follows from the fact that $v$ is the inversion bottom of precisely
those $d_{\pi}(v)$ elements whose preimage is in what remains of $S$ but is
smaller than $\sigma_{e}^{-1}(v)$.

It remains to show that $\sigma_{e}^{-1}(v)<v$. Initially, there are

$v-1-\\#\\{w\in RT\mid w<v\\}$

elements in $S$ that are strictly less than $v$. When defining
$\sigma_{e}^{-1}(v)$, we can assume by induction that only elements strictly
less than $v$ were removed from $S$. Moreover, the number of removed elements
equals $\\#\\{w\in[n]\setminus RB\mid w<v\\}$. Thus, the number of elements
strictly less than $v$ in what remains of $S$ is

$v-1-\\#\\{w\in RT\mid w<v\\}-\\#\\{w\in[n]\setminus RB\mid w<v\\}.$

It remains to show that this is larger than $d_{\pi}(v)$, which follows from
these two observations:

$v-1-\\#\\{w\in[n]\setminus RB\mid w<v\\}=\\#\\{w\in RB\mid
w<v\\},\qquad\quad$

and

$\\#\\{w\in RB\mid w<v\\}-\\#\\{w\in RT\mid w<v\\}\\\ =\\#\\{r\in
R\mid\min(r)<v\leq\max(r)\\}>d_{\pi}(v).$

∎

######  Lemma 3.2.

Let $\pi_{1}$ and $\pi_{2}$ be two permutations. Then

$\chi_{e}(\pi_{1})=\chi_{e}(\pi_{2})\Leftrightarrow R(\pi_{1})=R(\pi_{2}).$

###### Proof.

If the sets of runs of $\pi_{1}$ and $\pi_{2}$ coincide we have
$\chi_{e}(\pi_{1})=\chi_{e}(\pi_{2})$, because the multiset of descent views
of a permutation only depends on its set of runs.

Conversely, $\chi_{e}(\pi_{1})=\chi_{e}(\pi_{2})$ immediately implies that the
sets of run bottoms and run tops of $\pi_{1}$ and $\pi_{2}$ are the same. We
show how to reconstruct the set of runs of a permutation $\pi$ from
$\chi_{e}(\pi)$. Let us first determine the matching between run bottoms and
run tops.

Let $t$ be a run top of $\pi$, beginning with the smallest. Suppose that $t$
is not a run bottom. In this case $d_{\pi}(t)$ is the multiplicity of $t$ in
the multiset of inversion bottoms of $\chi_{e}(\pi)$. Then, as $t$ completes
$d_{\pi}(t)$ descent views, $t$ must be the run top for the
$(d_{\pi}(t)+1)$-st smallest run bottom which is not yet matched with a run
top. If $t$ is a run bottom, $d_{\pi_{1}}(t)$ is not determined by
$\chi_{e}(\pi_{1})$. However, in this case it is clearly a singleton run in
both $\pi_{1}$ and $\pi_{2}$.

Finally, suppose the $v$ is neither a run bottom nor a run top. Then, among
the runs with smaller run bottom and larger run top, $v$ belongs to the one
with $(d_{\pi}(v)+1)$-st smallest run bottom. ∎

######  Lemma 3.3.

Let $\pi$ be a permutation and let $\sigma$ be any permutation that agrees
with $\sigma_{e}(\pi)$ on the set of exceedances and has no other exceedances.
Then the multiset of invisible inversion bottoms of $\sigma$ equals the
multiset of descent views of $\pi$.

###### Proof.

Let $RB$ be the set of run bottoms of $\pi$. If $v\in[n]\setminus RB$, then by
Lemma 3.1 $v$ is the value of an exceedance of $\sigma$. Therefore, $v$ is an
invisible inversion bottom if and only if it is an inversion bottom. Thus, the
multiplicity of $v$ in the multiset of invisible inversion bottoms equals the
multiplicity of $v$ in the multiset of descent views of $\pi$.

Suppose now that $v\in RB$. We partition the set $[v-1]$ in two ways. For any
element $w$ let $\operatorname{rt}(w)$ be the run top in the decreasing run
containing $w$. Then the first partition of $[v-1]$ is as follows:

$\displaystyle A$ $\displaystyle=\\{w\in[v-1]\mid w\not\in RB\\}$
$\displaystyle B$ $\displaystyle=\\{w\in[v-1]\mid w\in RB\text{ and
}\operatorname{rt}(w)\leq v\\}$ $\displaystyle C$
$\displaystyle=\\{w\in[v-1]\mid w\in RB\text{ and }\operatorname{rt}(w)>v\\}.$

Note that $\\#C=d_{\pi}(v)$. For the second partition of $[v-1]$, let

$\displaystyle F$ $\displaystyle=\\{i\in[v-1]\mid\sigma(i)\leq i\\}$
$\displaystyle G$ $\displaystyle=\\{i\in[v-1]\mid\sigma(i)>i\text{ and
}\sigma(i)\leq v\\}$ $\displaystyle H$
$\displaystyle=\\{i\in[v-1]\mid\sigma(i)>i\text{ and }\sigma(i)>v\\}.$

Note that $\\#H$ is the multiplicity of $v$ in the multiset of invisible
inversions bottoms, because with $j=\sigma^{-1}(v)\geq v$ we have $i<j$ and
$i<v=\sigma(j)<\sigma(i)$ for any $i\in H$. Moreover, $\\#F=\\#B$, since every
element $i$ of $F$ is a run top of $\pi$, and mapping $i$ to the corresponding
run bottom yields a bijection. Finally, $\\#G=\\#A$, with $\sigma$ restricted
to $G$ serving as a bijection: because any $i\in G$ is an exceedance of
$\sigma$ we find that $\sigma(i)$ is not a run bottom of $\pi$ and therefore
$\sigma(i)\neq v$.

We conclude that $\\#C=\\#H$, which is what we wanted to prove. ∎

######  Proposition 3.4.

Let $\pi$ be a permutation and let $\sigma$ be any permutation that agrees
with $\chi_{e}(\pi)$ on the set of exceedances and that has no other
exceedances. Then the sets of global ascents of $\pi$ and $\sigma$ are the
same.

###### Proof.

If $\pi$ has a global ascent at index $m$,
$\overline{\pi}=(\pi(1),\dots,\pi(m))$ is a permutation of $[m]$. Moreover,
any pair $(i,j)\in 31\mstar 2(\pi)$ has either both $i$ and $j$ in $[m]$, or
both in the complement of $[m]$. The same is true for pairs
$(i,j)\in\widecheck{\mathrm{Inv}}(\pi)$.

Therefore, the restriction of $\chi_{e}(\pi)$ to $[m]$ is the same as
$\chi_{e}(\overline{\pi})$. Since the remaining values of $\sigma$ are weak
deficiencies, $\sigma$ also has a global ascent at index $m$.

Conversely, suppose that $\sigma$ has a global ascent at index $m$. Since
$\sigma$ agrees with $\chi_{e}(\pi)$ on the set of exceedances and has no
other exceedances, it maps run tops of $\pi$ to run bottoms of $\pi$. Because
it has a global ascent at $m$, any run top larger than $m$ is mapped to a run
bottom larger than $m$. Therefore, the number of run tops of $\pi$ smaller
than $m$ must be equal to the number of run bottoms of $\pi$ smaller than $m$.
Thus, any run of $\pi$ has either both its run bottom and its run top, and
therefore all of its elements contained in $[m]$ or all of its elements
contained in the complement of $[m]$. Finally, any ordering of the runs of
$\pi$ must be such that the runs contained in $[m]$ must come first. This in
turn implies that $\pi$ has a global ascent. ∎

$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$

$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$

$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$

Figure 1. Descent views of $\pi=52\,96\,8731\,4$ and $8731\,52\,4\,96$, and
invisible inversions of $\sigma_{e}=375??89??$.

Let us conclude this section with an example. Let $\pi=52\;96\;8731\;4$. In
the left most diagram of Figure 1 there is, for each $i$, a black dots in the
$i$-th column from the left and the $\pi(i)$-th row from the bottom. The
descending runs of $\pi$ are separated by heavier vertical lines.

The permutation $\overline{\pi}$ illustrated in the middle diagram is obtained
by sorting the set of descending runs of $\pi$ such that the sequence of run
bottoms increases. Thus, the multisets $\\{\\{\pi(j)\mid(i,j)\in 31\mstar
2(\pi)\\}\\}$ and $\\{\\{\overline{\pi}(j)\mid(i,j)\in 31\mstar
2(\overline{\pi})\\}\\}$ are the same, but the multiset for $\overline{\pi}$
is easier to visualize. In the middle diagram, the descent views are indicated
by horizontal dashed lines, emanating from the dotted lines, which indicate
the descents, towards the right.

For both $\pi$ and $\overline{\pi}$ we have $[n]\setminus RB=(3,5,7,8,9)$ and
the multiset of descent views is $\\{\\{2,4,4,5,6\\}\\}$. The only descent
view which is not a run bottom is $5$, and we have
$(d_{\pi}(v))_{v\in[n]\setminus RB}=(0,1,0,0,0)$.

The partial permutation $\sigma_{e}=375??89??$ is illustrated in the right
most diagram. Additionally, the dashed horizontal lines emanating from the
vertical dotted lines indicate the invisible inversions. The only invisible
inversion $(i,j)$ such that $\sigma(j)$ is not a run bottom has $\sigma(i)=5$.

There are twelve permutations with the same set of runs as $\pi$, and twelve
permutations whose restriction to $[n]\setminus RT$ equals $\sigma_{e}$ and
which do not have any further exceedances.

##  4\. The weak deficiencies of $\chi(\pi)$

Lemma 3.1 shows that the values of $\sigma$ on $[n]\setminus RT$ are
determined by the first three requirements in Theorem 1.1. This is not the
case for the values on the run tops of $\pi$, even when imposing the final
requirement stated in Theorem 1.1.

In this section we provide two different ways to complete the definition of
$\sigma$. Note that, if we ignore the final requirement from Theorem 1.1, it
suffices to encode the order of the runs of $\pi$ in the bijection
$\sigma_{d}:RT\to RB$.

In both variants we will make use of the following construction: let $f$ be a
partial permutation, that is an injective map $S\to[n]$ defined on a subset
$S$ of $[n]$. Then the _iterated preimage_ $f^{*}(c)$ of an element $c\in[n]$
which is not contained in a cycle of $f$ is the element $s\in S$ such that
$f^{k}(s)=c$, with $k\geq 0$ maximal. In particular, if $c$ is not in the
image of $f$, then $f^{*}(c)=c$.

We define the values of $\sigma$ on the set of run tops iteratively, beginning
with the smallest run top and removing the corresponding runs from $\pi$.
Thus, throughout the algorithm, we consider $\sigma$ as a partial permutation,
which initially equals $\sigma_{e}$. Note that $\sigma_{e}$ does not contain
any cycles.

The first three steps of both variants are identical:

  1. (1)

Let $t$ be the smallest run top in $\pi$.

  2. (2)

Remove the run containing $t$ from $\pi$.

  3. (3)

If $t$ was the first element of $\pi$, set $\sigma(t)=\sigma^{*}(t)$.

In the following two sections, we provide two different ways of specifying
$\sigma(t)$ if there is a run bottom to the left of $t$. In both cases, we set
$\sigma(t)=\sigma^{*}(t^{\prime})$ for some run top $t^{\prime}>t$ satisfying
$\sigma^{*}(t^{\prime})<t$. Thus, throughout the algorithm the functional
digraph of $\sigma$ is a collection of paths beginning with a run bottom and
ending with a run top, which is also the largest element of the path, together
with a collection of cycles. In each iteration a run top is connected to a
smaller run bottom. Assuming this, we can already conclude that the bijection
satisfies the final requirement of Theorem 1.1.

######  Lemma 4.1.

A cycle of $\sigma$ is completed in an iteration of the algorithm if and only
if the smallest run top $t$ is the first element of $\pi$. In this case, $t$
is the maximal element of the cycle.

Therefore, the left-to-right maxima of $\pi$ are the maximal elements of the
cycles of $\sigma$.

###### Proof.

If the minimal run top $t$ is the first element of $\pi$, and therefore a
left-to-right maximum, we complete a cycle of $\sigma$ by setting
$\sigma(t)=\sigma^{*}(t)$. This cycle has maximal element $t$ because only run
tops $t^{\prime}<t$ have been assigned an image yet, and, by assumption, all
run tops are weak deficiencies.

Otherwise, we set $\sigma(t)=\sigma^{*}(t^{\prime})$ for some run top
$t^{\prime}>t$. Since the (partial) map $\sigma$ is injective,
$\sigma^{*}(t^{\prime})$ must be different from $\sigma^{*}(t)$ before this
assignment, which means that no cycle is completed. ∎

###  4.1. First variant

In the following we will use an auxiliary map $\tau$, which we now define. Let
$\rho:RB\to RT$ be the bijection that maps each run bottom of $\pi$ to the
corresponding run top in the same run. Then, given $\sigma$, we set
$\tau=\sigma^{*}\circ\rho$, restricted to the set of run bottoms remaining in
$\pi$. Note that $\tau$ has to be recomputed whenever another value of
$\sigma$ is determined.

For example, if $\pi=52\;96\;8731\;4$, we have

$\rho=\begin{smallmatrix}1&2&4&6\\\ 8&5&4&9\end{smallmatrix}\text{ and
}\sigma_{e}^{*}=\begin{smallmatrix}8&5&4&9\\\ 6&1&4&2\end{smallmatrix}$

and therefore

$\tau=\begin{smallmatrix}1&2&4&6\\\ 6&1&4&2\end{smallmatrix}.$

We now specify the final step of the algorithm as follows:

  1. (4)

Otherwise, let $a$ be the run bottom left of $t$, and let $k\geq 1$ be minimal
such that $\tau^{k}(a)<t$. Set $\sigma(t)=\tau^{k}(a)$.

Let us illustrate this procedure by resuming our example. Initially, we have

$\pi=52\;96\;8731\;4\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&&&8&9&&\end{smallmatrix}\qquad\tau=\begin{smallmatrix}1&2&4&6\\\
6&1&4&2\end{smallmatrix}.$

The smallest run top is $t=4$. There is a run to the left of $t$, with run
bottom $a=1$. Since $\tau(a)=6>4$, and $\tau^{2}(a)=2<4$, we set
$\sigma(4)=2$.

Removing the run $4$ from $\pi$ and taking into account that now
$\tau(6)=\sigma^{*}(9)=4$ we obtain

$\pi=52\;96\;8731\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&2&&8&9&&\end{smallmatrix}\qquad\tau=\begin{smallmatrix}1&2&6\\\
6&1&4\end{smallmatrix}.$

The smallest run top is now $t=5$. Since $t$ is the first element of $\pi$, we
set $\sigma(5)=\sigma^{*}(5)=1$. We remove the run $52$ from $\pi$ and obtain

$\pi=96\;8731\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&2&1&8&9&&\end{smallmatrix}\qquad\tau=\begin{smallmatrix}1&6\\\
6&4\end{smallmatrix}.$

The smallest run top is now $t=8$. There is a run to the left of $t$, with run
bottom $a=6$. Since $\tau(a)=4<8$, we set $\sigma(8)=4$. We also remove the
run $8731$ from $\pi$, which leaves us with

$\pi=96\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&2&1&8&9&4&\end{smallmatrix}\qquad\tau=\begin{smallmatrix}6\\\
6\end{smallmatrix},$

and it remains to set $\sigma(9)=\sigma^{*}(9)=6$.

######  Lemma 4.2.

At any stage of the algorithm and for any run bottom $b$ we either have
$\tau(b)=\sigma_{e}^{*}(\rho(b))$ or $\tau(b)$ is less than or equal to the
minimal remaining run top of $\pi$.

###### Proof.

Suppose that the minimal run top is $t$ and the corresponding run bottom is
$b$.

If $t$ is the first element of $\pi$, then, after setting $\sigma(t)$, only
$b$ is removed from the domain of $\tau$, and no other values of $\tau$ are
modified.

Otherwise, let $c=\tau^{k-1}(a)$, and let $d=\tau(c)=\sigma^{*}(\rho(c))$.
Then after setting $\sigma(t)=d$, the value of $\tau(c)$ becomes

$\sigma^{*}(\rho(c))=\sigma^{*}(\sigma^{-1}(d))=\sigma^{*}(t)=\sigma^{*}(\rho(b))=\tau(b).$

If $\tau(b)$ still has its original value, we have

$\tau(b)=\sigma_{e}^{*}(\rho(b))=\sigma_{e}^{*}(t)\leq t.$

Otherwise, $\tau(b)$ is not larger than the minimal run top remaining when it
was modified itself, which in turn must be smaller than $t$. ∎

######  Lemma 4.3.

In step (4), there exists an integer $k\geq 1$ such that $\tau^{k}(a)<t$. We
then also have that $\tau^{k}(a)=\sigma^{*}(t^{\prime})$ for some run top
$t^{\prime}>t$.

Thus, the algorithm is well defined and satisfies the assumption.

###### Proof.

Initially, $\tau$ is a permutation of the run bottoms of $\pi$. Thus, if
$\tau^{\ell}(a)=(\sigma_{e}^{*}\circ\rho)^{\ell}(a)$ for all $\ell$, the cycle
of $\tau$ beginning with $\tau(a)$ also contains $a$, which is strictly
smaller than $t$.

Otherwise, if $\tau^{\ell}(a)\neq(\sigma_{e}^{*}\circ\rho)^{\ell}(a)$ for some
$\ell$, then $\tau^{\ell}(a)\leq s<t$ by Lemma 4.2, where $s$ is the minimal
run top of what remained of $\pi$ when the modification of
$\sigma^{*}(\rho(\tau^{\ell-1}(a)))$ occurred.

It remains to show that $\tau^{k}(a)=\sigma^{*}(t^{\prime})$ for some run top
$t^{\prime}>t$. To this end, let $t^{\prime}=\sigma^{m}(\tau^{k}(a))$ with $m$
maximal. Then $t^{\prime}\geq t$, because all run tops strictly smaller than
$t$ have already been assigned an image.

Suppose that $t^{\prime}=t$, that is,
$\tau^{k}(a)=\sigma^{*}(t^{\prime})=\sigma^{*}(t)$. Then
$\tau^{k-1}(a)=\rho^{-1}(t)\leq t$. By the minimality of $k$ we obtain that
$\tau^{k-1}(a)=t=\rho(t)$. However, if $\tau(c)=\sigma^{*}(\rho(c))=t$ then
$\rho(c)=t$, because $t$ has no image, which in turn implies that $t$ must be
a fixed point of $\tau$. This contradicts the assumption that
$\tau^{k}(a)=\sigma^{*}(t)=t$. ∎

######  Proposition 4.4.

$\chi$ is injective, and therefore a bijection.

###### Proof.

Suppose that $\chi(\pi_{1})=\chi(\pi_{2})$. By Lemma 3.2, $\pi_{1}$ and
$\pi_{2}$ have the same set of runs, which implies that the same $\tau$ will
be used for both to compute the weak deficiencies of $\chi(\pi_{1})$ and
$\chi(\pi_{2})$. We show that the sequence of runs is the same in $\pi_{1}$
and $\pi_{2}$.

Suppose that there is a run, with run top $t$ and run bottom $b$, which is the
first run in what remains of $\pi_{1}$ but in what remains of $\pi_{2}$ the
run bottom $a$ precedes $t$. Then
$\chi(\pi_{1})(t)=\sigma^{*}(t)=\tau(b)=\tau^{k}(a)=\chi(\pi_{2})(t)$. Since
$\tau$ is injective, we therefore have $\tau^{k-1}(a)=b\leq t$, which
contradicts the minimality of $k$.

Finally, suppose that the currently minimal run top $t$ is preceded by $a_{1}$
in what remains of $\pi_{1}$, and by $a_{2}$ in what remains of $\pi_{2}$.
Then we have
$\chi(\pi_{1})(t)=\tau^{k_{1}}(a_{1})=\tau^{k_{2}}(a_{2})=\chi(\pi_{2})(t)$.
Without loss of generality, we may assume that $k_{1}<k_{2}$. Since $\tau$ is
injective, $\tau^{k_{2}-k_{1}}(a_{2})=a_{1}\leq t$, contradicting the
minimality of $k_{2}$. ∎

###  4.2. Second variant

We specify the final step of the algorithm as follows:

  1. (4)

Otherwise, let $i$ be the index of the run bottom left of $t$ in the sequence
$b_{1}<b_{2}<\dots$ of run bottoms in what remains of $\pi$ and let $s_{i}$ be
the $i$-th smallest element other than $s=\sigma^{*}(t)$ which is not yet in
the image of $\sigma$. Set $\sigma(t)=s_{i}$.

Again, let us illustrate this procedure by resuming our example. Initially, we
have

$\pi=52\;96\;8731\;4\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&&&8&9&&\end{smallmatrix}$

The smallest run top is $t=4$, with corresponding run bottom $b=4$. There is a
run to the left of $t$, whose run bottom $1$ is the smallest among the run
bottoms in $\pi$ other than $b=4$. The first element other than
$\sigma^{*}(t)=4$ which is not in the image of $\sigma$ is $1$, so we set
$\sigma(4)=1$.

Removing the run $4$ from $\pi$ we obtain

$\pi=52\;96\;8731\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&1&&8&9&&\end{smallmatrix}$

The smallest run top is now $t=5$. Since $t$ is the first element of $\pi$, we
set $\sigma(5)=\sigma^{*}(5)=4$.

We remove the run $52$ from $\pi$, to obtain

$\pi=96\;8731\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&1&4&8&9&&\end{smallmatrix}$

The smallest run top is now $t=8$, with corresponding run bottom $b=1$. There
is a run to the left of $t$, whose run bottom $6$ is the smallest among the
run bottoms in $\pi$ other than $b=1$. The first element other than
$\sigma^{*}(t)=6$ which is not in the image of $\sigma$ is $2$, so we set
$\sigma(8)=2$.

Finally, we remove the run $8731$ from $\pi$. This leaves us with

$\pi=96\qquad\sigma=\begin{smallmatrix}1&2&3&4&5&6&7&8&9\\\
3&7&5&1&4&8&9&2&\end{smallmatrix}$

and it remains to set $\sigma(9)=\sigma^{*}(9)=6$.

######  Lemma 4.5.

In step (4) of the algorithm, the number of run bottoms strictly less than $t$
equals the number of elements strictly less than $t$ other than $s$ which are
not in the image of $\sigma$.

Thus, the algorithm is well defined. Moreover, the assumption is satisfied.

###### Proof.

We consider the effect of a single iteration of the algorithm on the set of
run bottoms of what remains of $\pi$ and the set of elements which are not yet
in the image of $\sigma$. To do so, initialise the two sets $B$ and $S$ with
the initial set of run bottoms $RB$ of $\pi$. After each iteration, remove the
run bottom $b$ in the same run as $t$ from $B$ and remove $\sigma(t)$ from
$S$. Thus, only elements smaller than or equal to $t$ are removed from $B$.

If step (3) is executed, also an element smaller than or equal to $t$ is
removed from $S$, because $\sigma^{*}(t)\leq t$. On the other hand, suppose
that in previous iterations only elements smaller than or equal to the then
current run top were removed from $S$. Then, in step (3), the number of
elements in $S\setminus s$ which are less than or equal to $t$ equals the
number of elements in $B\setminus b$ which are less than or equal to $t$.
Since $b_{i}\in B\setminus b$, we conclude that $s_{i}\in S\setminus s$.

Finally, since $s_{i}\neq\sigma^{*}(t)$ and all elements smaller than $t$ have
an image, $s_{i}=\sigma(t^{\prime})$ for some run top strictly larger than
$t$. ∎

######  Proposition 4.6.

$\chi$ is injective, and therefore a bijection.

###### Proof.

Suppose that $\chi(\pi_{1})=\chi(\pi_{2})$. By Lemma 3.2, $\pi_{1}$ and
$\pi_{2}$ have the same set of runs. We show that the sequence of runs is the
same in $\pi_{1}$ and $\pi_{2}$.

Suppose that there is a run, with run top $t$, which is the first run in what
remains of $\pi_{1}$ but in what remains of $\pi_{2}$ the run bottom $b_{i}$
precedes $t$. Then $s=\sigma^{*}(t)=s_{i}$, which is impossible.

Otherwise, suppose that the minimal run top $t$ is preceded by $b_{i}$ in what
remains of $\pi_{1}$, and by $b_{j}$ in what remains of $\pi_{2}$. Then we
have $s_{i}=s_{j}$ and therefore also $i=j$. ∎

## References

  * [1] Per Alexandersson and Olivia Nabawanda  “Peaks are preserved under run-sorting”, 2021  arXiv:2104.04220 [math.CO]
  * [2] Michael Coopman and Zachary Hamaker  “Involutions under Bruhat order and labeled Motzkin Paths”, 2021  arXiv:2106.06021 [math.CO]
  * [3] Zachary Hamaker, Eric Marberg and Brendan Pawlowski  “Fixed-point-free involutions and Schur $P$-positivity”  In _J. Comb._ 11.1, 2020, pp. 65–110  DOI: 10.4310/JOC.2020.v11.n1.a4


PowNet: a power systems analysis model for
large-scale water-energy nexus studies

AFM Kamal Chowdhury1, Jordan Kern2, Thanh Duc Dang1, Stefano Galelli1

1 Pillar of Engineering Systems and Design, Singapore University of Technology
and Design, Singapore 487372
2 Department of Forestry and Environmental Resources, North Carolina State
University, Jordan Hall Addition, 2820 Faucette Dr., NC 27695

Corresponding author: AFM Kamal Chowdhury<EMAIL_ADDRESS>
## Abstract

PowNet is a free modelling tool for simulating the Unit Commitment / Economic
Dispatch of large-scale power systems. PowNet is specifically conceived for
applications in the water-energy nexus domain, which investigate the impact of
water availability on electricity supply. To this purpose, PowNet is equipped
with features that guarantee accuracy, reusability, and computational
efficiency over large spatial and temporal domains. Specifically, the model
(i) accounts for the techno-economic constraints of both generating units and
transmission networks, (ii) can be easily coupled with models that estimate
the status of generating units as a function of the climatic conditions, and
(iii) explicitly includes import/export nodes, which are often found in cross-
border systems. PowNet is implemented in Python and runs with the help of any
standard optimization solver (e.g., Gurobi, CPLEX). Its functionality is
demonstrated on the Cambodian power system.

## Keywords

Unit commitment; economic dispatch; transmission networks; water-energy nexus;
energy systems; power systems; Python

## (1) Overview

##  1 Introduction

Fuelled by economic and population growth, electricity demand is rapidly
increasing in many parts of the world. At the same time, several countries are
cutting carbon dioxide emissions through a larger dependance on renewable
resources (e.g., hydro, wind and solar) [1]. Yet, electricity supply from
these resources varies over multiple temporal scales—from hourly to seasonal
and inter-annual—thereby requiring more flexible power grids [2, 3]. These
challenges have prompted the development of several modelling tools for energy
and electricity systems; see [4] for a comprehensive review. Broadly speaking,
models are used for two main tasks, long-term planning (e.g., capacity
expansion, investment optimization) and short-term management (e.g., power
flow analysis, unit commitment). Hereafter, we refer to these two groups as
energy and power systems analysis models [5].

Importantly, modelling tools are used not only for ‘traditional’ tasks in the
energy and power domains, such as investment optimization and grid analysis,
but also for interdisciplinary research spanning across multiple engineering
domains. For example, models are increasingly being used in studies on the
water-energy nexus, which aim to characterize the interdependencies between
these two critical sectors and introduce planning and management solutions
that span across coupled systems [6]. The strategic importance of energy and
power models is thus likely to increase in the near future, as climatic
changes are expected to transform both supply and demand of electricity [7, 8,
9].

An important application in the water-energy nexus domain is Unit Commitment /
Economic Dispatch (UC/ED), in which a computer model is used to optimize the
operations of power generating units—more precisely, UC determines when and
which generating units to start-up and shut-down, while ED establishes the
amount of power supplied by each unit [10]. The correct simulation of the
UC/ED decision-making process is indeed a critical step if one seeks to
decipher the effect of water availability on the performance of a power
system. To this purpose, researchers and practitioners typically rely on power
systems models—such as PROMOD [11] or GENESYS [9]—that account for the techno-
economic constraints of the generating units, but often adopt simplified
representations of the transmission networks; an assumption that may lead to a
misrepresentation of power system’s performance [12, 13]. To explicitly
account for electricity transmission in a UC/ED exercise, one can only rely on
a handful of models, namely PSAT [14], PyPSA [5], and PLEXOS [15]. Yet, the
latter is a proprietary software, and thereby not freely available to
researchers.

Here, we contribute to this growing field and introduce PowNet, a UC/ED
modelling tool specifically conceived for applications in the water-energy
nexus domain. PowNet builds on the UC/ED model first presented by [16], and
complements it with a comprehensive representation of the high-voltage
transmission lines. As we shall see later, PowNet has a few desirable
features. First, it bases the power flow calculation on a Direct Current (DC)
network; a choice that strikes a reasonable balance between modelling accuracy
and data and computational requirements. This is particularly important for
water-energy applications, which are generally carried out over extensive
spatial and temporal domains. Moreover, it should be noted that the error
introduced by DC flow is generally negligible (as compared to a full-scale
power system model), except for high loadings with increased reactive power
[17, 18]. To minimize such instances, PowNet incorporates the N-1 criterion,
which leaves part of the lines’ capacity unused, thereby allowing for reactive
power flows [18, 19]. Second, PowNet accounts for the potential effect of
water availability on the UC/ED process. Specifically, the user can soft link
PowNet with any model able to process climatic data and provide information on
the status of renewable and non-renewable resources. Third, PowNet explicitly
includes the export/import nodes—as substations and generators–which are key
components of cross-borders interconnections. Fourth, PowNet is fully written
in Python, a programming language that should enhance its dissemination and
reusability.

The next section describes the mathematical model on which PowNet is based,
while its Python implementation and architecture are described in Section 3.
Section 4 presents the quality control, along with a sample implementation for
the Cambodian power system. The concluding remarks are outlined in Section 5.

##  2 Functionality

In PowNet, a power system is represented by a set of nodes ($n\,\epsilon\,N$)
that include power plants and high-voltage substations. Given a pre-defined
planning horizon (e.g., 24 hours), the model (1) schedules the operating
status of the dispatchable power plant units (e.g., coal, gas, oil, and
biomass), and (2) determines the hourly dispatch of electricity from the
committed units and variable renewable resources (e.g., hydro, solar, wind)
that meets the system’s demand at a minimum cost. As illustrated in Figure 1,
the electricity available through the variable renewable resources is an input
that can be obtained from existing data or simulated by a separate model
(e.g., a hydrological-hydraulic model for the available hydropower). PowNet
can also include import stations as dispatchable units. The scheduling and
dispatch of hourly electricity is constrained by the design features of the
power plants as well as the capacity and susceptance of the transmission
lines. Overall, PowNet solves a Mixed Integer Linear Program (MILP), whose
objective function, decision variables, and constraints are described next
(the notation used in the following sections is summarized in Table 1).

Figure 1: Graphical representation of PowNet. Black and red boxes represent
input and output elements, respectively. Grey boxes represent elements not
included in the model.

###  2.1 Objective function and decision variables

The goal of PowNet is to meet the hourly electricity demand at the substations
while minimizing the production cost over a planning horizon, say 24 hours
($t\,\epsilon\,T$). The production cost of the dispatchable units
($g\,\epsilon\,G$) depends on their fixed operation and maintenance (O&M)
costs (${FixedCost}_{g}$), start-up cost (${StartCost}_{g}$), variable costs
for heat rate (${HeatRate}_{g}$) and fuel price (${FuelPrice}_{g}$), and
variable O&M costs (${VarCost}_{g}$). The shut-down costs of the units are
generally negligible when compared to the other costs [20], and are thus not
considered in our model. The cost of imported electricity depends on the
import price (${ImportPrice}_{i}$), which is specified for each import source
($i\,\epsilon\,I$). The production cost of the $rn$-th variable renewable
resource ($rn\,\epsilon\,RN$) depends on the unit production cost
(${UnitCost}_{rn}$), which is typically smaller than the one of the
dispatchable unit [16]. The objective function is thus formulated as follows:

$\displaystyle\begin{split}&\min\sum_{t=1}^{T}\Big{(}\sum_{g}^{G}\big{(}{FixedCost}_{g}\times{ON}_{g,t}+{Elec}_{g,t}\times({HeatRate}_{g}\times\\\
&{FuelPrice}_{g}+{VarCost}_{g})+{StartCost}_{g}\times{Switch}_{g,t}\big{)}+\\\
&\sum_{i}^{I}({Elec}_{i,t}\times{ImportPrice}_{i})+\sum_{rn}^{RN}({Elec}_{rn,t}\times{UnitCost}_{rn})\Big{)},\end{split}$
(1)

where ${ON}_{g,t}$ and ${Switch}_{g,t}$ are two decision variables describing
the operational status (on-line or off-line, and to be started-up or shut-
down) of the $g$-th dispatchable unit at hour $t$, while ${Elec}_{g,t}$,
${Elec}_{i,t}$, and ${Elec}_{rn,t}$ denote the hourly electricity production
of the $g$-th dispatchable unit, $i$-th import source, and $rn$-th variable
renewable resource, respectively. At each hour t, PowNet optimizes a few
additional decision variables, namely, the voltage angle ${VoltAngle}_{n,t}$
at each node $n$ of the network (needed to estimate the transmission through
each line), and the spinning and non-spinning reserves ${SpinRes}_{g,t}$ and
${NonSpinRes}_{g,t}$.

Table 1: Notations used to describe PowNet.

Indices and sets: n any node in the system N set of all nodes in the system g
dispatchable unit G set of all dispatchable units i import node I set of all
import nodes rn variable renewable resource (e.g., hydro, wind, solar) RN set
of all variable renewable resources k sink node connected by the transmission
line to any node n t time-step (hour, h) T planning horizon (e.g., 24 h)
Parameters of the dispatchable units (g): ${MaxCap}_{g}$ maximum capacity (MW)
${MinCap}_{g}$ minimum capacity (MW) ${FixedCost}_{g}$ fixed O&M cost ($)
${StartCost}_{g}$ start-up cost ($/start) ${HeatRate}_{g}$ heat rate
(MMBtu/MWh) ${FuelPrice}_{g}$ price of fuel ($/MMBtu) ${VarCost}_{g}$ variable
O&M cost ($/MWh) ${Ramp}_{g}$ ramping limit (MW/h) ${MinUpTime}_{g}$ minimum
up time (h) ${MinDownTime}_{g}$ minimum down time (h) Parameters of the import
nodes (i): ${MaxCap}_{i}$ maximum allowable import (MW) ${ImportPrice}_{i}$
price of imported electricity ($/MWh) Parameters of the transmission network:
${LineSus}_{n,k}$ susceptance (Siemens) of the transmission line between nodes
n and k ${LineCap}_{n,k}$ capacity (MW) of the transmission line between nodes
n and k Input time series (hourly): ${RenewAvail}_{rn,t}$ available
electricity (MWh) from the rn-th renewable resource ${Demand}_{n,t}$
electricity demand (MWh) (or export) at any node n Decision variables (at each
hour t): ${ON}_{g,t}$ binary (0,1) variable indicating if unit g is online (1)
or offline (0) ${Switch}_{g,t}$ binary (0,1) variable indicating if unit g
must be started-up (${Switch}_{g,t}$=1 only when ${ON}_{g,t-1}$=0 is followed
by ${ON}_{g,t}$=1) ${Elec}_{g*,t}$ electricity (MWh) generated by dispatchable
unit g (*or any other powerplant) ${VoltAngle}_{n,t}$ voltage angle (radian)
at any node n ${SpinRes}_{g,t}$ spinning reserve (MWh) at unit g
${NonSpinRes}_{g,t}$ non-spinning reserve (MWh) at unit g

###  2.2 Constraints

The scheduling and dispatch of hourly electricity is subject to multiple
constraints accounting for the technical specifications of generating units
(i.e., capacity, minimum up/down time, ramping limit), energy balance at each
node (demand and supply), capacity and susceptance of the transmission lines,
transmission loss and N-1 criterion, and minimum requirements of spinning and
non-spinning reserves.

#### Logical constraints.

Similarly to [16], we adopt a set of logical constraints to bind the
operational status of the various power plant units. First of all, we
introduce a constraint (equation (2)) on the operational status of the
dispatchable units, according to which an off-line unit can be started up but
not shut down, and vice versa:

$\displaystyle\begin{split}&{Switch}_{g,t}\geq
1-{ON}_{g,t-1}-(1-{ON}_{g,t});\\\
&{ON}_{g,t}\,\epsilon\,\\{0,1\\},\,{Switch}_{g,t}\,\epsilon\,\\{0,1\\},\,\forall_{g},\,\forall_{t},\end{split}$
(2)

where, the binary variable ${ON}_{g,t}$ determines whether the $g$-th
dispatchable unit is off-line (or on-line) at hour $t$, while ${Switch}_{g,t}$
indicates whether an off-line unit must be started up (or not).

The operational status of each unit is also constrained by the minimum up and
down time (${MinUpTime}_{g}$ and ${MinDownTime}_{g}$) required to start it up
or shut it down, that is:

$\displaystyle\begin{split}&{ON}_{g,t}-{ON}_{g,t-1}\leq{ON}_{g,j};\\\
&\forall_{g},\,t\,\epsilon\,\\{2\>to\>(T-1)\\},\,t<j\leq\min(t+{MinUpTime}_{g}-1,T),\end{split}$
(3) $\displaystyle\begin{split}&{ON}_{g,t-1}-{ON}_{g,t}\leq 1-{ON}_{g,j};\\\
&\forall_{g},\,t\,\epsilon\,\\{2\>to\>(T-1)\\},\,t<j\leq\min(t+{MinDownTime}_{g}-1,T).\end{split}$
(4)

Over a planning horizon $T$, equations (3) and (4) thus force PowNet to
account for the minimum number of hours necessary to start the $g$-th unit up
(or to shut it down) at hour $j$.

#### Ramping limits.

The ramping up and down hourly limits of the $g$-th unit (${Ramp}_{g}$) are
constrained by equations (5) and (6):

$\displaystyle\begin{split}&{Elec}_{g,t}-{Elec}_{g,t-1}\leq{Ramp}_{g};\;\;\forall_{g},\,\forall_{t},\end{split}$
(5)
$\displaystyle\begin{split}&{Elec}_{g,t-1}-{Elec}_{g,t}\leq{Ramp}_{g};\;\;\forall_{g},\,\forall_{t}.\end{split}$
(6)

In other words, equations (5) and (6) ensure that the increase or decrease of
the power generation during two consecutive hours (${Elec}_{g,t}$ and
${Elec}_{g,t-1}$) is below the ramping limit (${Ramp}_{g}$) of the $g$-th
unit.

#### Capacity constraints.

Equation (7) accounts for the minimum and maximum capacity of the generating
units. In particular, equation (7) indicates that the hourly electricity
production ${Elec}_{g,t}$ from the $g$-th dispatchable unit is bounded by its
minimum and maximum capacity (${MinCap}_{g}$ and ${MaxCap}_{g}$):

$\displaystyle\begin{split}&{MinCap}_{g}\times{ON}_{g,t}\leq{Elec}_{g,t}\leq{MaxCap}_{g}\times{ON}_{g,t}\times{DerateF}_{g,t};\;\;\forall_{g},\,\forall_{t}.\end{split}$
(7)

The term ${DerateF}_{g,t}$ is used to account for the impact of droughts on
freshwater-dependent dispatchable units—during a prolonged dry spell, for
example, a thermo-power unit may not be able to run at full capacity because
of its limited cooling capability. The default value of ${DerateF}_{g,t}$ is
one, but it can be modified to a smaller value if water availability becomes a
limiting factor. Note that the value of ${DerateF}_{g,t}$ must be supplied by
the user, which can rely on a variety of methods for such task [11, 21].

Similarly, the hourly electricity import ${Elec}_{i,t}$ from the $i$-th import
source is constrained by the maximum allowable import (${MaxCap}_{i}$), as
indicated by equation (8):

$\displaystyle\begin{split}&0\leq{Elec}_{i,t}\leq{MaxCap}_{i}\times{ON}_{i,t};\;\;\forall_{i},\,\forall_{t}.\end{split}$
(8)

Finally, the amount of electricity ${Elec}_{rn,t}$ dispatched from the $rn$-th
renewable resource (e.g., hydro, wind, and solar) is bounded by its
availability (${RenewAvail}_{rn,t}$):

$\displaystyle\begin{split}&0\leq{Elec}_{rn,t}\leq{RenewAvail}_{rn,t};\;\;\forall_{rn},\,\forall_{t}.\end{split}$
(9)

The value of ${RenewAvail}_{rn,t}$ is generally modelled through the use of
climatic data. For example, the available hydro-electricity can be estimated
by feeding a hydrological-hydraulic model with rainfall and temperature data
[22]. Similarly, the electricity available in wind and solar power plants can
be simulated by harnessing data on wind speed [23] and solar radiation [24].

#### Energy balance.

Equation (10) applies the energy balance at each node n connected to any other
node k of the power system [10]. The left-hand side of equation (10) accounts
for (1) the electricity inputs (${Elec}_{n,t}$) from the available power
plants and/or import-sources connected to n, and (2) the electricity used to
meet domestic demand or export (${Demand}_{n,t}$ or ${Export}_{n,t}$) at the
node. The right-hand side indicates that the electricity transferred (in or
out) between n and k is proportional to the difference of the voltage angles
at these nodes (${VoltAngle}_{n,t}$ and ${VoltAngle}_{k,t}$), where the
susceptance of the transmission line (${LineSus}_{n,k}$) is the
proportionality constant [25]. The voltage angle at an arbitrary reference
node (usually, the node with highest demand) is set to zero, while the voltage
angle at any other node can be positive or negative [10]. The parameter
TransLoss is used to discount the energy production, or import, by a given
percentage, so as to account for the transmission losses (similar to [26]).
Equation (10) is formulated as:

$\displaystyle\begin{split}&(1-TransLoss)\times\sum{Elec}_{n,t}-{Demand}_{n,t}\,(-{Export}_{n,t})\\\
&=\sum_{k\,\epsilon\,N}{LineSus}_{n,k}\times\big{(}{VoltAngle}_{n,t}-{VoltAngle}_{k,t}\big{)};\;\;\forall_{n},\,\forall_{t}.\end{split}$
(10)

The hourly demand (and export) time series at the substations represent an
input to the model. These data can be obtained from observed records (see
Section 4.1) or modelled through relevant factors, such as population or
temperature [3].

#### Transmission capacity constraints.

With equation (11), known as the N-1 criterion, PowNet limits the electricity
transfer between any node-pair (n and k) below a certain percentage
($N1Criterion$) of the line-capacity (${LineCap}_{n,k}$), thereby leaving the
remaining fraction as a safety margin:

$\displaystyle\begin{split}&-N1Criterion\times{LineCap}_{n,k}\leq{LineSus}_{n,k}\times\big{(}{VoltAngle}_{n,t}-{VoltAngle}_{k,t}\big{)}\\\
&\leq
N1Criterion\times{LineCap}_{n,k};\;\;\forall_{n},\,\forall_{t},\,k\,\epsilon\,N.\end{split}$
(11)

A common value for the parameter $N1Criterion$ is 75% (c.f., [19]). As
illustrated in Appendix A, the parameters ${LineCap}_{n,k}$ and
${LineSus}_{n,k}$ are estimated from design specifications of the transmission
lines (e.g., size and length, voltage level, number of circuits and
conductors, and capacity per circuit), which can be easily obtained from
technical reports.

#### Electricity reserve.

The last two equations ensure that (1) the hourly electricity reserve is
larger than a predefined percentage of the system’s demand at time $t$ (e.g.,
$ResMargin$ = 15%, [26]), and (2) the minimum spinning reserve is a predefined
percentage of the total reserve (e.g., $SpinMargin$ = 50%, [16]):

$\displaystyle\begin{split}&\sum_{g}^{G}\big{(}{SpinRes}_{g,t}+{NonSpinRes}_{g,t}\big{)}\geq
ResMargin\times\sum_{n}^{N}{Demand}_{t};\;\;\forall_{t},\end{split}$ (12)
$\displaystyle\begin{split}&\sum_{g}^{G}{SpinRes}_{g,t}\geq SpinMargin\times
ResMargin\times\sum_{n}^{N}{Demand}_{t};\;\;\forall_{t}.\end{split}$ (13)

Two additional constraints are used to ensure that spinning and non-spinning
reserves are served by on-line and off-line generators, respectively.
Furthermore, users can allocate all or some specific generators (e.g., oil-
fired units) for the minimum reserve requirements.

##  3 Implementation and architecture

PowNet is implemented in three Python scripts, namely ‘PowNetModel.py’,
‘PowNetDataSetup.py’, and ‘PowNetSolver.ipynb’. ‘PowNetModel.py’ contains the
main model structure, with the objective function and constraints described in
Section 2. The model structure is based on the Pyomo optimization package
[27]. ‘PowNetDataSetup.py’ prepares the data required to execute the model.
Specifically, it outlines the input data into several .csv files that are read
as DataFrame objects. Then, the script generates a .dat file in which all data
are specified in a format that is executable by Pyomo. Finally,
‘PowNetSolver.ipynb’ executes the model and solves the optimization problem
using a standard solver, such as Gurobi or CPLEX. The script also generates
.csv files containing the value of each decision variable.

PowNet input data are categorized as: (i) parameters of the dispatchable
units, (ii) parameters of the transmission lines, (iii) hourly time series of
electricity demand at the substations, and (iv) hourly time series of
electricity available from variable renewable resources. The techno-economic
parameters of the dispatchable units are provided in a .csv file that also
includes identification data, such as the name and type of each unit and the
node to which they belong. The type of unit depends on fuel and turbine (e.g.,
‘coal_st’ stands for a coal-fired unit with steam turbine). The techno-
economic parameters are considered constant over the simulation period. In
addition, the .csv file contains the value of the derating factor (see Section
2.2). The data concerning the parameters of the transmission lines (i.e.,
susceptance and capacity), hourly electricity demand, and electricity
available from renewable resources are provided in separate .csv files. The
data regarding the length of the simulation period, planning horizon,
transmission loss, N-1 criterion, and hourly reserve margins are provided
directly by the user in the script ‘PowNetDataSetup.py’.

##  4 Quality control

So far, PowNet has been tested on the Laotian [28, 29] and Thai [30] power
systems. In both cases, the model output was validated against observed
statistics, such as the seasonal or annual generation mix. Here, we present an
implementation of PowNet for the Cambodian power system. The data and code
used for this demonstration are available in GitHub along with step-by-step
instructions on how to customize them. The next section presents an overview
of the model setup, followed by an evaluation of its performance.

###  4.1 Setup

Our implementation is based on the infrastructure built and operated in 2016.
The system consists of 30 nodes—including power plants and
substations—connected by high-voltage transmission lines (Figure 2) [31]. The
total generating capacity is 2,000 MW, with the national peak demand equal to
1,192 MW. The domestic capacity includes three coal-fired units (400 MW), 15
oil-fired units (282 MW), and six hydropower plants (930 MW). The system is
also connected to two import stations (dispatchable) from Vietnam (200 MW) and
Thailand (120 MW), and a hydropower plant in Laos. To set PowNet, data on the
parameters of dispatchable units and transmission lines were extracted from
different technical reports [20, 31, 32]. (Further details about the
estimation of the transmission parameters are given in Appendix A.) We also
extracted data on province-wise, monthly-varied peak electricity demand from
[31]. Spatially, the province-wise demand data were disaggregated to
substations based on their voltage-levels. For the disaggregation of monthly
data to hourly resolution, we used a week-daily and a clock-hourly demand
profile to incorporate the variability of demand over days in a week and hours
in a day, respectively. The time series of available hydropower was simulated
by a conceptual hydrologic model (see Appendix B).

The model was run with a 24 hour planning horizon, threshold for the N-1
criterion equal to 75% (of the line’s capacity), and reserve margin equivalent
to 15% of the system’s demand. The model was calibrated against the 2016
(observed) annual generation mix by tuning the fuel price value in Equation
(1). For each day (24 hours) of simulation, PowNet optimizes around 2,600
variables (continuous and binary). The model was tested with two solvers
(Gurobi and CPLEX) on an Intel(R) Core(TM) i7-8700 CPU @ 3.20 GHz with 8 GB
RAM running Microsoft Windows 10. They both yield the same output, with
slightly different computational requirements—$\sim$3.5 and $\sim$3.0 seconds
per day of simulation, respectively. Further tests on a Linux operating system
show similar performance.

Figure 2: Main generation and transmission components of the Cambodian power
system, as of 2016. The dashed lines denote components that are either planned
or under construction.

###  4.2 Performance

The simulation for the year of 2016 provides the following hourly time series:
(1) operational status of dispatchable units, (2) generation provided by
dispatchable units and variable renewable resources, (3) voltage angles at
each node, and (4) spinning and non-spinning reserves. These variables
represent an important information for the operation, planning, and management
of power systems. For example, detailed information on the operational status
can support the unit commitment and economic dispatch over the planning
horizon, while statistics on the generation mix provide an overview of the
system’s dependance on the various energy sources. These concepts are further
exemplified in Figure 3, which illustrates the energy generation mix. Here, we
can notice the ‘signature’ of wet and dry seasons: during the monsoon (May to
November), the system heavily relies on hydropower production, while during
the pre- and post-monsoon months the electricity generation is largely based
on coal and import. The use of these two resources is not only controlled by
economic factors—coal is cheaper than imported electricity—but also by the
several techno-economic constraints described in Section 2.2. For example,
there are a few days in August in which the concomitance of limited load and
high fixed and start-up costs make imported electricity preferable over coal.
The above analyses could be readily extended to longer simulation periods or
multiple demand patterns, so as to explore the effect of different drivers on
the performance of the power system (e.g., [3, 11]).

Figure 3: Daily generation mix for 2016.

Apart from the detailed representation of the aforementioned variables,
another feature of PowNet is the explicit representation of the hourly
transmission of electricity through the lines (estimated from the voltage
angle at each node). This information is synthesized in Figure 4, which
depicts the annual average usage of each line. Results indicate that usage is
limited, with only a few lines showing values larger than 40% of their
capacity. Unsurprisingly, these lines connect the coal plants in the
Southwestern coast and import station from Vietnam to the capital (Phnom
Penh), namely the area with the highest load. The radar chart indicates that
the average usage of these lines is higher during the dry months, when the
system heavily relies on the coal units due to the low hydropower
availability. Despite the limited average usage, the maximum usage of the
lines during wet months is high ($\sim$ 70%), mainly because of the peak-hour
supply from the import station. Note that the transmission of electricity
through the lines can also be used to calculate the number of N-1 violations
(not observed in this example), a proxy of the network’s stress conditions.

Figure 4: Annual average usage of the transmission lines, expressed as a
percentage of the lines’ capacity. The radar chart shows the monthly average
and maximum usage of the line connecting Kampot to Takoe (one of the lines
with relatively high usage).

To further demonstrate the importance of a detailed representation of the
high-voltage transmission lines, we run PowNet using a slightly altered
network. In the ‘altered’ network, we assume that the capacity of the two
lines transferring electricity from the Southwestern coast and Vietnam to the
capital (see Figure 4) is halved—these are double circuit transmission lines,
so such scenario represents an instance in which one of the two circuits fails
to operate. (All other parameters and input variables remain unchanged.)
Figure 5 compares the system’s performance obtained with the ‘existing’ and
‘altered’ transmission networks. Looking at the generation mix (left panel),
we note that the model with altered network dispatches less electricity from
coal plants and Vietnam’s import station. That is because the two lines with
reduced capacity are frequently stressed (about 18% of the time), so they do
not allow the coal plants and import station to run at their full capacity.
The reduced dispatch from the coal plants and Vietnam’s import station is
partially offset by higher production from the oil-fired units and Thai import
station (we also observe a shortage of electricity supply of about 25 GWh). In
turn, such higher reliance on oil affects operating costs and CO2 emissions.
Overall, these results indicate that the altered functioning of just a few
lines can influence the behaviour of an entire power system. Capturing such
dynamics is therefore paramount to supporting effectively the operations and
planning of large-scale energy systems.

Figure 5: Simulation results obtained with the ‘existing’ and ‘altered’
transmission networks. System’s performance is measured in terms of generation
mix, electricity shortage, operating costs, and CO2 emissions.

##  5 Conclusions

PowNet is a least-cost optimization model for simulating the UC/ED of national
and regional power systems. The model accounts for the techno-economic
constraints of generating units and DC transmission network, thereby providing
functionalities for both grid and economic analyses. In particular, PowNet is
conceived for applications in the water-energy nexus domain, and it can easily
incorporate information on the effect of water availability on renewable and
non-renewable resources. The data requirements for the DC transmission network
are limited, thereby making PowNet applicable to data-scarce regions,
particularly developing countries.

## (2) Availability

### Operating system

Windows 10, Linux, and any other operating systems running Python and a
standard solver (e.g., Gurobi, CPLEX).

### Programming language

Python 3.5

### Additional system requirements

None.

### Dependencies

PowNet is written in Python 3.5. The following Python packages are required
for PowNet: (i) Pyomo, (ii) NumPy, (iii) Pandas, and (iv) Matplotlib (optional
for plotting). The Jupyter Notebook (freely available as part of Anaconda
Python with the aforementioned packages) is required to run the script
‘PowNetSolver.ipynb’, which also requires an optimization solver (e.g.,
Gurobi, CPLEX).

### Software location:

Name:

Zenodo

Persistent identifier:

https://doi.org/10.5281/zenodo.3462879

Licence:

MIT

Publisher:

AFM Kamal Chowdhury

Version published:

v1.1

Date published:

27-September-2019

Code repository

Name:

GitHub

Persistent identifier:

https://github.com/kamal0013/PowNet

Licence:

MIT

Date published:

27-September-2019

### Language

English

## (3) Reuse potential

PowNet is available on GitHub with step-by-step instructions on how to
formulate and implement the model of a given power system. While the data and
scripts demonstrate its use for the Cambodian power system, the user can
easily build a new model or customize an existing one by modifying (or adding)
dispatchable generators, renewable resources, substations, and transmission
lines. The GitHub repository also includes a few additional scripts that help
users perform some standard analyses on PowNet’s output. Note that Pyomo is
free, and that academic users can obtain a free license of state-of-the-art
standard solvers (e.g., Gurobi, CPLEX) to solve the model. We also note that
PowNet has been tested on Windows and Linux operating systems. Overall, the
availability of a dedicated repository, instructions, and extensive examples
should make PowNet easy and straightforward to reuse.

## Acknowledgment/Funding statement

This research is supported by Singapore’s Ministry of Education (MoE) through
the Tier 2 project ‘Linking water availability to hydropower supply—an
engineering systems approach’ (Award No. MOE2017-T2-1-143).

## Competing interests

The authors declare that they have no competing interests.

## Appendix

## A. Estimation of transmission parameters

PowNet uses two parameters for each transmission line, namely susceptance
(LineSus) and capacity (LineCap). For each transmission line, LineCap is
estimated as the product between the capacity per circuit and number of
circuits in the line. LineSus is estimated as the reciprocal of line reactance
X, which is calculated as follows [25]:

$\displaystyle\begin{split}&{X}=4\pi
fL\times{10}^{-7}\times\ln\Big{(}\dfrac{{D}_{m}}{GMR}\Big{)},\end{split}$ (A1)

where, f and $L$ are the line frequency (Hz) and length (km), Dm the geometric
mean distance between phases, and GMR the geometric mean radius of line per
phase. Assuming that the lines are in a three-phase system with symmetrically
arranged conductors, the geometric mean distance $D_{m}$ can be considered
equal to the centre-to-centre distance $D$ (m) between any two conductors
[10]. $D$ is calculated as a function of the voltage level (kV), as
recommended by [33, 34]:

$\displaystyle\begin{split}&{D}_{m}=D=0.0348\times\big{(}0.077\times
Voltage-3.11\big{)}.\end{split}$ (A2)

The GMR associated with line is calculated as follows [10]:

$\displaystyle\begin{split}&GMR=\Big{(}\prod_{c=1}^{C}\big{(}{e}^{-1/4}\times
r_{j}\times\prod_{j=1,j\neq
c}^{C}{d}_{c,j}\big{)}^{1/C}\Big{)}^{1/C},\end{split}$ (A3)

where, $r_{j}$ is the radius of any conductor j, and $d_{c,j}$ is the centre-
to-centre distance between j and each of the other conductors of a phase of C
conductors.

For the Cambodian power system, we obtained data on voltage level (kV), number
of circuits, line length (km), size (mm2) and number of conductors, and
capacity (MW) per circuit from [31, 35].

## B. Simulation of hydropower availability

Table B1 shows the design specifications (collected from [36, 37]) of the
Cambodian hydropower reservoirs. To calculate the hydropower available in each
dam, we adopted the following procedure. First, we estimated the inflow to the
reservoirs (${Q}_{t}$) through the use of the rational method, that is:

$\displaystyle\begin{split}&{Q}_{t}=c\times{I}_{t}\times A,\end{split}$ (B1)

where $c$ is a runoff coefficient, ${I}_{t}$ the rainfall intensity (mm/day),
and $A$ the drainage area of each dam (km2). The runoff coefficient was
estimated as a function of the soil type and slope of the drainage basins,
while the rainfall intensity was extracted from the APHRODITE gridded rainfall
dataset.

Then, we calculated the mass balance of each reservoir, namely:

$\displaystyle\begin{split}&{S}_{t+1}={S}_{t}+{Q}_{t}-{R}_{t},\end{split}$
(B2) $\displaystyle\begin{split}\text{s.t. }&0\leq
S_{t}\leq{S}_{cap},\end{split}$ (B4)

where ${S}_{t}$, $Q_{t}$, and $R_{t}$ represent the water storage, inflow, and
release at time $t$. $S_{cap}$ is the capacity of the reservoir. To calculate
the release $R_{t}$, we adopted rule curves aimed to maximize the hydropower
production [38].

Finally, we used the hydropower equation to estimate the power available at
each hydropower plant:

$\displaystyle\begin{split}&{hydropower}_{t}=\eta\times\rho\times
g\times{R}_{t}\times{H}_{t},\end{split}$ (B5)

where ${hydropower}_{t}$ is the available hydropower (MW), $\eta$ a non-
dimensional turbine efficiency term, $\rho$ the water density (1,000 kg/m3),
$g$ the gravitational acceleration (9.81 m/s2), and ${H}_{t}$ the hydraulic
head at time $t$ (calculated from the storage $S_{t}$). The daily time series
of available hydropower was transformed into an hourly time series by assuming
equal water availability throughout a single day.

Table B1: Design specifications of the Cambodian hydropower dams. Name |  | Installed
---
capacity
| Dam
---
height
Storage |  | Design
---
discharge
| Hydraulic
---
head
| Basin
---
area
| Runoff
---
coefficient
| (MW) | (m) | (Mm3) | (m3/s) | (m) | (km2) |
Kamchay | 194.1 | 110 | 680 | 163.5 | 122 | 710 | 0.62
Kirirom I | 12 | 34 | 30 | 20 | 373.5 | 99 | 0.48
Kirirom III | 18 | 40 | 30 | 40 | 271 | 105 | 0.48
L.R. Chrum | 338 | 68 | 62 | 300 | 132 | 1,550 | 0.51
Stung Atay | 240 | 45 | 443.8 | 125 | 216 | 1,157 | 0.75
Stung Tatay | 246 | 77 | 322 | 150 | 188 | 1,073 | 0.71

## References

## References

  * Gielen et al. [2019] Dolf Gielen, Francisco Boshell, Deger Saygin, Morgan D. Bazilian, Nicholas Wagner, and Ricardo Gorini.  The role of renewable energy in the global energy transformation.  _Energy Strategy Reviews_ , 24:38 – 50, 2019.
  * Welsch et al. [2014] Manuel Welsch, Paul Deane, Mark Howells, Brian Ó Gallachóir, Fionn Rogan, Morgan Bazilian, and Hans-Holger Rogner.  Incorporating flexibility requirements into long-term energy system models–A case study on high levels of renewable electricity penetration in Ireland.  _Applied Energy_ , 135:600–615, 2014.
  * Su et al. [2017] Yufei Su, Jordan D. Kern, and Gregory W. Characklis.  The impact of wind power growth and hydrological uncertainty on financial losses from oversupply events in hydropower-dominated systems.  _Applied Energy_ , 194:172–183, 2017.
  * Ringkjøb et al. [2018] Hans-Kristian Ringkjøb, Peter M. Haugan, and Ida Marie Solbrekke.  A review of modelling tools for energy and electricity systems with large shares of variable renewables.  _Renewable and Sustainable Energy Reviews_ , 96:440 – 459, 2018.
  * Brown et al. [2018] Thomas Brown, Jonas Hörsch, and David Schlachtberger.  PyPSA: Python for Power System Analysis.  _Journal of Open Research Software_ , 6(1), 2018.
  * Dai et al. [2018] Jiangyu Dai, Shiqiang Wu, Guoyi Han, Josh Weinberg, Xinghua Xie, Xiufeng Wu, Xingqiang Song, Benyou Jia, Wanyun Xue, and Qianqian Yang.  Water-energy nexus: A review of methods and tools for macro-assessment.  _Applied Energy_ , 210:393–408, 2018.
  * van Vliet et al. [2016] Michelle T. H. van Vliet, David Wiberg, Sylvain Leduc, and Keywan Riahi.  Power-generation system vulnerability and adaptation to changes in climate and water resources.  _Nature Climate Change_ , 6:375–380, 2016.
  * Turner et al. [2017] Sean W.D. Turner, Jia Yi Ng, and Stefano Galelli.  Examining global electricity supply vulnerability to climate change using a high-fidelity hydropower dam model.  _Science of The Total Environment_ , 590-591:663–675, 2017\.
  * Turner et al. [2019] S. W. D. Turner, N. Voisin, J. Fazio, D. Hua, and M. Jourabchi.  Compound climate events transform electrical power shortfall risk in the Pacific Northwest.  _Nature Communications_ , 10:1–8, 2019.
  * Conejo and Baringo [2018] A.J. Conejo and L. Baringo.  _Power system operations_.  Springer, 1st. edition, 2018.
  * Voisin et al. [2016] N. Voisin, M. Kintner-Meyer, R. Skaggs, T. Nguyen, D. Wu, J. Dirks, Y. Xie, and M. Hejazi.  Vulnerability of the U.S. western electric grid to hydro-climatological conditions: How bad can it get?  _Energy_ , 115:1–12, 2016.
  * Deane et al. [2012] J.P. Deane, Alessandro Chiodi, Maurizio Gargiulo, and Brian P. Ó Gallachóir.  Soft-linking of a power systems model to an energy systems model.  _Energy_ , 42(1):303–312, 2012.
  * Savvidis et al. [2019] Georgios Savvidis, Kais Siala, Christoph Weissbart, Lukas Schmidt, Frieder Borggrefe, Subhash Kumar, Karen Pittel, Reinhard Madlener, and Kai Hufendiek.  The gap between energy policy challenges and model capabilities.  _Energy Policy_ , 125:503 – 520, 2019.
  * Milano [2005] F. Milano.  An open source power system analysis toolbox.  _IEEE Transactions on Power Systems_ , 20(3):1199–1206, 2005.
  * O’Connell et al. [2019] O’Connell, Nathalie Voisin, Macknick, and Fu.  Sensitivity of western u.s. power system dynamics to droughts compounded with fuel price variability.  _Applied Energy_ , 247:745 – 754, 2019.
  * Kern and Characklis [2017] Jordan D. Kern and Gregory W. Characklis.  Evaluating the financial vulnerability of a major electric utility in the Southeastern U.S. to drought under climate change and an evolving generation mix.  _Environmental Science & Technology_, 51(15):8815–8823, 2017.
  * Stott et al. [2009] B. Stott, J. Jardim, and O. Alsac.  DC power flow revisited.  _IEEE Transactions on Power Systems_ , 24(3):1290–1300, 2009.
  * Brown et al. [2016] T. Brown, P. Schierhorn, E. Tröster, and T. Ackermann.  Optimising the european transmission system for 77% renewable electricity by 2030.  _IET Renewable Power Generation_ , 10(1):3–9, 2016.
  * Schlecht and Weigt [2014] Ingmar Schlecht and Hannes Weigt.  Swissmod - a model of the Swiss electricity market.  _FoNEW Discussion Paper_ , page 31, 2014.
  * Truby [2014] Johannes Truby.  Thermal power plant economics and variable renewable energies: A model-based case study for Germany.  Technical report, International Energy Agency (IEA), 2014.
  * Lubega and Stillwell [2018] William Naggaga Lubega and Ashlynn S Stillwell.  Maintaining electric grid reliability under hydrologic drought and heat wave conditions.  _Applied Energy_ , 210:538–549, 2018.
  * Dang et al. [2019] T. D. Dang, A. K. Chowdhury, and S. Galelli.  On the representation of water reservoir storage and operations in large-scale hydrological models: implications on model parameterization and climate change impact assessments.  _Hydrology and Earth System Sciences Discussions_ , 2019:1–34, 2019.  10.5194/hess-2019-334.
  * Papavasiliou et al. [2015] A. Papavasiliou, S. S. Oren, and I. Aravena.  Stochastic modeling of multi-area wind power production.  In _2015 48th Hawaii International Conference on System Sciences_ , pages 2616–2626, 2015.
  * Blair et al. [2014] N. Blair, A. Dobos, J. Freeman, T. Neises, M. Wagner, T. Ferguson, P. Gilman, and S. Janzou.  System advisor model, SAM 2014.1.14: General description, 2014.  url: https://sam.nrel.gov, last accessed on 05/09/2019.
  * Bergen and Vittal [1999] Arthur R. Bergen and Vijay. Vittal.  _Power systems analysis_.  Prentice Hall, Upper Saddle River, New Jersey, 2nd. edition, 1999.
  * Guerra et al. [2016] Omar J. Guerra, Diego A. Tejada, and Gintaras V. Reklaitis.  An optimization framework for the integrated planning of generation and transmission expansion in interconnected power systems.  _Applied Energy_ , 170:1–21, 2016.
  * Hart et al. [2011] W E Hart, W J Paul, and L W David.  Pyomo: Modeling and solving mathematical programs in Python.  _Mathematical Programming Computation_ , 3:219–260, 2011\.
  * Chowdhury et al. [2018] A. K. Chowdhury, T. D. Dang, and S. Galelli.  Coupling hydrologic and network constrained unit commitment models to understand the water-energy nexus in Laos, 2018.  Presented in AGU Fall Meeting 2018, Washington D.C. url: http://adsabs.harvard.edu/abs/2018AGUFM.H23F..03C.
  * Galelli et al. [2019] S. Galelli, A. K. Chowdhury, and T. D. Dang.  A coupled water-energy model reveals key interdependencies between hydro-climatic variability, energy generation, and power distribution in the Greater Mekong Sub-region, 2019.  Presented in EGU General Assembly 2019, Vienna. url: https://meetingorganizer.copernicus.org/EGU2019/EGU2019-6293.pdf.
  * Chowdhury et al. [2019] A. K. Chowdhury, T. D. Dang, and S. Galelli.  Impacts of hydro-climatic variability on the energy system of the Greater Mekong Sub-region, 2019.  Presented in AOGS Annual Meeting 2019, Singapore.
  * EDC [2016] EDC.  Annual report 2016.  Technical report, Electricite Du Cambodge (EDC), 2016.
  * EIA [2016] EIA.  Average tested heat rates by prime mover and energy source, 2007 - 2016 (Form EIA-860, annual electric generator report).  Technical report, U.S. Energy Information Administration (EIA), 2016.
  * Barthold et al. [1978] L.O. Barthold, R.E. Clayton, I.S. Grant, V.J. Longo, J.R. Stewart, and D.D. Wilson.  Transmission line reference book: 115–138 kV compact line design.  Technical report, Electric Power Research Institute, Inc., Palo Alto, CA, 1978.
  * MacCarthy [1968] D.D. MacCarthy.  _EHV Transmission Line Reference Book_.  Project EHV, General Electric Company, Edison Electric Institute, 1968\.
  * JICA [2014] JICA.  Final report: Preparatory survey for Phnom Penh city transmission and distribution system expansion project phase ii in the Kingdom of Cambodia.  Technical report, Japan International Cooperation Agency (JICA), 2014\.
  * Middleton and Chanthy [2008] C. Middleton and S. Chanthy.  Cambodia’s hydropower development and China’s involvement.  Technical report, International Rivers, 2008.
  * Men et al. [2014] Prachvuthy Men, Vathana Thun, Soriya Yin, and Louis Lebel.  Benefit sharing from Kamchay and Lower Sesan 2 hydropower watersheds in Cambodia.  _Water Resources and Rural Development_ , 4:40 – 53, 2014\.
  * Piman et al. [2013] T. Piman, T. A. Cochrane, M. E. Arias, A. Green, and N. D. Dat.  Assessment of flow changes from hydropower development and operations in Sekong, Sesan, and Srepok Rivers of the Mekong basin.  _Journal of Water Resources Planning and Management_ , 139(6):723–732, 2013.