@ -0,0 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: e45a7fe8a95d461be60dae9616b4cc97
|
||||
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
|
@ -0,0 +1,305 @@
|
||||
```{sectnum}
|
||||
---
|
||||
start: 2
|
||||
depth: 2
|
||||
suffix: .
|
||||
---
|
||||
```
|
||||
|
||||
|
||||
Data Format
|
||||
===========
|
||||
|
||||
|
||||
Input Data Format
|
||||
-----------------
|
||||
|
||||
Instances are specified by JSON files containing the following main sections:
|
||||
|
||||
* Parameters
|
||||
* Buses
|
||||
* Generators
|
||||
* Price-sensitive loads
|
||||
* Transmission lines
|
||||
* Reserves
|
||||
* Contingencies
|
||||
|
||||
Each section is described in detail below. For a complete example, see [case14](https://github.com/ANL-CEEESA/UnitCommitment.jl/tree/dev/instances/matpower/case14).
|
||||
|
||||
### Parameters
|
||||
|
||||
This section describes system-wide parameters, such as power balance penalty, and optimization parameters, such as the length of the planning horizon and the time.
|
||||
|
||||
| Key | Description | Default | Time series?
|
||||
| :----------------------------- | :------------------------------------------------ | :------: | :------------:
|
||||
| `Time horizon (h)` | Length of the planning horizon (in hours). | Required | N
|
||||
| `Time step (min)` | Length of each time step (in minutes). Must be a divisor of 60 (e.g. 60, 30, 20, 15, etc). | `60` | N
|
||||
| `Power balance penalty ($/MW)` | Penalty for system-wide shortage or surplus in production (in $/MW). This is charged per time step. For example, if there is a shortage of 1 MW for three time steps, three times this amount will be charged. | `1000.0` | Y
|
||||
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"Parameters": {
|
||||
"Time horizon (h)": 4,
|
||||
"Power balance penalty ($/MW)": 1000.0,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Buses
|
||||
|
||||
This section describes the characteristics of each bus in the system.
|
||||
|
||||
| Key | Description | Default | Time series?
|
||||
| :----------------- | :------------------------------------------------------------ | ------- | :-------------:
|
||||
| `Load (MW)` | Fixed load connected to the bus (in MW). | Required | Y
|
||||
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"Buses": {
|
||||
"b1": {
|
||||
"Load (MW)": 0.0
|
||||
},
|
||||
"b2": {
|
||||
"Load (MW)": [
|
||||
26.01527,
|
||||
24.46212,
|
||||
23.29725,
|
||||
22.90897
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Generators
|
||||
|
||||
This section describes all generators in the system, including thermal units, renewable units and virtual units.
|
||||
|
||||
| Key | Description | Default | Time series?
|
||||
| :------------------------ | :------------------------------------------------| ------- | :-----------:
|
||||
| `Bus` | Identifier of the bus where this generator is located (string). | Required | N
|
||||
| `Production cost curve (MW)` and `Production cost curve ($)` | Parameters describing the piecewise-linear production costs. See below for more details. | Required | Y
|
||||
| `Startup costs ($)` and `Startup delays (h)` | Parameters describing how much it costs to start the generator after it has been shut down for a certain amount of time. If `Startup costs ($)` and `Startup delays (h)` are set to `[300.0, 400.0]` and `[1, 4]`, for example, and the generator is shut down at time `00:00` (h:min), then it costs \$300 to start up the generator at any time between `01:00` and `03:59`, and \$400 to start the generator at time `04:00` or any time after that. The number of startup cost points is unlimited, and may be different for each generator. Startup delays must be strictly increasing and the first entry must equal `Minimum downtime (h)`. | `[0.0]` and `[1]` | N
|
||||
| `Minimum uptime (h)` | Minimum amount of time the generator must stay operational after starting up (in hours). For example, if the generator starts up at time `00:00` (h:min) and `Minimum uptime (h)` is set to 4, then the generator can only shut down at time `04:00`. | `1` | N
|
||||
| `Minimum downtime (h)` | Minimum amount of time the generator must stay offline after shutting down (in hours). For example, if the generator shuts down at time `00:00` (h:min) and `Minimum downtime (h)` is set to 4, then the generator can only start producing power again at time `04:00`. | `1` | N
|
||||
| `Ramp up limit (MW)` | Maximum increase in production from one time step to the next (in MW). For example, if the generator is producing 100 MW at time step 1 and if this parameter is set to 40 MW, then the generator will produce at most 140 MW at time step 2. | `+inf` | N
|
||||
| `Ramp down limit (MW)` | Maximum decrease in production from one time step to the next (in MW). For example, if the generator is producing 100 MW at time step 1 and this parameter is set to 40 MW, then the generator will produce at least 60 MW at time step 2. | `+inf` | N
|
||||
| `Startup limit (MW)` | Maximum amount of power a generator can produce immediately after starting up (in MW). For example, if `Startup limit (MW)` is set to 100 MW and the unit is off at time step 1, then it may produce at most 100 MW at time step 2.| `+inf` | N
|
||||
| `Shutdown limit (MW)` | Maximum amount of power a generator can produce immediately before shutting down (in MW). Specifically, the generator can only shut down at time step `t+1` if its production at time step `t` is below this limit. | `+inf` | N
|
||||
| `Initial status (h)` | If set to a positive number, indicates the amount of time (in hours) the generator has been on at the beginning of the simulation, and if set to a negative number, the amount of time the generator has been off. For example, if `Initial status (h)` is `-2`, this means that the generator was off since `-02:00` (h:min). The simulation starts at time `00:00`. If `Initial status (h)` is `3`, this means that the generator was on since `-03:00`. A value of zero is not acceptable. | Required | N
|
||||
| `Initial power (MW)` | Amount of power the generator at time step `-1`, immediately before the planning horizon starts. | Required | N
|
||||
| `Must run?` | If `true`, the generator should be committed, even if that is not economical (Boolean). | `false` | Y
|
||||
| `Reserve eligibility` | List of reserve products this generator is eligibe to provide. By default, the generator is not eligible to provide any reserves. | `[]` | N
|
||||
|
||||
#### Production costs and limits
|
||||
|
||||
Production costs are represented as piecewise-linear curves. Figure 1 shows an example cost curve with three segments, where it costs \$1400, \$1600, \$2200 and \$2400 to generate, respectively, 100, 110, 130 and 135 MW of power. To model this generator, `Production cost curve (MW)` should be set to `[100, 110, 130, 135]`, and `Production cost curve ($)` should be set to `[1400, 1600, 2200, 2400]`.
|
||||
Note that this curve also specifies the production limits. Specifically, the first point identifies the minimum power output when the unit is operational, while the last point identifies the maximum power output.
|
||||
|
||||
<center>
|
||||
<img src="../_static/cost_curve.png" style="max-width: 500px"/>
|
||||
<div><b>Figure 1.</b> Piecewise-linear production cost curve.</div>
|
||||
<br/>
|
||||
</center>
|
||||
|
||||
#### Additional remarks:
|
||||
|
||||
* For time-dependent production limits or time-dependent production costs, the usage of nested arrays is allowed. For example, if `Production cost curve (MW)` is set to `[5.0, [10.0, 12.0, 15.0, 20.0]]`, then the unit may generate at most 10, 12, 15 and 20 MW of power during time steps 1, 2, 3 and 4, respectively. The minimum output for all time periods is fixed to at 5 MW.
|
||||
* There is no limit to the number of piecewise-linear segments, and different generators may have a different number of segments.
|
||||
* If `Production cost curve (MW)` and `Production cost curve ($)` both contain a single element, then the generator must produce exactly that amount of power when operational. To specify that the generator may produce any amount of power up to a certain limit `P`, the parameter `Production cost curve (MW)` should be set to `[0, P]`.
|
||||
* Production cost curves must be convex.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"Generators": {
|
||||
"gen1": {
|
||||
"Bus": "b1",
|
||||
"Production cost curve (MW)": [100.0, 110.0, 130.0, 135.0],
|
||||
"Production cost curve ($)": [1400.0, 1600.0, 2200.0, 2400.0],
|
||||
"Startup costs ($)": [300.0, 400.0],
|
||||
"Startup delays (h)": [1, 4],
|
||||
"Ramp up limit (MW)": 232.68,
|
||||
"Ramp down limit (MW)": 232.68,
|
||||
"Startup limit (MW)": 232.68,
|
||||
"Shutdown limit (MW)": 232.68,
|
||||
"Minimum downtime (h)": 4,
|
||||
"Minimum uptime (h)": 4,
|
||||
"Initial status (h)": 12,
|
||||
"Must run?": false,
|
||||
"Reserve eligibility": ["r1"],
|
||||
},
|
||||
"gen2": {
|
||||
"Bus": "b5",
|
||||
"Production cost curve (MW)": [0.0, [10.0, 8.0, 0.0, 3.0]],
|
||||
"Production cost curve ($)": [0.0, 0.0],
|
||||
"Reserve eligibility": ["r1", "r2"],
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Price-sensitive loads
|
||||
|
||||
This section describes components in the system which may increase or reduce their energy consumption according to the energy prices. Fixed loads (as described in the `buses` section) are always served, regardless of the price, unless there is significant congestion in the system or insufficient production capacity. Price-sensitive loads, on the other hand, are only served if it is economical to do so.
|
||||
|
||||
| Key | Description | Default | Time series?
|
||||
| :---------------- | :------------------------------------------------ | :------: | :------------:
|
||||
| `Bus` | Bus where the load is located. Multiple price-sensitive loads may be placed at the same bus. | Required | N
|
||||
| `Revenue ($/MW)` | Revenue obtained for serving each MW of power to this load. | Required | Y
|
||||
| `Demand (MW)` | Maximum amount of power required by this load. Any amount lower than this may be served. | Required | Y
|
||||
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"Price-sensitive loads": {
|
||||
"p1": {
|
||||
"Bus": "b3",
|
||||
"Revenue ($/MW)": 23.0,
|
||||
"Demand (MW)": 50.0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Transmission Lines
|
||||
|
||||
This section describes the characteristics of transmission system, such as its topology and the susceptance of each transmission line.
|
||||
|
||||
| Key | Description | Default | Time series?
|
||||
| :--------------------- | :----------------------------------------------- | ------- | :------------:
|
||||
| `Source bus` | Identifier of the bus where the transmission line originates. | Required | N
|
||||
| `Target bus` | Identifier of the bus where the transmission line reaches. | Required | N
|
||||
| `Reactance (ohms)` | Reactance of the transmission line (in ohms). | Required | N
|
||||
| `Susceptance (S)` | Susceptance of the transmission line (in siemens). | Required | N
|
||||
| `Normal flow limit (MW)` | Maximum amount of power (in MW) allowed to flow through the line when the system is in its regular, fully-operational state. | `+inf` | Y
|
||||
| `Emergency flow limit (MW)` | Maximum amount of power (in MW) allowed to flow through the line when the system is in degraded state (for example, after the failure of another transmission line). | `+inf` | Y
|
||||
| `Flow limit penalty ($/MW)` | Penalty for violating the flow limits of the transmission line (in $/MW). This is charged per time step. For example, if there is a thermal violation of 1 MW for three time steps, then three times this amount will be charged. | `5000.0` | Y
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"Transmission lines": {
|
||||
"l1": {
|
||||
"Source bus": "b1",
|
||||
"Target bus": "b2",
|
||||
"Reactance (ohms)": 0.05917,
|
||||
"Susceptance (S)": 29.49686,
|
||||
"Normal flow limit (MW)": 15000.0,
|
||||
"Emergency flow limit (MW)": 20000.0,
|
||||
"Flow limit penalty ($/MW)": 5000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Reserves
|
||||
|
||||
This section describes the hourly amount of reserves required.
|
||||
|
||||
|
||||
| Key | Description | Default | Time series?
|
||||
| :-------------------- | :------------------------------------------------- | --------- | :----:
|
||||
| `Type` | Type of reserve product. Must be either "spinning" or "flexiramp". | Required | N
|
||||
| `Amount (MW)` | Amount of reserves required. | Required | Y
|
||||
| `Shortfall penalty ($/MW)` | Penalty for shortage in meeting the reserve requirements (in $/MW). This is charged per time step. Negative value implies reserve constraints must always be satisfied. | `-1` | Y
|
||||
|
||||
#### Example 1
|
||||
|
||||
```json
|
||||
{
|
||||
"Reserves": {
|
||||
"r1": {
|
||||
"Type": "spinning",
|
||||
"Amount (MW)": [
|
||||
57.30552,
|
||||
53.88429,
|
||||
51.31838,
|
||||
50.46307
|
||||
],
|
||||
"Shortfall penalty ($/MW)": 5.0
|
||||
},
|
||||
"r2": {
|
||||
"Type": "flexiramp",
|
||||
"Amount (MW)": [
|
||||
20.31042,
|
||||
23.65273,
|
||||
27.41784,
|
||||
25.34057
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Contingencies
|
||||
|
||||
This section describes credible contingency scenarios in the optimization, such as the loss of a transmission line or generator.
|
||||
|
||||
| Key | Description | Default
|
||||
| :-------------------- | :----------------------------------------------- | ----------
|
||||
| `Affected generators` | List of generators affected by this contingency. May be omitted if no generators are affected. | `[]`
|
||||
| `Affected lines` | List of transmission lines affected by this contingency. May be omitted if no lines are affected. | `[]`
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"Contingencies": {
|
||||
"c1": {
|
||||
"Affected lines": ["l1", "l2", "l3"],
|
||||
"Affected generators": ["g1"]
|
||||
},
|
||||
"c2": {
|
||||
"Affected lines": ["l4"]
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Additional remarks
|
||||
|
||||
#### Time series parameters
|
||||
|
||||
Many numerical properties in the JSON file can be specified either as a single floating point number if they are time-independent, or as an array containing exactly `T` elements, if they are time-dependent, where `T` is the number of time steps in the planning horizon. For example, both formats below are valid when `T=3`:
|
||||
|
||||
```json
|
||||
{
|
||||
"Load (MW)": 800.0,
|
||||
"Load (MW)": [800.0, 850.0, 730.0]
|
||||
}
|
||||
```
|
||||
|
||||
The value `T` depends on both `Time horizon (h)` and `Time step (min)`, as the table below illustrates.
|
||||
|
||||
Time horizon (h) | Time step (min) | T
|
||||
:---------------:|:---------------:|:----:
|
||||
24 | 60 | 24
|
||||
24 | 15 | 96
|
||||
24 | 5 | 288
|
||||
36 | 60 | 36
|
||||
36 | 15 | 144
|
||||
36 | 5 | 432
|
||||
|
||||
Output Data Format
|
||||
------------------
|
||||
|
||||
The output data format is also JSON-based, but it is not currently documented since we expect it to change significantly in a future version of the package.
|
||||
|
||||
|
||||
Current limitations
|
||||
-------------------
|
||||
|
||||
* Network topology remains the same for all time periods
|
||||
* Only N-1 transmission contingencies are supported. Generator contingencies are not currently supported.
|
||||
* Time-varying minimum production amounts are not currently compatible with ramp/startup/shutdown limits.
|
||||
* Flexible ramping products can only be acquired under the `WanHob2016` formulation, which does not support spinning reserves.
|
@ -0,0 +1,82 @@
|
||||
# UnitCommitment.jl
|
||||
|
||||
**UnitCommitment.jl** (UC.jl) is a Julia/JuMP optimization package for the Security-Constrained Unit Commitment Problem (SCUC), a fundamental optimization problem in power systems used, for example, to clear the day-ahead electricity markets. The package provides benchmark instances for the problem and Julia/JuMP implementations of state-of-the-art mixed-integer programming formulations.
|
||||
|
||||
## Package Components
|
||||
|
||||
* **Data Format:** The package proposes an extensible and fully-documented JSON-based data specification format for SCUC, developed in collaboration with Independent System Operators (ISOs), which describes the most important aspects of the problem. The format supports all the most common generator characteristics (including ramping, piecewise-linear production cost curves and time-dependent startup costs), as well as operating reserves, price-sensitive loads, transmission networks and contingencies.
|
||||
* **Benchmark Instances:** The package provides a diverse collection of large-scale benchmark instances collected from the literature, converted into a common data format, and extended using data-driven methods to make them more challenging and realistic.
|
||||
* **Model Implementation**: The package provides a Julia/JuMP implementations of state-of-the-art formulations and solution methods for SCUC, including multiple ramping formulations ([ArrCon2000][ArrCon2000], [MorLatRam2013][MorLatRam2013], [DamKucRajAta2016][DamKucRajAta2016], [PanGua2016][PanGua2016]), multiple piecewise-linear costs formulations ([Gar1962][Gar1962], [CarArr2006][CarArr2006], [KnuOstWat2018][KnuOstWat2018]) and contingency screening methods ([XavQiuWanThi2019][XavQiuWanThi2019]). Our goal is to keep these implementations up-to-date as new methods are proposed in the literature.
|
||||
* **Benchmark Tools:** The package provides automated benchmark scripts to accurately evaluate the performance impact of proposed code changes.
|
||||
|
||||
[ArrCon2000]: https://doi.org/10.1109/59.871739
|
||||
[CarArr2006]: https://doi.org/10.1109/TPWRS.2006.876672
|
||||
[DamKucRajAta2016]: https://doi.org/10.1007/s10107-015-0919-9
|
||||
[Gar1962]: https://doi.org/10.1109/AIEEPAS.1962.4501405
|
||||
[KnuOstWat2018]: https://doi.org/10.1109/TPWRS.2017.2783850
|
||||
[MorLatRam2013]: https://doi.org/10.1109/TPWRS.2013.2251373
|
||||
[PanGua2016]: https://doi.org/10.1287/opre.2016.1520
|
||||
[XavQiuWanThi2019]: https://doi.org/10.1109/TPWRS.2019.2892620
|
||||
|
||||
### Authors
|
||||
* **Alinson S. Xavier** (Argonne National Laboratory)
|
||||
* **Aleksandr M. Kazachkov** (University of Florida)
|
||||
* **Feng Qiu** (Argonne National Laboratory)
|
||||
|
||||
### Acknowledgments
|
||||
|
||||
* We would like to thank **Yonghong Chen** (Midcontinent Independent System Operator), **Feng Pan** (Pacific Northwest National Laboratory) for valuable feedback on early versions of this package.
|
||||
|
||||
* Based upon work supported by **Laboratory Directed Research and Development** (LDRD) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U.S. Department of Energy under Contract No. DE-AC02-06CH11357
|
||||
|
||||
* Based upon work supported by the **U.S. Department of Energy Advanced Grid Modeling Program** under Grant DE-OE0000875.
|
||||
|
||||
### Citing
|
||||
|
||||
If you use UnitCommitment.jl in your research (instances, models or algorithms), we kindly request that you cite the package as follows:
|
||||
|
||||
* **Alinson S. Xavier, Aleksandr M. Kazachkov, Feng Qiu**, "UnitCommitment.jl: A Julia/JuMP Optimization Package for Security-Constrained Unit Commitment". Zenodo (2020). [DOI: 10.5281/zenodo.4269874](https://doi.org/10.5281/zenodo.4269874).
|
||||
|
||||
If you use the instances, we additionally request that you cite the original sources, as described in the [instances page](instances.md).
|
||||
|
||||
### License
|
||||
|
||||
```text
|
||||
UnitCommitment.jl: A Julia/JuMP Optimization Package for Security-Constrained Unit Commitment
|
||||
Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
## Site contents
|
||||
|
||||
```{toctree}
|
||||
---
|
||||
maxdepth: 2
|
||||
---
|
||||
usage.md
|
||||
format.md
|
||||
instances.md
|
||||
model.md
|
||||
```
|
||||
|
@ -0,0 +1,244 @@
|
||||
```{sectnum}
|
||||
---
|
||||
start: 4
|
||||
depth: 2
|
||||
suffix: .
|
||||
---
|
||||
```
|
||||
|
||||
JuMP Model
|
||||
==========
|
||||
|
||||
In this page, we describe the JuMP optimization model produced by the function `UnitCommitment.build_model`. A detailed understanding of this model is not necessary if you are just interested in using the package to solve some standard unit commitment cases, but it may be useful, for example, if you need to solve a slightly different problem, with additional variables and constraints. The notation in this page generally follows [KnOsWa20].
|
||||
|
||||
Decision variables
|
||||
------------------
|
||||
|
||||
### Generators
|
||||
|
||||
Name | Symbol | Description | Unit
|
||||
-----|:--------:|-------------|:------:
|
||||
`is_on[g,t]` | $u_{g}(t)$ | True if generator `g` is on at time `t`. | Binary
|
||||
`switch_on[g,t]` | $v_{g}(t)$ | True is generator `g` switches on at time `t`. | Binary
|
||||
`switch_off[g,t]` | $w_{g}(t)$ | True if generator `g` switches off at time `t`. | Binary
|
||||
`prod_above[g,t]` |$p'_{g}(t)$ | Amount of power produced by generator `g` above its minimum power output at time `t`. For example, if the minimum power of generator `g` is 100 MW and `g` is producing 115 MW of power at time `t`, then `prod_above[g,t]` equals `15.0`. | MW
|
||||
`segprod[g,t,k]` | $p^k_g(t)$ | Amount of power from piecewise linear segment `k` produced by generator `g` at time `t`. For example, if cost curve for generator `g` is defined by the points `(100, 1400)`, `(110, 1600)`, `(130, 2200)` and `(135, 2400)`, and if the generator is producing 115 MW of power at time `t`, then `segprod[g,t,:]` equals `[10.0, 5.0, 0.0]`.| MW
|
||||
`reserve[r,g,t]` | $r_g(t)$ | Amount of reserve `r` provided by unit `g` at time `t`. | MW
|
||||
`startup[g,t,s]` | $\delta^s_g(t)$ | True if generator `g` switches on at time `t` incurring start-up costs from start-up category `s`. | Binary
|
||||
|
||||
|
||||
### Buses
|
||||
|
||||
Name | Symbol | Description | Unit
|
||||
-----|:------:|-------------|:------:
|
||||
`net_injection[b,t]` | $n_b(t)$ | Net injection at bus `b` at time `t`. | MW
|
||||
`curtail[b,t]` | $s^+_b(t)$ | Amount of load curtailed at bus `b` at time `t` | MW
|
||||
|
||||
|
||||
### Price-sensitive loads
|
||||
|
||||
Name | Symbol | Description | Unit
|
||||
-----|:------:|-------------|:------:
|
||||
`loads[s,t]` | $d_{s}(t)$ | Amount of power served to price-sensitive load `s` at time `t`. | MW
|
||||
|
||||
### Transmission lines
|
||||
|
||||
Name | Symbol | Description | Unit
|
||||
-----|:------:|-------------|:------:
|
||||
`flow[l,t]` | $f_l(t)$ | Power flow on line `l` at time `t`. | MW
|
||||
`overflow[l,t]` | $f^+_l(t)$ | Amount of flow above the limit for line `l` at time `t`. | MW
|
||||
|
||||
```{warning}
|
||||
|
||||
Since transmission and N-1 security constraints are enforced in a lazy way, most of the `flow[l,t]` variables are never added to the model. Accessing `model[:flow][l,t]` without first checking that the variable exists will likely generate an error.
|
||||
```
|
||||
|
||||
Objective function
|
||||
------------------
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\text{minimize} \;\; &
|
||||
\sum_{t \in \mathcal{T}}
|
||||
\sum_{g \in \mathcal{G}}
|
||||
C^\text{min}_g(t) u_g(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{g \in \mathcal{G}}
|
||||
\sum_{g \in \mathcal{K}_g}
|
||||
C^k_g(t) p^k_g(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{g \in \mathcal{G}}
|
||||
\sum_{s \in \mathcal{S}_g}
|
||||
C^s_{g}(t) \delta^s_g(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{l \in \mathcal{L}}
|
||||
C^\text{overflow}_{l}(t) f^+_l(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{b \in \mathcal{B}}
|
||||
C^\text{curtail}(t) s^+_b(t) \\
|
||||
&
|
||||
- \sum_{t \in \mathcal{T}}
|
||||
\sum_{s \in \mathcal{PS}}
|
||||
R_{s}(t) d_{s}(t) \\
|
||||
|
||||
\end{align}
|
||||
$$
|
||||
where
|
||||
- $\mathcal{B}$ is the set of buses
|
||||
- $\mathcal{G}$ is the set of generators
|
||||
- $\mathcal{L}$ is the set of transmission lines
|
||||
- $\mathcal{PS}$ is the set of price-sensitive loads
|
||||
- $\mathcal{S}_g$ is the set of start-up categories for generator $g$
|
||||
- $\mathcal{T}$ is the set of time steps
|
||||
- $C^\text{curtail}(t)$ is the curtailment penalty (in \$/MW)
|
||||
- $C^\text{min}_g(t)$ is the cost of keeping generator $g$ on and producing at minimum power during time $t$ (in \$)
|
||||
- $C^\text{overflow}_{l}(t)$ is the flow limit penalty for line $l$ at time $t$ (in \$/MW)
|
||||
- $C^k_g(t)$ is the cost for generator $g$ to produce 1 MW of power at time $t$ under piecewise linear segment $k$
|
||||
- $C^s_{g}(t)$ is the cost of starting up generator $g$ at time $t$ under start-up category $s$ (in \$)
|
||||
- $R_{s}(t)$ is the revenue obtained from serving price-sensitive load $s$ at time $t$ (in \$/MW)
|
||||
|
||||
|
||||
Constraints
|
||||
-----------
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
Inspecting and modifying the model
|
||||
----------------------------------
|
||||
|
||||
### Accessing decision variables
|
||||
|
||||
After building a model using `UnitCommitment.build_model`, it is possible to obtain a reference to the decision variables by calling `model[:varname][index]`. For example, `model[:is_on]["g1",1]` returns a direct reference to the JuMP variable indicating whether generator named "g1" is on at time 1. The script below illustrates how to build a model, solve it and display the solution without using the function `UnitCommitment.solution`.
|
||||
|
||||
```julia
|
||||
using Cbc
|
||||
using Printf
|
||||
using JuMP
|
||||
using UnitCommitment
|
||||
|
||||
# Load benchmark instance
|
||||
instance = UnitCommitment.read_benchmark("matpower/case118/2017-02-01")
|
||||
|
||||
# Build JuMP model
|
||||
model = UnitCommitment.build_model(
|
||||
instance=instance,
|
||||
optimizer=Cbc.Optimizer,
|
||||
)
|
||||
|
||||
# Solve the model
|
||||
UnitCommitment.optimize!(model)
|
||||
|
||||
# Display commitment status
|
||||
for g in instance.units
|
||||
for t in 1:instance.time
|
||||
@printf(
|
||||
"%-10s %5d %5.1f %5.1f %5.1f\n",
|
||||
g.name,
|
||||
t,
|
||||
value(model[:is_on][g.name, t]),
|
||||
value(model[:switch_on][g.name, t]),
|
||||
value(model[:switch_off][g.name, t]),
|
||||
)
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
### Fixing variables, modifying objective function and adding constraints
|
||||
|
||||
Since we now have a direct reference to the JuMP decision variables, it is possible to fix variables, change the coefficients in the objective function, or even add new constraints to the model before solving it. The script below shows how can this be accomplished. For more information on modifying an existing model, [see the JuMP documentation](https://jump.dev/JuMP.jl/stable/manual/variables/).
|
||||
|
||||
```julia
|
||||
using Cbc
|
||||
using JuMP
|
||||
using UnitCommitment
|
||||
|
||||
# Load benchmark instance
|
||||
instance = UnitCommitment.read_benchmark("matpower/case118/2017-02-01")
|
||||
|
||||
# Construct JuMP model
|
||||
model = UnitCommitment.build_model(
|
||||
instance=instance,
|
||||
optimizer=Cbc.Optimizer,
|
||||
)
|
||||
|
||||
# Fix a decision variable to 1.0
|
||||
JuMP.fix(
|
||||
model[:is_on]["g1",1],
|
||||
1.0,
|
||||
force=true,
|
||||
)
|
||||
|
||||
# Change the objective function
|
||||
JuMP.set_objective_coefficient(
|
||||
model,
|
||||
model[:switch_on]["g2",1],
|
||||
1000.0,
|
||||
)
|
||||
|
||||
# Create a new constraint
|
||||
@constraint(
|
||||
model,
|
||||
model[:is_on]["g3",1] + model[:is_on]["g4",1] <= 1,
|
||||
)
|
||||
|
||||
# Solve the model
|
||||
UnitCommitment.optimize!(model)
|
||||
```
|
||||
|
||||
### Adding new component to a bus
|
||||
|
||||
The following snippet shows how to add a new grid component to a particular bus. For each time step, we create decision variables for the new grid component, add these variables to the objective function, then attach the component to a particular bus by modifying some existing model constraints.
|
||||
|
||||
```julia
|
||||
using Cbc
|
||||
using JuMP
|
||||
using UnitCommitment
|
||||
|
||||
# Load instance and build base model
|
||||
instance = UnitCommitment.read_benchmark("matpower/case118/2017-02-01")
|
||||
model = UnitCommitment.build_model(
|
||||
instance=instance,
|
||||
optimizer=Cbc.Optimizer,
|
||||
)
|
||||
|
||||
# Get the number of time steps in the original instance
|
||||
T = instance.time
|
||||
|
||||
# Create decision variables for the new grid component.
|
||||
# In this example, we assume that the new component can
|
||||
# inject up to 10 MW of power at each time step, so we
|
||||
# create new continuous variables 0 ≤ x[t] ≤ 10.
|
||||
@variable(model, x[1:T], lower_bound=0.0, upper_bound=10.0)
|
||||
|
||||
# For each time step
|
||||
for t in 1:T
|
||||
|
||||
# Add production costs to the objective function.
|
||||
# In this example, we assume a cost of $5/MW.
|
||||
set_objective_coefficient(model, x[t], 5.0)
|
||||
|
||||
# Attach the new component to bus b1, by modifying the
|
||||
# constraint `eq_net_injection`.
|
||||
set_normalized_coefficient(
|
||||
model[:eq_net_injection]["b1", t],
|
||||
x[t],
|
||||
1.0,
|
||||
)
|
||||
end
|
||||
|
||||
# Solve the model
|
||||
UnitCommitment.optimize!(model)
|
||||
|
||||
# Show optimal values for the x variables
|
||||
@show value.(x)
|
||||
```
|
||||
|
||||
References
|
||||
----------
|
||||
* [KnOsWa20] **Bernard Knueven, James Ostrowski and Jean-Paul Watson.** "On Mixed-Integer Programming Formulations for the Unit Commitment Problem". INFORMS Journal on Computing (2020). [DOI: 10.1287/ijoc.2019.0944](https://doi.org/10.1287/ijoc.2019.0944)
|
||||
|
@ -0,0 +1,149 @@
|
||||
```{sectnum}
|
||||
---
|
||||
start: 1
|
||||
depth: 2
|
||||
suffix: .
|
||||
---
|
||||
```
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
UnitCommitment.jl was tested and developed with [Julia 1.6](https://julialang.org/). To install Julia, please follow the [installation guide on the official Julia website](https://julialang.org/downloads/platform.html). To install UnitCommitment.jl, run the Julia interpreter, type `]` to open the package manager, then type:
|
||||
|
||||
```text
|
||||
pkg> add UnitCommitment@0.2
|
||||
```
|
||||
|
||||
To test that the package has been correctly installed, run:
|
||||
|
||||
```text
|
||||
pkg> test UnitCommitment
|
||||
```
|
||||
|
||||
If all tests pass, the package should now be ready to be used by any Julia script on the machine.
|
||||
|
||||
To solve the optimization models, a mixed-integer linear programming (MILP) solver is also required. Please see the [JuMP installation guide](https://jump.dev/JuMP.jl/stable/installation/) for more instructions on installing a solver. Typical open-source choices are [Cbc](https://github.com/JuliaOpt/Cbc.jl) and [GLPK](https://github.com/JuliaOpt/GLPK.jl). In the instructions below, Cbc will be used, but any other MILP solver listed in JuMP installation guide should also be compatible.
|
||||
|
||||
Typical Usage
|
||||
-------------
|
||||
|
||||
### Solving user-provided instances
|
||||
|
||||
The first step to use UC.jl is to construct a JSON file describing your unit commitment instance. See [Data Format](format.md) for a complete description of the data format UC.jl expects. The next steps, as shown below, are to: (1) read the instance from file; (2) construct the optimization model; (3) run the optimization; and (4) extract the optimal solution.
|
||||
|
||||
```julia
|
||||
using Cbc
|
||||
using JSON
|
||||
using UnitCommitment
|
||||
|
||||
# 1. Read instance
|
||||
instance = UnitCommitment.read("/path/to/input.json")
|
||||
|
||||
# 2. Construct optimization model
|
||||
model = UnitCommitment.build_model(
|
||||
instance=instance,
|
||||
optimizer=Cbc.Optimizer,
|
||||
)
|
||||
|
||||
# 3. Solve model
|
||||
UnitCommitment.optimize!(model)
|
||||
|
||||
# 4. Write solution to a file
|
||||
solution = UnitCommitment.solution(model)
|
||||
UnitCommitment.write("/path/to/output.json", solution)
|
||||
```
|
||||
|
||||
### Solving benchmark instances
|
||||
|
||||
UnitCommitment.jl contains a large number of benchmark instances collected from the literature and converted into a common data format. To solve one of these instances individually, instead of constructing your own, the function `read_benchmark` can be used, as shown below. See [Instances](instances.md) for the complete list of available instances.
|
||||
|
||||
```julia
|
||||
using UnitCommitment
|
||||
instance = UnitCommitment.read_benchmark("matpower/case3375wp/2017-02-01")
|
||||
```
|
||||
|
||||
Advanced usage
|
||||
--------------
|
||||
|
||||
### Customizing the formulation
|
||||
|
||||
By default, `build_model` uses a formulation that combines modeling components from different publications, and that has been carefully tested, using our own benchmark scripts, to provide good performance across a wide variety of instances. This default formulation is expected to change over time, as new methods are proposed in the literature. You can, however, construct your own formulation, based on the modeling components that you choose, as shown in the next example.
|
||||
|
||||
```julia
|
||||
using Cbc
|
||||
using UnitCommitment
|
||||
|
||||
import UnitCommitment:
|
||||
Formulation,
|
||||
KnuOstWat2018,
|
||||
MorLatRam2013,
|
||||
ShiftFactorsFormulation
|
||||
|
||||
instance = UnitCommitment.read_benchmark(
|
||||
"matpower/case118/2017-02-01",
|
||||
)
|
||||
|
||||
model = UnitCommitment.build_model(
|
||||
instance = instance,
|
||||
optimizer = Cbc.Optimizer,
|
||||
formulation = Formulation(
|
||||
pwl_costs = KnuOstWat2018.PwlCosts(),
|
||||
ramping = MorLatRam2013.Ramping(),
|
||||
startup_costs = MorLatRam2013.StartupCosts(),
|
||||
transmission = ShiftFactorsFormulation(
|
||||
isf_cutoff = 0.005,
|
||||
lodf_cutoff = 0.001,
|
||||
),
|
||||
),
|
||||
)
|
||||
```
|
||||
|
||||
### Generating initial conditions
|
||||
|
||||
When creating random unit commitment instances for benchmark purposes, it is often hard to compute, in advance, sensible initial conditions for all generators. Setting initial conditions naively (for example, making all generators initially off and producing no power) can easily cause the instance to become infeasible due to excessive ramping. Initial conditions can also make it hard to modify existing instances. For example, increasing the system load without carefully modifying the initial conditions may make the problem infeasible or unrealistically challenging to solve.
|
||||
|
||||
To help with this issue, UC.jl provides a utility function which can generate feasible initial conditions by solving a single-period optimization problem, as shown below:
|
||||
|
||||
```julia
|
||||
using Cbc
|
||||
using UnitCommitment
|
||||
|
||||
# Read original instance
|
||||
instance = UnitCommitment.read("instance.json")
|
||||
|
||||
# Generate initial conditions (in-place)
|
||||
UnitCommitment.generate_initial_conditions!(instance, Cbc.Optimizer)
|
||||
|
||||
# Construct and solve optimization model
|
||||
model = UnitCommitment.build_model(
|
||||
instance=instance,
|
||||
optimizer=Cbc.Optimizer,
|
||||
)
|
||||
UnitCommitment.optimize!(model)
|
||||
```
|
||||
|
||||
```{warning}
|
||||
The function `generate_initial_conditions!` may return different initial conditions after each call, even if the same instance and the same optimizer is provided. The particular algorithm may also change in a future version of UC.jl. For these reasons, it is recommended that you generate initial conditions exactly once for each instance and store them for later use.
|
||||
```
|
||||
|
||||
### Verifying solutions
|
||||
|
||||
When developing new formulations, it is very easy to introduce subtle errors in the model that result in incorrect solutions. To help with this, UC.jl includes a utility function that verifies if a given solution is feasible, and, if not, prints all the validation errors it found. The implementation of this function is completely independent from the implementation of the optimization model, and therefore can be used to validate it. The function can also be used to verify solutions produced by other optimization packages, as long as they follow the [UC.jl data format](format.md).
|
||||
|
||||
```julia
|
||||
using JSON
|
||||
using UnitCommitment
|
||||
|
||||
# Read instance
|
||||
instance = UnitCommitment.read("instance.json")
|
||||
|
||||
# Read solution (potentially produced by other packages)
|
||||
solution = JSON.parsefile("solution.json")
|
||||
|
||||
# Validate solution and print validation errors
|
||||
UnitCommitment.validate(instance, solution)
|
||||
```
|
@ -0,0 +1,861 @@
|
||||
/*
|
||||
* basic.css
|
||||
* ~~~~~~~~~
|
||||
*
|
||||
* Sphinx stylesheet -- basic theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
/* -- main layout ----------------------------------------------------------- */
|
||||
|
||||
div.clearer {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
div.section::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: left;
|
||||
}
|
||||
|
||||
/* -- relbar ---------------------------------------------------------------- */
|
||||
|
||||
div.related {
|
||||
width: 100%;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
div.related h3 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.related ul {
|
||||
margin: 0;
|
||||
padding: 0 0 0 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
div.related li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.related li.right {
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/* -- sidebar --------------------------------------------------------------- */
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
padding: 10px 5px 0 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
float: left;
|
||||
width: 270px;
|
||||
margin-left: -100%;
|
||||
font-size: 90%;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap : break-word;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul ul,
|
||||
div.sphinxsidebar ul.want-points {
|
||||
margin-left: 20px;
|
||||
list-style: square;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar form {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid #98dbcc;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox form.search {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="text"] {
|
||||
float: left;
|
||||
width: 80%;
|
||||
padding: 0.25em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="submit"] {
|
||||
float: left;
|
||||
width: 20%;
|
||||
border-left: none;
|
||||
padding: 0.25em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* -- search page ----------------------------------------------------------- */
|
||||
|
||||
ul.search {
|
||||
margin: 10px 0 0 20px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.search li {
|
||||
padding: 5px 0 5px 20px;
|
||||
background-image: url(file.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 7px;
|
||||
}
|
||||
|
||||
ul.search li a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.search li div.context {
|
||||
color: #888;
|
||||
margin: 2px 0 0 30px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
ul.keywordmatches li.goodmatch a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* -- index page ------------------------------------------------------------ */
|
||||
|
||||
table.contentstable {
|
||||
width: 90%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.contentstable p.biglink {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
a.biglink {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
span.linkdescr {
|
||||
font-style: italic;
|
||||
padding-top: 5px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* -- general index --------------------------------------------------------- */
|
||||
|
||||
table.indextable {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.indextable td {
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.indextable ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
table.indextable > tbody > tr > td > ul {
|
||||
padding-left: 0em;
|
||||
}
|
||||
|
||||
table.indextable tr.pcap {
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
table.indextable tr.cap {
|
||||
margin-top: 10px;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
img.toggler {
|
||||
margin-right: 3px;
|
||||
margin-top: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.modindex-jumpbox {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
div.genindex-jumpbox {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
/* -- domain module index --------------------------------------------------- */
|
||||
|
||||
table.modindextable td {
|
||||
padding: 2px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/* -- general body styles --------------------------------------------------- */
|
||||
|
||||
div.body {
|
||||
min-width: 450px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
div.body p, div.body dd, div.body li, div.body blockquote {
|
||||
-moz-hyphens: auto;
|
||||
-ms-hyphens: auto;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
a.headerlink {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
a.brackets:before,
|
||||
span.brackets > a:before{
|
||||
content: "[";
|
||||
}
|
||||
|
||||
a.brackets:after,
|
||||
span.brackets > a:after {
|
||||
content: "]";
|
||||
}
|
||||
|
||||
h1:hover > a.headerlink,
|
||||
h2:hover > a.headerlink,
|
||||
h3:hover > a.headerlink,
|
||||
h4:hover > a.headerlink,
|
||||
h5:hover > a.headerlink,
|
||||
h6:hover > a.headerlink,
|
||||
dt:hover > a.headerlink,
|
||||
caption:hover > a.headerlink,
|
||||
p.caption:hover > a.headerlink,
|
||||
div.code-block-caption:hover > a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
div.body p.caption {
|
||||
text-align: inherit;
|
||||
}
|
||||
|
||||
div.body td {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.first {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
p.rubric {
|
||||
margin-top: 30px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
img.align-left, figure.align-left, .figure.align-left, object.align-left {
|
||||
clear: left;
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
img.align-right, figure.align-right, .figure.align-right, object.align-right {
|
||||
clear: right;
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
img.align-center, figure.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.align-default, figure.align-default, .figure.align-default {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.align-default {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* -- sidebars -------------------------------------------------------------- */
|
||||
|
||||
div.sidebar,
|
||||
aside.sidebar {
|
||||
margin: 0 0 0.5em 1em;
|
||||
border: 1px solid #ddb;
|
||||
padding: 7px;
|
||||
background-color: #ffe;
|
||||
width: 40%;
|
||||
float: right;
|
||||
clear: right;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
p.sidebar-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.admonition, div.topic, blockquote {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
/* -- topics ---------------------------------------------------------------- */
|
||||
|
||||
div.topic {
|
||||
border: 1px solid #ccc;
|
||||
padding: 7px;
|
||||
margin: 10px 0 10px 0;
|
||||
}
|
||||
|
||||
p.topic-title {
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* -- admonitions ----------------------------------------------------------- */
|
||||
|
||||
div.admonition {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
div.admonition dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
margin: 0px 10px 5px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.body p.centered {
|
||||
text-align: center;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
/* -- content of sidebars/topics/admonitions -------------------------------- */
|
||||
|
||||
div.sidebar > :last-child,
|
||||
aside.sidebar > :last-child,
|
||||
div.topic > :last-child,
|
||||
div.admonition > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.sidebar::after,
|
||||
aside.sidebar::after,
|
||||
div.topic::after,
|
||||
div.admonition::after,
|
||||
blockquote::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* -- tables ---------------------------------------------------------------- */
|
||||
|
||||
table.docutils {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
border: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-default {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table caption span.caption-number {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
table caption span.caption-text {
|
||||
}
|
||||
|
||||
table.docutils td, table.docutils th {
|
||||
padding: 1px 8px 1px 5px;
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
|
||||
table.footnote td, table.footnote th {
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
table.citation td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
th > :first-child,
|
||||
td > :first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
th > :last-child,
|
||||
td > :last-child {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* -- figures --------------------------------------------------------------- */
|
||||
|
||||
div.figure, figure {
|
||||
margin: 0.5em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
div.figure p.caption, figcaption {
|
||||
padding: 0.3em;
|
||||
}
|
||||
|
||||
div.figure p.caption span.caption-number,
|
||||
figcaption span.caption-number {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.figure p.caption span.caption-text,
|
||||
figcaption span.caption-text {
|
||||
}
|
||||
|
||||
/* -- field list styles ----------------------------------------------------- */
|
||||
|
||||
table.field-list td, table.field-list th {
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.field-list ul {
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
.field-list p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.field-name {
|
||||
-moz-hyphens: manual;
|
||||
-ms-hyphens: manual;
|
||||
-webkit-hyphens: manual;
|
||||
hyphens: manual;
|
||||
}
|
||||
|
||||
/* -- hlist styles ---------------------------------------------------------- */
|
||||
|
||||
table.hlist {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
table.hlist td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
/* -- other body styles ----------------------------------------------------- */
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha;
|
||||
}
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha;
|
||||
}
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman;
|
||||
}
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman;
|
||||
}
|
||||
|
||||
:not(li) > ol > li:first-child > :first-child,
|
||||
:not(li) > ul > li:first-child > :first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
:not(li) > ol > li:last-child > :last-child,
|
||||
:not(li) > ul > li:last-child > :last-child {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
ol.simple ol p,
|
||||
ol.simple ul p,
|
||||
ul.simple ol p,
|
||||
ul.simple ul p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
ol.simple > li:not(:first-child) > p,
|
||||
ul.simple > li:not(:first-child) > p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
ol.simple p,
|
||||
ul.simple p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dl.footnote > dt,
|
||||
dl.citation > dt {
|
||||
float: left;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
dl.footnote > dd,
|
||||
dl.citation > dd {
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
|
||||
dl.footnote > dd:after,
|
||||
dl.citation > dd:after {
|
||||
content: "";
|
||||
clear: both;
|
||||
}
|
||||
|
||||
dl.field-list {
|
||||
display: grid;
|
||||
grid-template-columns: fit-content(30%) auto;
|
||||
}
|
||||
|
||||
dl.field-list > dt {
|
||||
font-weight: bold;
|
||||
word-break: break-word;
|
||||
padding-left: 0.5em;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
dl.field-list > dt:after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
dl.field-list > dd {
|
||||
padding-left: 0.5em;
|
||||
margin-top: 0em;
|
||||
margin-left: 0em;
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
|
||||
dl {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
dd > :first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
dd ul, dd table {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
dl > dd:last-child,
|
||||
dl > dd:last-child > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt:target, span.highlighted {
|
||||
background-color: #fbe54e;
|
||||
}
|
||||
|
||||
rect.highlighted {
|
||||
fill: #fbe54e;
|
||||
}
|
||||
|
||||
dl.glossary dt {
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.optional {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.sig-paren {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
.versionmodified {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.system-message {
|
||||
background-color: #fda;
|
||||
padding: 5px;
|
||||
border: 3px solid red;
|
||||
}
|
||||
|
||||
.footnote:target {
|
||||
background-color: #ffa;
|
||||
}
|
||||
|
||||
.line-block {
|
||||
display: block;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.line-block .line-block {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
.guilabel, .menuselection {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.accelerator {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.classifier {
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
.classifier:before {
|
||||
font-style: normal;
|
||||
margin: 0.5em;
|
||||
content: ":";
|
||||
}
|
||||
|
||||
abbr, acronym {
|
||||
border-bottom: dotted 1px;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
/* -- code displays --------------------------------------------------------- */
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */
|
||||
}
|
||||
|
||||
pre, div[class*="highlight-"] {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
span.pre {
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
-webkit-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
div[class*="highlight-"] {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
td.linenos pre {
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
table.highlighttable {
|
||||
display: block;
|
||||
}
|
||||
|
||||
table.highlighttable tbody {
|
||||
display: block;
|
||||
}
|
||||
|
||||
table.highlighttable tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
table.highlighttable td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.highlighttable td.linenos {
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
table.highlighttable td.code {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.highlight .hll {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.highlight pre,
|
||||
table.highlighttable pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.code-block-caption + div {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.code-block-caption {
|
||||
margin-top: 1em;
|
||||
padding: 2px 5px;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
div.code-block-caption code {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
table.highlighttable td.linenos,
|
||||
span.linenos,
|
||||
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
div.code-block-caption span.caption-number {
|
||||
padding: 0.1em 0.3em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.code-block-caption span.caption-text {
|
||||
}
|
||||
|
||||
div.literal-block-wrapper {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
code.descname {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
code.descclassname {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
code.xref, a code {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.viewcode-link {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
float: right;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
div.viewcode-block:target {
|
||||
margin: -1px -10px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
/* -- math display ---------------------------------------------------------- */
|
||||
|
||||
img.math {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.body div.math p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
span.eqno {
|
||||
float: right;
|
||||
}
|
||||
|
||||
span.eqno a.headerlink {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
div.math:hover a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* -- printout stylesheet --------------------------------------------------- */
|
||||
|
||||
@media print {
|
||||
div.document,
|
||||
div.documentwrapper,
|
||||
div.bodywrapper {
|
||||
margin: 0 !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar,
|
||||
div.related,
|
||||
div.footer,
|
||||
#top-link {
|
||||
display: none;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,117 @@
|
||||
:root {
|
||||
/*****************************************************************************
|
||||
* Theme config
|
||||
**/
|
||||
--pst-header-height: 60px;
|
||||
|
||||
/*****************************************************************************
|
||||
* Font size
|
||||
**/
|
||||
--pst-font-size-base: 15px; /* base font size - applied at body / html level */
|
||||
|
||||
/* heading font sizes */
|
||||
--pst-font-size-h1: 36px;
|
||||
--pst-font-size-h2: 32px;
|
||||
--pst-font-size-h3: 26px;
|
||||
--pst-font-size-h4: 21px;
|
||||
--pst-font-size-h5: 18px;
|
||||
--pst-font-size-h6: 16px;
|
||||
|
||||
/* smaller then heading font sizes*/
|
||||
--pst-font-size-milli: 12px;
|
||||
|
||||
--pst-sidebar-font-size: .9em;
|
||||
--pst-sidebar-caption-font-size: .9em;
|
||||
|
||||
/*****************************************************************************
|
||||
* Font family
|
||||
**/
|
||||
/* These are adapted from https://systemfontstack.com/ */
|
||||
--pst-font-family-base-system: -apple-system, BlinkMacSystemFont, Segoe UI, "Helvetica Neue",
|
||||
Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
|
||||
--pst-font-family-monospace-system: "SFMono-Regular", Menlo, Consolas, Monaco,
|
||||
Liberation Mono, Lucida Console, monospace;
|
||||
|
||||
--pst-font-family-base: var(--pst-font-family-base-system);
|
||||
--pst-font-family-heading: var(--pst-font-family-base);
|
||||
--pst-font-family-monospace: var(--pst-font-family-monospace-system);
|
||||
|
||||
/*****************************************************************************
|
||||
* Color
|
||||
*
|
||||
* Colors are defined in rgb string way, "red, green, blue"
|
||||
**/
|
||||
--pst-color-primary: 19, 6, 84;
|
||||
--pst-color-success: 40, 167, 69;
|
||||
--pst-color-info: 0, 123, 255; /*23, 162, 184;*/
|
||||
--pst-color-warning: 255, 193, 7;
|
||||
--pst-color-danger: 220, 53, 69;
|
||||
--pst-color-text-base: 51, 51, 51;
|
||||
|
||||
--pst-color-h1: var(--pst-color-primary);
|
||||
--pst-color-h2: var(--pst-color-primary);
|
||||
--pst-color-h3: var(--pst-color-text-base);
|
||||
--pst-color-h4: var(--pst-color-text-base);
|
||||
--pst-color-h5: var(--pst-color-text-base);
|
||||
--pst-color-h6: var(--pst-color-text-base);
|
||||
--pst-color-paragraph: var(--pst-color-text-base);
|
||||
--pst-color-link: 0, 91, 129;
|
||||
--pst-color-link-hover: 227, 46, 0;
|
||||
--pst-color-headerlink: 198, 15, 15;
|
||||
--pst-color-headerlink-hover: 255, 255, 255;
|
||||
--pst-color-preformatted-text: 34, 34, 34;
|
||||
--pst-color-preformatted-background: 250, 250, 250;
|
||||
--pst-color-inline-code: 232, 62, 140;
|
||||
|
||||
--pst-color-active-navigation: 19, 6, 84;
|
||||
--pst-color-navbar-link: 77, 77, 77;
|
||||
--pst-color-navbar-link-hover: var(--pst-color-active-navigation);
|
||||
--pst-color-navbar-link-active: var(--pst-color-active-navigation);
|
||||
--pst-color-sidebar-link: 77, 77, 77;
|
||||
--pst-color-sidebar-link-hover: var(--pst-color-active-navigation);
|
||||
--pst-color-sidebar-link-active: var(--pst-color-active-navigation);
|
||||
--pst-color-sidebar-expander-background-hover: 244, 244, 244;
|
||||
--pst-color-sidebar-caption: 77, 77, 77;
|
||||
--pst-color-toc-link: 119, 117, 122;
|
||||
--pst-color-toc-link-hover: var(--pst-color-active-navigation);
|
||||
--pst-color-toc-link-active: var(--pst-color-active-navigation);
|
||||
|
||||
/*****************************************************************************
|
||||
* Icon
|
||||
**/
|
||||
|
||||
/* font awesome icons*/
|
||||
--pst-icon-check-circle: '\f058';
|
||||
--pst-icon-info-circle: '\f05a';
|
||||
--pst-icon-exclamation-triangle: '\f071';
|
||||
--pst-icon-exclamation-circle: '\f06a';
|
||||
--pst-icon-times-circle: '\f057';
|
||||
--pst-icon-lightbulb: '\f0eb';
|
||||
|
||||
/*****************************************************************************
|
||||
* Admonitions
|
||||
**/
|
||||
|
||||
--pst-color-admonition-default: var(--pst-color-info);
|
||||
--pst-color-admonition-note: var(--pst-color-info);
|
||||
--pst-color-admonition-attention: var(--pst-color-warning);
|
||||
--pst-color-admonition-caution: var(--pst-color-warning);
|
||||
--pst-color-admonition-warning: var(--pst-color-warning);
|
||||
--pst-color-admonition-danger: var(--pst-color-danger);
|
||||
--pst-color-admonition-error: var(--pst-color-danger);
|
||||
--pst-color-admonition-hint: var(--pst-color-success);
|
||||
--pst-color-admonition-tip: var(--pst-color-success);
|
||||
--pst-color-admonition-important: var(--pst-color-success);
|
||||
|
||||
--pst-icon-admonition-default: var(--pst-icon-info-circle);
|
||||
--pst-icon-admonition-note: var(--pst-icon-info-circle);
|
||||
--pst-icon-admonition-attention: var(--pst-icon-exclamation-circle);
|
||||
--pst-icon-admonition-caution: var(--pst-icon-exclamation-triangle);
|
||||
--pst-icon-admonition-warning: var(--pst-icon-exclamation-triangle);
|
||||
--pst-icon-admonition-danger: var(--pst-icon-exclamation-triangle);
|
||||
--pst-icon-admonition-error: var(--pst-icon-times-circle);
|
||||
--pst-icon-admonition-hint: var(--pst-icon-lightbulb);
|
||||
--pst-icon-admonition-tip: var(--pst-icon-lightbulb);
|
||||
--pst-icon-admonition-important: var(--pst-icon-exclamation-circle);
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
h1.site-logo {
|
||||
font-size: 30px !important;
|
||||
}
|
||||
|
||||
h1.site-logo small {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
|
||||
h1.site-logo {
|
||||
font-size: 30px !important;
|
||||
}
|
||||
|
||||
h1.site-logo small {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
|
||||
tbody, thead, pre {
|
||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
table td, th {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
table td code {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table tr,
|
||||
table th {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
table tr:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
box-shadow: inherit !important;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.text-align\:center {
|
||||
text-align: center;
|
||||
}
|
@ -0,0 +1,321 @@
|
||||
/*
|
||||
* doctools.js
|
||||
* ~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx JavaScript utilities for all documentation.
|
||||
*
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* select a different prefix for underscore
|
||||
*/
|
||||
$u = _.noConflict();
|
||||
|
||||
/**
|
||||
* make the code below compatible with browsers without
|
||||
* an installed firebug like debugger
|
||||
if (!window.console || !console.firebug) {
|
||||
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
|
||||
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
|
||||
"profile", "profileEnd"];
|
||||
window.console = {};
|
||||
for (var i = 0; i < names.length; ++i)
|
||||
window.console[names[i]] = function() {};
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* small helper function to urldecode strings
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
|
||||
*/
|
||||
jQuery.urldecode = function(x) {
|
||||
if (!x) {
|
||||
return x
|
||||
}
|
||||
return decodeURIComponent(x.replace(/\+/g, ' '));
|
||||
};
|
||||
|
||||
/**
|
||||
* small helper function to urlencode strings
|
||||
*/
|
||||
jQuery.urlencode = encodeURIComponent;
|
||||
|
||||
/**
|
||||
* This function returns the parsed url parameters of the
|
||||
* current request. Multiple values per key are supported,
|
||||
* it will always return arrays of strings for the value parts.
|
||||
*/
|
||||
jQuery.getQueryParameters = function(s) {
|
||||
if (typeof s === 'undefined')
|
||||
s = document.location.search;
|
||||
var parts = s.substr(s.indexOf('?') + 1).split('&');
|
||||
var result = {};
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
var tmp = parts[i].split('=', 2);
|
||||
var key = jQuery.urldecode(tmp[0]);
|
||||
var value = jQuery.urldecode(tmp[1]);
|
||||
if (key in result)
|
||||
result[key].push(value);
|
||||
else
|
||||
result[key] = [value];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* highlight a given string on a jquery object by wrapping it in
|
||||
* span elements with the given class name.
|
||||
*/
|
||||
jQuery.fn.highlightText = function(text, className) {
|
||||
function highlight(node, addItems) {
|
||||
if (node.nodeType === 3) {
|
||||
var val = node.nodeValue;
|
||||
var pos = val.toLowerCase().indexOf(text);
|
||||
if (pos >= 0 &&
|
||||
!jQuery(node.parentNode).hasClass(className) &&
|
||||
!jQuery(node.parentNode).hasClass("nohighlight")) {
|
||||
var span;
|
||||
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
|
||||
if (isInSVG) {
|
||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||
} else {
|
||||
span = document.createElement("span");
|
||||
span.className = className;
|
||||
}
|
||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
|
||||
document.createTextNode(val.substr(pos + text.length)),
|
||||
node.nextSibling));
|
||||
node.nodeValue = val.substr(0, pos);
|
||||
if (isInSVG) {
|
||||
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
||||
var bbox = node.parentElement.getBBox();
|
||||
rect.x.baseVal.value = bbox.x;
|
||||
rect.y.baseVal.value = bbox.y;
|
||||
rect.width.baseVal.value = bbox.width;
|
||||
rect.height.baseVal.value = bbox.height;
|
||||
rect.setAttribute('class', className);
|
||||
addItems.push({
|
||||
"parent": node.parentNode,
|
||||
"target": rect});
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!jQuery(node).is("button, select, textarea")) {
|
||||
jQuery.each(node.childNodes, function() {
|
||||
highlight(this, addItems);
|
||||
});
|
||||
}
|
||||
}
|
||||
var addItems = [];
|
||||
var result = this.each(function() {
|
||||
highlight(this, addItems);
|
||||
});
|
||||
for (var i = 0; i < addItems.length; ++i) {
|
||||
jQuery(addItems[i].parent).before(addItems[i].target);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
* backward compatibility for jQuery.browser
|
||||
* This will be supported until firefox bug is fixed.
|
||||
*/
|
||||
if (!jQuery.browser) {
|
||||
jQuery.uaMatch = function(ua) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(msie) ([\w.]+)/.exec(ua) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
jQuery.browser = {};
|
||||
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Small JavaScript module for the documentation.
|
||||
*/
|
||||
var Documentation = {
|
||||
|
||||
init : function() {
|
||||
this.fixFirefoxAnchorBug();
|
||||
this.highlightSearchWords();
|
||||
this.initIndexTable();
|
||||
if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
|
||||
this.initOnKeyListeners();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* i18n support
|
||||
*/
|
||||
TRANSLATIONS : {},
|
||||
PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
|
||||
LOCALE : 'unknown',
|
||||
|
||||
// gettext and ngettext don't access this so that the functions
|
||||
// can safely bound to a different name (_ = Documentation.gettext)
|
||||
gettext : function(string) {
|
||||
var translated = Documentation.TRANSLATIONS[string];
|
||||
if (typeof translated === 'undefined')
|
||||
return string;
|
||||
return (typeof translated === 'string') ? translated : translated[0];
|
||||
},
|
||||
|
||||
ngettext : function(singular, plural, n) {
|
||||
var translated = Documentation.TRANSLATIONS[singular];
|
||||
if (typeof translated === 'undefined')
|
||||
return (n == 1) ? singular : plural;
|
||||
return translated[Documentation.PLURALEXPR(n)];
|
||||
},
|
||||
|
||||
addTranslations : function(catalog) {
|
||||
for (var key in catalog.messages)
|
||||
this.TRANSLATIONS[key] = catalog.messages[key];
|
||||
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
|
||||
this.LOCALE = catalog.locale;
|
||||
},
|
||||
|
||||
/**
|
||||
* add context elements like header anchor links
|
||||
*/
|
||||
addContextElements : function() {
|
||||
$('div[id] > :header:first').each(function() {
|
||||
$('<a class="headerlink">\u00B6</a>').
|
||||
attr('href', '#' + this.id).
|
||||
attr('title', _('Permalink to this headline')).
|
||||
appendTo(this);
|
||||
});
|
||||
$('dt[id]').each(function() {
|
||||
$('<a class="headerlink">\u00B6</a>').
|
||||
attr('href', '#' + this.id).
|
||||
attr('title', _('Permalink to this definition')).
|
||||
appendTo(this);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* workaround a firefox stupidity
|
||||
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
|
||||
*/
|
||||
fixFirefoxAnchorBug : function() {
|
||||
if (document.location.hash && $.browser.mozilla)
|
||||
window.setTimeout(function() {
|
||||
document.location.href += '';
|
||||
}, 10);
|
||||
},
|
||||
|
||||
/**
|
||||
* highlight the search words provided in the url in the text
|
||||
*/
|
||||
highlightSearchWords : function() {
|
||||
var params = $.getQueryParameters();
|
||||
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
|
||||
if (terms.length) {
|
||||
var body = $('div.body');
|
||||
if (!body.length) {
|
||||
body = $('body');
|
||||
}
|
||||
window.setTimeout(function() {
|
||||
$.each(terms, function() {
|
||||
body.highlightText(this.toLowerCase(), 'highlighted');
|
||||
});
|
||||
}, 10);
|
||||
$('<p class="highlight-link"><a href="javascript:Documentation.' +
|
||||
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
|
||||
.appendTo($('#searchbox'));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* init the domain index toggle buttons
|
||||
*/
|
||||
initIndexTable : function() {
|
||||
var togglers = $('img.toggler').click(function() {
|
||||
var src = $(this).attr('src');
|
||||
var idnum = $(this).attr('id').substr(7);
|
||||
$('tr.cg-' + idnum).toggle();
|
||||
if (src.substr(-9) === 'minus.png')
|
||||
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
|
||||
else
|
||||
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
|
||||
}).css('display', '');
|
||||
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
|
||||
togglers.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* helper function to hide the search marks again
|
||||
*/
|
||||
hideSearchWords : function() {
|
||||
$('#searchbox .highlight-link').fadeOut(300);
|
||||
$('span.highlighted').removeClass('highlighted');
|
||||
},
|
||||
|
||||
/**
|
||||
* make the url absolute
|
||||
*/
|
||||
makeURL : function(relativeURL) {
|
||||
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
|
||||
},
|
||||
|
||||
/**
|
||||
* get the current relative url
|
||||
*/
|
||||
getCurrentURL : function() {
|
||||
var path = document.location.pathname;
|
||||
var parts = path.split(/\//);
|
||||
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
|
||||
if (this === '..')
|
||||
parts.pop();
|
||||
});
|
||||
var url = parts.join('/');
|
||||
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
|
||||
},
|
||||
|
||||
initOnKeyListeners: function() {
|
||||
$(document).keydown(function(event) {
|
||||
var activeElementType = document.activeElement.tagName;
|
||||
// don't navigate when in search box, textarea, dropdown or button
|
||||
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
|
||||
&& activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey
|
||||
&& !event.shiftKey) {
|
||||
switch (event.keyCode) {
|
||||
case 37: // left
|
||||
var prevHref = $('link[rel="prev"]').prop('href');
|
||||
if (prevHref) {
|
||||
window.location.href = prevHref;
|
||||
return false;
|
||||
}
|
||||
case 39: // right
|
||||
var nextHref = $('link[rel="next"]').prop('href');
|
||||
if (nextHref) {
|
||||
window.location.href = nextHref;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// quick alias for translations
|
||||
_ = Documentation.gettext;
|
||||
|
||||
$(document).ready(function() {
|
||||
Documentation.init();
|
||||
});
|
@ -0,0 +1,12 @@
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||
VERSION: '0.2',
|
||||
LANGUAGE: 'None',
|
||||
COLLAPSE_INDEX: false,
|
||||
BUILDER: 'dirhtml',
|
||||
FILE_SUFFIX: '.html',
|
||||
LINK_SUFFIX: '.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt',
|
||||
NAVIGATION_WITH_KEYS: true
|
||||
};
|
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,297 @@
|
||||
/*
|
||||
* language_data.js
|
||||
* ~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* This script contains the language-specific data used by searchtools.js,
|
||||
* namely the list of stopwords, stemmer, scorer and splitter.
|
||||
*
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
|
||||
|
||||
|
||||
/* Non-minified version is copied as a separate JS file, is available */
|
||||
|
||||
/**
|
||||
* Porter Stemmer
|
||||
*/
|
||||
var Stemmer = function() {
|
||||
|
||||
var step2list = {
|
||||
ational: 'ate',
|
||||
tional: 'tion',
|
||||
enci: 'ence',
|
||||
anci: 'ance',
|
||||
izer: 'ize',
|
||||
bli: 'ble',
|
||||
alli: 'al',
|
||||
entli: 'ent',
|
||||
eli: 'e',
|
||||
ousli: 'ous',
|
||||
ization: 'ize',
|
||||
ation: 'ate',
|
||||
ator: 'ate',
|
||||
alism: 'al',
|
||||
iveness: 'ive',
|
||||
fulness: 'ful',
|
||||
ousness: 'ous',
|
||||
aliti: 'al',
|
||||
iviti: 'ive',
|
||||
biliti: 'ble',
|
||||
logi: 'log'
|
||||
};
|
||||
|
||||
var step3list = {
|
||||
icate: 'ic',
|
||||
ative: '',
|
||||
alize: 'al',
|
||||
iciti: 'ic',
|
||||
ical: 'ic',
|
||||
ful: '',
|
||||
ness: ''
|
||||
};
|
||||
|
||||
var c = "[^aeiou]"; // consonant
|
||||
var v = "[aeiouy]"; // vowel
|
||||
var C = c + "[^aeiouy]*"; // consonant sequence
|
||||
var V = v + "[aeiou]*"; // vowel sequence
|
||||
|
||||
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
|
||||
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
|
||||
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
|
||||
var s_v = "^(" + C + ")?" + v; // vowel in stem
|
||||
|
||||
this.stemWord = function (w) {
|
||||
var stem;
|
||||
var suffix;
|
||||
var firstch;
|
||||
var origword = w;
|
||||
|
||||
if (w.length < 3)
|
||||
return w;
|
||||
|
||||
var re;
|
||||
var re2;
|
||||
var re3;
|
||||
var re4;
|
||||
|
||||
firstch = w.substr(0,1);
|
||||
if (firstch == "y")
|
||||
w = firstch.toUpperCase() + w.substr(1);
|
||||
|
||||
// Step 1a
|
||||
re = /^(.+?)(ss|i)es$/;
|
||||
re2 = /^(.+?)([^s])s$/;
|
||||
|
||||
if (re.test(w))
|
||||
w = w.replace(re,"$1$2");
|
||||
else if (re2.test(w))
|
||||
w = w.replace(re2,"$1$2");
|
||||
|
||||
// Step 1b
|
||||
re = /^(.+?)eed$/;
|
||||
re2 = /^(.+?)(ed|ing)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
re = new RegExp(mgr0);
|
||||
if (re.test(fp[1])) {
|
||||
re = /.$/;
|
||||
w = w.replace(re,"");
|
||||
}
|
||||
}
|
||||
else if (re2.test(w)) {
|
||||
var fp = re2.exec(w);
|
||||
stem = fp[1];
|
||||
re2 = new RegExp(s_v);
|
||||
if (re2.test(stem)) {
|
||||
w = stem;
|
||||
re2 = /(at|bl|iz)$/;
|
||||
re3 = new RegExp("([^aeiouylsz])\\1$");
|
||||
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
|
||||
if (re2.test(w))
|
||||
w = w + "e";
|
||||
else if (re3.test(w)) {
|
||||
re = /.$/;
|
||||
w = w.replace(re,"");
|
||||
}
|
||||
else if (re4.test(w))
|
||||
w = w + "e";
|
||||
}
|
||||
}
|
||||
|
||||
// Step 1c
|
||||
re = /^(.+?)y$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
re = new RegExp(s_v);
|
||||
if (re.test(stem))
|
||||
w = stem + "i";
|
||||
}
|
||||
|
||||
// Step 2
|
||||
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
suffix = fp[2];
|
||||
re = new RegExp(mgr0);
|
||||
if (re.test(stem))
|
||||
w = stem + step2list[suffix];
|
||||
}
|
||||
|
||||
// Step 3
|
||||
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
suffix = fp[2];
|
||||
re = new RegExp(mgr0);
|
||||
if (re.test(stem))
|
||||
w = stem + step3list[suffix];
|
||||
}
|
||||
|
||||
// Step 4
|
||||
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
|
||||
re2 = /^(.+?)(s|t)(ion)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
re = new RegExp(mgr1);
|
||||
if (re.test(stem))
|
||||
w = stem;
|
||||
}
|
||||
else if (re2.test(w)) {
|
||||
var fp = re2.exec(w);
|
||||
stem = fp[1] + fp[2];
|
||||
re2 = new RegExp(mgr1);
|
||||
if (re2.test(stem))
|
||||
w = stem;
|
||||
}
|
||||
|
||||
// Step 5
|
||||
re = /^(.+?)e$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
re = new RegExp(mgr1);
|
||||
re2 = new RegExp(meq1);
|
||||
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
|
||||
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
|
||||
w = stem;
|
||||
}
|
||||
re = /ll$/;
|
||||
re2 = new RegExp(mgr1);
|
||||
if (re.test(w) && re2.test(w)) {
|
||||
re = /.$/;
|
||||
w = w.replace(re,"");
|
||||
}
|
||||
|
||||
// and turn initial Y back to y
|
||||
if (firstch == "y")
|
||||
w = firstch.toLowerCase() + w.substr(1);
|
||||
return w;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var splitChars = (function() {
|
||||
var result = {};
|
||||
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
|
||||
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
|
||||
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
|
||||
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
|
||||
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
|
||||
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
|
||||
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
|
||||
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
|
||||
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
|
||||
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
|
||||
var i, j, start, end;
|
||||
for (i = 0; i < singles.length; i++) {
|
||||
result[singles[i]] = true;
|
||||
}
|
||||
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
|
||||
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
|
||||
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
|
||||
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
|
||||
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
|
||||
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
|
||||
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
|
||||
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
|
||||
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
|
||||
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
|
||||
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
|
||||
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
|
||||
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
|
||||
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
|
||||
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
|
||||
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
|
||||
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
|
||||
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
|
||||
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
|
||||
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
|
||||
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
|
||||
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
|
||||
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
|
||||
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
|
||||
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
|
||||
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
|
||||
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
|
||||
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
|
||||
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
|
||||
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
|
||||
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
|
||||
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
|
||||
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
|
||||
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
|
||||
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
|
||||
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
|
||||
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
|
||||
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
|
||||
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
|
||||
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
|
||||
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
|
||||
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
|
||||
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
|
||||
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
|
||||
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
|
||||
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
|
||||
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
|
||||
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
|
||||
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
|
||||
for (i = 0; i < ranges.length; i++) {
|
||||
start = ranges[i][0];
|
||||
end = ranges[i][1];
|
||||
for (j = start; j <= end; j++) {
|
||||
result[j] = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
|
||||
function splitQuery(query) {
|
||||
var result = [];
|
||||
var start = -1;
|
||||
for (var i = 0; i < query.length; i++) {
|
||||
if (splitChars[query.charCodeAt(i)]) {
|
||||
if (start !== -1) {
|
||||
result.push(query.slice(start, i));
|
||||
start = -1;
|
||||
}
|
||||
} else if (start === -1) {
|
||||
start = i;
|
||||
}
|
||||
}
|
||||
if (start !== -1) {
|
||||
result.push(query.slice(start));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 90 B |
After Width: | Height: | Size: 90 B |
@ -0,0 +1,82 @@
|
||||
pre { line-height: 125%; }
|
||||
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
.highlight .hll { background-color: #ffffcc }
|
||||
.highlight { background: #f8f8f8; }
|
||||
.highlight .c { color: #8f5902; font-style: italic } /* Comment */
|
||||
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
|
||||
.highlight .g { color: #000000 } /* Generic */
|
||||
.highlight .k { color: #204a87; font-weight: bold } /* Keyword */
|
||||
.highlight .l { color: #000000 } /* Literal */
|
||||
.highlight .n { color: #000000 } /* Name */
|
||||
.highlight .o { color: #ce5c00; font-weight: bold } /* Operator */
|
||||
.highlight .x { color: #000000 } /* Other */
|
||||
.highlight .p { color: #000000; font-weight: bold } /* Punctuation */
|
||||
.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */
|
||||
.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
|
||||
.highlight .cp { color: #8f5902; font-style: italic } /* Comment.Preproc */
|
||||
.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */
|
||||
.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */
|
||||
.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
|
||||
.highlight .gd { color: #a40000 } /* Generic.Deleted */
|
||||
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
|
||||
.highlight .gr { color: #ef2929 } /* Generic.Error */
|
||||
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
||||
.highlight .go { color: #000000; font-style: italic } /* Generic.Output */
|
||||
.highlight .gp { color: #8f5902 } /* Generic.Prompt */
|
||||
.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */
|
||||
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||
.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
|
||||
.highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
|
||||
.highlight .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */
|
||||
.highlight .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */
|
||||
.highlight .ld { color: #000000 } /* Literal.Date */
|
||||
.highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */
|
||||
.highlight .s { color: #4e9a06 } /* Literal.String */
|
||||
.highlight .na { color: #c4a000 } /* Name.Attribute */
|
||||
.highlight .nb { color: #204a87 } /* Name.Builtin */
|
||||
.highlight .nc { color: #000000 } /* Name.Class */
|
||||
.highlight .no { color: #000000 } /* Name.Constant */
|
||||
.highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
|
||||
.highlight .ni { color: #ce5c00 } /* Name.Entity */
|
||||
.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */
|
||||
.highlight .nf { color: #000000 } /* Name.Function */
|
||||
.highlight .nl { color: #f57900 } /* Name.Label */
|
||||
.highlight .nn { color: #000000 } /* Name.Namespace */
|
||||
.highlight .nx { color: #000000 } /* Name.Other */
|
||||
.highlight .py { color: #000000 } /* Name.Property */
|
||||
.highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */
|
||||
.highlight .nv { color: #000000 } /* Name.Variable */
|
||||
.highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */
|
||||
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
|
||||
.highlight .mb { color: #0000cf; font-weight: bold } /* Literal.Number.Bin */
|
||||
.highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */
|
||||
.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */
|
||||
.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #4e9a06 } /* Literal.String.Char */
|
||||
.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */
|
||||
.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */
|
||||
.highlight .se { color: #4e9a06 } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #4e9a06 } /* Literal.String.Other */
|
||||
.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */
|
||||
.highlight .fm { color: #000000 } /* Name.Function.Magic */
|
||||
.highlight .vc { color: #000000 } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #000000 } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #000000 } /* Name.Variable.Instance */
|
||||
.highlight .vm { color: #000000 } /* Name.Variable.Magic */
|
||||
.highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
|
@ -0,0 +1,522 @@
|
||||
/*
|
||||
* searchtools.js
|
||||
* ~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx JavaScript utilities for the full-text search.
|
||||
*
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
if (!Scorer) {
|
||||
/**
|
||||
* Simple result scoring code.
|
||||
*/
|
||||
var Scorer = {
|
||||
// Implement the following function to further tweak the score for each result
|
||||
// The function takes a result array [filename, title, anchor, descr, score]
|
||||
// and returns the new score.
|
||||
/*
|
||||
score: function(result) {
|
||||
return result[4];
|
||||
},
|
||||
*/
|
||||
|
||||
// query matches the full name of an object
|
||||
objNameMatch: 11,
|
||||
// or matches in the last dotted part of the object name
|
||||
objPartialMatch: 6,
|
||||
// Additive scores depending on the priority of the object
|
||||
objPrio: {0: 15, // used to be importantResults
|
||||
1: 5, // used to be objectResults
|
||||
2: -5}, // used to be unimportantResults
|
||||
// Used when the priority is not in the mapping.
|
||||
objPrioDefault: 0,
|
||||
|
||||
// query found in title
|
||||
title: 15,
|
||||
partialTitle: 7,
|
||||
// query found in terms
|
||||
term: 5,
|
||||
partialTerm: 2
|
||||
};
|
||||
}
|
||||
|
||||
if (!splitQuery) {
|
||||
function splitQuery(query) {
|
||||
return query.split(/\s+/);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Module
|
||||
*/
|
||||
var Search = {
|
||||
|
||||
_index : null,
|
||||
_queued_query : null,
|
||||
_pulse_status : -1,
|
||||
|
||||
htmlToText : function(htmlString) {
|
||||
var virtualDocument = document.implementation.createHTMLDocument('virtual');
|
||||
var htmlElement = $(htmlString, virtualDocument);
|
||||
htmlElement.find('.headerlink').remove();
|
||||
docContent = htmlElement.find('[role=main]')[0];
|
||||
if(docContent === undefined) {
|
||||
console.warn("Content block not found. Sphinx search tries to obtain it " +
|
||||
"via '[role=main]'. Could you check your theme or template.");
|
||||
return "";
|
||||
}
|
||||
return docContent.textContent || docContent.innerText;
|
||||
},
|
||||
|
||||
init : function() {
|
||||
var params = $.getQueryParameters();
|
||||
if (params.q) {
|
||||
var query = params.q[0];
|
||||
$('input[name="q"]')[0].value = query;
|
||||
this.performSearch(query);
|
||||
}
|
||||
},
|
||||
|
||||
loadIndex : function(url) {
|
||||
$.ajax({type: "GET", url: url, data: null,
|
||||
dataType: "script", cache: true,
|
||||
complete: function(jqxhr, textstatus) {
|
||||
if (textstatus != "success") {
|
||||
document.getElementById("searchindexloader").src = url;
|
||||
}
|
||||
}});
|
||||
},
|
||||
|
||||
setIndex : function(index) {
|
||||
var q;
|
||||
this._index = index;
|
||||
if ((q = this._queued_query) !== null) {
|
||||
this._queued_query = null;
|
||||
Search.query(q);
|
||||
}
|
||||
},
|
||||
|
||||
hasIndex : function() {
|
||||
return this._index !== null;
|
||||
},
|
||||
|
||||
deferQuery : function(query) {
|
||||
this._queued_query = query;
|
||||
},
|
||||
|
||||
stopPulse : function() {
|
||||
this._pulse_status = 0;
|
||||
},
|
||||
|
||||
startPulse : function() {
|
||||
if (this._pulse_status >= 0)
|
||||
return;
|
||||
function pulse() {
|
||||
var i;
|
||||
Search._pulse_status = (Search._pulse_status + 1) % 4;
|
||||
var dotString = '';
|
||||
for (i = 0; i < Search._pulse_status; i++)
|
||||
dotString += '.';
|
||||
Search.dots.text(dotString);
|
||||
if (Search._pulse_status > -1)
|
||||
window.setTimeout(pulse, 500);
|
||||
}
|
||||
pulse();
|
||||
},
|
||||
|
||||
/**
|
||||
* perform a search for something (or wait until index is loaded)
|
||||
*/
|
||||
performSearch : function(query) {
|
||||
// create the required interface elements
|
||||
this.out = $('#search-results');
|
||||
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
|
||||
this.dots = $('<span></span>').appendTo(this.title);
|
||||
this.status = $('<p class="search-summary"> </p>').appendTo(this.out);
|
||||
this.output = $('<ul class="search"/>').appendTo(this.out);
|
||||
|
||||
$('#search-progress').text(_('Preparing search...'));
|
||||
this.startPulse();
|
||||
|
||||
// index already loaded, the browser was quick!
|
||||
if (this.hasIndex())
|
||||
this.query(query);
|
||||
else
|
||||
this.deferQuery(query);
|
||||
},
|
||||
|
||||
/**
|
||||
* execute search (requires search index to be loaded)
|
||||
*/
|
||||
query : function(query) {
|
||||
var i;
|
||||
|
||||
// stem the searchterms and add them to the correct list
|
||||
var stemmer = new Stemmer();
|
||||
var searchterms = [];
|
||||
var excluded = [];
|
||||
var hlterms = [];
|
||||
var tmp = splitQuery(query);
|
||||
var objectterms = [];
|
||||
for (i = 0; i < tmp.length; i++) {
|
||||
if (tmp[i] !== "") {
|
||||
objectterms.push(tmp[i].toLowerCase());
|
||||
}
|
||||
|
||||
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i] === "") {
|
||||
// skip this "word"
|
||||
continue;
|
||||
}
|
||||
// stem the word
|
||||
var word = stemmer.stemWord(tmp[i].toLowerCase());
|
||||
// prevent stemmer from cutting word smaller than two chars
|
||||
if(word.length < 3 && tmp[i].length >= 3) {
|
||||
word = tmp[i];
|
||||
}
|
||||
var toAppend;
|
||||
// select the correct list
|
||||
if (word[0] == '-') {
|
||||
toAppend = excluded;
|
||||
word = word.substr(1);
|
||||
}
|
||||
else {
|
||||
toAppend = searchterms;
|
||||
hlterms.push(tmp[i].toLowerCase());
|
||||
}
|
||||
// only add if not already in the list
|
||||
if (!$u.contains(toAppend, word))
|
||||
toAppend.push(word);
|
||||
}
|
||||
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
|
||||
|
||||
// console.debug('SEARCH: searching for:');
|
||||
// console.info('required: ', searchterms);
|
||||
// console.info('excluded: ', excluded);
|
||||
|
||||
// prepare search
|
||||
var terms = this._index.terms;
|
||||
var titleterms = this._index.titleterms;
|
||||
|
||||
// array of [filename, title, anchor, descr, score]
|
||||
var results = [];
|
||||
$('#search-progress').empty();
|
||||
|
||||
// lookup as object
|
||||
for (i = 0; i < objectterms.length; i++) {
|
||||
var others = [].concat(objectterms.slice(0, i),
|
||||
objectterms.slice(i+1, objectterms.length));
|
||||
results = results.concat(this.performObjectSearch(objectterms[i], others));
|
||||
}
|
||||
|
||||
// lookup as search terms in fulltext
|
||||
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
|
||||
|
||||
// let the scorer override scores with a custom scoring function
|
||||
if (Scorer.score) {
|
||||
for (i = 0; i < results.length; i++)
|
||||
results[i][4] = Scorer.score(results[i]);
|
||||
}
|
||||
|
||||
// now sort the results by score (in opposite order of appearance, since the
|
||||
// display function below uses pop() to retrieve items) and then
|
||||
// alphabetically
|
||||
results.sort(function(a, b) {
|
||||
var left = a[4];
|
||||
var right = b[4];
|
||||
if (left > right) {
|
||||
return 1;
|
||||
} else if (left < right) {
|
||||
return -1;
|
||||
} else {
|
||||
// same score: sort alphabetically
|
||||
left = a[1].toLowerCase();
|
||||
right = b[1].toLowerCase();
|
||||
return (left > right) ? -1 : ((left < right) ? 1 : 0);
|
||||
}
|
||||
});
|
||||
|
||||
// for debugging
|
||||
//Search.lastresults = results.slice(); // a copy
|
||||
//console.info('search results:', Search.lastresults);
|
||||
|
||||
// print the results
|
||||
var resultCount = results.length;
|
||||
function displayNextItem() {
|
||||
// results left, load the summary and display it
|
||||
if (results.length) {
|
||||
var item = results.pop();
|
||||
var listItem = $('<li></li>');
|
||||
var requestUrl = "";
|
||||
var linkUrl = "";
|
||||
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
|
||||
// dirhtml builder
|
||||
var dirname = item[0] + '/';
|
||||
if (dirname.match(/\/index\/$/)) {
|
||||
dirname = dirname.substring(0, dirname.length-6);
|
||||
} else if (dirname == 'index/') {
|
||||
dirname = '';
|
||||
}
|
||||
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;
|
||||
linkUrl = requestUrl;
|
||||
|
||||
} else {
|
||||
// normal html builders
|
||||
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||
}
|
||||
listItem.append($('<a/>').attr('href',
|
||||
linkUrl +
|
||||
highlightstring + item[2]).html(item[1]));
|
||||
if (item[3]) {
|
||||
listItem.append($('<span> (' + item[3] + ')</span>'));
|
||||
Search.output.append(listItem);
|
||||
setTimeout(function() {
|
||||
displayNextItem();
|
||||
}, 5);
|
||||
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
|
||||
$.ajax({url: requestUrl,
|
||||
dataType: "text",
|
||||
complete: function(jqxhr, textstatus) {
|
||||
var data = jqxhr.responseText;
|
||||
if (data !== '' && data !== undefined) {
|
||||
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
|
||||
}
|
||||
Search.output.append(listItem);
|
||||
setTimeout(function() {
|
||||
displayNextItem();
|
||||
}, 5);
|
||||
}});
|
||||
} else {
|
||||
// no source available, just display title
|
||||
Search.output.append(listItem);
|
||||
setTimeout(function() {
|
||||
displayNextItem();
|
||||
}, 5);
|
||||
}
|
||||
}
|
||||
// search finished, update title and status message
|
||||
else {
|
||||
Search.stopPulse();
|
||||
Search.title.text(_('Search Results'));
|
||||
if (!resultCount)
|
||||
Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
|
||||
else
|
||||
Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
|
||||
Search.status.fadeIn(500);
|
||||
}
|
||||
}
|
||||
displayNextItem();
|
||||
},
|
||||
|
||||
/**
|
||||
* search for object names
|
||||
*/
|
||||
performObjectSearch : function(object, otherterms) {
|
||||
var filenames = this._index.filenames;
|
||||
var docnames = this._index.docnames;
|
||||
var objects = this._index.objects;
|
||||
var objnames = this._index.objnames;
|
||||
var titles = this._index.titles;
|
||||
|
||||
var i;
|
||||
var results = [];
|
||||
|
||||
for (var prefix in objects) {
|
||||
for (var name in objects[prefix]) {
|
||||
var fullname = (prefix ? prefix + '.' : '') + name;
|
||||
var fullnameLower = fullname.toLowerCase()
|
||||
if (fullnameLower.indexOf(object) > -1) {
|
||||
var score = 0;
|
||||
var parts = fullnameLower.split('.');
|
||||
// check for different match types: exact matches of full name or
|
||||
// "last name" (i.e. last dotted part)
|
||||
if (fullnameLower == object || parts[parts.length - 1] == object) {
|
||||
score += Scorer.objNameMatch;
|
||||
// matches in last name
|
||||
} else if (parts[parts.length - 1].indexOf(object) > -1) {
|
||||
score += Scorer.objPartialMatch;
|
||||
}
|
||||
var match = objects[prefix][name];
|
||||
var objname = objnames[match[1]][2];
|
||||
var title = titles[match[0]];
|
||||
// If more than one term searched for, we require other words to be
|
||||
// found in the name/title/description
|
||||
if (otherterms.length > 0) {
|
||||
var haystack = (prefix + ' ' + name + ' ' +
|
||||
objname + ' ' + title).toLowerCase();
|
||||
var allfound = true;
|
||||
for (i = 0; i < otherterms.length; i++) {
|
||||
if (haystack.indexOf(otherterms[i]) == -1) {
|
||||
allfound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!allfound) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
var descr = objname + _(', in ') + title;
|
||||
|
||||
var anchor = match[3];
|
||||
if (anchor === '')
|
||||
anchor = fullname;
|
||||
else if (anchor == '-')
|
||||
anchor = objnames[match[1]][1] + '-' + fullname;
|
||||
// add custom score for some objects according to scorer
|
||||
if (Scorer.objPrio.hasOwnProperty(match[2])) {
|
||||
score += Scorer.objPrio[match[2]];
|
||||
} else {
|
||||
score += Scorer.objPrioDefault;
|
||||
}
|
||||
results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
},
|
||||
|
||||
/**
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
|
||||
*/
|
||||
escapeRegExp : function(string) {
|
||||
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
},
|
||||
|
||||
/**
|
||||
* search for full-text terms in the index
|
||||
*/
|
||||
performTermsSearch : function(searchterms, excluded, terms, titleterms) {
|
||||
var docnames = this._index.docnames;
|
||||
var filenames = this._index.filenames;
|
||||
var titles = this._index.titles;
|
||||
|
||||
var i, j, file;
|
||||
var fileMap = {};
|
||||
var scoreMap = {};
|
||||
var results = [];
|
||||
|
||||
// perform the search on the required terms
|
||||
for (i = 0; i < searchterms.length; i++) {
|
||||
var word = searchterms[i];
|
||||
var files = [];
|
||||
var _o = [
|
||||
{files: terms[word], score: Scorer.term},
|
||||
{files: titleterms[word], score: Scorer.title}
|
||||
];
|
||||
// add support for partial matches
|
||||
if (word.length > 2) {
|
||||
var word_regex = this.escapeRegExp(word);
|
||||
for (var w in terms) {
|
||||
if (w.match(word_regex) && !terms[word]) {
|
||||
_o.push({files: terms[w], score: Scorer.partialTerm})
|
||||
}
|
||||
}
|
||||
for (var w in titleterms) {
|
||||
if (w.match(word_regex) && !titleterms[word]) {
|
||||
_o.push({files: titleterms[w], score: Scorer.partialTitle})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no match but word was a required one
|
||||
if ($u.every(_o, function(o){return o.files === undefined;})) {
|
||||
break;
|
||||
}
|
||||
// found search word in contents
|
||||
$u.each(_o, function(o) {
|
||||
var _files = o.files;
|
||||
if (_files === undefined)
|
||||
return
|
||||
|
||||
if (_files.length === undefined)
|
||||
_files = [_files];
|
||||
files = files.concat(_files);
|
||||
|
||||
// set score for the word in each file to Scorer.term
|
||||
for (j = 0; j < _files.length; j++) {
|
||||
file = _files[j];
|
||||
if (!(file in scoreMap))
|
||||
scoreMap[file] = {};
|
||||
scoreMap[file][word] = o.score;
|
||||
}
|
||||
});
|
||||
|
||||
// create the mapping
|
||||
for (j = 0; j < files.length; j++) {
|
||||
file = files[j];
|
||||
if (file in fileMap && fileMap[file].indexOf(word) === -1)
|
||||
fileMap[file].push(word);
|
||||
else
|
||||
fileMap[file] = [word];
|
||||
}
|
||||
}
|
||||
|
||||
// now check if the files don't contain excluded terms
|
||||
for (file in fileMap) {
|
||||
var valid = true;
|
||||
|
||||
// check if all requirements are matched
|
||||
var filteredTermCount = // as search terms with length < 3 are discarded: ignore
|
||||
searchterms.filter(function(term){return term.length > 2}).length
|
||||
if (
|
||||
fileMap[file].length != searchterms.length &&
|
||||
fileMap[file].length != filteredTermCount
|
||||
) continue;
|
||||
|
||||
// ensure that none of the excluded terms is in the search result
|
||||
for (i = 0; i < excluded.length; i++) {
|
||||
if (terms[excluded[i]] == file ||
|
||||
titleterms[excluded[i]] == file ||
|
||||
$u.contains(terms[excluded[i]] || [], file) ||
|
||||
$u.contains(titleterms[excluded[i]] || [], file)) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we have still a valid result we can add it to the result list
|
||||
if (valid) {
|
||||
// select one (max) score for the file.
|
||||
// for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
|
||||
var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
|
||||
results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
},
|
||||
|
||||
/**
|
||||
* helper function to return a node containing the
|
||||
* search summary for a given text. keywords is a list
|
||||
* of stemmed words, hlwords is the list of normal, unstemmed
|
||||
* words. the first one is used to find the occurrence, the
|
||||
* latter for highlighting it.
|
||||
*/
|
||||
makeSearchSummary : function(htmlText, keywords, hlwords) {
|
||||
var text = Search.htmlToText(htmlText);
|
||||
var textLower = text.toLowerCase();
|
||||
var start = 0;
|
||||
$.each(keywords, function() {
|
||||
var i = textLower.indexOf(this.toLowerCase());
|
||||
if (i > -1)
|
||||
start = i;
|
||||
});
|
||||
start = Math.max(start - 120, 0);
|
||||
var excerpt = ((start > 0) ? '...' : '') +
|
||||
$.trim(text.substr(start, 240)) +
|
||||
((start + 240 - text.length) ? '...' : '');
|
||||
var rv = $('<div class="context"></div>').text(excerpt);
|
||||
$.each(hlwords, function() {
|
||||
rv = rv.highlightText(this, 'highlighted');
|
||||
});
|
||||
return rv;
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
Search.init();
|
||||
});
|
@ -0,0 +1,18 @@
|
||||
var initTriggerNavBar=()=>{if($(window).width()<768){$("#navbar-toggler").trigger("click")}}
|
||||
var scrollToActive=()=>{var navbar=document.getElementById('site-navigation')
|
||||
var active_pages=navbar.querySelectorAll(".active")
|
||||
var active_page=active_pages[active_pages.length-1]
|
||||
if(active_page!==undefined&&active_page.offsetTop>($(window).height()*.5)){navbar.scrollTop=active_page.offsetTop-($(window).height()*.2)}}
|
||||
var sbRunWhenDOMLoaded=cb=>{if(document.readyState!='loading'){cb()}else if(document.addEventListener){document.addEventListener('DOMContentLoaded',cb)}else{document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete')cb()})}}
|
||||
function toggleFullScreen(){var navToggler=$("#navbar-toggler");if(!document.fullscreenElement){document.documentElement.requestFullscreen();if(!navToggler.hasClass("collapsed")){navToggler.click();}}else{if(document.exitFullscreen){document.exitFullscreen();if(navToggler.hasClass("collapsed")){navToggler.click();}}}}
|
||||
var initTooltips=()=>{$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip();});}
|
||||
var initTocHide=()=>{var scrollTimeout;var throttle=200;var tocHeight=$("#bd-toc-nav").outerHeight(true)+$(".bd-toc").outerHeight(true);var hideTocAfter=tocHeight+200;var checkTocScroll=function(){var margin_content=$(".margin, .tag_margin, .full-width, .full_width, .tag_full-width, .tag_full_width, .sidebar, .tag_sidebar, .popout, .tag_popout");margin_content.each((index,item)=>{var topOffset=$(item).offset().top-$(window).scrollTop();var bottomOffset=topOffset+$(item).outerHeight(true);var topOverlaps=((topOffset>=0)&&(topOffset<hideTocAfter));var bottomOverlaps=((bottomOffset>=0)&&(bottomOffset<hideTocAfter));var removeToc=(topOverlaps||bottomOverlaps);if(removeToc&&window.pageYOffset>20){$("div.bd-toc").removeClass("show")
|
||||
return false}else{$("div.bd-toc").addClass("show")};})};var manageScrolledClassOnBody=function(){if(window.scrollY>0){document.body.classList.add("scrolled");}else{document.body.classList.remove("scrolled");}}
|
||||
$(window).on('scroll',function(){if(!scrollTimeout){scrollTimeout=setTimeout(function(){checkTocScroll();manageScrolledClassOnBody();scrollTimeout=null;},throttle);}});}
|
||||
var initThebeSBT=()=>{var title=$("div.section h1")[0]
|
||||
if(!$(title).next().hasClass("thebe-launch-button")){$("<button class='thebe-launch-button'></button>").insertAfter($(title))}
|
||||
initThebe();}
|
||||
sbRunWhenDOMLoaded(initTooltips)
|
||||
sbRunWhenDOMLoaded(initTriggerNavBar)
|
||||
sbRunWhenDOMLoaded(scrollToActive)
|
||||
sbRunWhenDOMLoaded(initTocHide)
|
@ -0,0 +1,34 @@
|
||||
Font Awesome Free License
|
||||
-------------------------
|
||||
|
||||
Font Awesome Free is free, open source, and GPL friendly. You can use it for
|
||||
commercial projects, open source projects, or really almost whatever you want.
|
||||
Full Font Awesome Free license: https://fontawesome.com/license/free.
|
||||
|
||||
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
|
||||
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
|
||||
packaged as SVG and JS file types.
|
||||
|
||||
# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
|
||||
In the Font Awesome Free download, the SIL OFL license applies to all icons
|
||||
packaged as web and desktop font files.
|
||||
|
||||
# Code: MIT License (https://opensource.org/licenses/MIT)
|
||||
In the Font Awesome Free download, the MIT license applies to all non-font and
|
||||
non-icon files.
|
||||
|
||||
# Attribution
|
||||
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
|
||||
Awesome Free files already contain embedded comments with sufficient
|
||||
attribution, so you shouldn't need to do anything additional when using these
|
||||
files normally.
|
||||
|
||||
We've kept attribution comments terse, so we ask that you do not actively work
|
||||
to remove them from files, especially code. They're a great way for folks to
|
||||
learn about Font Awesome.
|
||||
|
||||
# Brand Icons
|
||||
All brand icons are trademarks of their respective owners. The use of these
|
||||
trademarks does not indicate endorsement of the trademark holder by Font
|
||||
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
|
||||
to represent the company, product, or service to which they refer.**
|
After Width: | Height: | Size: 699 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 876 KiB |
@ -0,0 +1,25 @@
|
||||
<!-- these macros are generated by "yarn build:production". do not edit by hand. -->
|
||||
{% macro head_pre_icons() %}
|
||||
<link rel="stylesheet"
|
||||
href="{{ pathto('_static/vendor/fontawesome/5.13.0/css/all.min.css', 1) }}">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="{{ pathto('_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2', 1) }}">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="{{ pathto('_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2', 1) }}">
|
||||
{% endmacro %}
|
||||
|
||||
{% macro head_pre_fonts() %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro head_pre_bootstrap() %}
|
||||
<link href="{{ pathto('_static/css/theme.css', 1) }}" rel="stylesheet" />
|
||||
<link href="{{ pathto('_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css', 1) }}" rel="stylesheet" />
|
||||
{% endmacro %}
|
||||
|
||||
{% macro head_js_preload() %}
|
||||
<link rel="preload" as="script" href="{{ pathto('_static/js/index.1c5a1a01449ed65a7b51.js', 1) }}">
|
||||
{% endmacro %}
|
||||
|
||||
{% macro body_post() %}
|
||||
<script src="{{ pathto('_static/js/index.1c5a1a01449ed65a7b51.js', 1) }}"></script>
|
||||
{% endmacro %}
|
@ -0,0 +1,852 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>2. Data Format — UnitCommitment.jl<br/><small>0.2</small></title>
|
||||
|
||||
<link href="../_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="../_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="../_static/vendor/fontawesome/5.13.0/css/all.min.css">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
|
||||
|
||||
<link rel="preload" as="script" href="../_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
|
||||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<link rel="index" title="Index" href="../genindex/" />
|
||||
<link rel="search" title="Search" href="../search/" />
|
||||
<link rel="next" title="3. Instances" href="../instances/" />
|
||||
<link rel="prev" title="1. Usage" href="../usage/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
|
||||
<div class="container-fluid" id="banner"></div>
|
||||
|
||||
|
||||
|
||||
<div class="container-xl">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
|
||||
|
||||
<div class="navbar-brand-box">
|
||||
<a class="navbar-brand text-wrap" href="../">
|
||||
|
||||
|
||||
<h1 class="site-logo" id="site-title">UnitCommitment.jl<br/><small>0.2</small></h1>
|
||||
|
||||
</a>
|
||||
</div><form class="bd-search d-flex align-items-center" action="../search/" method="get">
|
||||
<i class="icon fas fa-search"></i>
|
||||
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
|
||||
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
|
||||
<div class="bd-toc-item active">
|
||||
<ul class="current nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../usage/">
|
||||
<span class="sectnum">
|
||||
1.
|
||||
</span>
|
||||
Usage
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1 current active">
|
||||
<a class="current reference internal" href="#">
|
||||
<span class="sectnum">
|
||||
2.
|
||||
</span>
|
||||
Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../instances/">
|
||||
<span class="sectnum">
|
||||
3.
|
||||
</span>
|
||||
Instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../model/">
|
||||
<span class="sectnum">
|
||||
4.
|
||||
</span>
|
||||
JuMP Model
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav> <!-- To handle the deprecated key -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
|
||||
|
||||
<div class="topbar container-xl fixed-top">
|
||||
<div class="topbar-contents row">
|
||||
<div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div>
|
||||
<div class="col pl-md-4 topbar-main">
|
||||
|
||||
<button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
|
||||
data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
|
||||
aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
|
||||
title="Toggle navigation" data-toggle="tooltip" data-placement="left">
|
||||
<i class="fas fa-bars"></i>
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn" aria-label="Download this page"><i
|
||||
class="fas fa-download"></i></button>
|
||||
|
||||
<div class="dropdown-buttons">
|
||||
<!-- ipynb file if we had a myst markdown file -->
|
||||
|
||||
<!-- Download raw file -->
|
||||
<a class="dropdown-buttons" href="../_sources/format.md.txt"><button type="button"
|
||||
class="btn btn-secondary topbarbtn" title="Download source file" data-toggle="tooltip"
|
||||
data-placement="left">.md</button></a>
|
||||
<!-- Download PDF via print -->
|
||||
<button type="button" id="download-print" class="btn btn-secondary topbarbtn" title="Print to PDF"
|
||||
onClick="window.print()" data-toggle="tooltip" data-placement="left">.pdf</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Source interaction buttons -->
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
|
||||
aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
|
||||
<div class="dropdown-buttons sourcebuttons">
|
||||
<a class="repository-button"
|
||||
href="https://github.com/ANL-CEEESA/UnitCommitment.jl/"><button type="button" class="btn btn-secondary topbarbtn"
|
||||
data-toggle="tooltip" data-placement="left" title="Source repository"><i
|
||||
class="fab fa-github"></i>repository</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Full screen (wrap in <a> to have style consistency -->
|
||||
|
||||
<a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
|
||||
data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode"
|
||||
title="Fullscreen mode"><i
|
||||
class="fas fa-expand"></i></button></a>
|
||||
|
||||
<!-- Launch buttons -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
|
||||
<div class="tocsection onthispage pt-5 pb-3">
|
||||
<i class="fas fa-list"></i> Contents
|
||||
</div>
|
||||
<nav id="bd-toc-nav">
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#input-data-format">
|
||||
<span class="sectnum">
|
||||
2.1.
|
||||
</span>
|
||||
Input Data Format
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#parameters">
|
||||
Parameters
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#example">
|
||||
Example
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#buses">
|
||||
Buses
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#id1">
|
||||
Example
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#generators">
|
||||
Generators
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#production-costs-and-limits">
|
||||
Production costs and limits
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#additional-remarks">
|
||||
Additional remarks:
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#id2">
|
||||
Example
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#price-sensitive-loads">
|
||||
Price-sensitive loads
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#id3">
|
||||
Example
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#transmission-lines">
|
||||
Transmission Lines
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#id4">
|
||||
Example
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#reserves">
|
||||
Reserves
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#example-1">
|
||||
Example 1
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#contingencies">
|
||||
Contingencies
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#id5">
|
||||
Example
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#id6">
|
||||
Additional remarks
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h4 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#time-series-parameters">
|
||||
Time series parameters
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#output-data-format">
|
||||
<span class="sectnum">
|
||||
2.2.
|
||||
</span>
|
||||
Output Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#current-limitations">
|
||||
<span class="sectnum">
|
||||
2.3.
|
||||
</span>
|
||||
Current limitations
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<div>
|
||||
|
||||
<div class="section" id="data-format">
|
||||
<h1><span class="sectnum">2.</span> Data Format<a class="headerlink" href="#data-format" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="input-data-format">
|
||||
<h2><span class="sectnum">2.1.</span> Input Data Format<a class="headerlink" href="#input-data-format" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Instances are specified by JSON files containing the following main sections:</p>
|
||||
<ul class="simple">
|
||||
<li><p>Parameters</p></li>
|
||||
<li><p>Buses</p></li>
|
||||
<li><p>Generators</p></li>
|
||||
<li><p>Price-sensitive loads</p></li>
|
||||
<li><p>Transmission lines</p></li>
|
||||
<li><p>Reserves</p></li>
|
||||
<li><p>Contingencies</p></li>
|
||||
</ul>
|
||||
<p>Each section is described in detail below. For a complete example, see <a class="reference external" href="https://github.com/ANL-CEEESA/UnitCommitment.jl/tree/dev/instances/matpower/case14">case14</a>.</p>
|
||||
<div class="section" id="parameters">
|
||||
<h3>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes system-wide parameters, such as power balance penalty, and optimization parameters, such as the length of the planning horizon and the time.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="text-align:center head"><p>Default</p></th>
|
||||
<th class="text-align:center head"><p>Time series?</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Time</span> <span class="pre">horizon</span> <span class="pre">(h)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Length of the planning horizon (in hours).</p></td>
|
||||
<td class="text-align:center"><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Time</span> <span class="pre">step</span> <span class="pre">(min)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Length of each time step (in minutes). Must be a divisor of 60 (e.g. 60, 30, 20, 15, etc).</p></td>
|
||||
<td class="text-align:center"><p><code class="docutils literal notranslate"><span class="pre">60</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Power</span> <span class="pre">balance</span> <span class="pre">penalty</span> <span class="pre">($/MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Penalty for system-wide shortage or surplus in production (in $/MW). This is charged per time step. For example, if there is a shortage of 1 MW for three time steps, three times this amount will be charged.</p></td>
|
||||
<td class="text-align:center"><p><code class="docutils literal notranslate"><span class="pre">1000.0</span></code></p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="example">
|
||||
<h4>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Parameters"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Time horizon (h)"</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nt">"Power balance penalty ($/MW)"</span><span class="p">:</span> <span class="mf">1000.0</span><span class="p">,</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="buses">
|
||||
<h3>Buses<a class="headerlink" href="#buses" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes the characteristics of each bus in the system.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="head"><p>Default</p></th>
|
||||
<th class="text-align:center head"><p>Time series?</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Load</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Fixed load connected to the bus (in MW).</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="id1">
|
||||
<h4>Example<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Buses"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"b1"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Load (MW)"</span><span class="p">:</span> <span class="mf">0.0</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"b2"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Load (MW)"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="mf">26.01527</span><span class="p">,</span>
|
||||
<span class="mf">24.46212</span><span class="p">,</span>
|
||||
<span class="mf">23.29725</span><span class="p">,</span>
|
||||
<span class="mf">22.90897</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="generators">
|
||||
<h3>Generators<a class="headerlink" href="#generators" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes all generators in the system, including thermal units, renewable units and virtual units.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="head"><p>Default</p></th>
|
||||
<th class="text-align:center head"><p>Time series?</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Bus</span></code></p></td>
|
||||
<td class="text-align:left"><p>Identifier of the bus where this generator is located (string).</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">(MW)</span></code> and <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">($)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Parameters describing the piecewise-linear production costs. See below for more details.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Startup</span> <span class="pre">costs</span> <span class="pre">($)</span></code> and <code class="docutils literal notranslate"><span class="pre">Startup</span> <span class="pre">delays</span> <span class="pre">(h)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Parameters describing how much it costs to start the generator after it has been shut down for a certain amount of time. If <code class="docutils literal notranslate"><span class="pre">Startup</span> <span class="pre">costs</span> <span class="pre">($)</span></code> and <code class="docutils literal notranslate"><span class="pre">Startup</span> <span class="pre">delays</span> <span class="pre">(h)</span></code> are set to <code class="docutils literal notranslate"><span class="pre">[300.0,</span> <span class="pre">400.0]</span></code> and <code class="docutils literal notranslate"><span class="pre">[1,</span> <span class="pre">4]</span></code>, for example, and the generator is shut down at time <code class="docutils literal notranslate"><span class="pre">00:00</span></code> (h:min), then it costs $300 to start up the generator at any time between <code class="docutils literal notranslate"><span class="pre">01:00</span></code> and <code class="docutils literal notranslate"><span class="pre">03:59</span></code>, and $400 to start the generator at time <code class="docutils literal notranslate"><span class="pre">04:00</span></code> or any time after that. The number of startup cost points is unlimited, and may be different for each generator. Startup delays must be strictly increasing and the first entry must equal <code class="docutils literal notranslate"><span class="pre">Minimum</span> <span class="pre">downtime</span> <span class="pre">(h)</span></code>.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">[0.0]</span></code> and <code class="docutils literal notranslate"><span class="pre">[1]</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Minimum</span> <span class="pre">uptime</span> <span class="pre">(h)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Minimum amount of time the generator must stay operational after starting up (in hours). For example, if the generator starts up at time <code class="docutils literal notranslate"><span class="pre">00:00</span></code> (h:min) and <code class="docutils literal notranslate"><span class="pre">Minimum</span> <span class="pre">uptime</span> <span class="pre">(h)</span></code> is set to 4, then the generator can only shut down at time <code class="docutils literal notranslate"><span class="pre">04:00</span></code>.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Minimum</span> <span class="pre">downtime</span> <span class="pre">(h)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Minimum amount of time the generator must stay offline after shutting down (in hours). For example, if the generator shuts down at time <code class="docutils literal notranslate"><span class="pre">00:00</span></code> (h:min) and <code class="docutils literal notranslate"><span class="pre">Minimum</span> <span class="pre">downtime</span> <span class="pre">(h)</span></code> is set to 4, then the generator can only start producing power again at time <code class="docutils literal notranslate"><span class="pre">04:00</span></code>.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Ramp</span> <span class="pre">up</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum increase in production from one time step to the next (in MW). For example, if the generator is producing 100 MW at time step 1 and if this parameter is set to 40 MW, then the generator will produce at most 140 MW at time step 2.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">+inf</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Ramp</span> <span class="pre">down</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum decrease in production from one time step to the next (in MW). For example, if the generator is producing 100 MW at time step 1 and this parameter is set to 40 MW, then the generator will produce at least 60 MW at time step 2.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">+inf</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Startup</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum amount of power a generator can produce immediately after starting up (in MW). For example, if <code class="docutils literal notranslate"><span class="pre">Startup</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code> is set to 100 MW and the unit is off at time step 1, then it may produce at most 100 MW at time step 2.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">+inf</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Shutdown</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum amount of power a generator can produce immediately before shutting down (in MW). Specifically, the generator can only shut down at time step <code class="docutils literal notranslate"><span class="pre">t+1</span></code> if its production at time step <code class="docutils literal notranslate"><span class="pre">t</span></code> is below this limit.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">+inf</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Initial</span> <span class="pre">status</span> <span class="pre">(h)</span></code></p></td>
|
||||
<td class="text-align:left"><p>If set to a positive number, indicates the amount of time (in hours) the generator has been on at the beginning of the simulation, and if set to a negative number, the amount of time the generator has been off. For example, if <code class="docutils literal notranslate"><span class="pre">Initial</span> <span class="pre">status</span> <span class="pre">(h)</span></code> is <code class="docutils literal notranslate"><span class="pre">-2</span></code>, this means that the generator was off since <code class="docutils literal notranslate"><span class="pre">-02:00</span></code> (h:min). The simulation starts at time <code class="docutils literal notranslate"><span class="pre">00:00</span></code>. If <code class="docutils literal notranslate"><span class="pre">Initial</span> <span class="pre">status</span> <span class="pre">(h)</span></code> is <code class="docutils literal notranslate"><span class="pre">3</span></code>, this means that the generator was on since <code class="docutils literal notranslate"><span class="pre">-03:00</span></code>. A value of zero is not acceptable.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Initial</span> <span class="pre">power</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Amount of power the generator at time step <code class="docutils literal notranslate"><span class="pre">-1</span></code>, immediately before the planning horizon starts.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Must</span> <span class="pre">run?</span></code></p></td>
|
||||
<td class="text-align:left"><p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, the generator should be committed, even if that is not economical (Boolean).</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Reserve</span> <span class="pre">eligibility</span></code></p></td>
|
||||
<td class="text-align:left"><p>List of reserve products this generator is eligibe to provide. By default, the generator is not eligible to provide any reserves.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">[]</span></code></p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="production-costs-and-limits">
|
||||
<h4>Production costs and limits<a class="headerlink" href="#production-costs-and-limits" title="Permalink to this headline">¶</a></h4>
|
||||
<p>Production costs are represented as piecewise-linear curves. Figure 1 shows an example cost curve with three segments, where it costs $1400, $1600, $2200 and $2400 to generate, respectively, 100, 110, 130 and 135 MW of power. To model this generator, <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">(MW)</span></code> should be set to <code class="docutils literal notranslate"><span class="pre">[100,</span> <span class="pre">110,</span> <span class="pre">130,</span> <span class="pre">135]</span></code>, and <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">($)</span></code> should be set to <code class="docutils literal notranslate"><span class="pre">[1400,</span> <span class="pre">1600,</span> <span class="pre">2200,</span> <span class="pre">2400]</span></code>.
|
||||
Note that this curve also specifies the production limits. Specifically, the first point identifies the minimum power output when the unit is operational, while the last point identifies the maximum power output.</p>
|
||||
<center>
|
||||
<img src="../_static/cost_curve.png" style="max-width: 500px"/>
|
||||
<div><b>Figure 1.</b> Piecewise-linear production cost curve.</div>
|
||||
<br/>
|
||||
</center>
|
||||
</div>
|
||||
<div class="section" id="additional-remarks">
|
||||
<h4>Additional remarks:<a class="headerlink" href="#additional-remarks" title="Permalink to this headline">¶</a></h4>
|
||||
<ul class="simple">
|
||||
<li><p>For time-dependent production limits or time-dependent production costs, the usage of nested arrays is allowed. For example, if <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">(MW)</span></code> is set to <code class="docutils literal notranslate"><span class="pre">[5.0,</span> <span class="pre">[10.0,</span> <span class="pre">12.0,</span> <span class="pre">15.0,</span> <span class="pre">20.0]]</span></code>, then the unit may generate at most 10, 12, 15 and 20 MW of power during time steps 1, 2, 3 and 4, respectively. The minimum output for all time periods is fixed to at 5 MW.</p></li>
|
||||
<li><p>There is no limit to the number of piecewise-linear segments, and different generators may have a different number of segments.</p></li>
|
||||
<li><p>If <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">(MW)</span></code> and <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">($)</span></code> both contain a single element, then the generator must produce exactly that amount of power when operational. To specify that the generator may produce any amount of power up to a certain limit <code class="docutils literal notranslate"><span class="pre">P</span></code>, the parameter <code class="docutils literal notranslate"><span class="pre">Production</span> <span class="pre">cost</span> <span class="pre">curve</span> <span class="pre">(MW)</span></code> should be set to <code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">P]</span></code>.</p></li>
|
||||
<li><p>Production cost curves must be convex.</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="id2">
|
||||
<h4>Example<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Generators"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"gen1"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Bus"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
|
||||
<span class="nt">"Production cost curve (MW)"</span><span class="p">:</span> <span class="p">[</span><span class="mf">100.0</span><span class="p">,</span> <span class="mf">110.0</span><span class="p">,</span> <span class="mf">130.0</span><span class="p">,</span> <span class="mf">135.0</span><span class="p">],</span>
|
||||
<span class="nt">"Production cost curve ($)"</span><span class="p">:</span> <span class="p">[</span><span class="mf">1400.0</span><span class="p">,</span> <span class="mf">1600.0</span><span class="p">,</span> <span class="mf">2200.0</span><span class="p">,</span> <span class="mf">2400.0</span><span class="p">],</span>
|
||||
<span class="nt">"Startup costs ($)"</span><span class="p">:</span> <span class="p">[</span><span class="mf">300.0</span><span class="p">,</span> <span class="mf">400.0</span><span class="p">],</span>
|
||||
<span class="nt">"Startup delays (h)"</span><span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">4</span><span class="p">],</span>
|
||||
<span class="nt">"Ramp up limit (MW)"</span><span class="p">:</span> <span class="mf">232.68</span><span class="p">,</span>
|
||||
<span class="nt">"Ramp down limit (MW)"</span><span class="p">:</span> <span class="mf">232.68</span><span class="p">,</span>
|
||||
<span class="nt">"Startup limit (MW)"</span><span class="p">:</span> <span class="mf">232.68</span><span class="p">,</span>
|
||||
<span class="nt">"Shutdown limit (MW)"</span><span class="p">:</span> <span class="mf">232.68</span><span class="p">,</span>
|
||||
<span class="nt">"Minimum downtime (h)"</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nt">"Minimum uptime (h)"</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nt">"Initial status (h)"</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
|
||||
<span class="nt">"Must run?"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
|
||||
<span class="nt">"Reserve eligibility"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"r1"</span><span class="p">],</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"gen2"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Bus"</span><span class="p">:</span> <span class="s2">"b5"</span><span class="p">,</span>
|
||||
<span class="nt">"Production cost curve (MW)"</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">,</span> <span class="p">[</span><span class="mf">10.0</span><span class="p">,</span> <span class="mf">8.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">3.0</span><span class="p">]],</span>
|
||||
<span class="nt">"Production cost curve ($)"</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span>
|
||||
<span class="nt">"Reserve eligibility"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"r1"</span><span class="p">,</span> <span class="s2">"r2"</span><span class="p">],</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="price-sensitive-loads">
|
||||
<h3>Price-sensitive loads<a class="headerlink" href="#price-sensitive-loads" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes components in the system which may increase or reduce their energy consumption according to the energy prices. Fixed loads (as described in the <code class="docutils literal notranslate"><span class="pre">buses</span></code> section) are always served, regardless of the price, unless there is significant congestion in the system or insufficient production capacity. Price-sensitive loads, on the other hand, are only served if it is economical to do so.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="text-align:center head"><p>Default</p></th>
|
||||
<th class="text-align:center head"><p>Time series?</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Bus</span></code></p></td>
|
||||
<td class="text-align:left"><p>Bus where the load is located. Multiple price-sensitive loads may be placed at the same bus.</p></td>
|
||||
<td class="text-align:center"><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Revenue</span> <span class="pre">($/MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Revenue obtained for serving each MW of power to this load.</p></td>
|
||||
<td class="text-align:center"><p>Required</p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Demand</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum amount of power required by this load. Any amount lower than this may be served.</p></td>
|
||||
<td class="text-align:center"><p>Required</p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="id3">
|
||||
<h4>Example<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Price-sensitive loads"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"p1"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Bus"</span><span class="p">:</span> <span class="s2">"b3"</span><span class="p">,</span>
|
||||
<span class="nt">"Revenue ($/MW)"</span><span class="p">:</span> <span class="mf">23.0</span><span class="p">,</span>
|
||||
<span class="nt">"Demand (MW)"</span><span class="p">:</span> <span class="mf">50.0</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="transmission-lines">
|
||||
<h3>Transmission Lines<a class="headerlink" href="#transmission-lines" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes the characteristics of transmission system, such as its topology and the susceptance of each transmission line.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="head"><p>Default</p></th>
|
||||
<th class="text-align:center head"><p>Time series?</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Source</span> <span class="pre">bus</span></code></p></td>
|
||||
<td class="text-align:left"><p>Identifier of the bus where the transmission line originates.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Target</span> <span class="pre">bus</span></code></p></td>
|
||||
<td class="text-align:left"><p>Identifier of the bus where the transmission line reaches.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Reactance</span> <span class="pre">(ohms)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Reactance of the transmission line (in ohms).</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Susceptance</span> <span class="pre">(S)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Susceptance of the transmission line (in siemens).</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Normal</span> <span class="pre">flow</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum amount of power (in MW) allowed to flow through the line when the system is in its regular, fully-operational state.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">+inf</span></code></p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Emergency</span> <span class="pre">flow</span> <span class="pre">limit</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Maximum amount of power (in MW) allowed to flow through the line when the system is in degraded state (for example, after the failure of another transmission line).</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">+inf</span></code></p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Flow</span> <span class="pre">limit</span> <span class="pre">penalty</span> <span class="pre">($/MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Penalty for violating the flow limits of the transmission line (in $/MW). This is charged per time step. For example, if there is a thermal violation of 1 MW for three time steps, then three times this amount will be charged.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">5000.0</span></code></p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="id4">
|
||||
<h4>Example<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Transmission lines"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"l1"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Source bus"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
|
||||
<span class="nt">"Target bus"</span><span class="p">:</span> <span class="s2">"b2"</span><span class="p">,</span>
|
||||
<span class="nt">"Reactance (ohms)"</span><span class="p">:</span> <span class="mf">0.05917</span><span class="p">,</span>
|
||||
<span class="nt">"Susceptance (S)"</span><span class="p">:</span> <span class="mf">29.49686</span><span class="p">,</span>
|
||||
<span class="nt">"Normal flow limit (MW)"</span><span class="p">:</span> <span class="mf">15000.0</span><span class="p">,</span>
|
||||
<span class="nt">"Emergency flow limit (MW)"</span><span class="p">:</span> <span class="mf">20000.0</span><span class="p">,</span>
|
||||
<span class="nt">"Flow limit penalty ($/MW)"</span><span class="p">:</span> <span class="mf">5000.0</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="reserves">
|
||||
<h3>Reserves<a class="headerlink" href="#reserves" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes the hourly amount of reserves required.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="head"><p>Default</p></th>
|
||||
<th class="text-align:center head"><p>Time series?</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Type</span></code></p></td>
|
||||
<td class="text-align:left"><p>Type of reserve product. Must be either “spinning” or “flexiramp”.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>N</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Amount</span> <span class="pre">(MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Amount of reserves required.</p></td>
|
||||
<td><p>Required</p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Shortfall</span> <span class="pre">penalty</span> <span class="pre">($/MW)</span></code></p></td>
|
||||
<td class="text-align:left"><p>Penalty for shortage in meeting the reserve requirements (in $/MW). This is charged per time step. Negative value implies reserve constraints must always be satisfied.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">-1</span></code></p></td>
|
||||
<td class="text-align:center"><p>Y</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="example-1">
|
||||
<h4>Example 1<a class="headerlink" href="#example-1" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Reserves"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"r1"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"spinning"</span><span class="p">,</span>
|
||||
<span class="nt">"Amount (MW)"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="mf">57.30552</span><span class="p">,</span>
|
||||
<span class="mf">53.88429</span><span class="p">,</span>
|
||||
<span class="mf">51.31838</span><span class="p">,</span>
|
||||
<span class="mf">50.46307</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nt">"Shortfall penalty ($/MW)"</span><span class="p">:</span> <span class="mf">5.0</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"r2"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"flexiramp"</span><span class="p">,</span>
|
||||
<span class="nt">"Amount (MW)"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="mf">20.31042</span><span class="p">,</span>
|
||||
<span class="mf">23.65273</span><span class="p">,</span>
|
||||
<span class="mf">27.41784</span><span class="p">,</span>
|
||||
<span class="mf">25.34057</span>
|
||||
<span class="p">],</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="contingencies">
|
||||
<h3>Contingencies<a class="headerlink" href="#contingencies" title="Permalink to this headline">¶</a></h3>
|
||||
<p>This section describes credible contingency scenarios in the optimization, such as the loss of a transmission line or generator.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:left head"><p>Key</p></th>
|
||||
<th class="text-align:left head"><p>Description</p></th>
|
||||
<th class="head"><p>Default</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Affected</span> <span class="pre">generators</span></code></p></td>
|
||||
<td class="text-align:left"><p>List of generators affected by this contingency. May be omitted if no generators are affected.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">[]</span></code></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:left"><p><code class="docutils literal notranslate"><span class="pre">Affected</span> <span class="pre">lines</span></code></p></td>
|
||||
<td class="text-align:left"><p>List of transmission lines affected by this contingency. May be omitted if no lines are affected.</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">[]</span></code></p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="id5">
|
||||
<h4>Example<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Contingencies"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"c1"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Affected lines"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"l1"</span><span class="p">,</span> <span class="s2">"l2"</span><span class="p">,</span> <span class="s2">"l3"</span><span class="p">],</span>
|
||||
<span class="nt">"Affected generators"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"g1"</span><span class="p">]</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"c2"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Affected lines"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"l4"</span><span class="p">]</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id6">
|
||||
<h3>Additional remarks<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="section" id="time-series-parameters">
|
||||
<h4>Time series parameters<a class="headerlink" href="#time-series-parameters" title="Permalink to this headline">¶</a></h4>
|
||||
<p>Many numerical properties in the JSON file can be specified either as a single floating point number if they are time-independent, or as an array containing exactly <code class="docutils literal notranslate"><span class="pre">T</span></code> elements, if they are time-dependent, where <code class="docutils literal notranslate"><span class="pre">T</span></code> is the number of time steps in the planning horizon. For example, both formats below are valid when <code class="docutils literal notranslate"><span class="pre">T=3</span></code>:</p>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="nt">"Load (MW)"</span><span class="p">:</span> <span class="mf">800.0</span><span class="p">,</span>
|
||||
<span class="nt">"Load (MW)"</span><span class="p">:</span> <span class="p">[</span><span class="mf">800.0</span><span class="p">,</span> <span class="mf">850.0</span><span class="p">,</span> <span class="mf">730.0</span><span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The value <code class="docutils literal notranslate"><span class="pre">T</span></code> depends on both <code class="docutils literal notranslate"><span class="pre">Time</span> <span class="pre">horizon</span> <span class="pre">(h)</span></code> and <code class="docutils literal notranslate"><span class="pre">Time</span> <span class="pre">step</span> <span class="pre">(min)</span></code>, as the table below illustrates.</p>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="text-align:center head"><p>Time horizon (h)</p></th>
|
||||
<th class="text-align:center head"><p>Time step (min)</p></th>
|
||||
<th class="text-align:center head"><p>T</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td class="text-align:center"><p>24</p></td>
|
||||
<td class="text-align:center"><p>60</p></td>
|
||||
<td class="text-align:center"><p>24</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:center"><p>24</p></td>
|
||||
<td class="text-align:center"><p>15</p></td>
|
||||
<td class="text-align:center"><p>96</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:center"><p>24</p></td>
|
||||
<td class="text-align:center"><p>5</p></td>
|
||||
<td class="text-align:center"><p>288</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:center"><p>36</p></td>
|
||||
<td class="text-align:center"><p>60</p></td>
|
||||
<td class="text-align:center"><p>36</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td class="text-align:center"><p>36</p></td>
|
||||
<td class="text-align:center"><p>15</p></td>
|
||||
<td class="text-align:center"><p>144</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td class="text-align:center"><p>36</p></td>
|
||||
<td class="text-align:center"><p>5</p></td>
|
||||
<td class="text-align:center"><p>432</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="output-data-format">
|
||||
<h2><span class="sectnum">2.2.</span> Output Data Format<a class="headerlink" href="#output-data-format" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The output data format is also JSON-based, but it is not currently documented since we expect it to change significantly in a future version of the package.</p>
|
||||
</div>
|
||||
<div class="section" id="current-limitations">
|
||||
<h2><span class="sectnum">2.3.</span> Current limitations<a class="headerlink" href="#current-limitations" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p>Network topology remains the same for all time periods</p></li>
|
||||
<li><p>Only N-1 transmission contingencies are supported. Generator contingencies are not currently supported.</p></li>
|
||||
<li><p>Time-varying minimum production amounts are not currently compatible with ramp/startup/shutdown limits.</p></li>
|
||||
<li><p>Flexible ramping products can only be acquired under the <code class="docutils literal notranslate"><span class="pre">WanHob2016</span></code> formulation, which does not support spinning reserves.</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
<a class='left-prev' id="prev-link" href="../usage/" title="previous page"><span class="sectnum">1.</span> Usage</a>
|
||||
<a class='right-next' id="next-link" href="../instances/" title="next page"><span class="sectnum">3.</span> Instances</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer mt-5 mt-md-0">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
© Copyright 2020-2021, UChicago Argonne, LLC.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,200 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Index — UnitCommitment.jl<br/><small>0.2</small></title>
|
||||
|
||||
<link href="../_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="../_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="../_static/vendor/fontawesome/5.13.0/css/all.min.css">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
|
||||
|
||||
<link rel="preload" as="script" href="../_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
|
||||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<link rel="index" title="Index" href="#" />
|
||||
<link rel="search" title="Search" href="../search/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
|
||||
<div class="container-fluid" id="banner"></div>
|
||||
|
||||
|
||||
|
||||
<div class="container-xl">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
|
||||
|
||||
<div class="navbar-brand-box">
|
||||
<a class="navbar-brand text-wrap" href="../">
|
||||
|
||||
|
||||
<h1 class="site-logo" id="site-title">UnitCommitment.jl<br/><small>0.2</small></h1>
|
||||
|
||||
</a>
|
||||
</div><form class="bd-search d-flex align-items-center" action="../search/" method="get">
|
||||
<i class="icon fas fa-search"></i>
|
||||
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
|
||||
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
|
||||
<div class="bd-toc-item active">
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../usage/">
|
||||
<span class="sectnum">
|
||||
1.
|
||||
</span>
|
||||
Usage
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../format/">
|
||||
<span class="sectnum">
|
||||
2.
|
||||
</span>
|
||||
Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../instances/">
|
||||
<span class="sectnum">
|
||||
3.
|
||||
</span>
|
||||
Instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../model/">
|
||||
<span class="sectnum">
|
||||
4.
|
||||
</span>
|
||||
JuMP Model
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav> <!-- To handle the deprecated key -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
|
||||
|
||||
<div class="topbar container-xl fixed-top">
|
||||
<div class="topbar-contents row">
|
||||
<div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div>
|
||||
<div class="col pl-md-4 topbar-main">
|
||||
|
||||
<button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
|
||||
data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
|
||||
aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
|
||||
title="Toggle navigation" data-toggle="tooltip" data-placement="left">
|
||||
<i class="fas fa-bars"></i>
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
|
||||
<!-- Source interaction buttons -->
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
|
||||
aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
|
||||
<div class="dropdown-buttons sourcebuttons">
|
||||
<a class="repository-button"
|
||||
href="https://github.com/ANL-CEEESA/UnitCommitment.jl/"><button type="button" class="btn btn-secondary topbarbtn"
|
||||
data-toggle="tooltip" data-placement="left" title="Source repository"><i
|
||||
class="fab fa-github"></i>repository</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Full screen (wrap in <a> to have style consistency -->
|
||||
|
||||
<a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
|
||||
data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode"
|
||||
title="Fullscreen mode"><i
|
||||
class="fas fa-expand"></i></button></a>
|
||||
|
||||
<!-- Launch buttons -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<h1 id="index">Index</h1>
|
||||
|
||||
<div class="genindex-jumpbox">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer mt-5 mt-md-0">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
© Copyright 2020-2021, UChicago Argonne, LLC.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,354 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>UnitCommitment.jl — UnitCommitment.jl<br/><small>0.2</small></title>
|
||||
|
||||
<link href="_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
|
||||
|
||||
<link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
|
||||
<script id="documentation_options" data-url_root="" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<link rel="index" title="Index" href="genindex/" />
|
||||
<link rel="search" title="Search" href="search/" />
|
||||
<link rel="next" title="1. Usage" href="usage/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
|
||||
<div class="container-fluid" id="banner"></div>
|
||||
|
||||
|
||||
|
||||
<div class="container-xl">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
|
||||
|
||||
<div class="navbar-brand-box">
|
||||
<a class="navbar-brand text-wrap" href="#">
|
||||
|
||||
|
||||
<h1 class="site-logo" id="site-title">UnitCommitment.jl<br/><small>0.2</small></h1>
|
||||
|
||||
</a>
|
||||
</div><form class="bd-search d-flex align-items-center" action="search/" method="get">
|
||||
<i class="icon fas fa-search"></i>
|
||||
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
|
||||
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
|
||||
<div class="bd-toc-item active">
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="usage/">
|
||||
<span class="sectnum">
|
||||
1.
|
||||
</span>
|
||||
Usage
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="format/">
|
||||
<span class="sectnum">
|
||||
2.
|
||||
</span>
|
||||
Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="instances/">
|
||||
<span class="sectnum">
|
||||
3.
|
||||
</span>
|
||||
Instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="model/">
|
||||
<span class="sectnum">
|
||||
4.
|
||||
</span>
|
||||
JuMP Model
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav> <!-- To handle the deprecated key -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
|
||||
|
||||
<div class="topbar container-xl fixed-top">
|
||||
<div class="topbar-contents row">
|
||||
<div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div>
|
||||
<div class="col pl-md-4 topbar-main">
|
||||
|
||||
<button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
|
||||
data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
|
||||
aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
|
||||
title="Toggle navigation" data-toggle="tooltip" data-placement="left">
|
||||
<i class="fas fa-bars"></i>
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn" aria-label="Download this page"><i
|
||||
class="fas fa-download"></i></button>
|
||||
|
||||
<div class="dropdown-buttons">
|
||||
<!-- ipynb file if we had a myst markdown file -->
|
||||
|
||||
<!-- Download raw file -->
|
||||
<a class="dropdown-buttons" href="_sources/index.md.txt"><button type="button"
|
||||
class="btn btn-secondary topbarbtn" title="Download source file" data-toggle="tooltip"
|
||||
data-placement="left">.md</button></a>
|
||||
<!-- Download PDF via print -->
|
||||
<button type="button" id="download-print" class="btn btn-secondary topbarbtn" title="Print to PDF"
|
||||
onClick="window.print()" data-toggle="tooltip" data-placement="left">.pdf</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Source interaction buttons -->
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
|
||||
aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
|
||||
<div class="dropdown-buttons sourcebuttons">
|
||||
<a class="repository-button"
|
||||
href="https://github.com/ANL-CEEESA/UnitCommitment.jl/"><button type="button" class="btn btn-secondary topbarbtn"
|
||||
data-toggle="tooltip" data-placement="left" title="Source repository"><i
|
||||
class="fab fa-github"></i>repository</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Full screen (wrap in <a> to have style consistency -->
|
||||
|
||||
<a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
|
||||
data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode"
|
||||
title="Fullscreen mode"><i
|
||||
class="fas fa-expand"></i></button></a>
|
||||
|
||||
<!-- Launch buttons -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
|
||||
<div class="tocsection onthispage pt-5 pb-3">
|
||||
<i class="fas fa-list"></i> Contents
|
||||
</div>
|
||||
<nav id="bd-toc-nav">
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#package-components">
|
||||
Package Components
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#authors">
|
||||
Authors
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#acknowledgments">
|
||||
Acknowledgments
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#citing">
|
||||
Citing
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#license">
|
||||
License
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#site-contents">
|
||||
Site contents
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<div>
|
||||
|
||||
<div class="section" id="unitcommitment-jl">
|
||||
<h1>UnitCommitment.jl<a class="headerlink" href="#unitcommitment-jl" title="Permalink to this headline">¶</a></h1>
|
||||
<p><strong>UnitCommitment.jl</strong> (UC.jl) is a Julia/JuMP optimization package for the Security-Constrained Unit Commitment Problem (SCUC), a fundamental optimization problem in power systems used, for example, to clear the day-ahead electricity markets. The package provides benchmark instances for the problem and Julia/JuMP implementations of state-of-the-art mixed-integer programming formulations.</p>
|
||||
<div class="section" id="package-components">
|
||||
<h2>Package Components<a class="headerlink" href="#package-components" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p><strong>Data Format:</strong> The package proposes an extensible and fully-documented JSON-based data specification format for SCUC, developed in collaboration with Independent System Operators (ISOs), which describes the most important aspects of the problem. The format supports all the most common generator characteristics (including ramping, piecewise-linear production cost curves and time-dependent startup costs), as well as operating reserves, price-sensitive loads, transmission networks and contingencies.</p></li>
|
||||
<li><p><strong>Benchmark Instances:</strong> The package provides a diverse collection of large-scale benchmark instances collected from the literature, converted into a common data format, and extended using data-driven methods to make them more challenging and realistic.</p></li>
|
||||
<li><p><strong>Model Implementation</strong>: The package provides a Julia/JuMP implementations of state-of-the-art formulations and solution methods for SCUC, including multiple ramping formulations (<a class="reference external" href="https://doi.org/10.1109/59.871739">ArrCon2000</a>, <a class="reference external" href="https://doi.org/10.1109/TPWRS.2013.2251373">MorLatRam2013</a>, <a class="reference external" href="https://doi.org/10.1007/s10107-015-0919-9">DamKucRajAta2016</a>, <a class="reference external" href="https://doi.org/10.1287/opre.2016.1520">PanGua2016</a>), multiple piecewise-linear costs formulations (<a class="reference external" href="https://doi.org/10.1109/AIEEPAS.1962.4501405">Gar1962</a>, <a class="reference external" href="https://doi.org/10.1109/TPWRS.2006.876672">CarArr2006</a>, <a class="reference external" href="https://doi.org/10.1109/TPWRS.2017.2783850">KnuOstWat2018</a>) and contingency screening methods (<a class="reference external" href="https://doi.org/10.1109/TPWRS.2019.2892620">XavQiuWanThi2019</a>). Our goal is to keep these implementations up-to-date as new methods are proposed in the literature.</p></li>
|
||||
<li><p><strong>Benchmark Tools:</strong> The package provides automated benchmark scripts to accurately evaluate the performance impact of proposed code changes.</p></li>
|
||||
</ul>
|
||||
<div class="section" id="authors">
|
||||
<h3>Authors<a class="headerlink" href="#authors" title="Permalink to this headline">¶</a></h3>
|
||||
<ul class="simple">
|
||||
<li><p><strong>Alinson S. Xavier</strong> (Argonne National Laboratory)</p></li>
|
||||
<li><p><strong>Aleksandr M. Kazachkov</strong> (University of Florida)</p></li>
|
||||
<li><p><strong>Feng Qiu</strong> (Argonne National Laboratory)</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="acknowledgments">
|
||||
<h3>Acknowledgments<a class="headerlink" href="#acknowledgments" title="Permalink to this headline">¶</a></h3>
|
||||
<ul class="simple">
|
||||
<li><p>We would like to thank <strong>Yonghong Chen</strong> (Midcontinent Independent System Operator), <strong>Feng Pan</strong> (Pacific Northwest National Laboratory) for valuable feedback on early versions of this package.</p></li>
|
||||
<li><p>Based upon work supported by <strong>Laboratory Directed Research and Development</strong> (LDRD) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U.S. Department of Energy under Contract No. DE-AC02-06CH11357</p></li>
|
||||
<li><p>Based upon work supported by the <strong>U.S. Department of Energy Advanced Grid Modeling Program</strong> under Grant DE-OE0000875.</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="citing">
|
||||
<h3>Citing<a class="headerlink" href="#citing" title="Permalink to this headline">¶</a></h3>
|
||||
<p>If you use UnitCommitment.jl in your research (instances, models or algorithms), we kindly request that you cite the package as follows:</p>
|
||||
<ul class="simple">
|
||||
<li><p><strong>Alinson S. Xavier, Aleksandr M. Kazachkov, Feng Qiu</strong>, “UnitCommitment.jl: A Julia/JuMP Optimization Package for Security-Constrained Unit Commitment”. Zenodo (2020). <a class="reference external" href="https://doi.org/10.5281/zenodo.4269874">DOI: 10.5281/zenodo.4269874</a>.</p></li>
|
||||
</ul>
|
||||
<p>If you use the instances, we additionally request that you cite the original sources, as described in the <a class="reference internal" href="instances/"><span class="doc std std-doc">instances page</span></a>.</p>
|
||||
</div>
|
||||
<div class="section" id="license">
|
||||
<h3>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>UnitCommitment.jl: A Julia/JuMP Optimization Package for Security-Constrained Unit Commitment
|
||||
Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="site-contents">
|
||||
<h2>Site contents<a class="headerlink" href="#site-contents" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="usage/"><span class="sectnum">1.</span> Usage</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="usage/#installation"><span class="sectnum">1.1.</span> Installation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="usage/#typical-usage"><span class="sectnum">1.2.</span> Typical Usage</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="usage/#advanced-usage"><span class="sectnum">1.3.</span> Advanced usage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="format/"><span class="sectnum">2.</span> Data Format</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="format/#input-data-format"><span class="sectnum">2.1.</span> Input Data Format</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="format/#output-data-format"><span class="sectnum">2.2.</span> Output Data Format</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="format/#current-limitations"><span class="sectnum">2.3.</span> Current limitations</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="instances/"><span class="sectnum">3.</span> Instances</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="instances/#matpower"><span class="sectnum">3.1.</span> MATPOWER</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="instances/#pglib-uc-instances"><span class="sectnum">3.2.</span> PGLIB-UC Instances</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="instances/#or-lib-uc"><span class="sectnum">3.3.</span> OR-LIB/UC</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="instances/#tejada19"><span class="sectnum">3.4.</span> Tejada19</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="instances/#references"><span class="sectnum">3.5.</span> References</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="model/"><span class="sectnum">4.</span> JuMP Model</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="model/#decision-variables"><span class="sectnum">4.1.</span> Decision variables</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="model/#objective-function"><span class="sectnum">4.2.</span> Objective function</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="model/#constraints"><span class="sectnum">4.3.</span> Constraints</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="model/#inspecting-and-modifying-the-model"><span class="sectnum">4.4.</span> Inspecting and modifying the model</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="model/#references"><span class="sectnum">4.5.</span> References</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
<a class='right-next' id="next-link" href="usage/" title="next page"><span class="sectnum">1.</span> Usage</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer mt-5 mt-md-0">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
© Copyright 2020-2021, UChicago Argonne, LLC.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,616 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>4. JuMP Model — UnitCommitment.jl<br/><small>0.2</small></title>
|
||||
|
||||
<link href="../_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="../_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="../_static/vendor/fontawesome/5.13.0/css/all.min.css">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
|
||||
|
||||
<link rel="preload" as="script" href="../_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
|
||||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]], "processRefs": false, "processEnvironments": false}})</script>
|
||||
<link rel="index" title="Index" href="../genindex/" />
|
||||
<link rel="search" title="Search" href="../search/" />
|
||||
<link rel="prev" title="3. Instances" href="../instances/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
|
||||
<div class="container-fluid" id="banner"></div>
|
||||
|
||||
|
||||
|
||||
<div class="container-xl">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
|
||||
|
||||
<div class="navbar-brand-box">
|
||||
<a class="navbar-brand text-wrap" href="../">
|
||||
|
||||
|
||||
<h1 class="site-logo" id="site-title">UnitCommitment.jl<br/><small>0.2</small></h1>
|
||||
|
||||
</a>
|
||||
</div><form class="bd-search d-flex align-items-center" action="../search/" method="get">
|
||||
<i class="icon fas fa-search"></i>
|
||||
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
|
||||
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
|
||||
<div class="bd-toc-item active">
|
||||
<ul class="current nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../usage/">
|
||||
<span class="sectnum">
|
||||
1.
|
||||
</span>
|
||||
Usage
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../format/">
|
||||
<span class="sectnum">
|
||||
2.
|
||||
</span>
|
||||
Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../instances/">
|
||||
<span class="sectnum">
|
||||
3.
|
||||
</span>
|
||||
Instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1 current active">
|
||||
<a class="current reference internal" href="#">
|
||||
<span class="sectnum">
|
||||
4.
|
||||
</span>
|
||||
JuMP Model
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav> <!-- To handle the deprecated key -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
|
||||
|
||||
<div class="topbar container-xl fixed-top">
|
||||
<div class="topbar-contents row">
|
||||
<div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div>
|
||||
<div class="col pl-md-4 topbar-main">
|
||||
|
||||
<button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
|
||||
data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
|
||||
aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
|
||||
title="Toggle navigation" data-toggle="tooltip" data-placement="left">
|
||||
<i class="fas fa-bars"></i>
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn" aria-label="Download this page"><i
|
||||
class="fas fa-download"></i></button>
|
||||
|
||||
<div class="dropdown-buttons">
|
||||
<!-- ipynb file if we had a myst markdown file -->
|
||||
|
||||
<!-- Download raw file -->
|
||||
<a class="dropdown-buttons" href="../_sources/model.md.txt"><button type="button"
|
||||
class="btn btn-secondary topbarbtn" title="Download source file" data-toggle="tooltip"
|
||||
data-placement="left">.md</button></a>
|
||||
<!-- Download PDF via print -->
|
||||
<button type="button" id="download-print" class="btn btn-secondary topbarbtn" title="Print to PDF"
|
||||
onClick="window.print()" data-toggle="tooltip" data-placement="left">.pdf</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Source interaction buttons -->
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
|
||||
aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
|
||||
<div class="dropdown-buttons sourcebuttons">
|
||||
<a class="repository-button"
|
||||
href="https://github.com/ANL-CEEESA/UnitCommitment.jl/"><button type="button" class="btn btn-secondary topbarbtn"
|
||||
data-toggle="tooltip" data-placement="left" title="Source repository"><i
|
||||
class="fab fa-github"></i>repository</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Full screen (wrap in <a> to have style consistency -->
|
||||
|
||||
<a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
|
||||
data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode"
|
||||
title="Fullscreen mode"><i
|
||||
class="fas fa-expand"></i></button></a>
|
||||
|
||||
<!-- Launch buttons -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
|
||||
<div class="tocsection onthispage pt-5 pb-3">
|
||||
<i class="fas fa-list"></i> Contents
|
||||
</div>
|
||||
<nav id="bd-toc-nav">
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#decision-variables">
|
||||
<span class="sectnum">
|
||||
4.1.
|
||||
</span>
|
||||
Decision variables
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#generators">
|
||||
Generators
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#buses">
|
||||
Buses
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#price-sensitive-loads">
|
||||
Price-sensitive loads
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#transmission-lines">
|
||||
Transmission lines
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#objective-function">
|
||||
<span class="sectnum">
|
||||
4.2.
|
||||
</span>
|
||||
Objective function
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#constraints">
|
||||
<span class="sectnum">
|
||||
4.3.
|
||||
</span>
|
||||
Constraints
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#inspecting-and-modifying-the-model">
|
||||
<span class="sectnum">
|
||||
4.4.
|
||||
</span>
|
||||
Inspecting and modifying the model
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#accessing-decision-variables">
|
||||
Accessing decision variables
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#fixing-variables-modifying-objective-function-and-adding-constraints">
|
||||
Fixing variables, modifying objective function and adding constraints
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#adding-new-component-to-a-bus">
|
||||
Adding new component to a bus
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#references">
|
||||
<span class="sectnum">
|
||||
4.5.
|
||||
</span>
|
||||
References
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<div>
|
||||
|
||||
<div class="section" id="jump-model">
|
||||
<h1><span class="sectnum">4.</span> JuMP Model<a class="headerlink" href="#jump-model" title="Permalink to this headline">¶</a></h1>
|
||||
<p>In this page, we describe the JuMP optimization model produced by the function <code class="docutils literal notranslate"><span class="pre">UnitCommitment.build_model</span></code>. A detailed understanding of this model is not necessary if you are just interested in using the package to solve some standard unit commitment cases, but it may be useful, for example, if you need to solve a slightly different problem, with additional variables and constraints. The notation in this page generally follows [KnOsWa20].</p>
|
||||
<div class="section" id="decision-variables">
|
||||
<h2><span class="sectnum">4.1.</span> Decision variables<a class="headerlink" href="#decision-variables" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="generators">
|
||||
<h3>Generators<a class="headerlink" href="#generators" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>Name</p></th>
|
||||
<th class="text-align:center head"><p>Symbol</p></th>
|
||||
<th class="head"><p>Description</p></th>
|
||||
<th class="text-align:center head"><p>Unit</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">is_on[g,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(u_{g}(t)\)</span></p></td>
|
||||
<td><p>True if generator <code class="docutils literal notranslate"><span class="pre">g</span></code> is on at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>Binary</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">switch_on[g,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(v_{g}(t)\)</span></p></td>
|
||||
<td><p>True is generator <code class="docutils literal notranslate"><span class="pre">g</span></code> switches on at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>Binary</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">switch_off[g,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(w_{g}(t)\)</span></p></td>
|
||||
<td><p>True if generator <code class="docutils literal notranslate"><span class="pre">g</span></code> switches off at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>Binary</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">prod_above[g,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(p'_{g}(t)\)</span></p></td>
|
||||
<td><p>Amount of power produced by generator <code class="docutils literal notranslate"><span class="pre">g</span></code> above its minimum power output at time <code class="docutils literal notranslate"><span class="pre">t</span></code>. For example, if the minimum power of generator <code class="docutils literal notranslate"><span class="pre">g</span></code> is 100 MW and <code class="docutils literal notranslate"><span class="pre">g</span></code> is producing 115 MW of power at time <code class="docutils literal notranslate"><span class="pre">t</span></code>, then <code class="docutils literal notranslate"><span class="pre">prod_above[g,t]</span></code> equals <code class="docutils literal notranslate"><span class="pre">15.0</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">segprod[g,t,k]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(p^k_g(t)\)</span></p></td>
|
||||
<td><p>Amount of power from piecewise linear segment <code class="docutils literal notranslate"><span class="pre">k</span></code> produced by generator <code class="docutils literal notranslate"><span class="pre">g</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code>. For example, if cost curve for generator <code class="docutils literal notranslate"><span class="pre">g</span></code> is defined by the points <code class="docutils literal notranslate"><span class="pre">(100,</span> <span class="pre">1400)</span></code>, <code class="docutils literal notranslate"><span class="pre">(110,</span> <span class="pre">1600)</span></code>, <code class="docutils literal notranslate"><span class="pre">(130,</span> <span class="pre">2200)</span></code> and <code class="docutils literal notranslate"><span class="pre">(135,</span> <span class="pre">2400)</span></code>, and if the generator is producing 115 MW of power at time <code class="docutils literal notranslate"><span class="pre">t</span></code>, then <code class="docutils literal notranslate"><span class="pre">segprod[g,t,:]</span></code> equals <code class="docutils literal notranslate"><span class="pre">[10.0,</span> <span class="pre">5.0,</span> <span class="pre">0.0]</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">reserve[r,g,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(r_g(t)\)</span></p></td>
|
||||
<td><p>Amount of reserve <code class="docutils literal notranslate"><span class="pre">r</span></code> provided by unit <code class="docutils literal notranslate"><span class="pre">g</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">startup[g,t,s]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(\delta^s_g(t)\)</span></p></td>
|
||||
<td><p>True if generator <code class="docutils literal notranslate"><span class="pre">g</span></code> switches on at time <code class="docutils literal notranslate"><span class="pre">t</span></code> incurring start-up costs from start-up category <code class="docutils literal notranslate"><span class="pre">s</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>Binary</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="buses">
|
||||
<h3>Buses<a class="headerlink" href="#buses" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>Name</p></th>
|
||||
<th class="text-align:center head"><p>Symbol</p></th>
|
||||
<th class="head"><p>Description</p></th>
|
||||
<th class="text-align:center head"><p>Unit</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">net_injection[b,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(n_b(t)\)</span></p></td>
|
||||
<td><p>Net injection at bus <code class="docutils literal notranslate"><span class="pre">b</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">curtail[b,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(s^+_b(t)\)</span></p></td>
|
||||
<td><p>Amount of load curtailed at bus <code class="docutils literal notranslate"><span class="pre">b</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code></p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="price-sensitive-loads">
|
||||
<h3>Price-sensitive loads<a class="headerlink" href="#price-sensitive-loads" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>Name</p></th>
|
||||
<th class="text-align:center head"><p>Symbol</p></th>
|
||||
<th class="head"><p>Description</p></th>
|
||||
<th class="text-align:center head"><p>Unit</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">loads[s,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(d_{s}(t)\)</span></p></td>
|
||||
<td><p>Amount of power served to price-sensitive load <code class="docutils literal notranslate"><span class="pre">s</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="transmission-lines">
|
||||
<h3>Transmission lines<a class="headerlink" href="#transmission-lines" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="colwidths-auto docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>Name</p></th>
|
||||
<th class="text-align:center head"><p>Symbol</p></th>
|
||||
<th class="head"><p>Description</p></th>
|
||||
<th class="text-align:center head"><p>Unit</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">flow[l,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(f_l(t)\)</span></p></td>
|
||||
<td><p>Power flow on line <code class="docutils literal notranslate"><span class="pre">l</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">overflow[l,t]</span></code></p></td>
|
||||
<td class="text-align:center"><p><span class="math notranslate nohighlight">\(f^+_l(t)\)</span></p></td>
|
||||
<td><p>Amount of flow above the limit for line <code class="docutils literal notranslate"><span class="pre">l</span></code> at time <code class="docutils literal notranslate"><span class="pre">t</span></code>.</p></td>
|
||||
<td class="text-align:center"><p>MW</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Warning</p>
|
||||
<p>Since transmission and N-1 security constraints are enforced in a lazy way, most of the <code class="docutils literal notranslate"><span class="pre">flow[l,t]</span></code> variables are never added to the model. Accessing <code class="docutils literal notranslate"><span class="pre">model[:flow][l,t]</span></code> without first checking that the variable exists will likely generate an error.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="objective-function">
|
||||
<h2><span class="sectnum">4.2.</span> Objective function<a class="headerlink" href="#objective-function" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[\begin{split}
|
||||
\begin{align}
|
||||
\text{minimize} \;\; &
|
||||
\sum_{t \in \mathcal{T}}
|
||||
\sum_{g \in \mathcal{G}}
|
||||
C^\text{min}_g(t) u_g(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{g \in \mathcal{G}}
|
||||
\sum_{g \in \mathcal{K}_g}
|
||||
C^k_g(t) p^k_g(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{g \in \mathcal{G}}
|
||||
\sum_{s \in \mathcal{S}_g}
|
||||
C^s_{g}(t) \delta^s_g(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{l \in \mathcal{L}}
|
||||
C^\text{overflow}_{l}(t) f^+_l(t) \\
|
||||
&
|
||||
+ \sum_{t \in \mathcal{T}}
|
||||
\sum_{b \in \mathcal{B}}
|
||||
C^\text{curtail}(t) s^+_b(t) \\
|
||||
&
|
||||
- \sum_{t \in \mathcal{T}}
|
||||
\sum_{s \in \mathcal{PS}}
|
||||
R_{s}(t) d_{s}(t) \\
|
||||
|
||||
\end{align}
|
||||
\end{split}\]</div>
|
||||
<p>where</p>
|
||||
<ul class="simple">
|
||||
<li><p><span class="math notranslate nohighlight">\(\mathcal{B}\)</span> is the set of buses</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(\mathcal{G}\)</span> is the set of generators</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(\mathcal{L}\)</span> is the set of transmission lines</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(\mathcal{PS}\)</span> is the set of price-sensitive loads</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(\mathcal{S}_g\)</span> is the set of start-up categories for generator <span class="math notranslate nohighlight">\(g\)</span></p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(\mathcal{T}\)</span> is the set of time steps</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(C^\text{curtail}(t)\)</span> is the curtailment penalty (in $/MW)</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(C^\text{min}_g(t)\)</span> is the cost of keeping generator <span class="math notranslate nohighlight">\(g\)</span> on and producing at minimum power during time <span class="math notranslate nohighlight">\(t\)</span> (in $)</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(C^\text{overflow}_{l}(t)\)</span> is the flow limit penalty for line <span class="math notranslate nohighlight">\(l\)</span> at time <span class="math notranslate nohighlight">\(t\)</span> (in $/MW)</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(C^k_g(t)\)</span> is the cost for generator <span class="math notranslate nohighlight">\(g\)</span> to produce 1 MW of power at time <span class="math notranslate nohighlight">\(t\)</span> under piecewise linear segment <span class="math notranslate nohighlight">\(k\)</span></p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(C^s_{g}(t)\)</span> is the cost of starting up generator <span class="math notranslate nohighlight">\(g\)</span> at time <span class="math notranslate nohighlight">\(t\)</span> under start-up category <span class="math notranslate nohighlight">\(s\)</span> (in $)</p></li>
|
||||
<li><p><span class="math notranslate nohighlight">\(R_{s}(t)\)</span> is the revenue obtained from serving price-sensitive load <span class="math notranslate nohighlight">\(s\)</span> at time <span class="math notranslate nohighlight">\(t\)</span> (in $/MW)</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="constraints">
|
||||
<h2><span class="sectnum">4.3.</span> Constraints<a class="headerlink" href="#constraints" title="Permalink to this headline">¶</a></h2>
|
||||
<p>TODO</p>
|
||||
</div>
|
||||
<div class="section" id="inspecting-and-modifying-the-model">
|
||||
<h2><span class="sectnum">4.4.</span> Inspecting and modifying the model<a class="headerlink" href="#inspecting-and-modifying-the-model" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="accessing-decision-variables">
|
||||
<h3>Accessing decision variables<a class="headerlink" href="#accessing-decision-variables" title="Permalink to this headline">¶</a></h3>
|
||||
<p>After building a model using <code class="docutils literal notranslate"><span class="pre">UnitCommitment.build_model</span></code>, it is possible to obtain a reference to the decision variables by calling <code class="docutils literal notranslate"><span class="pre">model[:varname][index]</span></code>. For example, <code class="docutils literal notranslate"><span class="pre">model[:is_on]["g1",1]</span></code> returns a direct reference to the JuMP variable indicating whether generator named “g1” is on at time 1. The script below illustrates how to build a model, solve it and display the solution without using the function <code class="docutils literal notranslate"><span class="pre">UnitCommitment.solution</span></code>.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">Cbc</span>
|
||||
<span class="k">using</span> <span class="n">Printf</span>
|
||||
<span class="k">using</span> <span class="n">JuMP</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="c"># Load benchmark instance</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read_benchmark</span><span class="p">(</span><span class="s">"matpower/case118/2017-02-01"</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Build JuMP model</span>
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">build_model</span><span class="p">(</span>
|
||||
<span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span>
|
||||
<span class="n">optimizer</span><span class="o">=</span><span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># Solve the model</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">optimize!</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Display commitment status</span>
|
||||
<span class="k">for</span> <span class="n">g</span> <span class="kp">in</span> <span class="n">instance</span><span class="o">.</span><span class="n">units</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="kp">in</span> <span class="mi">1</span><span class="o">:</span><span class="n">instance</span><span class="o">.</span><span class="n">time</span>
|
||||
<span class="nd">@printf</span><span class="p">(</span>
|
||||
<span class="s">"</span><span class="si">%-10s</span><span class="s"> </span><span class="si">%5d</span><span class="s"> </span><span class="si">%5.1f</span><span class="s"> </span><span class="si">%5.1f</span><span class="s"> </span><span class="si">%5.1f</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span>
|
||||
<span class="n">g</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
|
||||
<span class="n">t</span><span class="p">,</span>
|
||||
<span class="n">value</span><span class="p">(</span><span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">is_on</span><span class="p">][</span><span class="n">g</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">t</span><span class="p">]),</span>
|
||||
<span class="n">value</span><span class="p">(</span><span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">switch_on</span><span class="p">][</span><span class="n">g</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">t</span><span class="p">]),</span>
|
||||
<span class="n">value</span><span class="p">(</span><span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">switch_off</span><span class="p">][</span><span class="n">g</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">t</span><span class="p">]),</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="fixing-variables-modifying-objective-function-and-adding-constraints">
|
||||
<h3>Fixing variables, modifying objective function and adding constraints<a class="headerlink" href="#fixing-variables-modifying-objective-function-and-adding-constraints" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Since we now have a direct reference to the JuMP decision variables, it is possible to fix variables, change the coefficients in the objective function, or even add new constraints to the model before solving it. The script below shows how can this be accomplished. For more information on modifying an existing model, <a class="reference external" href="https://jump.dev/JuMP.jl/stable/manual/variables/">see the JuMP documentation</a>.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">Cbc</span>
|
||||
<span class="k">using</span> <span class="n">JuMP</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="c"># Load benchmark instance</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read_benchmark</span><span class="p">(</span><span class="s">"matpower/case118/2017-02-01"</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Construct JuMP model</span>
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">build_model</span><span class="p">(</span>
|
||||
<span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span>
|
||||
<span class="n">optimizer</span><span class="o">=</span><span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># Fix a decision variable to 1.0</span>
|
||||
<span class="n">JuMP</span><span class="o">.</span><span class="n">fix</span><span class="p">(</span>
|
||||
<span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">is_on</span><span class="p">][</span><span class="s">"g1"</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span>
|
||||
<span class="mf">1.0</span><span class="p">,</span>
|
||||
<span class="n">force</span><span class="o">=</span><span class="kc">true</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># Change the objective function</span>
|
||||
<span class="n">JuMP</span><span class="o">.</span><span class="n">set_objective_coefficient</span><span class="p">(</span>
|
||||
<span class="n">model</span><span class="p">,</span>
|
||||
<span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">switch_on</span><span class="p">][</span><span class="s">"g2"</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span>
|
||||
<span class="mf">1000.0</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># Create a new constraint</span>
|
||||
<span class="nd">@constraint</span><span class="p">(</span>
|
||||
<span class="n">model</span><span class="p">,</span>
|
||||
<span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">is_on</span><span class="p">][</span><span class="s">"g3"</span><span class="p">,</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">is_on</span><span class="p">][</span><span class="s">"g4"</span><span class="p">,</span><span class="mi">1</span><span class="p">]</span> <span class="o"><=</span> <span class="mi">1</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># Solve the model</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">optimize!</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="adding-new-component-to-a-bus">
|
||||
<h3>Adding new component to a bus<a class="headerlink" href="#adding-new-component-to-a-bus" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The following snippet shows how to add a new grid component to a particular bus. For each time step, we create decision variables for the new grid component, add these variables to the objective function, then attach the component to a particular bus by modifying some existing model constraints.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">Cbc</span>
|
||||
<span class="k">using</span> <span class="n">JuMP</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="c"># Load instance and build base model</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read_benchmark</span><span class="p">(</span><span class="s">"matpower/case118/2017-02-01"</span><span class="p">)</span>
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">build_model</span><span class="p">(</span>
|
||||
<span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span>
|
||||
<span class="n">optimizer</span><span class="o">=</span><span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># Get the number of time steps in the original instance</span>
|
||||
<span class="n">T</span> <span class="o">=</span> <span class="n">instance</span><span class="o">.</span><span class="n">time</span>
|
||||
|
||||
<span class="c"># Create decision variables for the new grid component.</span>
|
||||
<span class="c"># In this example, we assume that the new component can</span>
|
||||
<span class="c"># inject up to 10 MW of power at each time step, so we</span>
|
||||
<span class="c"># create new continuous variables 0 ≤ x[t] ≤ 10.</span>
|
||||
<span class="nd">@variable</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="o">:</span><span class="n">T</span><span class="p">],</span> <span class="n">lower_bound</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">upper_bound</span><span class="o">=</span><span class="mf">10.0</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># For each time step</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="kp">in</span> <span class="mi">1</span><span class="o">:</span><span class="n">T</span>
|
||||
|
||||
<span class="c"># Add production costs to the objective function.</span>
|
||||
<span class="c"># In this example, we assume a cost of $5/MW.</span>
|
||||
<span class="n">set_objective_coefficient</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">x</span><span class="p">[</span><span class="n">t</span><span class="p">],</span> <span class="mf">5.0</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Attach the new component to bus b1, by modifying the</span>
|
||||
<span class="c"># constraint `eq_net_injection`.</span>
|
||||
<span class="n">set_normalized_coefficient</span><span class="p">(</span>
|
||||
<span class="n">model</span><span class="p">[</span><span class="o">:</span><span class="n">eq_net_injection</span><span class="p">][</span><span class="s">"b1"</span><span class="p">,</span> <span class="n">t</span><span class="p">],</span>
|
||||
<span class="n">x</span><span class="p">[</span><span class="n">t</span><span class="p">],</span>
|
||||
<span class="mf">1.0</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
<span class="c"># Solve the model</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">optimize!</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Show optimal values for the x variables</span>
|
||||
<span class="nd">@show</span> <span class="n">value</span><span class="o">.</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="references">
|
||||
<h2><span class="sectnum">4.5.</span> References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p>[KnOsWa20] <strong>Bernard Knueven, James Ostrowski and Jean-Paul Watson.</strong> “On Mixed-Integer Programming Formulations for the Unit Commitment Problem”. INFORMS Journal on Computing (2020). <a class="reference external" href="https://doi.org/10.1287/ijoc.2019.0944">DOI: 10.1287/ijoc.2019.0944</a></p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
<a class='left-prev' id="prev-link" href="../instances/" title="previous page"><span class="sectnum">3.</span> Instances</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer mt-5 mt-md-0">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
© Copyright 2020-2021, UChicago Argonne, LLC.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,220 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Search — UnitCommitment.jl<br/><small>0.2</small></title>
|
||||
|
||||
<link href="../_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="../_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="../_static/vendor/fontawesome/5.13.0/css/all.min.css">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
|
||||
|
||||
<link rel="preload" as="script" href="../_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
|
||||
|
||||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<script src="../_static/searchtools.js"></script>
|
||||
<script src="../_static/language_data.js"></script>
|
||||
<link rel="index" title="Index" href="../genindex/" />
|
||||
<link rel="search" title="Search" href="#" />
|
||||
<script src="../searchindex.js" defer></script>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
|
||||
<div class="container-fluid" id="banner"></div>
|
||||
|
||||
|
||||
|
||||
<div class="container-xl">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
|
||||
|
||||
<div class="navbar-brand-box">
|
||||
<a class="navbar-brand text-wrap" href="../">
|
||||
|
||||
|
||||
<h1 class="site-logo" id="site-title">UnitCommitment.jl<br/><small>0.2</small></h1>
|
||||
|
||||
</a>
|
||||
</div><form class="bd-search d-flex align-items-center" action="#" method="get">
|
||||
<i class="icon fas fa-search"></i>
|
||||
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
|
||||
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
|
||||
<div class="bd-toc-item active">
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../usage/">
|
||||
<span class="sectnum">
|
||||
1.
|
||||
</span>
|
||||
Usage
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../format/">
|
||||
<span class="sectnum">
|
||||
2.
|
||||
</span>
|
||||
Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../instances/">
|
||||
<span class="sectnum">
|
||||
3.
|
||||
</span>
|
||||
Instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../model/">
|
||||
<span class="sectnum">
|
||||
4.
|
||||
</span>
|
||||
JuMP Model
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav> <!-- To handle the deprecated key -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
|
||||
|
||||
<div class="topbar container-xl fixed-top">
|
||||
<div class="topbar-contents row">
|
||||
<div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div>
|
||||
<div class="col pl-md-4 topbar-main">
|
||||
|
||||
<button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
|
||||
data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
|
||||
aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
|
||||
title="Toggle navigation" data-toggle="tooltip" data-placement="left">
|
||||
<i class="fas fa-bars"></i>
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
|
||||
<!-- Source interaction buttons -->
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
|
||||
aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
|
||||
<div class="dropdown-buttons sourcebuttons">
|
||||
<a class="repository-button"
|
||||
href="https://github.com/ANL-CEEESA/UnitCommitment.jl/"><button type="button" class="btn btn-secondary topbarbtn"
|
||||
data-toggle="tooltip" data-placement="left" title="Source repository"><i
|
||||
class="fab fa-github"></i>repository</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Full screen (wrap in <a> to have style consistency -->
|
||||
|
||||
<a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
|
||||
data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode"
|
||||
title="Fullscreen mode"><i
|
||||
class="fas fa-expand"></i></button></a>
|
||||
|
||||
<!-- Launch buttons -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<div>
|
||||
|
||||
<h1 id="search-documentation">Search</h1>
|
||||
<div id="fallback" class="admonition warning">
|
||||
<script>$('#fallback').hide();</script>
|
||||
<p>
|
||||
Please activate JavaScript to enable the search
|
||||
functionality.
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
Searching for multiple words only shows matches that contain
|
||||
all words.
|
||||
</p>
|
||||
<form action="" method="get">
|
||||
<input type="text" name="q" aria-labelledby="search-documentation" value="" />
|
||||
<input type="submit" value="search" />
|
||||
<span id="search-progress" style="padding-left: 10px"></span>
|
||||
</form>
|
||||
|
||||
<div id="search-results">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer mt-5 mt-md-0">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
© Copyright 2020-2021, UChicago Argonne, LLC.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,406 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>1. Usage — UnitCommitment.jl<br/><small>0.2</small></title>
|
||||
|
||||
<link href="../_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="../_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="../_static/vendor/fontawesome/5.13.0/css/all.min.css">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin
|
||||
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
|
||||
|
||||
<link rel="preload" as="script" href="../_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
|
||||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<link rel="index" title="Index" href="../genindex/" />
|
||||
<link rel="search" title="Search" href="../search/" />
|
||||
<link rel="next" title="2. Data Format" href="../format/" />
|
||||
<link rel="prev" title="UnitCommitment.jl" href="../" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
|
||||
<div class="container-fluid" id="banner"></div>
|
||||
|
||||
|
||||
|
||||
<div class="container-xl">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
|
||||
|
||||
<div class="navbar-brand-box">
|
||||
<a class="navbar-brand text-wrap" href="../">
|
||||
|
||||
|
||||
<h1 class="site-logo" id="site-title">UnitCommitment.jl<br/><small>0.2</small></h1>
|
||||
|
||||
</a>
|
||||
</div><form class="bd-search d-flex align-items-center" action="../search/" method="get">
|
||||
<i class="icon fas fa-search"></i>
|
||||
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
|
||||
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
|
||||
<div class="bd-toc-item active">
|
||||
<ul class="current nav bd-sidenav">
|
||||
<li class="toctree-l1 current active">
|
||||
<a class="current reference internal" href="#">
|
||||
<span class="sectnum">
|
||||
1.
|
||||
</span>
|
||||
Usage
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../format/">
|
||||
<span class="sectnum">
|
||||
2.
|
||||
</span>
|
||||
Data Format
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../instances/">
|
||||
<span class="sectnum">
|
||||
3.
|
||||
</span>
|
||||
Instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="../model/">
|
||||
<span class="sectnum">
|
||||
4.
|
||||
</span>
|
||||
JuMP Model
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav> <!-- To handle the deprecated key -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
|
||||
|
||||
<div class="topbar container-xl fixed-top">
|
||||
<div class="topbar-contents row">
|
||||
<div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div>
|
||||
<div class="col pl-md-4 topbar-main">
|
||||
|
||||
<button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
|
||||
data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
|
||||
aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
|
||||
title="Toggle navigation" data-toggle="tooltip" data-placement="left">
|
||||
<i class="fas fa-bars"></i>
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn" aria-label="Download this page"><i
|
||||
class="fas fa-download"></i></button>
|
||||
|
||||
<div class="dropdown-buttons">
|
||||
<!-- ipynb file if we had a myst markdown file -->
|
||||
|
||||
<!-- Download raw file -->
|
||||
<a class="dropdown-buttons" href="../_sources/usage.md.txt"><button type="button"
|
||||
class="btn btn-secondary topbarbtn" title="Download source file" data-toggle="tooltip"
|
||||
data-placement="left">.md</button></a>
|
||||
<!-- Download PDF via print -->
|
||||
<button type="button" id="download-print" class="btn btn-secondary topbarbtn" title="Print to PDF"
|
||||
onClick="window.print()" data-toggle="tooltip" data-placement="left">.pdf</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Source interaction buttons -->
|
||||
|
||||
<div class="dropdown-buttons-trigger">
|
||||
<button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
|
||||
aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
|
||||
<div class="dropdown-buttons sourcebuttons">
|
||||
<a class="repository-button"
|
||||
href="https://github.com/ANL-CEEESA/UnitCommitment.jl/"><button type="button" class="btn btn-secondary topbarbtn"
|
||||
data-toggle="tooltip" data-placement="left" title="Source repository"><i
|
||||
class="fab fa-github"></i>repository</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Full screen (wrap in <a> to have style consistency -->
|
||||
|
||||
<a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
|
||||
data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode"
|
||||
title="Fullscreen mode"><i
|
||||
class="fas fa-expand"></i></button></a>
|
||||
|
||||
<!-- Launch buttons -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
|
||||
<div class="tocsection onthispage pt-5 pb-3">
|
||||
<i class="fas fa-list"></i> Contents
|
||||
</div>
|
||||
<nav id="bd-toc-nav">
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#installation">
|
||||
<span class="sectnum">
|
||||
1.1.
|
||||
</span>
|
||||
Installation
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#typical-usage">
|
||||
<span class="sectnum">
|
||||
1.2.
|
||||
</span>
|
||||
Typical Usage
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#solving-user-provided-instances">
|
||||
Solving user-provided instances
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#solving-benchmark-instances">
|
||||
Solving benchmark instances
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#advanced-usage">
|
||||
<span class="sectnum">
|
||||
1.3.
|
||||
</span>
|
||||
Advanced usage
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#customizing-the-formulation">
|
||||
Customizing the formulation
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#generating-initial-conditions">
|
||||
Generating initial conditions
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#verifying-solutions">
|
||||
Verifying solutions
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<div>
|
||||
|
||||
<div class="section" id="usage">
|
||||
<h1><span class="sectnum">1.</span> Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="installation">
|
||||
<h2><span class="sectnum">1.1.</span> Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
|
||||
<p>UnitCommitment.jl was tested and developed with <a class="reference external" href="https://julialang.org/">Julia 1.6</a>. To install Julia, please follow the <a class="reference external" href="https://julialang.org/downloads/platform.html">installation guide on the official Julia website</a>. To install UnitCommitment.jl, run the Julia interpreter, type <code class="docutils literal notranslate"><span class="pre">]</span></code> to open the package manager, then type:</p>
|
||||
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>pkg> add UnitCommitment@0.2
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To test that the package has been correctly installed, run:</p>
|
||||
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>pkg> test UnitCommitment
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If all tests pass, the package should now be ready to be used by any Julia script on the machine.</p>
|
||||
<p>To solve the optimization models, a mixed-integer linear programming (MILP) solver is also required. Please see the <a class="reference external" href="https://jump.dev/JuMP.jl/stable/installation/">JuMP installation guide</a> for more instructions on installing a solver. Typical open-source choices are <a class="reference external" href="https://github.com/JuliaOpt/Cbc.jl">Cbc</a> and <a class="reference external" href="https://github.com/JuliaOpt/GLPK.jl">GLPK</a>. In the instructions below, Cbc will be used, but any other MILP solver listed in JuMP installation guide should also be compatible.</p>
|
||||
</div>
|
||||
<div class="section" id="typical-usage">
|
||||
<h2><span class="sectnum">1.2.</span> Typical Usage<a class="headerlink" href="#typical-usage" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="solving-user-provided-instances">
|
||||
<h3>Solving user-provided instances<a class="headerlink" href="#solving-user-provided-instances" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The first step to use UC.jl is to construct a JSON file describing your unit commitment instance. See <a class="reference internal" href="../format/"><span class="doc std std-doc">Data Format</span></a> for a complete description of the data format UC.jl expects. The next steps, as shown below, are to: (1) read the instance from file; (2) construct the optimization model; (3) run the optimization; and (4) extract the optimal solution.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">Cbc</span>
|
||||
<span class="k">using</span> <span class="n">JSON</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="c"># 1. Read instance</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s">"/path/to/input.json"</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># 2. Construct optimization model</span>
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">build_model</span><span class="p">(</span>
|
||||
<span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span>
|
||||
<span class="n">optimizer</span><span class="o">=</span><span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="c"># 3. Solve model</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">optimize!</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># 4. Write solution to a file</span>
|
||||
<span class="n">solution</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">solution</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"/path/to/output.json"</span><span class="p">,</span> <span class="n">solution</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="solving-benchmark-instances">
|
||||
<h3>Solving benchmark instances<a class="headerlink" href="#solving-benchmark-instances" title="Permalink to this headline">¶</a></h3>
|
||||
<p>UnitCommitment.jl contains a large number of benchmark instances collected from the literature and converted into a common data format. To solve one of these instances individually, instead of constructing your own, the function <code class="docutils literal notranslate"><span class="pre">read_benchmark</span></code> can be used, as shown below. See <a class="reference internal" href="../instances/"><span class="doc std std-doc">Instances</span></a> for the complete list of available instances.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read_benchmark</span><span class="p">(</span><span class="s">"matpower/case3375wp/2017-02-01"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="advanced-usage">
|
||||
<h2><span class="sectnum">1.3.</span> Advanced usage<a class="headerlink" href="#advanced-usage" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="customizing-the-formulation">
|
||||
<h3>Customizing the formulation<a class="headerlink" href="#customizing-the-formulation" title="Permalink to this headline">¶</a></h3>
|
||||
<p>By default, <code class="docutils literal notranslate"><span class="pre">build_model</span></code> uses a formulation that combines modeling components from different publications, and that has been carefully tested, using our own benchmark scripts, to provide good performance across a wide variety of instances. This default formulation is expected to change over time, as new methods are proposed in the literature. You can, however, construct your own formulation, based on the modeling components that you choose, as shown in the next example.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">Cbc</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="k">import</span> <span class="n">UnitCommitment</span><span class="o">:</span>
|
||||
<span class="n">Formulation</span><span class="p">,</span>
|
||||
<span class="n">KnuOstWat2018</span><span class="p">,</span>
|
||||
<span class="n">MorLatRam2013</span><span class="p">,</span>
|
||||
<span class="n">ShiftFactorsFormulation</span>
|
||||
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read_benchmark</span><span class="p">(</span>
|
||||
<span class="s">"matpower/case118/2017-02-01"</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">build_model</span><span class="p">(</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">instance</span><span class="p">,</span>
|
||||
<span class="n">optimizer</span> <span class="o">=</span> <span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">,</span>
|
||||
<span class="n">formulation</span> <span class="o">=</span> <span class="n">Formulation</span><span class="p">(</span>
|
||||
<span class="n">pwl_costs</span> <span class="o">=</span> <span class="n">KnuOstWat2018</span><span class="o">.</span><span class="n">PwlCosts</span><span class="p">(),</span>
|
||||
<span class="n">ramping</span> <span class="o">=</span> <span class="n">MorLatRam2013</span><span class="o">.</span><span class="n">Ramping</span><span class="p">(),</span>
|
||||
<span class="n">startup_costs</span> <span class="o">=</span> <span class="n">MorLatRam2013</span><span class="o">.</span><span class="n">StartupCosts</span><span class="p">(),</span>
|
||||
<span class="n">transmission</span> <span class="o">=</span> <span class="n">ShiftFactorsFormulation</span><span class="p">(</span>
|
||||
<span class="n">isf_cutoff</span> <span class="o">=</span> <span class="mf">0.005</span><span class="p">,</span>
|
||||
<span class="n">lodf_cutoff</span> <span class="o">=</span> <span class="mf">0.001</span><span class="p">,</span>
|
||||
<span class="p">),</span>
|
||||
<span class="p">),</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="generating-initial-conditions">
|
||||
<h3>Generating initial conditions<a class="headerlink" href="#generating-initial-conditions" title="Permalink to this headline">¶</a></h3>
|
||||
<p>When creating random unit commitment instances for benchmark purposes, it is often hard to compute, in advance, sensible initial conditions for all generators. Setting initial conditions naively (for example, making all generators initially off and producing no power) can easily cause the instance to become infeasible due to excessive ramping. Initial conditions can also make it hard to modify existing instances. For example, increasing the system load without carefully modifying the initial conditions may make the problem infeasible or unrealistically challenging to solve.</p>
|
||||
<p>To help with this issue, UC.jl provides a utility function which can generate feasible initial conditions by solving a single-period optimization problem, as shown below:</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">Cbc</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="c"># Read original instance</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s">"instance.json"</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Generate initial conditions (in-place)</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">generate_initial_conditions!</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Construct and solve optimization model</span>
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">build_model</span><span class="p">(</span>
|
||||
<span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span>
|
||||
<span class="n">optimizer</span><span class="o">=</span><span class="n">Cbc</span><span class="o">.</span><span class="n">Optimizer</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">optimize!</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Warning</p>
|
||||
<p>The function <code class="docutils literal notranslate"><span class="pre">generate_initial_conditions!</span></code> may return different initial conditions after each call, even if the same instance and the same optimizer is provided. The particular algorithm may also change in a future version of UC.jl. For these reasons, it is recommended that you generate initial conditions exactly once for each instance and store them for later use.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="verifying-solutions">
|
||||
<h3>Verifying solutions<a class="headerlink" href="#verifying-solutions" title="Permalink to this headline">¶</a></h3>
|
||||
<p>When developing new formulations, it is very easy to introduce subtle errors in the model that result in incorrect solutions. To help with this, UC.jl includes a utility function that verifies if a given solution is feasible, and, if not, prints all the validation errors it found. The implementation of this function is completely independent from the implementation of the optimization model, and therefore can be used to validate it. The function can also be used to verify solutions produced by other optimization packages, as long as they follow the <a class="reference internal" href="../format/"><span class="doc std std-doc">UC.jl data format</span></a>.</p>
|
||||
<div class="highlight-julia notranslate"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="n">JSON</span>
|
||||
<span class="k">using</span> <span class="n">UnitCommitment</span>
|
||||
|
||||
<span class="c"># Read instance</span>
|
||||
<span class="n">instance</span> <span class="o">=</span> <span class="n">UnitCommitment</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s">"instance.json"</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Read solution (potentially produced by other packages) </span>
|
||||
<span class="n">solution</span> <span class="o">=</span> <span class="n">JSON</span><span class="o">.</span><span class="n">parsefile</span><span class="p">(</span><span class="s">"solution.json"</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Validate solution and print validation errors</span>
|
||||
<span class="n">UnitCommitment</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">solution</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
<a class='left-prev' id="prev-link" href="../" title="previous page">UnitCommitment.jl</a>
|
||||
<a class='right-next' id="next-link" href="../format/" title="next page"><span class="sectnum">2.</span> Data Format</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer mt-5 mt-md-0">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
© Copyright 2020-2021, UChicago Argonne, LLC.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|