)</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'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'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("dvRatedProduction"*_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
0 commit comments