scopflow.md

May 21, 2026 · View on GitHub

Security-constrained optimal power flow (SCOPFLOW)

SCOPFLOW solves a contingency-constrained optimal power flow problem. The problem is set up as a two-stage optimization problem where the first-stage (base-case) represents the normal operation of the grid and the second-stage comprises of Nc`N_c` contingency scenarios. Compactly, the problem can be set up in the following form:

min c{0,Nc}fc(xc)s.t. gc(xc)=0   c{0,Nc} hc(xc)0  c{0,Nc}xxcx+  c{0,Nc}Δxcxcx0Δxc  c{1,Nc}\begin{aligned} \text{min}&~\sum_{c \in \{0,N_c\}}f_c(x_c)& \\ &\text{s.t.}& \\ &~g_c(x_c) = 0~~~c \in \{0,N_c\}& \\ &~h_c(x_c) \le 0~~c \in \{0,N_c\}& \\ &x^- \le x_c \le x^+~~c\in \{0,N_c\}& \\ -\Delta{x}_c & \le x_c - x_0 \le \Delta{x}_c~~c \in \{1,N_c\}& \end{aligned}

where Nc`N_c` is the number of contingencies. The total number of scenarios equals Nc+1`N_c + 1`, i.e., the base-case + Nc`N_c` contingencies. Each scenario is an optimal power flow formulation. See OPFLOW. The last equation is the coupling between the 2nd stage contingency scenarios and the first-stage. Each contingency scenario can either be single-period or multi-period. In the multi-period mode, additional data files for the load and wind generation profiles can be set via command line options. Multi-period SCOPFLOW is activated either by setting the command line option -scopflow_enable_multiperiod OR calling SCOPFLOWEnableMultiPeriod.

Depending on the mode, SCOPFLOW can either be preventive (mode = 0) or corrective (mode = 1). In the preventive mode, the PV and PQ generator real power is fixed to its corresponding base-case values. Any power offset/make-up is done by the swing bus generators. The corrective mode allows deviation of the PV and PQ generator real power from the base-case dispatch, constrained by its 30-min. ramp rate capability.

Dependency

To use this application, one must have ExaGO built with Ipopt. Even when using HiOp as the main solver, this application still uses Ipopt (to solve the base subproblem).

Usage

SCOPFLOW is executed via

mpiexec -n <N> ./scopflow <options>

where <options> are the available command line options as given in the next section.

Options

The current version has several options available for SCOPFLOW. These options can be set either through the options file options/scopflowoptions or via the command line.

Option NameDescriptionValues (Default value)Compatibility
-netfileName of network file in MATPOWER format(case9mod.m)4096 characters max.
-ctgcfileName of contingency list file(case9.cont)4096 characters max. Uses a native format for describing contingencies. See scopflow.h
-scopflow_NcNumber of contingenciesWith this option set, SCOPFLOW will only pick up the first Nc contingencies in the contingency file. To select all contingencies, use -scopflow_Nc -1
-scopflow_modelSCOPFLOW model typeGENRAMP, GENRAMPT (GENRAMP)
-scopflow_solverOptimization solver(Ipopt), HiOp, or EMPARSee the note below on solvers
-scopflow_modeMode of operation0 or 1 (0)See the note below on mode of operation
-scopflow_subproblem_solverOptimization solver for the subproblem when using HiOp solverIpopt or HiOp (Ipopt)See opflow page for description of solvers
-scopflow_subproblem_modelModel for the subproblem when using HiOp solver(POWER_BALANCE_POLAR)See opflow page for available models
-scopflow_modeMode of operation0 or 1 (0)See the note below on mode of operation
-scopflow_toleranceOptimization solver tolerance(1e-6)All solvers
-scopflow_enable_multiperiodInclude multi-period0 or 1 (0)Only compatible with Ipopt solver
-scopflow_durationDuration for multi-period run in hoursOnly when multi-period is enabled
-scopflow_dTTime-step for multi-period run in minutesOnly when multi-period is enabled
-scopflow_ploadprofileActive power load profile filenameOnly when multi-period is enabled
-scopflow_qloadprofileReactive power load profile filenameOnly when multi-period is enabled
-scopflow_windgenprofileWind generation profile filenameOnly when multi-period is enabled
-print_outputPrint SCOPFLOW solution to screen0 or 1 (0)All solvers
-save_outputSave OPFLOW solution to file0 or 1 (0)All solvers

Contingencies

Contingencies can either be specified in PTI format (.con file) or a native format. The description of the native format is given in the header file include/scopflow.h. SCOPFLOW supports single/multiple generator and line/transformer outage contingencies.

Solver

SCOPFLOW can be solved with either Ipopt, HiOp, or EMPAR. With Ipopt, SCOPFLOW can be only run on one processor (N = 1) as Ipopt only supports single process execution. HiOp supports a distributed solution allowing SCOPFLOW to be solved in parallel. It uses a two-stage primal decomposition algorithm for solving the problem.

In addition, one can solve SCOPFLOW in an embarrassingly parallel model with the EMPAR solver. With EMPAR, the base case and the contingencies are solved independently, i.e, there is no coupling.

Mode

Set SCOPFLOW to either run in preventive (0) or corrective (1) mode. In preventive mode, any power deficit or surplus in the contingency problem is provided by the swing bus only. In the corrective mode, in addition to the swing bus, the generators at PV/PQ buses contribute to the deficit/surplus. The contribution amount is decided by the optimization with the constraint that the real power dispatch for these generators should be within 30-min ramping limit.