Update docs

docs
Alinson S. Xavier 5 years ago
parent 712742a518
commit 100c4267e4

@ -133,6 +133,8 @@
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/languages/julia.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

@ -117,37 +117,24 @@
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#data-format">Data Format</a></li>
<li class="second-level"><a href="#parameters">Parameters</a></li>
<li class="second-level"><a href="#1-input-data-format">1. Input Data Format</a></li>
<li class="third-level"><a href="#example">Example</a></li>
<li class="second-level"><a href="#buses">Buses</a></li>
<li class="third-level"><a href="#11-parameters">1.1 Parameters</a></li>
<li class="third-level"><a href="#12-buses">1.2 Buses</a></li>
<li class="third-level"><a href="#13-generators">1.3 Generators</a></li>
<li class="third-level"><a href="#14-price-sensitive-loads">1.4 Price-sensitive loads</a></li>
<li class="third-level"><a href="#15-transmission-lines">1.5 Transmission Lines</a></li>
<li class="third-level"><a href="#16-reserves">1.6 Reserves</a></li>
<li class="third-level"><a href="#17-contingencies">1.7 Contingencies</a></li>
<li class="third-level"><a href="#18-additional-remarks">1.8 Additional remarks</a></li>
<li class="second-level"><a href="#2-output-data-format">2. Output Data Format</a></li>
<li class="third-level"><a href="#example_1">Example</a></li>
<li class="second-level"><a href="#generators">Generators</a></li>
<li class="third-level"><a href="#production-costs-and-limits">Production costs and limits</a></li>
<li class="third-level"><a href="#example_2">Example</a></li>
<li class="second-level"><a href="#price-sensitive-loads">Price-sensitive loads</a></li>
<li class="third-level"><a href="#example_3">Example</a></li>
<li class="second-level"><a href="#transmission-lines">Transmission Lines</a></li>
<li class="third-level"><a href="#example_4">Example</a></li>
<li class="second-level"><a href="#reserves">Reserves</a></li>
<li class="third-level"><a href="#example_5">Example</a></li>
<li class="second-level"><a href="#contingencies">Contingencies</a></li>
<li class="third-level"><a href="#example_6">Example</a></li>
<li class="second-level"><a href="#additional-remarks">Additional remarks</a></li>
<li class="third-level"><a href="#time-series-parameters">Time series parameters</a></li>
<li class="third-level"><a href="#current-limitations">Current limitations</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="data-format">Data Format</h1>
<h2 id="1-input-data-format">1. Input Data Format</h2>
<p>Instances are specified by JSON files containing the following main sections:</p>
<ul>
<li><a href="#parameters">Parameters</a></li>
@ -159,7 +146,7 @@
<li><a href="#contingencies">Contingencies</a></li>
</ul>
<p>Each section is described in detail below. For a complete example, see <a href="https://github.com/ANL-CEEESA/UnitCommitment.jl/blob/dev/instances/matpower-24h/case14.json">case14.json</a>.</p>
<h2 id="parameters">Parameters</h2>
<h3 id="11-parameters">1.1 Parameters</h3>
<p>This section describes system-wide parameters, such as power balance penalties, and optimization parameters, such as the length of the planning horizon.</p>
<table>
<thead>
@ -185,7 +172,7 @@
</tr>
</tbody>
</table>
<h3 id="example">Example</h3>
<h4 id="example">Example</h4>
<pre><code class="json">{
&quot;Parameters&quot;: {
&quot;Time (h)&quot;: 4,
@ -194,7 +181,7 @@
}
</code></pre>
<h2 id="buses">Buses</h2>
<h3 id="12-buses">1.2 Buses</h3>
<p>This section describes the characteristics of each bus in the system. </p>
<table>
<thead>
@ -214,7 +201,7 @@
</tr>
</tbody>
</table>
<h3 id="example_1">Example</h3>
<h4 id="example_1">Example</h4>
<pre><code class="json">{
&quot;Buses&quot;: {
&quot;b1&quot;: {
@ -232,7 +219,7 @@
}
</code></pre>
<h2 id="generators">Generators</h2>
<h3 id="13-generators">1.3 Generators</h3>
<p>This section describes all generators in the system, including thermal units, renewable units and virtual units.</p>
<table>
<thead>
@ -324,7 +311,7 @@
</tr>
</tbody>
</table>
<h3 id="production-costs-and-limits">Production costs and limits</h3>
<h4 id="production-costs-and-limits">Production costs and limits</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 dollars to generate, respectively, 100, 110, 130 and 135 MW of power. To model this generator, <code>Production cost curve (MW)</code> should be set to <code>[100, 110, 130, 135]</code>, and <code>Production cost curve ($)</code> should be set to <code>[1400, 1600, 2200, 2400]</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>
<p><center>
@ -332,14 +319,14 @@ Note that this curve also specifies the production limits. Specifically, the fir
<div><b>Figure 1.</b> Piecewise-linear production cost curve.</div>
<br/>
</center></p>
<p><strong>Additional remarks:</strong></p>
<h4 id="additional-remarks">Additional remarks:</h4>
<ul>
<li>For time-dependent production limits or time-dependent production costs, the usage of nested arrays is allowed. For example, if <code>Production cost curve (MW)</code> is set to <code>[5.0, [10.0, 12.0, 15.0, 20.0]]</code>, then the unit may generate at most 10, 12, 15 and 20 MW of power during time periods 1, 2, 3 and 4, respectively. The minimum output for all time periods is fixed to at 5 MW.</li>
<li>There is no limit to the number of piecewise-linear segments, and different generators may have a different number of segments.</li>
<li>If <code>Production cost curve (MW)</code> and <code>Production cost curve ($)</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>P</code>, the parameter <code>Production cost curve (MW)</code> should be set to <code>[0, P]</code>. </li>
<li>Production cost curves must be convex.</li>
</ul>
<h3 id="example_2">Example</h3>
<h4 id="example_2">Example</h4>
<pre><code class="json">{
&quot;Generators&quot;: {
&quot;gen1&quot;: {
@ -368,7 +355,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
}
</code></pre>
<h2 id="price-sensitive-loads">Price-sensitive loads</h2>
<h3 id="14-price-sensitive-loads">1.4 Price-sensitive loads</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>buses</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>
<thead>
@ -400,7 +387,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
</tr>
</tbody>
</table>
<h3 id="example_3">Example</h3>
<h4 id="example_3">Example</h4>
<pre><code class="json">{
&quot;Price-sensitive loads&quot;: {
&quot;p1&quot;: {
@ -412,7 +399,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
}
</code></pre>
<h2 id="transmission-lines">Transmission Lines</h2>
<h3 id="15-transmission-lines">1.5 Transmission Lines</h3>
<p>This section describes the characteristics of transmission system, such as its topology and the susceptance of each transmission line.</p>
<table>
<thead>
@ -468,7 +455,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
</tr>
</tbody>
</table>
<h3 id="example_4">Example</h3>
<h4 id="example_4">Example</h4>
<pre><code class="json">{
&quot;Transmission lines&quot;: {
&quot;l1&quot;: {
@ -484,7 +471,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
}
</code></pre>
<h2 id="reserves">Reserves</h2>
<h3 id="16-reserves">1.6 Reserves</h3>
<p>This section describes the hourly amount of operating reserves required.</p>
<table>
<thead>
@ -504,7 +491,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
</tr>
</tbody>
</table>
<h3 id="example_5">Example</h3>
<h4 id="example_5">Example</h4>
<pre><code class="json">{
&quot;Reserves&quot;: {
&quot;Spinning (MW)&quot;: [
@ -517,7 +504,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
}
</code></pre>
<h2 id="contingencies">Contingencies</h2>
<h3 id="17-contingencies">1.7 Contingencies</h3>
<p>This section describes credible contingency scenarios in the optimization, such as the loss of a transmission line or generator.</p>
<table>
<thead>
@ -540,7 +527,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
</tr>
</tbody>
</table>
<h3 id="example_6">Example</h3>
<h4 id="example_6">Example</h4>
<pre><code class="json">{
&quot;Contingencies&quot;: {
&quot;c1&quot;: {
@ -554,8 +541,8 @@ Note that this curve also specifies the production limits. Specifically, the fir
}
</code></pre>
<h2 id="additional-remarks">Additional remarks</h2>
<h3 id="time-series-parameters">Time series parameters</h3>
<h3 id="18-additional-remarks">1.8 Additional remarks</h3>
<h4 id="time-series-parameters">Time series parameters</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>T</code> elements, where <code>T</code> is the length of the planning horizon, if they are time-dependent. For example, both formats below are valid when <code>T=3</code>:</p>
<pre><code class="json">{
&quot;Load (MW)&quot;: 800.0,
@ -563,12 +550,15 @@ Note that this curve also specifies the production limits. Specifically, the fir
}
</code></pre>
<h3 id="current-limitations">Current limitations</h3>
<h4 id="current-limitations">Current limitations</h4>
<ul>
<li>All reserves are system-wide (no zonal reserves)</li>
<li>Network topology remains the same for all time periods</li>
<li>Only N-1 transmission contingencies are supported. Generator contingencies are not supported.</li>
</ul></div>
<li>Time-varying minimum production amounts are not currently compatible with ramp/startup/shutdown limits.</li>
</ul>
<h2 id="2-output-data-format">2. Output Data Format</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>
@ -591,6 +581,8 @@ Note that this curve also specifies the production limits. Specifically, the fir
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/languages/julia.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

@ -134,7 +134,7 @@
<div class="col-md-9" role="main">
<h1 id="unitcommitmentjl">UnitCommitment.jl</h1>
<p><strong>UnitCommitment.jl</strong> (UC.jl) is an 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 JuMP implementations of state-of-the-art mixed-integer programming formulations.</p>
<p><strong>UnitCommitment.jl</strong> (UC.jl) is a Julia 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>
<h3 id="package-components">Package Components</h3>
<ul>
<li><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.</li>
@ -189,6 +189,8 @@
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/languages/julia.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
@ -271,5 +273,5 @@
<!--
MkDocs version : 1.1.2
Build Date UTC : 2020-11-03 23:36:25.864718+00:00
Build Date UTC : 2020-11-06 19:44:10.310639+00:00
-->

@ -1,230 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Isf - UnitCommitment.jl</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
<link href="../css/base.min.css" rel="stylesheet">
<link href="../css/cinder.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/styles/github.min.css">
<link href="../css/custom.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="..">UnitCommitment.jl</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li >
<a href="..">Home</a>
</li>
<li >
<a href="../usage/">Usage</a>
</li>
<li >
<a href="../format/">Format</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fas fa-search"></i> Search
</a>
</li>
<li>
<a href="https://github.com/ANL-CEEESA/unitcommitment.jl/edit/dev/src/docs/isf.md"><i class="fab fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#linear-sensitivity-factors">Linear Sensitivity Factors</a></li>
<li class="second-level"><a href="#injection-shift-factors">Injection Shift Factors</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="linear-sensitivity-factors">Linear Sensitivity Factors</h1>
<p>UnitCommitment.jl includes a number of functions to compute typical linear sensitivity
factors, such as <a href="@ref">Injection Shift Factors</a> and <a href="@ref">Line Outage Distribution Factors</a>. These sensitivity factors can be used to quickly compute DC power flows in both base and N-1 contigency scenarios.</p>
<h2 id="injection-shift-factors">Injection Shift Factors</h2>
<p>Given a network with <code>B</code> buses and <code>L</code> transmission lines, the Injection Shift Factors (ISF) matrix is an <code>L</code>-by-<code>B</code> matrix which indicates much power flows through a certain transmission line when 1 MW of power is injected at bus <code>b</code> and withdrawn from the slack bus. For example, <code>isf[:l7, :b5]</code> indicates the amount of power (in MW) that flows through line <code>l7</code> when 1 MW of power is injected at bus <code>b5</code> and withdrawn from the slack bus.
This matrix is computed based on the DC linearization of power flow equations and does not include losses.
To compute the ISF matrix, the function <code>injection_shift_factors</code> can be used. It is necessary to specify the set of lines, buses and the slack bus:</p>
<pre><code class="julia">using UnitCommitment
instance = UnitCommitment.load(&quot;ieee_rts/case14&quot;)
isf = UnitCommitment.injection_shift_factors(lines = instance.lines,
buses = instance.buses,
slack = :b14)
@show isf[:l7, :b5]
</code></pre></div>
</div>
<footer class="col-md-12 text-center">
<hr>
<p>
<small>Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.</small><br>
<small>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</small>
</p>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../js/bootstrap-3.0.3.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>var base_url = ".."</script>
<script src="../js/base.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="../js/mathjax.js"></script>
<script src="../search/main.js"></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="searchModalLabel">Search</h4>
</div>
<div class="modal-body">
<p>
From here you can search these documents. Enter
your search terms below.
</p>
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>

@ -1,321 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Model - UnitCommitment.jl</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
<link href="../css/base.min.css" rel="stylesheet">
<link href="../css/cinder.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/styles/github.min.css">
<link href="../css/custom.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="..">UnitCommitment.jl</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li >
<a href="..">Home</a>
</li>
<li >
<a href="../usage/">Usage</a>
</li>
<li >
<a href="../format/">Format</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fas fa-search"></i> Search
</a>
</li>
<li>
<a href="https://github.com/ANL-CEEESA/unitcommitment.jl/edit/dev/src/docs/model.md"><i class="fab fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#benchmark-model">Benchmark Model</a></li>
<li class="second-level"><a href="#building-and-solving-the-model">Building and Solving the Model</a></li>
<li class="second-level"><a href="#decision-variables">Decision Variables</a></li>
<li class="second-level"><a href="#accessing-the-solution">Accessing the Solution</a></li>
<li class="second-level"><a href="#modifying-the-model">Modifying the Model</a></li>
<li class="second-level"><a href="#reference">Reference</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="benchmark-model">Benchmark Model</h1>
<p>UnitCommitment.jl includes a reference Mixed-Integer Linear Programming
(MILP), built with <a href="https://github.com/JuliaOpt/JuMP.jl">JuMP</a>, which can
either be used as-is to solve instances of the problem, or be extended to
build more complex formulations.</p>
<h2 id="building-and-solving-the-model">Building and Solving the Model</h2>
<p>Given an instance and a JuMP optimizer, the function <code>build_model</code> can be used to
build the reference MILP model. For example:</p>
<pre><code class="julia">using UnitCommitment, JuMP, Cbc
instance = UnitCommitment.load(&quot;ieee_rts/case118&quot;)
model = build_model(instance, with_optimizer(Cbc.Optimizer))
</code></pre>
<p>The model enforces all unit constraints described in <a href="@ref">Unit Commitment
Instances</a>, including ramping, minimum-up and minimum-down times. Some
system-wide constraints, such as spinning reserves, are also enforced. The
model, however, does not enforce transmission or N-1 security constraints,
since these are typically generated on-the-fly.</p>
<p>A reference to the JuMP model is stored at <code>model.mip</code>. After constructed, the model can
be optimized as follows:</p>
<pre><code class="julia">optimize!(model.mip)
</code></pre>
<h2 id="decision-variables">Decision Variables</h2>
<p>References to all decision variables are stored at <code>model.vars</code>.
A complete list of available decision variables is as follows:</p>
<table>
<thead>
<tr>
<th align="left">Variable</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>model.vars.production[gi,t]</code></td>
<td align="left">Amount of power (in MW) produced by unit with index <code>gi</code> at time <code>t</code>.</td>
</tr>
<tr>
<td align="left"><code>model.vars.reserve[gi,t]</code></td>
<td align="left">Amount of spinning reserves (in MW) provided by unit with index <code>gi</code> at time <code>t</code>.</td>
</tr>
<tr>
<td align="left"><code>model.vars.is_on[gi,t]</code></td>
<td align="left">Binary variable indicating if unit with index <code>gi</code> is operational at time <code>t</code>.</td>
</tr>
<tr>
<td align="left"><code>model.vars.switch_on[gi,t]</code></td>
<td align="left">Binary variable indicating if unit with index <code>gi</code> was switched on at time <code>t</code>. That is, the unit was not operational at time <code>t-1</code>, but it is operational at time <code>t</code>.</td>
</tr>
<tr>
<td align="left"><code>model.vars.switch_off[gi,t]</code></td>
<td align="left">Binary variable indicating if unit with index <code>gi</code> was switched off at time <code>t</code>. That is, the unit was operational at time <code>t-1</code>, but it is no longer operational at time <code>t</code>.</td>
</tr>
<tr>
<td align="left"><code>model.vars.unit_cost[gi,t]</code></td>
<td align="left">The total cost to operate unit with index <code>gi</code> at time <code>t</code>. Includes start-up costs, no-load costs and any other production costs.</td>
</tr>
<tr>
<td align="left"><code>model.vars.cost[t]</code></td>
<td align="left">Total cost at time <code>t</code>.</td>
</tr>
<tr>
<td align="left"><code>model.vars.net_injection[bi,t]</code></td>
<td align="left">Total net injection (in MW) at bus with index <code>bi</code> and time <code>t</code>. Net injection is defined as the total power being produced by units located at the bus minus the bus load.</td>
</tr>
</tbody>
</table>
<h2 id="accessing-the-solution">Accessing the Solution</h2>
<p>To access the value of a particular decision variable after the
optimization is completed, the function <code>JuMP.value(var)</code> can be used. The
following example prints the amount of power (in MW) produced by each unit at time 5:</p>
<pre><code class="julia">for g in instance.units
@show value(model.vars.production[g.index, 5])
end
</code></pre>
<h2 id="modifying-the-model">Modifying the Model</h2>
<p>Prior to being solved, the reference model can be modified by using the variable references
above and conventional JuMP macros. For example, the
following code can be used to ensure that at most 10 units are operational at time 4:</p>
<pre><code class="julia">using UnitCommitment, JuMP, Cbc
instance = UnitCommitment.load(&quot;ieee_rts/case118&quot;)
model = build_model(instance, with_optimizer(Cbc.Optimizer))
@contraint(model.mip,
sum(model.vars.is_on[g.index, 4]
for g in instance.units) &lt;= 10)
optimize!(model.mip)
</code></pre>
<p>It is not currently possible to modify the constraints included in the
reference model.</p>
<h2 id="reference">Reference</h2>
<p><code>@docs
UnitCommitment.build_model</code></p></div>
</div>
<footer class="col-md-12 text-center">
<hr>
<p>
<small>Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.</small><br>
<small>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</small>
</p>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../js/bootstrap-3.0.3.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>var base_url = ".."</script>
<script src="../js/base.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="../js/mathjax.js"></script>
<script src="../search/main.js"></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="searchModalLabel">Search</h4>
</div>
<div class="modal-body">
<p>
From here you can search these documents. Enter
your search terms below.
</p>
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>None</loc>
<lastmod>2020-11-03</lastmod>
<lastmod>2020-11-06</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>None</loc>
<lastmod>2020-11-03</lastmod>
<lastmod>2020-11-06</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>None</loc>
<lastmod>2020-11-03</lastmod>
<lastmod>2020-11-06</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

@ -116,13 +116,25 @@
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#installation-guide">Installation Guide</a></li>
<li class="first-level active"><a href="#usage">Usage</a></li>
<li class="second-level"><a href="#1-installation">1. Installation</a></li>
<li class="second-level"><a href="#2-typical-usage">2. Typical Usage</a></li>
<li class="third-level"><a href="#21-solving-user-provided-instances">2.1 Solving user-provided instances</a></li>
<li class="third-level"><a href="#22-solving-benchmark-instances">2.2 Solving benchmark instances</a></li>
<li class="second-level"><a href="#3-advanced-usage">3. Advanced usage</a></li>
<li class="third-level"><a href="#31-modifying-the-formulation">3.1 Modifying the formulation</a></li>
<li class="third-level"><a href="#32-generating-initial-conditions">3.2 Generating initial conditions</a></li>
<li class="third-level"><a href="#33-verifying-solutions">3.3 Verifying solutions</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="installation-guide">Installation Guide</h1>
<p>This package was tested and developed with <a href="https://julialang.org/">Julia 1.5</a>. To install Julia, please follow the <a href="https://julialang.org/downloads/platform.html">installation guide on their website</a>. To install <code>UnitCommitment.jl</code>, run the Julia interpreter, type <code>]</code> to open the package manager, then type:</p>
<h1 id="usage">Usage</h1>
<h2 id="1-installation">1. Installation</h2>
<p>UnitCommitment.jl was tested and developed with <a href="https://julialang.org/">Julia 1.5</a>. To install Julia, please follow the <a 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>]</code> to open the package manager, then type:</p>
<pre><code class="text">pkg&gt; add https://github.com/ANL-CEEESA/UnitCommitment.jl.git
</code></pre>
@ -130,8 +142,73 @@
<pre><code class="text">pkg&gt; test UnitCommitment
</code></pre>
<p>If all tests pass, the package should now be ready to be used by any Julia script on the machine. To try it out in the julia interpreter hit <code>backspace</code> to return to the regular interpreter, and type the following command:</p>
<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 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 href="https://github.com/JuliaOpt/Cbc.jl">Cbc</a> and <a 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>
<h2 id="2-typical-usage">2. Typical Usage</h2>
<h3 id="21-solving-user-provided-instances">2.1 Solving user-provided instances</h3>
<p>The first step to use UC.jl is to construct a JSON file describing your unit commitment instance. See the <a href="">data format page</a> for a complete description of the data format UC.jl expects. The next steps, as shown below, are to read the instance from file, construct the optimization model, run the optimization and extract the optimal solution.</p>
<pre><code class="julia">using Cbc
using UnitCommitment
# Read instance
instance = UnitCommitment.read(&quot;/path/to/input.json&quot;)
# Construct optimization model
model = UnitCommitment.build_model(instance, Cbc.Optimizer)
# Solve model
UnitCommitment.optimize!(model)
# Extract solution and write it to a file
solution = UnitCommitment.get_solution(model)
open(&quot;/path/to/output.json&quot;, &quot;w&quot;) do file
JSON.print(file, solution, 2)
end
</code></pre>
<h3 id="22-solving-benchmark-instances">2.2 Solving benchmark instances</h3>
<p>As described in the <a href="">instances page</a>, UnitCommitment.jl contains a number of benchmark instances collected from the literature. To solve one of these instances individually, instead of constructing your own, the function <code>read_benchmark</code> can be used:</p>
<pre><code class="julia">using UnitCommitment
instance = UnitCommitment.read_benchmark(&quot;matpower/case3375wp/2017-01-01&quot;)
</code></pre>
<h2 id="3-advanced-usage">3. Advanced usage</h2>
<h3 id="31-modifying-the-formulation">3.1 Modifying the formulation</h3>
<p>For the time being, the recommended way of modifying the MILP formulation used by UC.jl is to create a local copy of our git repository and directly modify the source code of the package. In a future version, it will be possible to switch between multiple formulations, or to simply add/remove constraints after the model has been generated.</p>
<h3 id="32-generating-initial-conditions">3.2 Generating initial conditions</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>
<pre><code class="julia">using Cbc
using UnitCommitment
# Read original instance
instance = UnitCommitment.read(&quot;instance.json&quot;)
# Generate initial conditions (in-place)
UnitCommitment.generate_initial_conditions!(instance, Cbc.Optimizer)
# Construct and solve optimization model
model = UnitCommitment.build_model(instance, Cbc.Optimizer)
UnitCommitment.optimize!(model)
</code></pre>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The function <code>generate_initial_conditions!</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>
<h3 id="33-verifying-solutions">3.3 Verifying solutions</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 href="../format/">UC.jl data format</a>.</p>
<pre><code class="julia">using JSON
using UnitCommitment
# Read instance
instance = UnitCommitment.read(&quot;instance.json&quot;)
# Read solution (potentially produced by other packages)
solution = JSON.parsefile(&quot;solution.json&quot;)
# Validate solution and print validation errors
UnitCommitment.validate(instance, solution)
</code></pre></div>
@ -155,6 +232,8 @@
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/languages/julia.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

Loading…
Cancel
Save