|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "An Open Energy Modeling update" |
| 4 | +date: 2024-11-14 |
| 5 | +categories: [open-energy-modeling] |
| 6 | +author: "Oscar Dowson, Ivet Galabova, Joaquim Dias Garcia, Julian Hall" |
| 7 | +--- |
| 8 | + |
| 9 | +We're now two months into our [Open Energy Modeling project](/announcements/open-energy-modeling/2024/09/16/oem/). |
| 10 | +Here's a summary of some of things that we have been up to. |
| 11 | + |
| 12 | +If you are an open energy modeller who uses JuMP or HiGHS and you want to stay |
| 13 | +in touch with our progress or provide us with feedback and examples, write to |
| 14 | +`jump-highs-energy-models@googlegroups.com`. We'd love to hear how you are using |
| 15 | +JuMP or HiGHS to solve problems related to open energy modelling. |
| 16 | + |
| 17 | +## open-energy-modeling-benchmarks |
| 18 | + |
| 19 | +We have made good progress on our main task of creating the |
| 20 | +[open-energy-modeling-benchmarks](https://github.com/jump-dev/open-energy-modeling-benchmarks) |
| 21 | +repository of benchmark instances. We now include models from [GenX](https://github.com/GenXProject/GenX.jl), |
| 22 | +[PowerModels](https://github.com/lanl-ansi/PowerModels.jl), |
| 23 | +[Sienna](https://github.com/nrel-sienna), and [TulipaEnergyModel](https://github.com/TulipaEnergy/TulipaEnergyModel.jl). |
| 24 | + |
| 25 | +Now that we have the initial framework in place, our focus is shifting to |
| 26 | +profiling each of the implementations to find improvements. |
| 27 | + |
| 28 | +We've already started doing this with [GenX](https://github.com/GenXProject/GenX.jl/pull/773). |
| 29 | +Our work identified the root cause of a performance problem as an [issue in MutableArithmetics.jl](https://github.com/jump-dev/MutableArithmetics.jl/issues/302) |
| 30 | +that we have since fixed. |
| 31 | + |
| 32 | +## Tolerances and numerical issues |
| 33 | + |
| 34 | +One thing that has become very clear as we look at a range of energy system |
| 35 | +models is that poor scaling and numerical issues are quite common. |
| 36 | + |
| 37 | +Understanding the impact that problem scaling and the tolerances used within the |
| 38 | +solver have on the final solution is an important aspect of applied optimization. |
| 39 | + |
| 40 | +We've added a new tutorial to the JuMP documentation, [Tolerances and numerical issues](https://jump.dev/JuMP.jl/stable/tutorials/getting_started/tolerances/), |
| 41 | +which explains how solvers like HiGHS use numerical tolerances and what can go |
| 42 | +wrong. We encourage all modelers to read it. |
| 43 | + |
| 44 | +## HiGHS |
| 45 | + |
| 46 | +In the last two months we released HiGHS [v1.8.0](https://github.com/ERGO-Code/HiGHS/releases/tag/v1.8.0) |
| 47 | +and [v1.8.1](https://github.com/ERGO-Code/HiGHS/releases/tag/v1.8.1). See the |
| 48 | +links for the full release notes. |
| 49 | + |
| 50 | +HiGHlights (if you will) for energy modelers include: |
| 51 | + |
| 52 | + * Our initial benchmarking and analysis of energy system models exposed a |
| 53 | + few bugs. For example, we fixed a [segfault in the QP solver](https://github.com/ERGO-Code/HiGHS/issues/1990), |
| 54 | + fixed a [problem detecting unboundedness](https://github.com/ERGO-Code/HiGHS/issues/1962), |
| 55 | + and we fixed a [correctness issue](https://github.com/ERGO-Code/HiGHS/issues/1935) |
| 56 | + for badly scaled models when crossover was explicitly turned off. |
| 57 | + * We fixed the issue of HiGHS hanging on Windows when `threads` was set to a |
| 58 | + value other than `1`. In most cases, setting `threads` to a value other than |
| 59 | + `1` has limited performance benefits, but this will change in future releases |
| 60 | + as we implement a parallel MIP solver. |
| 61 | + * HiGHS now always computes a primal and dual unbounded ray if queried, even if |
| 62 | + the initial unboundedness was detected in presolve. For energy modelers, the |
| 63 | + dual ray is useful for implementing decomposition algorithms such as Benders |
| 64 | + decomposition where it shows up in the Benders feasibility cut. We rewrote |
| 65 | + the [Benders decomposition tutorial](https://jump.dev/JuMP.jl/stable/tutorials/algorithms/benders_decomposition/) |
| 66 | + in the JuMP documentation to simplify the implementation and add feasibility |
| 67 | + cuts; it's a good place to start if you are interested in implementing |
| 68 | + Benders. |
| 69 | + * Related to the dual ray, HiGHS now also computes the dual objective value, |
| 70 | + which is necessary for both Benders feasibility and optimality cuts. |
| 71 | + * HiGHS now computes the primal-dual integral, which is a quantitiative measure |
| 72 | + of solver performance. We intend to use the primal-dual integral as part of |
| 73 | + our benchmarking efforts of future solver performance. |
| 74 | + |
| 75 | +## HiGHS.jl |
| 76 | + |
| 77 | +We've had a fairly busy few months in HiGHS.jl, with frequent small releases |
| 78 | +([v1.9.3](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.9.3), |
| 79 | +[v1.10.0](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.10.0), |
| 80 | +[v1.10.1](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.10.1), |
| 81 | +[v1.10.2](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.10.2), |
| 82 | +[v1.11.0](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.11.0), |
| 83 | +[v1.12.0](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.12.0), and |
| 84 | +[v1.12.1](https://github.com/jump-dev/HiGHS.jl/releases/tag/v1.12.1); see the |
| 85 | +links for a full list of changes). |
| 86 | + |
| 87 | + * A big change was how we compute the dual objective value. As explained above, |
| 88 | + this is mostly useful for algorithms such as Benders decomposition. |
| 89 | + Previously, we used the default fallback in MathOptInterface. This |
| 90 | + implementation looped over every constraint in the model to compute the inner |
| 91 | + product between the set and the dual. However, due to [HiGHS.jl#207](https://github.com/jump-dev/HiGHS.jl/issues/207), |
| 92 | + this algorithm had unintentional `O(N^2)` scaling behavior. (We found one |
| 93 | + example where computing the dual objective value took over 200 seconds.) We |
| 94 | + fixed this issue in HiGHS.jl by manually computing the dual objective value |
| 95 | + using a different set of C API calls to HiGHS. (The model that took 200 |
| 96 | + seconds to compute the dual objective value for now takes less than 0.01 |
| 97 | + second.) Motivated by this result, Julian added support for computing the |
| 98 | + dual objective value to HiGHS, which was released in v1.8.1. |
| 99 | + * Somewhat related to the dual objective value, we also changed the definition |
| 100 | + of `MOI.ObjectiveBound` and `MOI.RelativeGap` for linear programs to return |
| 101 | + the dual objective value as the objective bound, and the relative difference |
| 102 | + between the primal and dual objective values as the relative gap. This is |
| 103 | + useful for quantifying the quality of solutions that use the interior point |
| 104 | + algorithm and slightly looser optimality tolerances. |
| 105 | + * We improved the performance of adding a bounded variable like |
| 106 | + `@variable(model, l <= x <= u)` from JuMP when HiGHS is used with |
| 107 | + `JuMP.direct_model`. The new method of adding the variable is three times |
| 108 | + faster than before. This is particularly noticeable if you have a model with |
| 109 | + a very large number of variables, a small number of constraints, and the |
| 110 | + model is simple to solve. |
| 111 | + |
| 112 | +Stay tuned for future updates! |
0 commit comments