Tutorial 4: solving optimal power flow with MadNLP
The previous tutorial was the last step we needed to implement the full optimal power flow problem with MadNLP. It just remains to add the following elements to the model:
- the cost to run each power generator;
- the line flow constraints;
- the voltage angle constraints;
We start the tutorial again by importing the usual packages:
using LinearAlgebra
using SparseArrays
using NLPModels
using ExaModels
using JLD2
include("utils.jl")
We import a small instance:
DATA_DIR = joinpath(splitdir(Base.active_project())[1], "instances")
data = JLD2.load(joinpath(DATA_DIR, "case9.jld2"))["data"]
(bus = @NamedTuple{i::Int64, pd::Float64, gs::Float64, qd::Float64, bs::Float64, bus_type::Int64}[(i = 1, pd = 0.9, gs = 0.0, qd = 0.3, bs = 0.0, bus_type = 1), (i = 2, pd = 0.0, gs = 0.0, qd = 0.0, bs = 0.0, bus_type = 1), (i = 3, pd = 0.0, gs = 0.0, qd = 0.0, bs = 0.0, bus_type = 1), (i = 4, pd = 1.0, gs = 0.0, qd = 0.35, bs = 0.0, bus_type = 1), (i = 5, pd = 0.0, gs = 0.0, qd = 0.0, bs = 0.0, bus_type = 2), (i = 6, pd = 1.25, gs = 0.0, qd = 0.5, bs = 0.0, bus_type = 1), (i = 7, pd = 0.0, gs = 0.0, qd = 0.0, bs = 0.0, bus_type = 1), (i = 8, pd = 0.0, gs = 0.0, qd = 0.0, bs = 0.0, bus_type = 2), (i = 9, pd = 0.0, gs = 0.0, qd = 0.0, bs = 0.0, bus_type = 3)], gen = @NamedTuple{i::Int64, cost1::Float64, cost2::Float64, cost3::Float64, bus::Int64}[(i = 1, cost1 = 850.0000000000001, cost2 = 120.0, cost3 = 600.0, bus = 5), (i = 2, cost1 = 1225.0, cost2 = 100.0, cost3 = 335.0, bus = 8), (i = 3, cost1 = 1100.0, cost2 = 500.0, cost3 = 150.0, bus = 9)], arc = @NamedTuple{i::Int64, rate_a::Float64, bus::Int64}[(i = 1, rate_a = 1.5, bus = 3), (i = 2, rate_a = 3.0, bus = 8), (i = 3, rate_a = 2.5, bus = 4), (i = 4, rate_a = 2.5, bus = 7), (i = 5, rate_a = 2.5, bus = 2), (i = 6, rate_a = 2.5, bus = 6), (i = 7, rate_a = 2.5, bus = 7), (i = 8, rate_a = 1.5, bus = 1), (i = 9, rate_a = 2.5, bus = 9), (i = 10, rate_a = 1.5, bus = 4), (i = 11, rate_a = 3.0, bus = 3), (i = 12, rate_a = 2.5, bus = 7), (i = 13, rate_a = 2.5, bus = 5), (i = 14, rate_a = 2.5, bus = 1), (i = 15, rate_a = 2.5, bus = 2), (i = 16, rate_a = 2.5, bus = 6), (i = 17, rate_a = 1.5, bus = 3), (i = 18, rate_a = 2.5, bus = 2)], branch = @NamedTuple{i::Int64, j::Int64, f_idx::Int64, t_idx::Int64, f_bus::Int64, t_bus::Int64, c1::Float64, c2::Float64, c3::Float64, c4::Float64, c5::Float64, c6::Float64, c7::Float64, c8::Float64, rate_a_sq::Float64}[(i = 1, j = 1, f_idx = 1, t_idx = 10, f_bus = 3, t_bus = 4, c1 = -1.1550874808900968, c2 = 9.784270426363172, c3 = -1.1550874808900968, c4 = 9.784270426363172, c5 = 1.1550874808900968, c6 = -9.679770426363172, c7 = 1.1550874808900968, c8 = -9.679770426363172, rate_a_sq = 2.25), (i = 2, j = 1, f_idx = 2, t_idx = 11, f_bus = 8, t_bus = 3, c1 = 0.0, c2 = 17.064846416382252, c3 = -0.0, c4 = 17.064846416382252, c5 = 0.0, c6 = -17.064846416382252, c7 = 0.0, c8 = -17.064846416382252, rate_a_sq = 9.0), (i = 3, j = 1, f_idx = 3, t_idx = 12, f_bus = 4, t_bus = 7, c1 = -1.6171224732461358, c2 = 13.697978596908442, c3 = -1.6171224732461358, c4 = 13.697978596908442, c5 = 1.6171224732461358, c6 = -13.623478596908441, c7 = 1.6171224732461358, c8 = -13.623478596908441, rate_a_sq = 6.25), (i = 4, j = 1, f_idx = 4, t_idx = 13, f_bus = 7, t_bus = 5, c1 = 0.0, c2 = 16.0, c3 = -0.0, c4 = 16.0, c5 = 0.0, c6 = -16.0, c7 = 0.0, c8 = -16.0, rate_a_sq = 6.25), (i = 5, j = 1, f_idx = 5, t_idx = 14, f_bus = 2, t_bus = 1, c1 = -1.9421912487147264, c2 = 10.51068205186793, c3 = -1.9421912487147264, c4 = 10.51068205186793, c5 = 1.9421912487147264, c6 = -10.431682051867929, c7 = 1.9421912487147264, c8 = -10.431682051867929, rate_a_sq = 6.25), (i = 6, j = 1, f_idx = 6, t_idx = 15, f_bus = 6, t_bus = 2, c1 = -1.36518771331058, c2 = 11.604095563139932, c3 = -1.36518771331058, c4 = 11.604095563139932, c5 = 1.36518771331058, c6 = -11.516095563139933, c7 = 1.36518771331058, c8 = -11.516095563139933, rate_a_sq = 6.25), (i = 7, j = 1, f_idx = 7, t_idx = 16, f_bus = 7, t_bus = 6, c1 = -1.1876043792911486, c2 = 5.975134533308592, c3 = -1.1876043792911486, c4 = 5.975134533308592, c5 = 1.1876043792911486, c6 = -5.822134533308592, c7 = 1.1876043792911486, c8 = -5.822134533308592, rate_a_sq = 6.25), (i = 8, j = 1, f_idx = 8, t_idx = 17, f_bus = 1, t_bus = 3, c1 = -1.2820091384241148, c2 = 5.588244962361526, c3 = -1.2820091384241148, c4 = 5.588244962361526, c5 = 1.2820091384241148, c6 = -5.409244962361526, c7 = 1.2820091384241148, c8 = -5.409244962361526, rate_a_sq = 2.25), (i = 9, j = 1, f_idx = 9, t_idx = 18, f_bus = 9, t_bus = 2, c1 = 0.0, c2 = 17.36111111111111, c3 = -0.0, c4 = 17.36111111111111, c5 = 0.0, c6 = -17.36111111111111, c7 = 0.0, c8 = -17.36111111111111, rate_a_sq = 6.25)], ref_buses = [9], vmax = [1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1], vmin = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9], vm0 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], va0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], pmax = [3.0, 2.7, 2.5], pmin = [0.1, 0.1, 0.1], qmax = [3.0, 3.0, 3.0], qmin = [-3.0, -3.0, -3.0], rate_a = [1.5, 3.0, 2.5, 2.5, 2.5, 2.5, 2.5, 1.5, 2.5, 1.5, 3.0, 2.5, 2.5, 2.5, 2.5, 2.5, 1.5, 2.5], angmax = [1.0472, 1.0472, 1.0472, 1.0472, 1.0472, 1.0472, 1.0472, 1.0472, 1.0472], angmin = [-1.0472, -1.0472, -1.0472, -1.0472, -1.0472, -1.0472, -1.0472, -1.0472, -1.0472], pg0 = [1.63, 0.85, 0.723], qg0 = [0.0654, -0.10949999999999999, 0.2703])
Optimal power flow model
We implement in ExaModels the AC optimal power flow problem in the function acopf_model
:
function acopf_model(
data;
backend = nothing,
T = Float64,
kwargs...,
)
w = ExaCore(T; backend = backend)
va = variable(w, length(data.bus))
vm = variable(
w,
length(data.bus);
start = data.vm0,
lvar = data.vmin,
uvar = data.vmax,
)
pg = variable(w, length(data.gen); start=data.pg0, lvar = data.pmin, uvar = data.pmax)
qg = variable(w, length(data.gen); start=data.qg0, lvar = data.qmin, uvar = data.qmax)
p = variable(w, length(data.arc); lvar = -data.rate_a, uvar = data.rate_a)
q = variable(w, length(data.arc); lvar = -data.rate_a, uvar = data.rate_a)
o = objective(
w,
g.cost1 * pg[g.i]^2 + g.cost2 * pg[g.i] + g.cost3 for g in data.gen
)
c1 = constraint(w, va[i] for i in data.ref_buses)
# Active power flow, FR
c2 = constraint(
w,
p[b.f_idx] - b.c5 * vm[b.f_bus]^2 -
b.c3 * (vm[b.f_bus] * vm[b.t_bus] * cos(va[b.f_bus] - va[b.t_bus])) -
b.c4 * (vm[b.f_bus] * vm[b.t_bus] * sin(va[b.f_bus] - va[b.t_bus])) for
b in data.branch
)
# Reactive power flow, FR
c3 = constraint(
w,
q[b.f_idx] +
b.c6 * vm[b.f_bus]^2 +
b.c4 * (vm[b.f_bus] * vm[b.t_bus] * cos(va[b.f_bus] - va[b.t_bus])) -
b.c3 * (vm[b.f_bus] * vm[b.t_bus] * sin(va[b.f_bus] - va[b.t_bus])) for
b in data.branch
)
# Active power flow, TO
c4 = constraint(
w,
p[b.t_idx] - b.c7 * vm[b.t_bus]^2 -
b.c1 * (vm[b.t_bus] * vm[b.f_bus] * cos(va[b.t_bus] - va[b.f_bus])) -
b.c2 * (vm[b.t_bus] * vm[b.f_bus] * sin(va[b.t_bus] - va[b.f_bus])) for
b in data.branch
)
# Reactive power flow, TO
c5 = constraint(
w,
q[b.t_idx] +
b.c8 * vm[b.t_bus]^2 +
b.c2 * (vm[b.t_bus] * vm[b.f_bus] * cos(va[b.t_bus] - va[b.f_bus])) -
b.c1 * (vm[b.t_bus] * vm[b.f_bus] * sin(va[b.t_bus] - va[b.f_bus])) for
b in data.branch
)
# Voltage angle difference
c6 = constraint(
w,
va[b.f_bus] - va[b.t_bus] for b in data.branch;
lcon = data.angmin,
ucon = data.angmax,
)
# Line flow constraints
c7 = constraint(
w,
p[b.f_idx]^2 + q[b.f_idx]^2 - b.rate_a_sq for b in data.branch;
lcon = fill!(similar(data.branch, Float64, length(data.branch)), -Inf),
)
c8 = constraint(
w,
p[b.t_idx]^2 + q[b.t_idx]^2 - b.rate_a_sq for b in data.branch;
lcon = fill!(similar(data.branch, Float64, length(data.branch)), -Inf),
)
# Active power balance
c9 = constraint(w, b.pd + b.gs * vm[b.i]^2 for b in data.bus)
c11 = constraint!(w, c9, a.bus => p[a.i] for a in data.arc)
c13 = constraint!(w, c9, g.bus => -pg[g.i] for g in data.gen)
# Reactive power balance
c10 = constraint(w, b.qd - b.bs * vm[b.i]^2 for b in data.bus)
c12 = constraint!(w, c10, a.bus => q[a.i] for a in data.arc)
c14 = constraint!(w, c10, g.bus => -qg[g.i] for g in data.gen)
return ExaModel(w; kwargs...)
end
acopf_model (generic function with 1 method)
Solving case9
is straightforward using MadNLP:
using MadNLP
nlp = acopf_model(data)
results = madnlp(nlp)
nothing
This is MadNLP version v0.8.7, running with umfpack
Number of nonzeros in constraint Jacobian............: 295
Number of nonzeros in Lagrangian Hessian.............: 417
Total number of variables............................: 60
variables with only lower bounds: 0
variables with lower and upper bounds: 51
variables with only upper bounds: 0
Total number of equality constraints.................: 55
Total number of inequality constraints...............: 27
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 9
inequality constraints with only upper bounds: 18
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 5.4455294e+03 1.63e+00 3.93e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
1 5.2194864e+03 1.70e+00 3.27e+00 -1.0 1.30e+00 - 6.68e-01 1.00e+00h 1
2 5.3060363e+03 1.89e-02 2.92e-01 -1.0 1.79e+00 - 1.00e+00 1.00e+00h 1
3 5.3024154e+03 1.87e-03 4.62e-02 -1.7 4.32e-02 - 1.00e+00 1.00e+00h 1
4 5.2970878e+03 2.91e-03 4.27e-02 -2.5 4.33e-02 - 1.00e+00 1.00e+00h 1
5 5.2968997e+03 1.39e-04 1.11e-03 -2.5 1.18e-02 - 1.00e+00 1.00e+00h 1
6 5.2967027e+03 2.38e-04 1.88e-01 -3.8 1.86e-02 - 1.00e+00 7.70e-01h 1
7 5.2967013e+03 6.26e-05 9.52e-03 -3.8 7.91e-03 - 9.89e-01 1.00e+00h 1
8 5.2966993e+03 3.99e-06 1.02e-05 -3.8 2.00e-03 - 1.00e+00 1.00e+00h 1
9 5.2966867e+03 3.81e-06 4.63e-03 -8.6 1.99e-03 - 9.96e-01 9.57e-01h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
10 5.2966862e+03 1.77e-07 9.17e-06 -8.6 4.17e-04 - 1.00e+00 9.99e-01h 1
11 5.2966862e+03 1.14e-10 3.97e-10 -8.6 1.07e-05 - 1.00e+00 1.00e+00h 1
Number of Iterations....: 11
(scaled) (unscaled)
Objective...............: 1.8321294370256518e+02 5.2966862024411594e+03
Dual infeasibility......: 3.9659065558777334e-10 1.1465435853042529e-08
Constraint violation....: 1.1385825615661815e-10 1.1385825615661815e-10
Complementarity.........: 1.0214318304728503e-10 2.9529594218970105e-09
Overall NLP error.......: 2.9529594218970105e-09 2.9529594218970105e-09
Number of objective function evaluations = 12
Number of objective gradient evaluations = 12
Number of constraint evaluations = 12
Number of constraint Jacobian evaluations = 12
Number of Lagrangian Hessian evaluations = 11
Total wall-clock secs in solver (w/o fun. eval./lin. alg.) = 0.001
Total wall-clock secs in linear solver = 0.002
Total wall-clock secs in NLP function evaluations = 0.000
Total wall-clock secs = 0.003
EXIT: Optimal Solution Found (tol = 1.0e-08).
Solving optimal power flow on the GPU
For solving the optimal power flow model on the GPU, the set-up is similar to what we have detailed in the tutorial 3. We start by importing MadNLPGPU, and we instantiate a new optimal power flow instance on the GPU:
using CUDA
using MadNLPGPU
nlp_gpu = acopf_model(data; backend=CUDABackend())
An ExaModel{Float64, CUDA.CuArray{Float64, 1, CUDA.DeviceMemory}, ...}
Problem name: Generic
All variables: ████████████████████ 60 All constraints: ████████████████████ 82
free: ███⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 9 free: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 upper: █████⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 18
low/upp: █████████████████⋅⋅⋅ 51 low/upp: ███⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 9
fixed: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 fixed: ██████████████⋅⋅⋅⋅⋅⋅ 55
infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
nnzh: ( 77.21% sparsity) 417 linear: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
nonlinear: ████████████████████ 82
nnzj: ( 94.00% sparsity) 295
Solving the problem using cuDSS simply amounts to
results = madnlp(nlp_gpu)
nothing
This is MadNLP version v0.8.7, running with cuDSS v0.4.0
Number of nonzeros in constraint Jacobian............: 295
Number of nonzeros in Lagrangian Hessian.............: 417
Total number of variables............................: 60
variables with only lower bounds: 0
variables with lower and upper bounds: 51
variables with only upper bounds: 0
Total number of equality constraints.................: 55
Total number of inequality constraints...............: 27
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 9
inequality constraints with only upper bounds: 18
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 5.4455294e+03 1.63e+00 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
1 5.4455293e+03 1.63e+00 9.28e-03 -1.0 1.44e+00 - 6.45e-01 2.00e-07h 2
2 5.2160418e+03 1.81e+00 2.26e-03 -1.0 1.34e+00 - 9.02e-01 1.00e+00h 1
3 5.3064366e+03 3.72e-02 1.37e-04 -1.0 1.79e+00 -2.0 1.00e+00 1.00e+00h 1
4 5.3042596e+03 3.65e-03 1.32e-03 -2.5 6.04e-02 - 9.03e-01 1.00e+00h 1
5 5.2962473e+03 6.57e-03 1.27e-03 -3.8 1.38e-01 - 6.51e-01 5.86e-01h 1
6 5.2964111e+03 2.94e-03 4.33e-03 -3.8 4.30e-02 - 8.64e-01 6.27e-01h 1
7 5.2966846e+03 4.53e-04 7.08e-03 -3.8 2.13e-02 - 7.80e-01 1.00e+00h 1
8 5.2966987e+03 1.16e-05 3.79e-06 -3.8 3.41e-03 - 1.00e+00 1.00e+00h 1
Number of Iterations....: 8
(scaled) (unscaled)
Objective...............: 1.8321337464849603e+02 5.2966986610880203e+03
Dual infeasibility......: 3.7923194001655401e-06 1.0963595385878577e-04
Constraint violation....: 1.1625391387326545e-05 1.1625391387326545e-05
Complementarity.........: 1.9878150144773805e-07 5.7467732068541076e-06
Overall NLP error.......: 1.1625391387326545e-05 1.1625391387326545e-05
Number of objective function evaluations = 10
Number of objective gradient evaluations = 9
Number of constraint evaluations = 10
Number of constraint Jacobian evaluations = 9
Number of Lagrangian Hessian evaluations = 8
Total wall-clock secs in solver (w/o fun. eval./lin. alg.) = 0.028
Total wall-clock secs in linear solver = 0.012
Total wall-clock secs in NLP function evaluations = 0.005
Total wall-clock secs = 0.045
EXIT: Optimal Solution Found (tol = 1.0e-04).
The instance case9
is too small to get any significant speed-up compared to the CPU. However, we can solve a larger instance just by importing new data. For instance, to solve the case 10000_goc
:
data = JLD2.load(joinpath(DATA_DIR, "pglib_opf_case10000_goc.jld2"))["data"]
nlp_gpu = acopf_model(data; backend=CUDABackend())
results = madnlp(nlp_gpu)
nothing
This is MadNLP version v0.8.7, running with cuDSS v0.4.0
Number of nonzeros in constraint Jacobian............: 419823
Number of nonzeros in Lagrangian Hessian.............: 602508
Total number of variables............................: 76804
variables with only lower bounds: 0
variables with lower and upper bounds: 66804
variables with only upper bounds: 0
Total number of equality constraints.................: 72773
Total number of inequality constraints...............: 39579
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 13193
inequality constraints with only upper bounds: 26386
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 3.0503288e+06 8.97e+00 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
1 3.0503288e+06 8.97e+00 4.39e-02 -1.0 1.99e+01 - 5.52e-02 2.71e-08h 1
2 2.7096508e+06 8.10e+00 1.44e-02 -1.0 1.82e+01 -4.0 1.02e-01 9.77e-02h 1
3 2.3710643e+06 8.31e+00 4.77e-03 -1.0 7.04e+01 -4.5 2.86e-01 1.24e-01h 1
4 2.1763780e+06 1.17e+01 5.00e-03 -1.0 1.74e+02 -5.0 4.88e-01 1.03e-01h 1
5 1.8959811e+06 3.27e+01 3.67e-03 -1.0 2.97e+02 -5.4 3.42e-01 2.10e-01h 1
6 1.7928162e+06 3.43e+01 3.04e-03 -1.0 4.33e+02 -5.9 1.65e-01 1.33e-01h 1
7 1.7396064e+06 3.34e+01 2.47e-03 -1.0 4.65e+02 -6.4 2.01e-01 9.07e-02h 1
8 1.6836025e+06 3.27e+01 2.26e-03 -1.0 4.84e+02 -6.9 6.78e-02 1.16e-01h 1
9 1.6573258e+06 3.13e+01 1.59e-03 -1.0 4.72e+02 -7.3 2.59e-01 6.64e-02h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
10 1.5850768e+06 3.24e+01 1.08e-03 -1.0 4.87e+02 -7.8 2.82e-01 2.11e-01h 1
11 1.5637009e+06 3.04e+01 7.51e-04 -1.0 4.51e+02 -8.3 2.66e-01 8.72e-02h 1
12 1.5156340e+06 2.83e+01 6.54e-04 -1.0 4.32e+02 -8.8 3.50e-01 2.24e-01h 1
13 1.4984677e+06 2.57e+01 1.54e-03 -1.0 3.43e+02 -9.2 2.80e-01 1.12e-01h 1
14 1.4798127e+06 2.25e+01 3.95e-03 -1.0 2.67e+02 -9.7 4.17e-01 1.48e-01h 1
15 1.4649979e+06 1.96e+01 4.89e-03 -1.0 2.22e+02 -10.2 3.62e-01 1.44e-01h 1
16 1.4415941e+06 1.50e+01 3.68e-03 -1.0 1.89e+02 -10.7 3.05e-01 2.76e-01h 1
17 1.4244094e+06 1.11e+01 3.59e-03 -1.0 1.38e+02 -11.2 5.87e-01 2.95e-01h 1
18 1.4154664e+06 8.69e+00 3.85e-03 -1.0 1.05e+02 -11.6 8.14e-01 2.30e-01h 1
19 1.3960036e+06 7.23e+00 2.06e-03 -1.0 9.11e+01 -12.1 9.90e-01 6.87e-01h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
20 1.3897785e+06 3.13e+00 2.91e-03 -1.0 2.85e+01 -12.6 1.00e+00 7.57e-01h 1
21 1.3878609e+06 2.23e-01 4.40e-06 -1.0 6.07e+00 -13.1 1.00e+00 1.00e+00h 1
22 1.3770491e+06 1.20e+00 4.43e-03 -1.7 1.11e+02 -13.5 6.59e-01 5.61e-01h 1
23 1.3703369e+06 1.68e+00 1.95e-03 -1.7 1.10e+02 -14.0 5.32e-01 5.58e-01h 1
24 1.3666685e+06 1.19e+00 1.11e-03 -1.7 7.10e+01 -14.5 5.67e-01 5.66e-01h 1
25 1.3649877e+06 6.18e-01 7.69e-04 -1.7 3.34e+01 -15.0 4.68e-01 5.63e-01h 1
26 1.3635980e+06 6.04e-02 4.65e-03 -1.7 1.50e+01 -15.5 4.17e-01 1.00e+00h 1
27 1.3625194e+06 7.77e-02 1.81e-03 -2.5 7.41e+01 -15.9 2.35e-01 1.49e-01h 1
28 1.3607282e+06 1.39e-01 1.62e-02 -2.5 6.70e+01 -16.4 4.56e-01 2.72e-01h 1
29 1.3599915e+06 1.30e-01 2.05e-02 -2.5 4.71e+01 -16.9 2.18e-01 1.44e-01h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
30 1.3592853e+06 1.16e-01 4.41e-02 -2.5 3.46e+01 -17.4 4.70e-01 1.67e-01h 1
31 1.3585834e+06 1.09e-01 3.64e-02 -2.5 2.69e+01 -17.8 1.35e-01 1.92e-01h 1
32 1.3577689e+06 1.88e-01 3.29e-02 -2.5 2.09e+01 -18.3 3.15e-01 2.74e-01h 1
33 1.3565842e+06 5.03e-01 1.67e-02 -2.5 1.23e+01 -18.8 4.71e-01 5.36e-01h 1
34 1.3562694e+06 3.91e-01 1.66e-02 -2.5 4.57e+00 -19.3 4.45e-01 3.02e-01h 1
35 1.3558235e+06 2.64e-01 1.42e-02 -2.5 2.76e+00 -19.7 1.00e+00 6.17e-01h 1
36 1.3555588e+06 5.54e-02 5.89e-06 -2.5 1.79e+00 -20.0 1.00e+00 1.00e+00h 1
37 1.3555597e+06 4.07e-03 5.15e-07 -2.5 2.82e-01 -20.0 1.00e+00 1.00e+00h 1
38 1.3552721e+06 8.37e-02 1.20e-02 -3.8 1.10e+01 -20.0 3.12e-01 1.96e-01f 1
39 1.3550469e+06 1.44e-01 5.83e-02 -3.8 1.06e+01 -20.0 4.80e-01 1.88e-01h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
40 1.3547590e+06 2.47e-01 7.71e-02 -3.8 5.46e+00 -20.0 3.97e-01 2.87e-01h 1
41 1.3545528e+06 3.26e-01 6.07e-02 -3.8 5.27e+00 -20.0 2.29e-01 2.90e-01h 1
42 1.3544195e+06 3.17e-01 8.41e-02 -3.8 4.34e+00 -20.0 4.28e-01 2.68e-01h 1
43 1.3543253e+06 2.77e-01 1.13e-01 -3.8 3.43e+00 -20.0 4.27e-01 2.62e-01h 1
44 1.3543042e+06 2.56e-01 1.56e+00 -3.8 2.97e+00 -20.0 8.12e-01 8.49e-02h 1
45 1.3542029e+06 1.97e-01 8.51e-01 -3.8 2.89e+00 -20.0 7.82e-01 4.54e-01h 1
46 1.3541462e+06 1.10e-01 5.26e-01 -3.8 1.44e+00 -20.0 1.00e+00 5.05e-01h 1
47 1.3541022e+06 8.35e-02 7.36e-02 -3.8 7.11e-01 -20.0 1.00e+00 8.65e-01h 1
48 1.3540972e+06 8.81e-03 7.98e-06 -3.8 1.65e-01 -20.0 1.00e+00 1.00e+00h 1
49 1.3540970e+06 2.63e-04 1.47e-06 -3.8 1.08e-01 -20.0 1.00e+00 1.00e+00h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
50 1.3540872e+06 6.27e-03 1.74e-01 -5.0 1.08e+00 -20.0 5.24e-01 1.48e-01h 1
51 1.3540661e+06 3.35e-02 2.15e-01 -5.0 1.08e+00 -20.0 5.26e-01 3.93e-01h 1
52 1.3540531e+06 3.71e-02 5.51e-01 -5.0 8.62e-01 -20.0 7.99e-01 4.07e-01h 1
53 1.3540445e+06 3.15e-02 5.69e-01 -5.0 6.23e-01 -20.0 8.25e-01 4.67e-01h 1
54 1.3540368e+06 1.65e-02 1.46e-01 -5.0 3.81e-01 -20.0 1.00e+00 8.07e-01h 1
55 1.3540351e+06 2.62e-03 5.81e-06 -5.0 7.48e-02 -20.0 1.00e+00 1.00e+00h 1
56 1.3540352e+06 1.26e-04 5.22e-07 -5.0 1.12e-02 -20.0 1.00e+00 1.00e+00h 1
57 1.3540351e+06 2.97e-06 1.14e-08 -5.0 1.72e-03 -20.0 1.00e+00 1.00e+00h 1
Number of Iterations....: 57
(scaled) (unscaled)
Objective...............: 1.1061716860256129e+04 1.3540351493116207e+06
Dual infeasibility......: 1.1400491987269213e-08 1.3955037057286038e-06
Constraint violation....: 2.9661459848284721e-06 2.9661459848284721e-06
Complementarity.........: 1.4932906447162992e-08 1.8278971037026370e-06
Overall NLP error.......: 2.9661459848284721e-06 2.9661459848284721e-06
Number of objective function evaluations = 58
Number of objective gradient evaluations = 58
Number of constraint evaluations = 58
Number of constraint Jacobian evaluations = 58
Number of Lagrangian Hessian evaluations = 57
Total wall-clock secs in solver (w/o fun. eval./lin. alg.) = 0.782
Total wall-clock secs in linear solver = 1.693
Total wall-clock secs in NLP function evaluations = 0.126
Total wall-clock secs = 2.601
EXIT: Optimal Solution Found (tol = 1.0e-04).
This page was generated using Literate.jl.