Skip to content

Commit 74ac4be

Browse files
author
Documenter.jl
committed
build based on bb85c6d
1 parent 83ed4bb commit 74ac4be

17 files changed

Lines changed: 56 additions & 55 deletions

File tree

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.10.11","generation_timestamp":"2026-04-13T19:42:14","documenter_version":"1.17.0"}}
1+
{"documenter":{"julia_version":"1.10.11","generation_timestamp":"2026-04-27T21:16:00","documenter_version":"1.17.0"}}

dev/developer/adding_tech/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
ghp::Vector{String}
3737
ashp::Vector{String}
3838
ashp_wh::Vector{String}
39-
end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/NatLabRockies/REopt.jl/blob/2af3afe46e65b818b7d968bdcb15af525b97d0b2/src/core/types.jl#L17-L53">source</a></section></details></article><article><details class="docstring" open="true"><summary id="REopt.Techs-Tuple{Scenario}"><a class="docstring-binding" href="#REopt.Techs-Tuple{Scenario}"><code>REopt.Techs</code></a><span class="docstring-category">Method</span></summary><section><div><pre><code class="language-julia hljs">Techs(s::Scenario)</code></pre><p>Create a <code>Techs</code> struct for the REoptInputs.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/NatLabRockies/REopt.jl/blob/2af3afe46e65b818b7d968bdcb15af525b97d0b2/src/core/techs.jl#L97-L101">source</a></section></details></article><article><details class="docstring" open="true"><summary id="REopt.Techs-Tuple{REoptInputs, BAUScenario}"><a class="docstring-binding" href="#REopt.Techs-Tuple{REoptInputs, BAUScenario}"><code>REopt.Techs</code></a><span class="docstring-category">Method</span></summary><section><div><pre><code class="language-julia hljs">Techs(p::REoptInputs, s::BAUScenario)</code></pre><p>Create a <code>Techs</code> struct for the BAUInputs</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/NatLabRockies/REopt.jl/blob/2af3afe46e65b818b7d968bdcb15af525b97d0b2/src/core/techs.jl#L2-L6">source</a></section></details></article><p>From the <a href="#Techs">Techs</a> definition we can see that there are already a lot of different energy generation technology categories in REopt. Adding a new technology to the model could be as simple as adding the appropriate inputs to <code>REoptInputs</code> (described in the next section) and using the <code>Techs</code> structure to define which variables and constraints apply to the new technology.</p><p>The <code>PV</code> technology is also part of a unique set of <code>Techs</code>, namely the <code>techs.pv</code> (there can be multiple <code>PV</code> technologies in a single model as we will see soon). An example of a constraint applied over <code>techs.pv</code> is:</p><pre><code class="language-julia hljs">@constraint(m, [loc in p.pvlocations],
39+
end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/NatLabRockies/REopt.jl/blob/bb85c6d237d679ce88439d934a182da1f3d6d86e/src/core/types.jl#L17-L53">source</a></section></details></article><article><details class="docstring" open="true"><summary id="REopt.Techs-Tuple{Scenario}"><a class="docstring-binding" href="#REopt.Techs-Tuple{Scenario}"><code>REopt.Techs</code></a><span class="docstring-category">Method</span></summary><section><div><pre><code class="language-julia hljs">Techs(s::Scenario)</code></pre><p>Create a <code>Techs</code> struct for the REoptInputs.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/NatLabRockies/REopt.jl/blob/bb85c6d237d679ce88439d934a182da1f3d6d86e/src/core/techs.jl#L97-L101">source</a></section></details></article><article><details class="docstring" open="true"><summary id="REopt.Techs-Tuple{REoptInputs, BAUScenario}"><a class="docstring-binding" href="#REopt.Techs-Tuple{REoptInputs, BAUScenario}"><code>REopt.Techs</code></a><span class="docstring-category">Method</span></summary><section><div><pre><code class="language-julia hljs">Techs(p::REoptInputs, s::BAUScenario)</code></pre><p>Create a <code>Techs</code> struct for the BAUInputs</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/NatLabRockies/REopt.jl/blob/bb85c6d237d679ce88439d934a182da1f3d6d86e/src/core/techs.jl#L2-L6">source</a></section></details></article><p>From the <a href="#Techs">Techs</a> definition we can see that there are already a lot of different energy generation technology categories in REopt. Adding a new technology to the model could be as simple as adding the appropriate inputs to <code>REoptInputs</code> (described in the next section) and using the <code>Techs</code> structure to define which variables and constraints apply to the new technology.</p><p>The <code>PV</code> technology is also part of a unique set of <code>Techs</code>, namely the <code>techs.pv</code> (there can be multiple <code>PV</code> technologies in a single model as we will see soon). An example of a constraint applied over <code>techs.pv</code> is:</p><pre><code class="language-julia hljs">@constraint(m, [loc in p.pvlocations],
4040
sum(m[Symbol(&quot;dvSize&quot;*_n)][t] * p.pv_to_location[t][loc] for t in p.techs.pv) &lt;= p.maxsize_pv_locations[loc]
4141
)</code></pre><p>Here we can see that the <code>dvSize</code> for each <code>techs.pv</code> is constrained based on the location of each <code>PV</code> technology. This constraint allows us to uniquely limit the <code>PV</code> capacity for roof mounted systems vs. ground mounted systems based on the available space at a site. We also see some additional inputs for the <code>PV</code> technology, such as the <code>pvlocations</code> and <code>maxsize_pv_locations</code>. Creating these input values is described in the next two sections.</p><h2 id="2.-User-Inputs"><a class="docs-heading-anchor" href="#2.-User-Inputs">2. User Inputs</a><a id="2.-User-Inputs-1"></a><a class="docs-heading-anchor-permalink" href="#2.-User-Inputs" title="Permalink"></a></h2><p>Any new technology should have a <code>technologyname.jl</code> file in the <code>src/core</code> directory. For example, in the <code>src/core/pv.jl</code> file we have a data structure and constructor for defining default values and creating the <code>PV</code> structure that is attached to the <a href="../../reopt/inputs/#Scenario">Scenario</a>. Once the new technology&#39;s data structure is defined it must be added to the <code>Scenario</code> structure (see <code>src/core/scenario.jl</code>). </p><p>When adding a new technology to REopt one must decide on how a user of the REopt will define the technology. Continuing with the <code>PV</code> example we saw that we need to define the <code>production_factor</code> for the <code>PV</code> technology in every time step. The <code>production_factor</code> varies from zero to one and defines the availability of the technology. For <code>PV</code> we have a default method for creating the <code>production_factor</code> as well as allow the user to provide their own <code>production_factor</code>.</p><p>We let the user define the <code>production_factor</code> by providing the <code>PV</code>s <code>production_factor_series</code> input in their JSON file or dictionary when creating their <a href="../../reopt/inputs/#Scenario">Scenario</a>. If the user does not provide a value for <code>production_factor_series</code> then we use the PVWatts API to get a <code>production_factor</code> based on the <code>Site.latitude</code> and <code>Site.longitude</code>. The <a href="../../reopt/inputs/#PV">PV</a> inputs structure also allows the user to change the arguments that are passed to PVWatts.</p><h2 id="3.-REopt-Inputs"><a class="docs-heading-anchor" href="#3.-REopt-Inputs">3. REopt Inputs</a><a id="3.-REopt-Inputs-1"></a><a class="docs-heading-anchor-permalink" href="#3.-REopt-Inputs" title="Permalink"></a></h2><p>The <a href="../inputs/#REoptInputs">REoptInputs</a> constructor is the work-horse for defining all the mathematical model parameters. It converts the user&#39;s <a href="../../reopt/inputs/#Scenario">Scenario</a> into a format that is necessary for adding the model decision variables and constraints.</p><p>A major part of the <a href="../inputs/#REoptInputs">REoptInputs</a> constructor is creating arrays that are indexed on sets of strings (defined in <a href="#Techs">Techs</a>) that allow us to define constraints all applicable technologies. Continuing with the <code>PV</code> example, the electrical load balance constraint includes:</p><pre><code class="language-julia hljs">sum(p.production_factor[t, ts] * p.levelization_factor[t] * m[Symbol(&quot;dvRatedProduction&quot;*_n)][t,ts] for t in p.techs.elec) </code></pre><p>which implies that we need to define a <code>production_factor</code> for all <code>techs.elec</code> in every time step <code>ts</code>. To create the <code>production_factor</code> array the <a href="../inputs/#REoptInputs">REoptInputs</a> constructor first creates an empty array like so:</p><pre><code class="language-julia hljs">production_factor = DenseAxisArray{Float64}(undef, techs.all, 1:length(s.electric_load.loads_kw))</code></pre><p>and then passes that array to technology specific functions that add their production factors to the <code>production_factor</code> array. For example, for <code>PV</code> within the <code>setup_pv_inputs</code> method we have:</p><pre><code class="language-julia hljs">for pv in s.pvs
4242
production_factor[pv.name, :] = get_production_factor(pv, s.site.latitude, s.site.longitude)
@@ -55,4 +55,4 @@
5555
m = Model(Cbc.Optimizer)
5656
results = run_reopt(m, &quot;path/to/mynewtech.json&quot;)
5757
@test results[&quot;mynewtech&quot;][&quot;some_result&quot;] ≈ 78.9 atol=0.1
58-
end</code></pre><h2 id="6.-Documenting"><a class="docs-heading-anchor" href="#6.-Documenting">6. Documenting</a><a id="6.-Documenting-1"></a><a class="docs-heading-anchor-permalink" href="#6.-Documenting" title="Permalink"></a></h2><p>See <a href="../documentation/#Documenting-the-Code">Documenting the Code</a></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../inputs/">« The REoptInputs structure</a><a class="docs-footer-nextpage" href="../documentation/">Documenting the Code »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.17.0 on <span class="colophon-date" title="Monday 13 April 2026 19:42">Monday 13 April 2026</span>. Using Julia version 1.10.11.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
58+
end</code></pre><h2 id="6.-Documenting"><a class="docs-heading-anchor" href="#6.-Documenting">6. Documenting</a><a id="6.-Documenting-1"></a><a class="docs-heading-anchor-permalink" href="#6.-Documenting" title="Permalink"></a></h2><p>See <a href="../documentation/#Documenting-the-Code">Documenting the Code</a></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../inputs/">« The REoptInputs structure</a><a class="docs-footer-nextpage" href="../documentation/">Documenting the Code »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.17.0 on <span class="colophon-date" title="Monday 27 April 2026 21:16">Monday 27 April 2026</span>. Using Julia version 1.10.11.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)