Application: unit commitment with valve-point costs¶
Unit commitment decides which thermal generators run in each hour of a horizon and how much each one produces, so that demand and a spinning reserve are met at the least fuel and start-up cost. With the valve-point effect, each unit’s fuel cost carries a term \(\lvert d_u \sin(e_u (P_u^{\min} - P)) \rvert\), non-convex and non-smooth in the dispatch, which CP-SAT cannot state. This page solves the formulation and instances of Pedroso, Kubo and Viana, Unit commitment with valve-point loading effect (2014).
The unit commitment cbls finds for Pedroso et al.’s ucp13 over 24 hours.
Each band is one generator’s output, stacked to meet the hourly demand
exactly. The dashed line is the committed capacity, which must also cover a
spinning reserve.¶
The unit commitment cbls finds for Pedroso et al.’s ucp13 over 24 hours.
Each band is one generator’s output, stacked to meet the hourly demand
exactly. The dashed line is the committed capacity, which must also cover a
spinning reserve.¶
The problem¶
Units \(u \in \mathcal{U}\), periods \(t \in \mathcal{T} = \{1, \ldots, T\}\). The commitment \(y_{u,t}\) and the dispatch \(p_{u,t}\) are the decisions:
with the fuel and start-up costs
The data: demand \(D_t\) and reserve \(R_t\) per period; per unit, the output limits \(P_u^{\min}\) and \(P_u^{\max}\), the fuel coefficients \(a_u, \ldots, e_u\), the hot and cold start-up costs \(A_u^{\text{hot}}\) and \(A_u^{\text{cold}}\), the cold-start time \(\tau_u^{\text{cold}}\), the minimum up and down times \(UT_u\) and \(DT_u\), and the state \(y_{u,0}\) the unit has held for \(n_u\) periods before the horizon.
Objective: fuel while a unit is committed, plus start-ups. The valve-point term \(\lvert d_u \sin(\cdot) \rvert\) makes each unit’s fuel cost non-convex and non-smooth in its dispatch.
Demand: the units’ output meets each period’s demand \(D_t\) exactly. The runner’s default is \(\geq\), a relaxation (with a valve-point cost, producing more can cost less);
--demand-equalitysolves the \(=\), as the published rows do.Spinning reserve: the committed capacity, not the dispatch, covers demand plus the reserve \(R_t\).
Dispatch limits: a committed unit runs between \(P_u^{\min}\) and \(P_u^{\max}\); a unit that is off produces nothing.
Minimum up and down times: a unit that starts stays on for \(UT_u\) periods, and one that stops stays off for \(DT_u\), up to the horizon’s end. A unit keeps its state before the horizon for what it still owes: \(L_u = UT_u - n_u\) periods if it was on, \(DT_u - n_u\) if it was off (none if negative).
Start-up cost: hot if the unit ran within its last \(\tau_u^{\text{cold}}\) periods, cold otherwise; every start-up on these instances is cold.
There are no ramp rates, in the source or here.
Instance |
Units |
Periods |
Source |
|---|---|---|---|
|
13 |
1, 3, 6, 12, 24 |
Pedroso et al.’s data, checked field by field |
|
40 |
1, 3, 6, 12, 24 |
Pedroso et al.’s data, checked field by field |
|
100 |
1, 3, 6, 12, 24, 48, 168 |
constructed from |
|
200 |
1, 3, 6, 12, 24, 48, 168 |
constructed from |
Pedroso et al. publish bounds for ucp13 and ucp40 only; the runner restates
them as cited rows in its comparison.csv. How ucp100 and ucp200 are built
is in the
developer notes,
and every runner flag in cbls_uc_chped --help.
In cbls, each \(y_{u,t}\) is a Bool and each \(p_{u,t}\) a Float; the fuel cost
is an expression over sin and abs, the start-up price an if_then_else
over a max of past commitments
(uc_model.h).
A problem-specific inner solver¶
The engine knows nothing about unit commitment. A C++ subclass of
InnerSolverHook adds what it knows, as a plugin the search calls on its
points (C++ reference). The runner ships one,
uc_hook.h.
It reads the commitment \(y\) and dispatch \(p\) at the search’s point. It acts only
on a commitment that meets the minimum up and down times and the initial state
and can be dispatched in every period: committed \(\sum P_u^{\max}\) covers
\(D_t + R_t\) and committed \(\sum P_u^{\min}\) does not exceed \(D_t\). With
--uc-repair it first tries to repair one that does not, mainly by switching
units on; a commitment that still fails, or any failing one without the flag,
is skipped. It then works in two layers.
Dispatch. For a fixed commitment the cost separates by period, and each period is an economic dispatch over the units that are on, balanced to \(D_t\) exactly whatever demand row the model uses:
The \(\lvert \sin \rvert\) term is zero, a kink of \(F_u\), at the valve points \(P_u^{\min} + k\pi / e_u\), \(k = 0, 1, \ldots\); these and \(P_u^{\max}\) are each unit’s candidate outputs. The fast dispatch solves the quadratic part by \(\lambda\)-dispatch (\(b_u + 2 c_u p_u = \lambda\), clamped to the limits, with \(\lambda\) set so the output meets \(D_t\)), snaps each unit to its nearest candidate and rebalances by whole steps between candidates; one unit closes the remaining residual where it can, else units are filled to their limits in turn. The polish, at most 4 sweeps, moves one unit onto another candidate while a second unit absorbs the difference, when that lowers the cost.
Commitment. With full, over such commitments it minimises
each \(ED_t\) priced by the fast dispatch (by default), by first-improvement descent: per unit, drop, shrink or extend a block of on periods, fill a gap between two blocks, or add a block of \(UT_u\) periods (cut at the horizon) at a few sampled off periods; then switch a block of one unit off and an idle unit on over the same periods. A move re-dispatches only the periods it changes. Optionally, an iterated local search kicks the commitment with random moves and descends again, keeping the better. The polish then runs on the final commitment’s dispatch.
The hook writes \((y, p)\) back only if the model finds it feasible and cheaper than the point it read; at an infeasible point (if asked to run there), cheaper than the best it has seen, or any feasible one before it has seen one. Otherwise it restores the point.
--uc-hook ed runs the dispatch only; --uc-hook full adds the commitment
search. The hook is off by default, and the results below are without it.
Results¶
At equal time and threads, cbls has the lowest primal integral on most rows: it reaches good solutions first. Pedroso et al.’s method ends with the best final gap on most. The setup and the counts are on the results page.
Row by row: the primal integral (PI; 0 if the best known is found at once, up to
2 if nothing is found) and the final gap in % to the row’s reference, the
lowest objective any method or the source reached. For cbls, the PI is the
median over its seeds and the gap the median over the seeds that found a
solution; pwl is Pedroso et al.’s method and exact SCIP’s MINLP, one run
each. In bold: the strictly lowest PI, and every gap tied for lowest at 0.01 %;
- is no solution in the budget.
Row |
Budget (s) |
PI cbls |
PI pwl |
PI exact |
Gap % cbls |
Gap % pwl |
Gap % exact |
|---|---|---|---|---|---|---|---|
|
10 |
0.0002 |
0.0184 |
0.0315 |
0.00 |
0.00 |
0.00 |
|
30 |
0.0014 |
0.0131 |
0.0173 |
0.00 |
0.00 |
0.00 |
|
60 |
0.0055 |
0.0092 |
0.0168 |
0.32 |
0.00 |
0.14 |
|
120 |
0.0056 |
0.0083 |
0.1294 |
0.42 |
0.00 |
0.37 |
|
300 |
0.0085 |
0.0123 |
0.5273 |
0.60 |
0.00 |
0.57 |
|
10 |
0.0040 |
0.0313 |
0.0523 |
0.00 |
0.00 |
0.00 |
|
30 |
0.0214 |
0.0210 |
0.0677 |
1.80 |
0.00 |
0.08 |
|
60 |
0.0118 |
0.0248 |
0.1503 |
0.96 |
0.05 |
0.36 |
|
120 |
0.0177 |
0.0181 |
0.3688 |
1.30 |
0.00 |
10.04 |
|
300 |
0.0307 |
0.0364 |
0.4129 |
2.46 |
0.00 |
8.12 |
|
10 |
0.0224 |
0.0484 |
0.2510 |
1.13 |
0.00 |
0.10 |
|
30 |
0.0262 |
0.0389 |
0.3770 |
2.39 |
0.00 |
0.45 |
|
60 |
0.0155 |
0.0677 |
0.6931 |
1.24 |
0.00 |
0.61 |
|
120 |
0.0299 |
0.2276 |
0.9962 |
2.51 |
0.00 |
0.89 |
|
300 |
0.0516 |
0.4058 |
0.6230 |
4.29 |
0.00 |
0.88 |
|
600 |
0.0645 |
1.9715 |
0.4995 |
5.95 |
0.00 |
12.37 |
|
600 |
0.0024 |
0.5494 |
2.0000 |
0.00 |
2.66 |
- |
|
10 |
0.0581 |
0.1606 |
0.1580 |
4.57 |
0.00 |
0.41 |
|
30 |
0.0351 |
0.1366 |
0.5173 |
3.05 |
0.00 |
1.75 |
|
60 |
0.0226 |
0.2307 |
0.9627 |
1.66 |
0.00 |
17.49 |
|
120 |
0.0425 |
0.7539 |
0.6402 |
3.36 |
0.00 |
0.74 |
|
300 |
0.0699 |
0.8342 |
1.0674 |
6.04 |
0.00 |
0.77 |
|
600 |
0.0029 |
2.0000 |
2.0000 |
0.00 |
- |
- |
|
600 |
0.0079 |
2.0000 |
2.0000 |
0.00 |
- |
- |
On ucp100-168p, ucp200-48p and ucp200-168p the reference is cbls’s own
best final result, so its best seed’s gap there is 0 by construction.
How to run it¶
Build the runner from the repository root, after cmake -B build:
cmake --build build --target cbls_uc_chped
Solve ucp13 over 3 periods for 2 s with the source’s equality demand, verify
it, and write the row and the solution to a temporary directory:
out=$(mktemp -d)
./build/cbls_uc_chped benchmarks/instances/uc-chped --instance ucp13 --periods 3 \
--time-limit 2 --seed 1 --demand-equality --verify \
--out "$out/ucp13.csv" --solution-out "$out/ucp13.jsonl"
Check each solution independently of the engine, from the instance file alone,
against Pedroso et al.’s = model at 1e-6 (prints OK per solution):
.venv/bin/python benchmarks/uc-chped/check_solutions.py benchmarks/instances/uc-chped "$out/ucp13.jsonl"
Without
--instance,--periodsand--time-limit, the runner solves the whole roster at its per-horizon budgets (10 s at 1 period up to 600 s at 168).--threads Nruns the parallel portfolio;cbls_uc_chped --helplists every flag.The SCIP references, Pedroso et al.’s Algorithm 1 ported to SCIP (
pwl) and SCIP’s MINLP with the true valve-point term (exact), are inbenchmarks/uc-chped/pedroso/(GPL-3.0-or-later).