From 3b143935e2ee91a374b5025145254048b275f2c4 Mon Sep 17 00:00:00 2001 From: yinongsun Date: Wed, 12 Oct 2022 14:08:25 -0600 Subject: [PATCH 01/12] Files with no actual changes --- LICENSE | 58 +- README.md | 130 +-- input_file_structure.html | 848 +++++++-------- src/PRAS_functions/conv.jl | 242 ++--- .../prediction/REC_profit.jl | 112 +- .../prediction/capacity_profit.jl | 124 +-- src/markets_simulation/economicdispatch.jl | 602 +++++------ .../ordc_construction/ordc_market_creator.jl | 46 +- src/representative_days/clustering.jl | 178 ++-- src/structs/Forecast.jl | 44 +- src/structs/InvestorBelief.jl | 200 ++-- src/structs/RiskPreference.jl | 44 +- src/structs/Scenario.jl | 44 +- src/structs/ZonalLine.jl | 46 +- src/structs/devices/BuildPhase.jl | 14 +- src/structs/market_structs/CapacityMarket.jl | 40 +- src/structs/market_structs/EnergyMarket.jl | 40 +- .../market_structs/MarketClearingProblem.jl | 76 +- .../market_structs/ReserveDownMarket.jl | 42 +- .../market_structs/ReserveORDCMarket.jl | 58 +- src/structs/market_structs/ReserveUpMarket.jl | 44 +- src/structs/products/Capacity.jl | 110 +- src/structs/products/OperatingReserve.jl | 28 +- src/structs/products/Product.jl | 18 +- src/test_system_parsers/test_system_reader.jl | 68 +- src/utils/conversion_utils.jl | 974 +++++++++--------- src/utils/finance_utils.jl | 298 +++--- src/utils/read_and_write_utils.jl | 64 +- 28 files changed, 2296 insertions(+), 2296 deletions(-) diff --git a/LICENSE b/LICENSE index 37f5fcd..52a1b7d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,29 @@ -BSD 3-Clause License - -Copyright (c) 2019, Alliance for Sustainable Energy, 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: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* 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. - -* 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. +BSD 3-Clause License + +Copyright (c) 2019, Alliance for Sustainable Energy, 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: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* 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. + +* 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. diff --git a/README.md b/README.md index e9e0869..6f8cea2 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,66 @@ -# EMIS AgentSimulation Model - -The Electricity Markets Investment Suite Agent-based Simulation (EMIS-AS) -model is an agent-based model developed at NREL for simulating annual investment -and retirement decisions of heterogeneous investors in the electricity sector. -EMIS-AS is designed to capture the evolution of the electricity generation portfolio -resulting from the interactions of heterogeneous investors under different policy -and market designs. EMIS-AS not only allows end-users to customize market products -and rules, but also to capture investors' heterogeneous financing parameters, -technology preferences, beliefs about the future (forecasts), ability to update -those forecasts, and risk preferences under uncertainty. - -## Model Structure - - - -EMIS-AS is initialized based on the input data detailing the test system, generation -units, market design, investors' characteristics and simulation parameters. Additionally, -the pre-processing step includes calculation of the weighted average cost of capital -(WACC) and adjusted CAPEX for all existing and option projects for each investor. -Next, the model selects the specified number of representative days (with hourly -resolution) to be used by the investors for price prediction. These representative -days and their corresponding weights are determined based on load and renewable -generation timeseries using k-medoids clustering. - -Subsequently, the simulation commences with successive yearly iterations for the specified -simulation horizon. At the start of each simulation year, the investors project future -prices and make revenue predictions. The predicted revenues are then used to calculate the -expected utility (based on the expected net present value (NPV)) for all projects. -Subsequently, the revenue prediction outcomes and expected utility are used to make -investment and retirement decisions and for calculation of market bids. - - -Once all investors have completed their decision-making process, their investment and -retirement decisions are announced. The model then updates the build-phases of all -projects, which are depicted below. - - - -The projects in the Option phase which get decided to be invested in are sent to the -interconnection queue and included in the list of active projects. The projects already -in the interconnection queue progress one year further in the queue. -The projects which have completed their queue time then enter the construction phase. It -is assumed that the investors only have to pay the annual queue costs when the projects are -in the queue, but would have to pay the full capital cost once construction commences. -The projects which have completed their construction times are included in the set of existing -projects. Finally, if any project is to be retired, either due to end-of-life or profitability -reasons, is removed from the list of active projects. - -The life cycle phase updates are followed by the actual clearing of the modeled electricity -markets. The current version of EMIS-AS includes energy, ancillary services, capacity and -Renewable Energy Certificates (REC) markets. The investors then update the realized revenues -for their projects and also update their beliefs (using Kalman Filters) based on the realized -values of the parameters. Finally, the derating factors of variable renewable generation -are calculated based on the updated installed capacities using the top-n net-load hour methodology. - -## Loading Data and Simulation Creation - -While the model's input data for investors and markets can be instantiated directly as -Julia structs, the model provides a CSV-based file import functionality that may be -more convenient. Data organized according to the file structure -[described here](input_file_structure.html) will be automatically populated into a -corresponding `AgentSimulation`. The worklow for processing the input data for creating -the `AgentSimulation` is depicted below. - +# EMIS AgentSimulation Model + +The Electricity Markets Investment Suite Agent-based Simulation (EMIS-AS) +model is an agent-based model developed at NREL for simulating annual investment +and retirement decisions of heterogeneous investors in the electricity sector. +EMIS-AS is designed to capture the evolution of the electricity generation portfolio +resulting from the interactions of heterogeneous investors under different policy +and market designs. EMIS-AS not only allows end-users to customize market products +and rules, but also to capture investors' heterogeneous financing parameters, +technology preferences, beliefs about the future (forecasts), ability to update +those forecasts, and risk preferences under uncertainty. + +## Model Structure + + + +EMIS-AS is initialized based on the input data detailing the test system, generation +units, market design, investors' characteristics and simulation parameters. Additionally, +the pre-processing step includes calculation of the weighted average cost of capital +(WACC) and adjusted CAPEX for all existing and option projects for each investor. +Next, the model selects the specified number of representative days (with hourly +resolution) to be used by the investors for price prediction. These representative +days and their corresponding weights are determined based on load and renewable +generation timeseries using k-medoids clustering. + +Subsequently, the simulation commences with successive yearly iterations for the specified +simulation horizon. At the start of each simulation year, the investors project future +prices and make revenue predictions. The predicted revenues are then used to calculate the +expected utility (based on the expected net present value (NPV)) for all projects. +Subsequently, the revenue prediction outcomes and expected utility are used to make +investment and retirement decisions and for calculation of market bids. + + +Once all investors have completed their decision-making process, their investment and +retirement decisions are announced. The model then updates the build-phases of all +projects, which are depicted below. + + + +The projects in the Option phase which get decided to be invested in are sent to the +interconnection queue and included in the list of active projects. The projects already +in the interconnection queue progress one year further in the queue. +The projects which have completed their queue time then enter the construction phase. It +is assumed that the investors only have to pay the annual queue costs when the projects are +in the queue, but would have to pay the full capital cost once construction commences. +The projects which have completed their construction times are included in the set of existing +projects. Finally, if any project is to be retired, either due to end-of-life or profitability +reasons, is removed from the list of active projects. + +The life cycle phase updates are followed by the actual clearing of the modeled electricity +markets. The current version of EMIS-AS includes energy, ancillary services, capacity and +Renewable Energy Certificates (REC) markets. The investors then update the realized revenues +for their projects and also update their beliefs (using Kalman Filters) based on the realized +values of the parameters. Finally, the derating factors of variable renewable generation +are calculated based on the updated installed capacities using the top-n net-load hour methodology. + +## Loading Data and Simulation Creation + +While the model's input data for investors and markets can be instantiated directly as +Julia structs, the model provides a CSV-based file import functionality that may be +more convenient. Data organized according to the file structure +[described here](input_file_structure.html) will be automatically populated into a +corresponding `AgentSimulation`. The worklow for processing the input data for creating +the `AgentSimulation` is depicted below. + \ No newline at end of file diff --git a/input_file_structure.html b/input_file_structure.html index a69a8bf..89b672c 100644 --- a/input_file_structure.html +++ b/input_file_structure.html @@ -1,424 +1,424 @@ - - - - - - - - - -