**2. TTC Calculation with TSCOPF**

We believe the OPF method is a brilliant choice because the optimization procedure enables a theoretical search for extreme operating conditions representing TTC. Therefore, TSCOPF is adopted to model TTC calculation problem in this section. According to [22], the generic OPF method for calculating TTC can be formulated as follows:

$$\begin{array}{l}\text{Max}\,f(y,\mu) \\ \text{s.t. }g(y,\mu) = 0 \\ h(y,\mu) \le 0 \end{array} \tag{1}$$

where *<sup>y</sup>*,*<sup>u</sup>* are the state and control variable vector of the system; and *<sup>g</sup>*(·), *<sup>h</sup>*(·) are the set of equality and inequality constraints, respectively.

(1) Objective function: It aims to maximize the sum of the active power output of all generators in the source area, i.e.,

$$\text{Max}\,f(y,\mathfrak{u}) = \sum\_{k \in \text{Sosu}} P\_{\text{Gk}\prime} \tag{2}$$

where *PGk* is generator active power output at bus *k*; and *Ssou* means the source area bus set.

(2) Static equality constraints: Power flow equations are formed under polar coordinates, shown below:

$$\begin{array}{l}P\_{Gi} - P\_{Di} - V\_i \sum\_{j=1}^{n} V\_j (G\_{l\bar{\eta}} \cos \theta\_{i\bar{\eta}} + B\_{i\bar{\eta}} \sin \theta\_{i\bar{\eta}}) = 0, \\ Q\_{Gi} - Q\_{Di} - V\_i \sum\_{j=1}^{n} V\_j (G\_{l\bar{\eta}} \sin \theta\_{i\bar{\eta}} - B\_{i\bar{\eta}} \cos \theta\_{i\bar{\eta}}) = 0 \end{array} \tag{3}$$

where *PGi*, *PDi* represent active generation and demand for bus *i*; *QGi*, *QDi* are reactive generation and demand for bus *i*, respective; *Vi* and *θ<sup>i</sup>* are the voltage magnitude and phase angle of bus *i*, and *θij* = *θ<sup>i</sup>* − *θj*; *Gij* + *jBij* is the driving point admittance and the transfer admittance; *n* is the number of buses.

(3) Static inequality constraints:

$$\begin{array}{l}P\_{Gi}^{\text{min}} \le P\_{Gi} \le P\_{Gi}^{\text{max}}, G \dot{e} \in \mathcal{S}\_G \cup \mathcal{S}\_W\\ Q\_{Gi}^{\text{min}} \le Q\_{Gi} \le Q\_{Gi}^{\text{max}}, G \dot{e} \in \mathcal{S}\_G \cup \mathcal{S}\_W\\ V\_i^{\text{min}} \le V\_i \le V\_i^{\text{max}}, i \in \mathcal{S}\_n\\ P\_{\vec{ij}} \le P\_{\vec{ij}}^{\text{max}}, \dot{\eta} \in \mathcal{S}\_I\end{array} \tag{4}$$

where *PGi*min, *PGi*max, *QGi*min, *QGi*max are the lower and upper limits of the generator active and reactive power at bus *k*, respective; *Vi* min and *Vi* max are the lower and upper limits of the voltage at bus *i*; *Pij* max is the transmission threshold of line *ij*; *SG*, *SW*, *Sn*, *Sl* are the sets of generators, wind farms, buses, and lines.

(4) Transient stability constraints: This paper adopts the classical generator model to analyze transient stability. During the dynamic process, loads are modeled as constant impedance. Hence, generic TS models can be simplified as follows:

$$\begin{array}{c} \mathbf{x}'(t) = \rho\_{\mathbf{c}}(\mathbf{x}(t), \mathbf{y}(t), \mathbf{u}),\\ \psi\_{\mathbf{c}}(\mathbf{x}(t), \mathbf{y}(t), \mathbf{u}) \ge 0, \mathbf{c} \in \mathcal{S}\_{\mathbf{c}}, t \in (t\_0, t\_{\text{end}}] \end{array} \tag{5}$$

where *x*, *y* are the algebraic and state variables; [*x*(*t*), *y*(t)] refers to the operating condition during the transient period (*t*0, *t*end]; *Sc* is a set of pre-contingencies; *ψc*(·) is the transient stability criterion used in this paper [23], and it is shown as follows:

$$\begin{array}{l} \mid \delta\_{i}(t) - \delta\_{\text{COM}}(t) \mid \leq \delta\_{\text{thr}}, \; t \in (t\_{0}, t\_{\text{end}}] \\ \delta\_{\text{COI}}(t) = (\sum\_{i} M\_{i} \cdot \delta\_{i}(t)) \;/\ (\sum\_{i} M\_{i}), \; i \in \{1, \dots, n\_{G}\} \end{array} \tag{6}$$

where *δi*(*t*) is the rotor angles of generator *i*; *δCOI*(*t*) is the rotor angle under the center of inertia (COI); *δthr* is the instability threshold that is usually set as 180 degree [23]; *Mi* represents the inertia constant of the *i*th generator; and *nG* denotes the number of generators.

It should be mentioned the DAEs Equation (5) encompasses numerous time-domain variables, i.e., *δi*(*t*). With more precise timestep and more contingencies to be checked, the dimensionality of Equation (5) will be of exponential growth.

#### **3. Proposed Surrogate Model**

In TSC programming problem, exact state and parameter estimation for dynamic components (e.g., synchronous generators) must be conducted to truly model the transient process. This is difficult because large-scale state estimation is challenging regarding efficiency and precision. A sensible alternative is to directly encapsulate transient stability dynamics in a parameterized model so as to bypass state estimation. Rich data is needed, fortunately, it can be easily gathered nowadays in smart grid.

As reported before, TSA significantly increases the computational burden of solving the OPF model. To reduce the massive time-domain variables, a data-driven learning-aided model is proposed. This model allows us to map Equation (5) into a parametric space, such that the time-domain variables can be surrogated by ML structural parameters independent of optimization, and few parallel forwards processes of ML are enabled to circumvent quantities of DAEs.
