Argos on CPU (default)
Unless explicitly specified, Argos solves the OPF on the CPU. Argos provides 3 different methods to solve the OPF, all relying on the interior-point method (IPM).
Method | Derivatives | KKT system |
---|---|---|
Full-space | Sparse | Sparse |
Biegler | Sparse | Dense |
Dommel & Tinney | Dense | Dense |
- Full-space and Biegler are equivalent in exact arithmetic. Full-space solves the original (sparse) KKT system whereas Biegler uses a reduction method to find an equivalent (dense) linear system.
- Dommel & Tinney is a port of the classical algorithm of Dommel and Tinney originally developed in 1968. It exploits the structure of the power flow equations to optimize only with relation to the degrees of freedom (the control, associated with the voltage at the PV nodes and the power generations). The reduction is the same as in Biegler, but Dommel & Tinney comprises an additional projection step to recover the dependent variables (the state). Currently, Dommel & Tinney uses the Newton-Raphson algorithm implemented in ExaPF to compute the projection step.
All three methods are described in detail in the Argos paper.
First, we set up the current Julia environment and choose an OPF instance in our artifact ExaData:
using Argos, MadNLP
datafile = joinpath(INSTANCES_DIR, "case118.m")
"/home/runner/.julia/artifacts/fc4d4283fe5bd2327fb1504317feb645a8421f7c/ExaData/case118.m"
Biegler's method (linearize-then-reduce)
- Biegler's reduction condenses and reduces the KKT linear system to a dense linear system whose size is given by the number of degrees of freedom in the problem. We recommend factorizing the resulting system with the Cholesky factorization shipped with Lapack.
- Note we obtain exactly the same convergence as with the previous
FullSpace
method, as the two methods are equivalent.
julia> Argos.run_opf(datafile, Argos.BieglerReduction(); lapack_algorithm=MadNLP.CHOLESKY);
This is MadNLP version v0.8.5, running with Lapack-CPU (CHOLESKY) Number of nonzeros in constraint Jacobian............: 3419 Number of nonzeros in Lagrangian Hessian.............: 1157 Total number of variables............................: 288 variables with only lower bounds: 0 variables with lower and upper bounds: 171 variables with only upper bounds: 0 Total number of equality constraints.................: 181 Total number of inequality constraints...............: 427 inequality constraints with only lower bounds: 0 inequality constraints with lower and upper bounds: 55 inequality constraints with only upper bounds: 372 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 0 1.3280884e+05 1.30e+00 1.80e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0 1 1.3128743e+05 5.98e-01 1.93e+01 -1.0 1.68e+00 - 6.81e-01 5.26e-01h 1 2 1.3035549e+05 1.28e-01 1.91e+01 -1.0 1.35e+00 - 9.58e-01 1.00e+00h 1 3 1.3097918e+05 2.88e-01 3.36e-01 -1.0 1.39e+00 - 9.90e-01 1.00e+00h 1 4 1.3110195e+05 6.32e-03 2.47e-03 -1.0 3.06e-01 - 9.97e-01 1.00e+00h 1 5 1.3029143e+05 4.67e-02 3.86e-01 -2.5 5.91e-01 - 8.98e-01 1.00e+00h 1 6 1.2996301e+05 4.46e-02 2.02e-02 -2.5 4.91e-01 - 9.63e-01 1.00e+00h 1 7 1.2981504e+05 5.20e-02 3.03e-03 -2.5 2.63e-01 - 1.00e+00 1.00e+00h 1 8 1.2980960e+05 1.52e-04 2.63e-05 -2.5 5.63e-02 - 1.00e+00 1.00e+00h 1 9 1.2971824e+05 2.22e-02 4.70e-03 -5.7 2.37e-01 - 7.63e-01 8.03e-01h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 10 1.2969004e+05 1.27e-02 1.49e-01 -5.7 2.91e-01 - 7.32e-01 4.49e-01h 1 11 1.2966972e+05 1.47e-02 8.84e-02 -5.7 3.32e-01 - 6.81e-01 6.00e-01h 1 12 1.2966195e+05 1.36e-02 4.23e-02 -5.7 2.18e-01 - 8.18e-01 7.21e-01h 1 13 1.2966049e+05 4.83e-03 1.15e-02 -5.7 8.72e-02 - 1.00e+00 8.85e-01h 1 14 1.2966068e+05 1.33e-03 7.67e-03 -5.7 1.78e-02 - 1.00e+00 7.28e-01h 1 15 1.2966078e+05 5.96e-05 6.08e-06 -5.7 7.51e-03 - 1.00e+00 1.00e+00h 1 16 1.2966078e+05 6.82e-07 1.34e-07 -5.7 1.18e-03 - 1.00e+00 1.00e+00h 1 17 1.2966070e+05 1.34e-05 2.39e-05 -8.6 3.47e-03 - 9.81e-01 9.71e-01h 1 18 1.2966069e+05 8.23e-07 6.55e-08 -8.6 8.68e-04 - 1.00e+00 1.00e+00h 1 19 1.2966069e+05 3.53e-09 5.55e-10 -8.6 8.40e-05 - 1.00e+00 1.00e+00h 1 Number of Iterations....: 19 (scaled) (unscaled) Objective...............: 1.0789722164548266e+02 1.2966069409995302e+05 Dual infeasibility......: 5.5539734887747036e-10 6.6742409728899220e-07 Constraint violation....: 3.5293425423941344e-09 3.5293425423941344e-09 Complementarity.........: 2.3347816352892952e-12 2.8057201361320484e-09 Overall NLP error.......: 3.5293425423941344e-09 3.5293425423941344e-09 Number of objective function evaluations = 20 Number of objective gradient evaluations = 20 Number of constraint evaluations = 20 Number of constraint Jacobian evaluations = 20 Number of Lagrangian Hessian evaluations = 19 Total wall-clock secs in solver (w/o fun. eval./lin. alg.) = 6.135 Total wall-clock secs in linear solver = 0.017 Total wall-clock secs in NLP function evaluations = 3.136 Total wall-clock secs = 9.287 EXIT: Optimal Solution Found (tol = 1.0e-08).
Dommel & Tinney's method (reduce-then-linearize)
DommelTinney
works in the reduced space, and the associated formulation has less variable than in the full space (107 versus 288).- The reduced Jacobian and reduced Hessian are dense, so
DommelTinney
can potentially eat a lot of memory on the largest instances. - As with
BieglerReduction
, we recommend using Lapack with a Cholesky factorization to solve the KKT system. - Note that we have to increase MadNLP's tolerance (parameter
tol
) as we cannot optimize below the tolerance of the Newton-Raphson employed under the hood (1e-10
by default).
julia> Argos.run_opf(datafile, Argos.DommelTinney(); tol=1e-5);
This is MadNLP version v0.8.5, running with Lapack-CPU (CHOLESKY) Number of nonzeros in constraint Jacobian............: 52537 Number of nonzeros in Lagrangian Hessian.............: 5778 Total number of variables............................: 107 variables with only lower bounds: 0 variables with lower and upper bounds: 107 variables with only upper bounds: 0 Total number of equality constraints.................: 0 Total number of inequality constraints...............: 491 inequality constraints with only lower bounds: 0 inequality constraints with lower and upper bounds: 119 inequality constraints with only upper bounds: 372 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 0 1.3115105e+05 3.54e-01 6.80e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0 1 1.3081561e+05 2.90e-01 5.66e+00 -1.0 1.37e+00 0.0 1.92e-01 1.80e-01h 1 2 1.3034709e+05 2.06e-01 1.04e+01 -1.0 1.95e+00 -0.5 2.72e-01 2.99e-01h 1 3 1.2989713e+05 1.17e-01 2.27e+01 -1.0 4.51e+00 - 4.65e-01 5.17e-01h 1 4 1.2977967e+05 9.84e-02 1.18e+01 -1.0 2.08e+00 - 8.58e-01 1.00e+00h 1 5 1.2977206e+05 5.41e-02 1.56e-01 -1.0 2.79e-01 - 9.90e-01 1.00e+00h 1 6 1.2977237e+05 3.35e-04 6.46e-03 -1.0 5.93e-02 - 9.92e-01 1.00e+00h 1 7 1.2970884e+05 1.00e-02 1.04e+00 -1.7 3.19e-01 - 9.77e-01 8.40e-01h 1 8 1.2968386e+05 3.10e-02 6.83e-02 -1.7 2.19e-01 - 1.00e+00 1.00e+00h 1 9 1.2966773e+05 3.01e-02 7.56e-01 -2.5 2.04e-01 - 9.14e-01 8.54e-01h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 10 1.2966373e+05 1.01e-02 1.82e-02 -2.5 9.18e-02 - 1.00e+00 1.00e+00h 1 11 1.2966125e+05 4.95e-03 2.51e-01 -3.8 6.19e-02 - 9.28e-01 8.43e-01h 1 12 1.2966079e+05 2.95e-04 4.51e-02 -3.8 2.08e-02 - 1.00e+00 9.61e-01h 1 13 1.2966076e+05 3.18e-05 1.82e-03 -3.8 5.20e-03 - 1.00e+00 1.00e+00h 1 14 1.2966076e+05 5.59e-07 5.08e-05 -3.8 7.08e-04 - 1.00e+00 1.00e+00h 1 15 1.2966062e+05 2.51e-05 3.99e-03 -5.7 5.05e-03 - 9.85e-01 9.63e-01h 1 16 1.2966062e+05 2.40e-06 1.32e-04 -5.7 1.38e-03 - 1.00e+00 1.00e+00h 1 17 1.2966062e+05 2.42e-08 4.91e-06 -5.7 1.91e-04 - 1.00e+00 1.00e+00h 1 Number of Iterations....: 17 (scaled) (unscaled) Objective...............: 5.3638754796152316e+03 1.2966061609960005e+05 Dual infeasibility......: 4.9091989771099520e-06 1.1866975032262738e-04 Constraint violation....: 2.4237283187834163e-08 2.4237283187834163e-08 Complementarity.........: 7.9499902941411124e-08 1.9217460275534212e-06 Overall NLP error.......: 1.9217460275534212e-06 4.9091989771099520e-06 Number of objective function evaluations = 18 Number of objective gradient evaluations = 18 Number of constraint evaluations = 18 Number of constraint Jacobian evaluations = 18 Number of Lagrangian Hessian evaluations = 17 Total wall-clock secs in solver (w/o fun. eval./lin. alg.) = 6.012 Total wall-clock secs in linear solver = 0.009 Total wall-clock secs in NLP function evaluations = 0.106 Total wall-clock secs = 6.127 EXIT: Optimal Solution Found (tol = 1.0e-05).