From 1b4705ce4cf8a407f31e2b03c16dd330bd5197e4 Mon Sep 17 00:00:00 2001 From: "Patel, Pralit L" Date: Wed, 8 Jan 2025 19:51:45 +0000 Subject: [PATCH] Pull request #343: Movers/feature/plcoe v7 Merge in JGCRI/gcam-core from movers/feature/plcoe_v7 to master Squashed commit of the following: commit 0fe169c4020a331a19fad43847f639cbd89d2f3b Author: Pralit Patel Date: Wed Jan 8 14:15:30 2025 -0500 Bump version number for public release commit 13253bf8faa2bc2174ad278fc600e46e8663e322 Merge: 72fda7987 bdcab9648 Author: Pralit Patel Date: Tue Dec 24 10:02:34 2024 -0500 Merge remote-tracking branch 'origin/master' into movers/feature/plcoe_v7 commit 72fda798789c80c22710dddcd02af21cfb819f84 Author: Matthew Binsted Date: Fri Nov 1 14:20:34 2024 -0400 Minor C++ updates in response to PR review comments. commit 6a6152f61a6d419f80d8a4651fa2879b21d17bc4 Author: Matthew Binsted Date: Thu Oct 10 17:15:30 2024 -0400 Improve comments in C++ code based on pull request review comments. commit 21021d933258e4d2425418fdab4b2dd37c7a6456 Author: Matthew Binsted Date: Wed Oct 9 17:19:24 2024 -0400 Re-incorporate option for using previous backup-capacity approach to VRE integration. Includes C++ code changes and gcamdata changes (using a switch in constants.R). commit d13a2e4888f799ff4e488270efa80705e388937a Author: Matthew Binsted Date: Tue Jun 11 00:25:27 2024 -0400 Minor C++ code cleanup. commit 7ffc87def4ee8331e1620e5aa8fc47a12257b633 Author: Matthew Binsted Date: Fri Mar 29 18:24:48 2024 -0400 Change subsector shareweight interpolation rules for wind and solar. commit 90602c5f16648c567daf10c0aa42590e0a39c684 Merge: 5d47ed44d a607cc4c3 Author: Matthew Binsted Date: Fri Mar 22 15:41:28 2024 -0400 Merge branch 'plcoe_v7' of https://github.com/mmowers/gcam-core into plcoe_v7 commit 5d47ed44dd03107ea79a3189386e8c8db93381d8 Author: Matthew Binsted Date: Fri Mar 22 15:41:12 2024 -0400 Bugfix for gcam-usa related to PLCOE setup. commit a607cc4c3408668723c622ae5fae97f6f06804c6 Author: Matt Mowers Date: Mon Mar 18 00:44:36 2024 -0400 Update comments for new PLCOE and value factor approach commit fb86da129ece9948d4b0ec2cd692557ddd3cfad0 Author: Matthew Binsted Date: Mon Feb 26 18:14:56 2024 -0500 Fix error related to L2233.Elec_tables_globaltech[cost_SWInterp_Fltr] in module_water_L2233.electricity_water. commit 8509286344fc34f49ab4a0e1f2ca0509ebcd69d1 Merge: 912f1b000 5c98b7969 Author: Matthew Binsted Date: Fri Feb 16 01:23:05 2024 -0500 Merge GCAM v6 PLCOE with GCAM v7. Code compiles; gcamdata produces all XMLs; GCAM runs and sovles cleanly; results have not yet been vetted. commit 5c98b79691531ad906d45ed8b089c2c16daab20e Author: Matt Mowers Date: Fri Mar 17 00:15:27 2023 -0400 Fix electricity technology value factor calculation commit 9fd62d08d1aab2a46854b890718176f690332bd2 Author: Matt Mowers Date: Fri Mar 10 13:33:45 2023 -0500 Separate offshore wind from onshore wind trial market commit 986ec4a3f9ec4deef310b5fb08571b4df9f5e0e8 Author: Matthew Binsted Date: Mon Mar 6 10:35:35 2023 -0500 Removing errant declaration of boost::noncopyable. commit c7b30e7716a38b292923aaff4377a1767aa724b5 Author: Matthew Binsted Date: Wed Mar 1 16:17:36 2023 -0500 Removing extra qualification ValueFactorCalculator::getValueFactor commit a3dd83027339ed454cbcaec80ff2360cf64fe707 Author: Matthew Binsted Date: Tue Feb 14 16:29:55 2023 -0500 Update to use parsed-in values for value factor equation, rather than hard-coded values. commit 2850cb25b8018ad34edb2bd874aa350a7f4a3b53 Author: Matthew Binsted Date: Fri Feb 3 17:48:33 2023 -0500 Initial implementation of value factor in GCAM. Data changes only in this commit (code changes were in a previous commit). Model runs and solves normally, but results have not been explored / vetted. commit a8ae1aa8888fd25f621d9099a786d0959b3732e8 Author: Matthew Binsted Date: Fri Feb 3 17:45:18 2023 -0500 Initial implementation of value factor in GCAM. Code changes only in this commit; data changes to follow in a separate commit. Model runs and solves normally, but results have not been explored / vetted. commit 82e33fef9524dc356e604e2ddeb4b34138ebe39d Author: Matt Mowers Date: Fri Dec 16 11:58:39 2022 -0500 Add technology value factor intercept and slope variables for clarity ... and 1 more commit --- cvs/objects/build/vc10/objects.vcxproj | 4 + .../build/vc10/objects.vcxproj.filters | 38 +- .../functions/include/non_energy_input.h | 1 + .../sectors/include/ibackup_calculator.h | 13 +- .../sectors/include/value_factor_calculator.h | 114 ++++ .../source/value_factor_calculator.cpp | 173 ++++++ .../include/backup_intermittent_technology.h | 219 +++++++ .../include/intermittent_technology.h | 91 +-- .../technologies/include/itechnology.h | 3 +- .../source/backup_intermittent_technology.cpp | 579 ++++++++++++++++++ .../source/intermittent_technology.cpp | 294 ++------- .../source/technology_container.cpp | 2 + .../util/base/include/gcam_data_containers.h | 2 + cvs/objects/util/base/include/version.h | 4 +- input/gcamdata/R/constants.R | 5 + input/gcamdata/R/sysdata.rda | Bin 6482 -> 6493 bytes input/gcamdata/R/xml.R | 2 +- input/gcamdata/R/zenergy_L223.electricity.R | 151 +++-- .../gcamdata/R/zenergy_L226.en_distribution.R | 22 + input/gcamdata/R/zenergy_xml_electricity.R | 102 +-- input/gcamdata/R/zgcamusa_L223.electricity.R | 4 +- .../R/zgcamusa_L2233.elec_segments_water.R | 51 +- .../gcamdata/R/zgcamusa_L2234.elec_segments.R | 44 +- input/gcamdata/R/zgcamusa_xml_elec_segments.R | 32 +- .../R/zgcamusa_xml_elec_segments_water.R | 44 +- input/gcamdata/R/zgcamusa_xml_electricity.R | 11 +- .../R/zwater_L2233.electricity_water.R | 33 +- .../gcamdata/R/zwater_xml_electricity_water.R | 22 +- .../gcamdata/data-raw/generate_package_data.R | 7 +- .../inst/extdata/energy/A23.globalinttech.csv | 20 +- .../energy/A23.globalinttech_backup.csv | 15 + .../extdata/energy/A23.globaltech_eff.csv | 1 - .../extdata/energy/A23.subsector_interp.csv | 6 +- .../extdata/energy/A23.subsector_shrwt.csv | 4 +- .../mi_headers/ModelInterface_headers.txt | 4 +- .../man/module_energy_L223.electricity.Rd | 2 +- .../man/module_gcamusa_L223.electricity.Rd | 2 +- ...odule_gcamusa_L2233.elec_segments_water.Rd | 4 +- .../man/module_gcamusa_L2234.elec_segments.Rd | 4 +- 39 files changed, 1620 insertions(+), 509 deletions(-) create mode 100644 cvs/objects/sectors/include/value_factor_calculator.h create mode 100644 cvs/objects/sectors/source/value_factor_calculator.cpp create mode 100644 cvs/objects/technologies/include/backup_intermittent_technology.h create mode 100644 cvs/objects/technologies/source/backup_intermittent_technology.cpp create mode 100644 input/gcamdata/inst/extdata/energy/A23.globalinttech_backup.csv diff --git a/cvs/objects/build/vc10/objects.vcxproj b/cvs/objects/build/vc10/objects.vcxproj index c5ac94a9be..052274d24d 100644 --- a/cvs/objects/build/vc10/objects.vcxproj +++ b/cvs/objects/build/vc10/objects.vcxproj @@ -642,6 +642,7 @@ + @@ -681,6 +682,7 @@ + @@ -924,6 +926,7 @@ + @@ -970,6 +973,7 @@ + diff --git a/cvs/objects/build/vc10/objects.vcxproj.filters b/cvs/objects/build/vc10/objects.vcxproj.filters index 3f8a38e561..2054fc61fe 100644 --- a/cvs/objects/build/vc10/objects.vcxproj.filters +++ b/cvs/objects/build/vc10/objects.vcxproj.filters @@ -269,12 +269,6 @@ Source Files\resources - - Source Files\sectors - - - Source Files\sectors - Source Files\sectors @@ -935,6 +929,18 @@ Source Files\resources + + Source Files\sectors + + + Source Files\sectors + + + Source Files\sectors + + + Source Files\technology + Source Files @@ -1075,12 +1081,6 @@ Header Files\sectors - - Header Files\sectors - - - Header Files\sectors - Header Files\sectors @@ -1900,8 +1900,20 @@ Header Files\technologies + + Header Files\sectors + + + Header Files\sectors + + + Header Files\sectors + + + Header Files\technologies + Header Files - \ No newline at end of file + diff --git a/cvs/objects/functions/include/non_energy_input.h b/cvs/objects/functions/include/non_energy_input.h index e4066dde12..42f9f0c170 100644 --- a/cvs/objects/functions/include/non_energy_input.h +++ b/cvs/objects/functions/include/non_energy_input.h @@ -74,6 +74,7 @@ class Tabs; */ class NonEnergyInput: public MiniCAMInput { + friend class BackupIntermittentTechnology; friend class IntermittentTechnology; friend class SolarTechnology; friend class WindTechnology; diff --git a/cvs/objects/sectors/include/ibackup_calculator.h b/cvs/objects/sectors/include/ibackup_calculator.h index a17090ab49..873ae2abf2 100644 --- a/cvs/objects/sectors/include/ibackup_calculator.h +++ b/cvs/objects/sectors/include/ibackup_calculator.h @@ -56,16 +56,17 @@ class Tabs; // Need to forward declare the subclasses as well. class CapacityLimitBackupCalculator; class CSPBackupCalculator; +class ValueFactorCalculator; /*! * \ingroup Objects - * \brief Interface which defines methods for calculating an average and - * marginal amount of backup capacity required per unit of output. - * \details Defines an interface to an object which determines the backup - * capacity required for a Sector. The backup capacity is determined + * \brief Interface which defines methods for calculating a value factor or + * backup capacity requirement (average and marginal) per unit of output. + * \details Defines an interface to an object which helps determine the value factor of or + * backup capacity required for a technology. The backup capacity is determined * per unit of output, but may use trial values to allow computation * based on the total output. Backup requirements are specific to - * sectors that produce electricity. + * technologies that produce electricity. * \author Josh Lurz */ class IBackupCalculator : public INamed, private boost::noncopyable { @@ -152,7 +153,7 @@ class IBackupCalculator : public INamed, private boost::noncopyable { * hierarchy under introspection. */ DEFINE_SUBCLASS_FAMILY( IBackupCalculator, CapacityLimitBackupCalculator, - CSPBackupCalculator ) + CSPBackupCalculator, ValueFactorCalculator ) ) }; diff --git a/cvs/objects/sectors/include/value_factor_calculator.h b/cvs/objects/sectors/include/value_factor_calculator.h new file mode 100644 index 0000000000..f1ce663435 --- /dev/null +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -0,0 +1,114 @@ +/* +* LEGAL NOTICE +* This computer software was prepared by Battelle Memorial Institute, +* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 +* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE +* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY +* LIABILITY FOR THE USE OF THIS SOFTWARE. This notice including this +* sentence must appear on any copies of this computer software. +* +* EXPORT CONTROL +* User agrees that the Software will not be shipped, transferred or +* exported into any country or used in any manner prohibited by the +* United States Export Administration Act or any other applicable +* export laws, restrictions or regulations (collectively the "Export Laws"). +* Export of the Software may require some form of license or other +* authority from the U.S. Government, and failure to obtain such +* export control license may result in criminal liability under +* U.S. laws. In addition, if the Software is identified as export controlled +* items under the Export Laws, User represents and warrants that User +* is not a citizen, or otherwise located within, an embargoed nation +* (including without limitation Iran, Syria, Sudan, Cuba, and North Korea) +* and that User is not otherwise prohibited +* under the Export Laws from receiving the Software. +* +* Copyright 2011 Battelle Memorial Institute. All Rights Reserved. +* Distributed as open-source under the terms of the Educational Community +* License version 2.0 (ECL 2.0). http://www.opensource.org/licenses/ecl2.php +* +* For further details, see: http://www.globalchange.umd.edu/models/gcam/ +* +*/ + + +#ifndef _VALUE_FACTOR_CALCULATOR_H_ +#define _VALUE_FACTOR_CALCULATOR_H_ +#if defined(_MSC_VER) +#pragma once +#endif + +/*! + * \file value_factor_calculator.h + * \ingroup Objects + * \brief The ValueFactorCalculator class header file. + * \author Matthew Binsted, Matt Mowers + */ + +#include +#include "sectors/include/ibackup_calculator.h" + + +// Forward declaration +class IInfo; + +/*! + * \ingroup Objects + * \brief Interface which defines methods for calculating value factor + * of a technology depending on its market share. + * \details Defines an interface to an object which determines the value + * factor for a technology. The value factor may use trial values of + * market share. Value factors are specific to electricity sector + * technologies. + * \author Matthew Binsted, Matt Mowers + */ +class ValueFactorCalculator : public IBackupCalculator { +public: + ValueFactorCalculator(); + virtual ValueFactorCalculator* clone() const; + static const std::string& getXMLNameStatic(); + virtual const std::string& getXMLName() const; + virtual bool isSameType(const std::string& aType) const; + virtual const std::string& getName() const; + virtual void toDebugXML(const int aPeriod, std::ostream& aOut, Tabs* aTabs) const; + virtual void initCalc(const IInfo* aTechInfo); + + virtual double getMarginalBackupCapacity(const std::string& aSector, + const std::string& aElectricSector, + const std::string& aResource, + const std::string& aRegion, + const double aTechCapacityFactor, + const double aReserveMargin, + const double aAverageGridCapacityFactor, + const int aPeriod) const; + + virtual double getAverageBackupCapacity(const std::string& aSector, + const std::string& aElectricSector, + const std::string& aResource, + const std::string& aRegion, + const double aTechCapacityFactor, + const double aReserveMargin, + const double aAverageGridCapacityFactor, + const int aPeriod) const; + + virtual double getValueFactor(const std::string& aSector, + const std::string& aElectricSector, + const std::string& aRegion, + const int aPeriod) const; + +protected: + + // Define data such that introspection utilities can process the data from this + // subclass together with the data members of the parent classes. + DEFINE_DATA_WITH_PARENT( + IBackupCalculator, + + //! Y-inercept of linear function which equates intermittent technology share to value factor + DEFINE_VARIABLE( SIMPLE, "value-factor-intercept", mValueFactorIntercept, double ), + + //! Slope of linear function which equates intermittent technology share to value factor + DEFINE_VARIABLE( SIMPLE, "value-factor-slope", mValueFactorSlope, double ) + + ) +}; + +#endif // _VALUE_FACTOR_CALCULATOR_H_ diff --git a/cvs/objects/sectors/source/value_factor_calculator.cpp b/cvs/objects/sectors/source/value_factor_calculator.cpp new file mode 100644 index 0000000000..feb1c832b9 --- /dev/null +++ b/cvs/objects/sectors/source/value_factor_calculator.cpp @@ -0,0 +1,173 @@ +/* +* LEGAL NOTICE +* This computer software was prepared by Battelle Memorial Institute, +* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 +* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE +* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY +* LIABILITY FOR THE USE OF THIS SOFTWARE. This notice including this +* sentence must appear on any copies of this computer software. +* +* EXPORT CONTROL +* User agrees that the Software will not be shipped, transferred or +* exported into any country or used in any manner prohibited by the +* United States Export Administration Act or any other applicable +* export laws, restrictions or regulations (collectively the "Export Laws"). +* Export of the Software may require some form of license or other +* authority from the U.S. Government, and failure to obtain such +* export control license may result in criminal liability under +* U.S. laws. In addition, if the Software is identified as export controlled +* items under the Export Laws, User represents and warrants that User +* is not a citizen, or otherwise located within, an embargoed nation +* (including without limitation Iran, Syria, Sudan, Cuba, and North Korea) +* and that User is not otherwise prohibited +* under the Export Laws from receiving the Software. +* +* Copyright 2011 Battelle Memorial Institute. All Rights Reserved. +* Distributed as open-source under the terms of the Educational Community +* License version 2.0 (ECL 2.0). http://www.opensource.org/licenses/ecl2.php +* +* For further details, see: http://www.globalchange.umd.edu/models/gcam/ +* +*/ + + +/*! + * \file value_factor_calculator.cpp + * \ingroup Objects + * \brief ValueFactorCalculator class source file. + * \author Matthew Binsted, Matt Mowers + */ + +#include "util/base/include/definitions.h" +#include +#include +#include + +#include "sectors/include/value_factor_calculator.h" +#include "util/base/include/util.h" +#include "util/base/include/xml_helper.h" +#include "sectors/include/sector_utils.h" +#include "marketplace/include/marketplace.h" + +using namespace std; + +/*! + * \brief Constructor. + */ +ValueFactorCalculator::ValueFactorCalculator() +{ + mValueFactorIntercept = 1.0; + mValueFactorSlope = 0.0; +} + +// Documentation is inherited. +ValueFactorCalculator* ValueFactorCalculator::clone() const { + ValueFactorCalculator* clone = new ValueFactorCalculator(); + clone->mValueFactorIntercept = mValueFactorIntercept; + clone->mValueFactorSlope = mValueFactorSlope; + + return clone; +} + +// Documentation is inherited. +bool ValueFactorCalculator::isSameType( const std::string& aType ) const { + return aType == getXMLNameStatic(); +} + +// Documentation is inherited. +const string& ValueFactorCalculator::getName() const { + return getXMLNameStatic(); +} + +/*! \brief Get the XML node name in static form for comparison when parsing XML. +* +* This public function accesses the private constant string, XML_NAME. This way +* the tag is always consistent for both read-in and output and can be easily +* changed. The "==" operator that is used when parsing, required this second +* function to return static. +* \note A function cannot be static and virtual. +* \return The constant XML_NAME as a static. +*/ +const string& ValueFactorCalculator::getXMLNameStatic() { + const static string XML_NAME = "value-factor-calculator"; + return XML_NAME; +} + +const string& ValueFactorCalculator::getXMLName() const { + return getXMLNameStatic(); +} + +// Documentation is inherited. +void ValueFactorCalculator::toDebugXML( const int aPeriod, ostream& aOut, Tabs* aTabs ) const { + XMLWriteOpeningTag( getXMLNameStatic(), aOut, aTabs ); + XMLWriteElement(mValueFactorIntercept, "ValueFactorIntercept", aOut, aTabs ); + XMLWriteElement(mValueFactorSlope, "ValueFactorSlope", aOut, aTabs ); + XMLWriteClosingTag( getXMLNameStatic(), aOut, aTabs ); +} + +// Documentation is inherited. +void ValueFactorCalculator::initCalc( const IInfo* aTechInfo ) { + // No information needs to be passed in +} + +double ValueFactorCalculator::getMarginalBackupCapacity(const string& aSector, + const string& aElectricSector, + const string& aResource, + const string& aRegion, + const double aTechCapacityFactor, + const double aReserveMargin, + const double aAverageGridCapacityFactor, + const int aPeriod) const +{ + // This is a placeholder function so we can use the IBackupCalculator class + // For now, it will do nothing (and should not be called) + + return 0.0; +} + +double ValueFactorCalculator::getAverageBackupCapacity(const string& aSector, + const string& aElectricSector, + const string& aResource, + const string& aRegion, + const double aTechCapacityFactor, + const double aReserveMargin, + const double aAverageGridCapacityFactor, + const int aPeriod) const +{ + // This is a placeholder function so we can use the IBackupCalculator class + // For now, it will do nothing (and should not be called) + + return 0.0; +} + +/*! + * \brief Compute value factor for electricity technology. + * \details Compute value factor (VF) for electricity technology, + * which will decrease linearly as market share increases. + * This value factor will then be used to adjust technology + * LCOE into "profitability-adjusted LCOE" (PLCOE), where + * PLCOE = LCOE/VF. + * \param aSector The name of the sector. + * \param aElectricSector The name of the electricity sector. + * \param aRegion Name of the containing region. + * \param aPeriod Model period. + * \return Value factor scalar for technology cost (range: 0-1). + */ +double ValueFactorCalculator::getValueFactor( const string& aSector, + const string& aElectricSector, + const string& aRegion, + const int aPeriod ) const +{ + // Preconditions + assert( !aSector.empty() ); + assert( !aElectricSector.empty() ); + assert( !aRegion.empty() ); + + double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); + + double valueFactor = 1.0; + valueFactor = std::max( ( mValueFactorIntercept + mValueFactorSlope * renewElecShare ), util::getVerySmallNumber() ); + + return valueFactor; + +} diff --git a/cvs/objects/technologies/include/backup_intermittent_technology.h b/cvs/objects/technologies/include/backup_intermittent_technology.h new file mode 100644 index 0000000000..5ae268a62c --- /dev/null +++ b/cvs/objects/technologies/include/backup_intermittent_technology.h @@ -0,0 +1,219 @@ +#ifndef _BACKUP_INTERMITTENT_TECHNOLOGY_H_ +#define _BACKUP_INTERMITTENT_TECHNOLOGY_H_ +#if defined(_MSC_VER) +#pragma once +#endif + +/* +* LEGAL NOTICE +* This computer software was prepared by Battelle Memorial Institute, +* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 +* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE +* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY +* LIABILITY FOR THE USE OF THIS SOFTWARE. This notice including this +* sentence must appear on any copies of this computer software. +* +* EXPORT CONTROL +* User agrees that the Software will not be shipped, transferred or +* exported into any country or used in any manner prohibited by the +* United States Export Administration Act or any other applicable +* export laws, restrictions or regulations (collectively the "Export Laws"). +* Export of the Software may require some form of license or other +* authority from the U.S. Government, and failure to obtain such +* export control license may result in criminal liability under +* U.S. laws. In addition, if the Software is identified as export controlled +* items under the Export Laws, User represents and warrants that User +* is not a citizen, or otherwise located within, an embargoed nation +* (including without limitation Iran, Syria, Sudan, Cuba, and North Korea) +* and that User is not otherwise prohibited +* under the Export Laws from receiving the Software. +* +* Copyright 2011 Battelle Memorial Institute. All Rights Reserved. +* Distributed as open-source under the terms of the Educational Community +* License version 2.0 (ECL 2.0). http://www.opensource.org/licenses/ecl2.php +* +* For further details, see: http://www.globalchange.umd.edu/models/gcam/ +* +*/ + + + +/*! +* \file backup_intermittent_technology.h +* \ingroup Objects +* \brief The BackupIntermittentTechnology class header file. +* \author Marshall Wise, Sonny Kim +*/ + +#include +#include "technologies/include/technology.h" +#include "util/base/include/value.h" +#include "sectors/include/ibackup_calculator.h" +#include "sectors/include/capacity_limit_backup_calculator.h" +#include "sectors/include/CSP_backup_calculator.h" + +class IInfo; +/* + * \ingroup Objects + * \brief A Technology which represents production from an intermittent + * resource. + * \details An intermittent technology represents the production of a good, such + * as electricity, from an intermittent resource, such as wind or + * solar. An intermittent technology has a pair of inputs - the + * intermittent resource which produces the majority of the output, + * and a backup energy input. The associated backup sector may produce + * a small amount of output, and emissions. The intermittent subsector + * has a backup calculator, which is responsible for determining the + * average and marginal quantity of backup capacity required. The backup + * calculator sets the shares of the technologies using the marginal backup + * requirements. These shares are used for the cost calculation, but not + * the output calculation. Output, and therefore emissions, is based on the + * average backup required. + * \note If a backup calculator is not read in, the backup requirement is + * assumed to be zero and this technology will operate exactly the same as + * a standard technology. + * XML specification for BackupIntermittentTechnology + * - XML name: \c intermittent-technology + * - Contained by: Subsector + * - Parsing inherited from class: Technology + * - Elements: + * - \c electric-sector-name mElectricSectorName + * - \c wind-backup-calculator WindBackupCalculator + * - \c capacity-limit-backup-calculator CapacityLimitBackupCalculator + * + * \author Marshall Wise, Josh Lurz + */ +class BackupIntermittentTechnology: public Technology { +public: + static const std::string& getXMLNameStatic(); + + BackupIntermittentTechnology( const std::string& aName, + const int aYear ); + BackupIntermittentTechnology(); + virtual ~BackupIntermittentTechnology(); + + virtual BackupIntermittentTechnology* clone() const; + + virtual const std::string& getXMLName() const; + + virtual void completeInit( const std::string& aRegionName, + const std::string& aSectorName, + const std::string& aSubsectorName, + const IInfo* aSubsectorInfo, + ILandAllocator* aLandAllocator ); + + virtual void initCalc( const std::string& aRegionName, + const std::string& aSectorName, + const IInfo* aSubsectorIInfo, + const Demographic* aDemographics, + PreviousPeriodInfo& aPrevPeriodInfo, + const int aPeriod ); + + virtual void postCalc( const std::string& aRegionName, + const int aPeriod ); + + virtual void production( const std::string& aRegionName, + const std::string& aSectorName, + double aVariableDemand, + double aFixedOutputScaleFactor, + const int aPeriod ); + + + virtual void calcCost( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ); +protected: + typedef std::vector::iterator InputIterator; + + // Define data such that introspection utilities can process the data from this + // subclass together with the data members of the parent classes. + DEFINE_DATA_WITH_PARENT( + Technology, + + //! A calculator which determines the amount of backup per unit output. + DEFINE_VARIABLE( CONTAINER, "backup-calculator", mBackupCalculator, IBackupCalculator* ), + + //! Name of the electricity sector which this Technology will supply. + DEFINE_VARIABLE( SIMPLE, "electric-sector-name", mElectricSectorName, std::string ), + + DEFINE_VARIABLE( SIMPLE, "electric-sector-market", mElectricSectorMarket, std::string ), + + //! Name of trial market associated with this Intermittent Technology. + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "real-trial-market-name", mTrialMarketName, std::string ), + + //! Name of trial market readin for this Intermittent Technology. + DEFINE_VARIABLE( SIMPLE, "trial-market-name", mTrialMarketNameParsed, std::string ), + + //! Cached input containing the resource. + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "resource-input-pointer", mResourceInput, InputIterator ), + + //! Cached input containing the backup. + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "backup-input-pointer", mBackupInput, InputIterator ), + + //! Cached input containing the capital costs for backup. + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "backup-cap-cost-input-pointer", mBackupCapCostInput, InputIterator ), + + //! Cached input containing the technology costs. + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "tech-cost-input-pointer", mTechCostInput, InputIterator ), + + //! Backup capacity factor read in at the Sector level. + DEFINE_VARIABLE( SIMPLE, "backup-capacity-factor", mBackupCapacityFactor, Value ), + + //! Backup capital cost. + DEFINE_VARIABLE( SIMPLE, "backup-capital-cost", mBackupCapitalCost, Value ), + + //! Electric reserve cost read in at the Sector level. + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "electricity-reserve-margin", mElecReserveMargin, Value ), + + //! Average grid capacity factor read in at the Sector level. + //todo dynamically calculate average grid capacity factor + DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "average-grid-capacity-factor", mAveGridCapacityFactor, Value ), + + //! State value necessary to track tech output ration + DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "tech-output-ratio", mIntermitOutTechRatio, Value ) + ) + + //! Info object used to pass parameter information into backup calculators. + std::unique_ptr mIntermittTechInfo; + + void copy( const BackupIntermittentTechnology& aOther ); + + void setCoefficients( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ); + + virtual double getResourceToEnergyRatio( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ); + + double getBackupCapacityPerEnergyOutput( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ) const; + + double getMarginalBackupCapCost( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ) const; + + void initializeInputLocations( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ); + + double getMarginalBackupCapacity( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ) const; + + double getAverageBackupCapacity( const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod ) const; + + double calcEnergyFromBackup() const; + + virtual void toDebugXMLDerived( const int period, std::ostream& out, Tabs* tabs ) const; + + + virtual const std::string& getBackupCapCostName( ) const; + + virtual const std::string& getTechCostName( ) const; +}; + +#endif // _BACKUP_INTERMITTENT_TECHNOLOGY_H_ diff --git a/cvs/objects/technologies/include/intermittent_technology.h b/cvs/objects/technologies/include/intermittent_technology.h index e7bb42cc2f..9a0eead26e 100644 --- a/cvs/objects/technologies/include/intermittent_technology.h +++ b/cvs/objects/technologies/include/intermittent_technology.h @@ -1,5 +1,5 @@ -#ifndef _ITERMITTENT_TECHNOLOGY_H_ -#define _ITERMITTENT_TECHNOLOGY_H_ +#ifndef _INTERMITTENT_TECHNOLOGY_H_ +#define _INTERMITTENT_TECHNOLOGY_H_ #if defined(_MSC_VER) #pragma once #endif @@ -42,48 +42,33 @@ * \file intermittent_technology.h * \ingroup Objects * \brief The IntermittentTechnology class header file. -* \author Marshall Wise, Sonny Kim +* \author Marshall Wise, Sonny Kim, Matthew Binsted, Matt Mowers */ #include #include "technologies/include/technology.h" #include "util/base/include/value.h" #include "sectors/include/ibackup_calculator.h" +#include "sectors/include/value_factor_calculator.h" class IInfo; /* * \ingroup Objects * \brief A Technology which represents production from an intermittent * resource. - * \details An intermittent subsector represents the production of a good, such + * \details An intermittent technology represents the production of a good, such * as electricity, from an intermittent resource, such as wind or - * solar. An intermittent subsector has a pair of technologies. One - * Technology consumes the intermittent resource and produces the - * majority of the output, and the other Technology produces the backup - * required. The backup Technology may produce a small amount of - * output, and emissions. The intermittent and backup technologies do - * not compete. The intermittent subsector has a backup calculator, - * which is responsible for determining the average and marginal quantity - * of backup capacity required. The backup calculator sets the shares - * of the technologies using the marginal backup requirements. These - * shares are used for the cost calculation, but not the output - * calculation. Output, and therefore emissions, is based on the - * average backup required. - * \note An intermittent subsector must have two and only two Technologies, one - * consuming an intermittent resource and one which is the backup. - * \note If a backup calculator is not read in, the backup requirement is - * assumed to be zero and this subsector will operate exactly the same as - * a standard Subsector with one Technology. + * solar. These technologies will have adjusted costs to reflect + * a reduction of their value as a function of market share. * XML specification for IntermittentTechnology * - XML name: \c intermittent-technology * - Contained by: Subsector * - Parsing inherited from class: Technology * - Elements: * - \c electric-sector-name mElectricSectorName - * - \c wind-backup-calculator WindBackupCalculator - * - \c capacity-limit-backup-calculator CapacityLimitBackupCalculator + * - \c value-factor-calculator ValueFactorCalculator * - * \author Marshall Wise, Josh Lurz + * \author Marshall Wise, Josh Lurz, Matthew Binsted, Matt Mowers */ class IntermittentTechnology: public Technology { public: @@ -132,8 +117,8 @@ class IntermittentTechnology: public Technology { DEFINE_DATA_WITH_PARENT( Technology, - //! A calculator which determines the amount of backup per unit output. - DEFINE_VARIABLE( CONTAINER, "backup-calculator", mBackupCalculator, IBackupCalculator* ), + //! A calculator which determines the value factor of the technology + DEFINE_VARIABLE(CONTAINER, "value-factor-calculator", mValueFactorCalculator, ValueFactorCalculator*), //! Name of the electricity sector which this Technology will supply. DEFINE_VARIABLE( SIMPLE, "electric-sector-name", mElectricSectorName, std::string ), @@ -149,29 +134,10 @@ class IntermittentTechnology: public Technology { //! Cached input containing the resource. DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "resource-input-pointer", mResourceInput, InputIterator ), - //! Cached input containing the backup. - DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "backup-input-pointer", mBackupInput, InputIterator ), - - //! Cached input containing the capital costs for backup. - DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "backup-cap-cost-input-pointer", mBackupCapCostInput, InputIterator ), - //! Cached input containing the technology costs. DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "tech-cost-input-pointer", mTechCostInput, InputIterator ), - //! Backup capacity factor read in at the Sector level. - DEFINE_VARIABLE( SIMPLE, "backup-capacity-factor", mBackupCapacityFactor, Value ), - - //! Backup capital cost. - DEFINE_VARIABLE( SIMPLE, "backup-capital-cost", mBackupCapitalCost, Value ), - - //! Electric reserve cost read in at the Sector level. - DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "electricity-reserve-margin", mElecReserveMargin, Value ), - - //! Average grid capacity factor read in at the Sector level. - //todo dynamically calculate average grid capacity factor - DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "average-grid-capacity-factor", mAveGridCapacityFactor, Value ), - - //! State value necessary to track tech output ration + //! State value necessary to track tech output ratio DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "tech-output-ratio", mIntermitOutTechRatio, Value ) ) @@ -180,42 +146,17 @@ class IntermittentTechnology: public Technology { void copy( const IntermittentTechnology& aOther ); - void setCoefficients( const std::string& aRegionName, - const std::string& aSectorName, - const int aPeriod ); - - virtual double getResourceToEnergyRatio( const std::string& aRegionName, - const std::string& aSectorName, - const int aPeriod ); - - double getBackupCapacityPerEnergyOutput( const std::string& aRegionName, - const std::string& aSectorName, - const int aPeriod ) const; - - double getMarginalBackupCapCost( const std::string& aRegionName, - const std::string& aSectorName, - const int aPeriod ) const; + virtual double getResourceToEnergyRatio(const std::string& aRegionName, + const std::string& aSectorName, + const int aPeriod); void initializeInputLocations( const std::string& aRegionName, const std::string& aSectorName, const int aPeriod ); - double getMarginalBackupCapacity( const std::string& aRegionName, - const std::string& aSectorName, - const int aPeriod ) const; - - double getAverageBackupCapacity( const std::string& aRegionName, - const std::string& aSectorName, - const int aPeriod ) const; - - double calcEnergyFromBackup() const; - virtual void toDebugXMLDerived( const int period, std::ostream& out, Tabs* tabs ) const; - - virtual const std::string& getBackupCapCostName( ) const; - virtual const std::string& getTechCostName( ) const; }; -#endif // _ITERMITTENT_TECHNOLOGY_H_ +#endif // _INTERMITTENT_TECHNOLOGY_H_ diff --git a/cvs/objects/technologies/include/itechnology.h b/cvs/objects/technologies/include/itechnology.h index 9e83056ff8..762dfc7c30 100644 --- a/cvs/objects/technologies/include/itechnology.h +++ b/cvs/objects/technologies/include/itechnology.h @@ -67,6 +67,7 @@ class Tabs; // Need to forward declare the subclasses as well. class Technology; class DefaultTechnology; +class BackupIntermittentTechnology; class IntermittentTechnology; class WindTechnology; class SolarTechnology; @@ -231,7 +232,7 @@ class ITechnology: public IYeared, private boost::noncopyable /* Declare all subclasses of ITechnology to allow automatic traversal of the * hierarchy under introspection. */ - DEFINE_SUBCLASS_FAMILY( ITechnology, Technology, DefaultTechnology, IntermittentTechnology, + DEFINE_SUBCLASS_FAMILY( ITechnology, Technology, DefaultTechnology, BackupIntermittentTechnology, IntermittentTechnology, WindTechnology, SolarTechnology, NukeFuelTechnology, TranTechnology, AgProductionTechnology, PassThroughTechnology, AgStorageTechnology, UnmanagedLandTechnology, ResourceReserveTechnology, EmptyTechnology ) diff --git a/cvs/objects/technologies/source/backup_intermittent_technology.cpp b/cvs/objects/technologies/source/backup_intermittent_technology.cpp new file mode 100644 index 0000000000..3ca4972a3d --- /dev/null +++ b/cvs/objects/technologies/source/backup_intermittent_technology.cpp @@ -0,0 +1,579 @@ +/* +* LEGAL NOTICE +* This computer software was prepared by Battelle Memorial Institute, +* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 +* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE +* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY +* LIABILITY FOR THE USE OF THIS SOFTWARE. This notice including this +* sentence must appear on any copies of this computer software. +* +* EXPORT CONTROL +* User agrees that the Software will not be shipped, transferred or +* exported into any country or used in any manner prohibited by the +* United States Export Administration Act or any other applicable +* export laws, restrictions or regulations (collectively the "Export Laws"). +* Export of the Software may require some form of license or other +* authority from the U.S. Government, and failure to obtain such +* export control license may result in criminal liability under +* U.S. laws. In addition, if the Software is identified as export controlled +* items under the Export Laws, User represents and warrants that User +* is not a citizen, or otherwise located within, an embargoed nation +* (including without limitation Iran, Syria, Sudan, Cuba, and North Korea) +* and that User is not otherwise prohibited +* under the Export Laws from receiving the Software. +* +* Copyright 2011 Battelle Memorial Institute. All Rights Reserved. +* Distributed as open-source under the terms of the Educational Community +* License version 2.0 (ECL 2.0). http://www.opensource.org/licenses/ecl2.php +* +* For further details, see: http://www.globalchange.umd.edu/models/gcam/ +* +*/ + + +/*! +* \file backup_intermittent_technology.cpp +* \ingroup Objects +* \brief BackupIntermittentTechnology class source file. +* \author Marshall Wise, Sonny Kim +*/ + +#include "util/base/include/definitions.h" +#include +#include +#include + +#include "technologies/include/backup_intermittent_technology.h" +#include "containers/include/scenario.h" +#include "containers/include/iinfo.h" +#include "containers/include/info_factory.h" +#include "util/base/include/model_time.h" +#include "util/base/include/xml_helper.h" +#include "marketplace/include/marketplace.h" +#include "sectors/include/ibackup_calculator.h" +#include "sectors/include/sector_utils.h" +#include "functions/include/iinput.h" +#include "functions/include/non_energy_input.h" +#include "technologies/include/iproduction_state.h" +#include "containers/include/market_dependency_finder.h" + +using namespace std; + +extern Scenario* scenario; + +/*! + * \brief Constructor. + * \author Marshall Wise, Sonny Kim + */ + +BackupIntermittentTechnology::BackupIntermittentTechnology( const string& aName, const int aYear ) +:Technology( aName, aYear ) +{ + mElectricSectorName = "electricity"; + mBackupCapacityFactor = 0.05; + mBackupCapitalCost = 0.0; + mElecReserveMargin = 0.15; + mAveGridCapacityFactor = 0.60; + + mBackupCalculator = 0; + + mResourceInput = mInputs.end(); + mBackupInput = mInputs.end(); + mBackupCapCostInput = mInputs.end(); + mTechCostInput = mInputs.end(); +} + +BackupIntermittentTechnology::BackupIntermittentTechnology() { + mElectricSectorName = "electricity"; + mBackupCapacityFactor = 0.05; + mBackupCapitalCost = 0.0; + mElecReserveMargin = 0.15; + mAveGridCapacityFactor = 0.60; + + mBackupCalculator = 0; + + mResourceInput = mInputs.end(); + mBackupInput = mInputs.end(); + mBackupCapCostInput = mInputs.end(); + mTechCostInput = mInputs.end(); +} + +/*! + * \brief Destructor. + */ +BackupIntermittentTechnology::~BackupIntermittentTechnology() { + delete mBackupCalculator; +} + +BackupIntermittentTechnology* BackupIntermittentTechnology::clone() const { + BackupIntermittentTechnology* clone = new BackupIntermittentTechnology( mName, mYear ); + clone->copy( *this ); + return clone; +} + +void BackupIntermittentTechnology::copy( const BackupIntermittentTechnology& aOther ) { + Technology::copy( aOther ); + mElectricSectorName = aOther.mElectricSectorName; + mElectricSectorMarket = aOther.mElectricSectorMarket; + mTrialMarketNameParsed = aOther.mTrialMarketNameParsed; + mBackupCapacityFactor = aOther.mBackupCapacityFactor; + mBackupCapitalCost = aOther.mBackupCapitalCost; + + if( aOther.mBackupCalculator ) { + delete mBackupCalculator; + mBackupCalculator = aOther.mBackupCalculator->clone(); + } + + /*! + * \warning Only copy member variables that are read-in. The rest will be filled in by + * initialization methods. + */ +} + +const string& BackupIntermittentTechnology::getXMLName() const { + return getXMLNameStatic(); +} + +/*! \brief Get the XML node name in static form for comparison when parsing XML. +* +* This public function accesses the private constant string, XML_NAME. This way +* the tag is always consistent for both read-in and output and can be easily +* changed. The "==" operator that is used when parsing, required this second +* function to return static. +* \note A function cannot be static and virtual. +* \author Josh Lurz, James Blackwood +* \return The constant XML_NAME as a static. +*/ +const string& BackupIntermittentTechnology::getXMLNameStatic() { + const static string XML_NAME = "backup-intermittent-technology"; + return XML_NAME; +} + +/*! \brief Return name to be used for input object containing backup capital costs. +* +* \author Steve Smith +* \return The constant XML_NAME as a static. +*/ +const string& BackupIntermittentTechnology::getBackupCapCostName( ) const { + const static string BACKUP_CAPCOST_NAME = "backup-cap-cost"; + return BACKUP_CAPCOST_NAME; +} + +/*! \brief Return name to be used for input object containing technology costs. +* +* This input object will contain technology capital, operation, and any other costs +* exclusive of backup or fuel costs. Setting to blank indicates that this object does +* not use this cost. +* +* \author Steve Smith +* \return The constant XML_NAME as a static. +*/ +const string& BackupIntermittentTechnology::getTechCostName( ) const { + const static string TECH_COST_NAME = ""; // no tech cost implmented in this class + return TECH_COST_NAME; +} + +void BackupIntermittentTechnology::toDebugXMLDerived( const int period, ostream& aOut, Tabs* aTabs ) const { + XMLWriteElement( mElectricSectorName, "electric-sector-name", aOut, aTabs); + XMLWriteElement( mElectricSectorMarket, "electric-sector-market", aOut, aTabs); + XMLWriteElementCheckDefault( mTrialMarketNameParsed, "trial-market-name", aOut, aTabs, string("") ); + if( mBackupCapacityFactor.isInited() ){ + XMLWriteElement( mBackupCapacityFactor.get(), "backup-capacity-factor", aOut, aTabs ); + } + if( mBackupCapitalCost.isInited() ){ + XMLWriteElement( mBackupCapitalCost.get(), "backup-capital-cost", aOut, aTabs ); + } + XMLWriteElement( calcEnergyFromBackup(), "energy-to-backup", aOut, aTabs ); + if( mBackupCalculator ){ + mBackupCalculator->toDebugXML( period, aOut, aTabs ); + } +} + +/*! \brief Create a trial market for the technology and complete the initialization. +* +* This routine is only called once per model run +* \param aRegionName Region name. +* \param aSectorName Sector name. +* \param aSubsectorName Subsector name. +* \param aSectorInfo Sector information object. +* \param aLandAllocator Regional land allocator. +* \author Marshall Wise, Sonny Kim +* \detail A trial market for the backup intermittent technology is created here, +* as well as the completetion of technology initialization. +* A trial market is created for each backup intermittent technology if common +* trial market name is not given. +* Use techInfo to pass infomation to SectorUtils for setting +* market parameters, such as units. +* \todo Member constant values (Backup Capacity Factor, Backup Cost, +* Electricity Reserve Margin, and Ave grid Capacity Factor) could +* be dynamically calculated and utilized by backup intermittent technology. +*/ +void BackupIntermittentTechnology::completeInit( const string& aRegionName, + const string& aSectorName, + const string& aSubsectorName, + const IInfo* aSubsectorInfo, + ILandAllocator* aLandAllocator ) +{ + // The parent method must be called first due to sequence issues + Technology::completeInit( aRegionName, aSectorName, aSubsectorName, aSubsectorInfo, + aLandAllocator ); + + // Initialize electric reserve margin and average grid capacity factor from the Sector. + mElecReserveMargin = aSubsectorInfo->getDouble( "electricity-reserve-margin", true ); + mAveGridCapacityFactor = aSubsectorInfo->getDouble( "average-grid-capacity-factor", true ); + + // Initialize a non-energy input to hold backup capacity charges + // This needs be be done before calling other methods so that 1) input vector size is fixed + // (so references won't change) and 2) so that initCalc() methods for new objects can be called. + if( util::searchForValue( mInputs, getBackupCapCostName() ) == mInputs.end() ){ + mInputs.push_back( new NonEnergyInput( getBackupCapCostName() ) ); + } + + // Inititalize info object + mIntermittTechInfo.reset( InfoFactory::constructInfo( 0, getName() ) ); + // Output unit for backup intermittent technology to be for market. + mIntermittTechInfo->setString( "output-unit", "share" ); + + // If trial market name has not been readin use technology name as default trial market name. + if( mTrialMarketNameParsed.empty() ){ + mTrialMarketName = getName(); // technology name + } + else { + mTrialMarketName = mTrialMarketNameParsed; + } + + if( mElectricSectorMarket.empty() ) { + mElectricSectorMarket = aRegionName; + } + + // Create trial market for intermettent technology if backup exists and needs to be + // calculated. + if( mBackupCalculator ){ + SectorUtils::createTrialSupplyMarket( aRegionName, mTrialMarketName, mIntermittTechInfo.get(), mElectricSectorMarket ); + MarketDependencyFinder* depFinder = scenario->getMarketplace()->getDependencyFinder(); + depFinder->addDependency( aSectorName, aRegionName, + SectorUtils::getTrialMarketName( mTrialMarketName ), + aRegionName ); + if( aSectorName != mElectricSectorName ) { + // This dependency can not be removed since it is inherently different + // than sector dependencies. + depFinder->addDependency( mElectricSectorName, mElectricSectorMarket, aSectorName, aRegionName, false ); + } + } + + // Warn if a backup calculator was not read-in. + if( !mBackupCalculator ){ + ILogger& mainLog = ILogger::getLogger( "main_log" ); + mainLog.setLevel( ILogger::NOTICE ); + mainLog << "Backup intermittent technology " << mName << " in sector " << aSectorName + << " in region " << aRegionName + << " did not read in a backup calculator. Backup costs will default to zero. " << endl; + } + + initializeInputLocations( aRegionName, aSectorName, 0 ); + MarketDependencyFinder* depFinder = scenario->getMarketplace()->getDependencyFinder(); + depFinder->addDependency( aSectorName, aRegionName, (*mResourceInput)->getName(), aRegionName ); +} + +void BackupIntermittentTechnology::initCalc( const string& aRegionName, + const string& aSectorName, + const IInfo* aSubsectorInfo, + const Demographic* aDemographics, + PreviousPeriodInfo& aPrevPeriodInfo, + const int aPeriod ) +{ + // Note: initCalc is called for all past, current and future technologies. + Technology::initCalc( aRegionName, aSectorName, aSubsectorInfo, + aDemographics, aPrevPeriodInfo, aPeriod ); + if ( mBackupCalculator ) { + mBackupCalculator->initCalc( mIntermittTechInfo.get() ); + + // The renewable trial market is a share calculation so we can give the + // solver some additional hints that the range should be between 0 and 1. + SectorUtils::setSupplyBehaviorBounds( SectorUtils::getTrialMarketName( mTrialMarketName ), + aRegionName, 0, 1, aPeriod ); + } + initializeInputLocations( aRegionName, aSectorName, aPeriod ); +} + +void BackupIntermittentTechnology::postCalc( const string& aRegionName, + const int aPeriod ) +{ + // Use the base class postCalc. + Technology::postCalc( aRegionName, aPeriod ); +} + +/*! \brief Set backup intermittent technology outputs and inputs and shares for trial market. +* \author Sonny Kim +* \param aRegionName name of the region. +* \param aSectorName name of the sector. +* \param aVariableDemand current demand for the technology. +* \param aFixedOutputScaleFactor +* \param aGDP GDP +* \param aPeriod Model period +*/ +void BackupIntermittentTechnology::production( const string& aRegionName, + const string& aSectorName, + double aVariableDemand, + double aFixedOutputScaleFactor, + const int aPeriod ) +{ + // Use the base class production to set outputs and inputs. + Technology::production( aRegionName, aSectorName, aVariableDemand, + aFixedOutputScaleFactor, aPeriod ); + + // For the trial intermittent technology market, set the trial supply amount to + // the ratio of intermittent-technology output to the electricity output. + double dependentSectorOutput = scenario->getMarketplace()->getDemand( mElectricSectorName, mElectricSectorMarket, aPeriod ); + + if ( dependentSectorOutput > 0 ){ + mIntermitOutTechRatio = std::min( getOutput( aPeriod ) / dependentSectorOutput, 1.0 ); + } + else { + mIntermitOutTechRatio = 0.0; + } + + // Multiple vintaged backup intermittent technology ratios are additive. This gives one share for + // backup calculation and proper behavior for vintaging backup intermittent technologies. + SectorUtils::addToTrialDemand( aRegionName, mTrialMarketName, mIntermitOutTechRatio, aPeriod ); +} + +/*! \brief Set tech shares based on backup energy needs for a backup intermittent +* resource. +* \author Marshall Wise +* \param aPeriod Model period. +*/ +void BackupIntermittentTechnology::setCoefficients( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) +{ + // Convert backup capacity per unit of resource energy to energy required + // (in EJ) per unit of resource energy (in EJ) using backup capacity factor. + // Based on average backup capacity as this is multiplied by sector output + // to get total backup electricity. + double backupEnergyFraction = getAverageBackupCapacity( aRegionName, aSectorName, + aPeriod ) * calcEnergyFromBackup(); + + /*! \invariant Backup energy fraction must be positive. */ + assert( util::isValidNumber( backupEnergyFraction ) && + backupEnergyFraction >= 0 ); + + // The inputs will only be invalid if the dataset was invalid. + if( mResourceInput != mInputs.end() && mBackupInput != mInputs.end() ){ + // Normalize coefficients so that the energy output of the sector is apportioned appropriately to the two energy inputs. + // + // NOTE: the version currently in the multi-inputs branch only changes the coefficient for + // backup, leaving the coefficient for the resource 1. This, essentially, assumes that as backup comes in + // some of the resource energy is lost. This assumption makes relatively little difference for wind + // (since the amount of energy from backup is small), but is not correct for CSP, where sector output is split between + // CSP and backup mode. + double newCoefficient = getResourceToEnergyRatio(aRegionName, aSectorName, aPeriod ) / + ( 1.0 + backupEnergyFraction ); + ( *mResourceInput )->setCoefficient( newCoefficient, aPeriod ); + double newBackupCoef = aPeriod > scenario->getModeltime()->getFinalCalibrationPeriod() ? + backupEnergyFraction / ( 1.0 + backupEnergyFraction ) : + // we do not include the back up energy in the calibration energy balance so we + // will have to turn off the energy demand in the historical years + 0.0; + ( *mBackupInput )->setCoefficient( newBackupCoef, aPeriod ); + } +} + +/*! \brief Return amount of resource needed per unit of energy output. +* This method should be used when a technology uses a resource that is +* not in energy units. +* \author Steve Smith +* \param aPeriod Model period. +*/ +double BackupIntermittentTechnology::getResourceToEnergyRatio( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) +{ + // Default assumpion is that resource is in energy units + return 1.0; +} + +/*! \brief Computes weighted cost of all technologies in Subsector plus backup +* costs. +* \details Computes a total cost of the subsector by adding the weighted +* technology costs and adding the additional backup cost based on the +* backup capacity required. +* \author Marshall Wise, Sonny Kim +* \param aGDP Regional GDP container. +* \param aPeriod Model period. +*/ +void BackupIntermittentTechnology::calcCost( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) +{ + // Set marginal cost for backup to the input object set asside for this + ( *mBackupCapCostInput )->setPrice( aRegionName, + getMarginalBackupCapCost( aRegionName, mTrialMarketName, aPeriod ), + aPeriod ); + + // Set the coefficients for energy and backup in the production function. + // Must call this after costs for backup capital and technology have been set. + setCoefficients( aRegionName, mTrialMarketName, aPeriod ); + + // Calculate the base technology cost. This will use the standard leontief + // production function with updated coefficients for the fuel and the + // backup. + Technology::calcCost( aRegionName, aSectorName, aPeriod ); +} + +/*! \brief Returns marginal cost for backup capacity +* \author Marshall Wise, Steve Smith +* \param aSectorName Sector name. +* \param aRegionName Region name. +* \param aPeriod Model period. +*/ +double BackupIntermittentTechnology::getMarginalBackupCapCost( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) const +{ + // Add per unit cost of backup capacity to subsector price backup capacity + // is in GW/EJ, so have to convert to kW/GJ (multiply numerator by 1E6 and + // denominator by 1E9 to get * 1/1000) to make consistent with market price + // which is in $/GJ. BackupCost is in $/kw/yr. + double backupCost = getMarginalBackupCapacity( aRegionName, aSectorName, aPeriod ) + / 1000 * mBackupCapitalCost; + return backupCost; +} + +/*! + * \brief Get the marginal backup capacity required per unit of energy output. + * \details Uses the internal backup calculator to determine the marginal backup + * capacity per unit output. If a backup calculator was not read-in, + * this is assumed to be zero. + * \author Marshall Wise, Steve Smith, Sonny Kim + * \param aPeriod Model period. + * \return Marginal backup capacity per unit of energy output. + */ +double BackupIntermittentTechnology::getMarginalBackupCapacity( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) const { + double backupCapacity = 0; + if( mBackupCalculator && mResourceInput != mInputs.end() ){ + const string& resourceName = ( *mResourceInput )->getName(); + backupCapacity = mBackupCalculator->getMarginalBackupCapacity( aSectorName, + mElectricSectorName, resourceName, aRegionName, + mCapacityFactor, mElecReserveMargin, mAveGridCapacityFactor, aPeriod ); + } + + /*! \post Backup capacity is a valid number and positive. */ + assert( backupCapacity >= 0 && util::isValidNumber( backupCapacity ) ); + return backupCapacity; +} + +/*! + * \brief Get the average backup capacity per unit output for the intermittent + * subsector. + * \details Uses the internal backup calculator to determine the average backup + * capacity per unit output. If a backup calculator was not read-in, + * this is assumed to be zero. + * \author Marshall Wise, Steve Smith, Sonny Kim + * \param aPeriod Model period. + * \return Average backup capacity per unit output. + */ +double BackupIntermittentTechnology::getAverageBackupCapacity( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) const +{ + double backupCapacity = 0; + if( mBackupCalculator ){ + const string& resourceName = ( *mResourceInput )->getName(); + backupCapacity = mBackupCalculator->getAverageBackupCapacity( aSectorName, + mElectricSectorName, resourceName, aRegionName, + mCapacityFactor, mElecReserveMargin, mAveGridCapacityFactor, aPeriod ); + } + + /*! \post Backup capacity is a valid number and positive. */ + assert( backupCapacity >= 0 && util::isValidNumber( backupCapacity ) ); + return backupCapacity; +} + +/*! + * \brief Initialize the cached locations of the resource and backup inputs. + * \details Determines and caches the locations of the resource and backup + * inputs. The resource input is assumed to be the input with a + * variance. The backup input is assumed to be the remaining energy + * input. + * \param aRegionName Name of the containing region. + * \param aSectorName Name of the containing sector. + * \param aPeriod Period. + * \warning If the input vector changes size, these positions will not be valid. + */ +void BackupIntermittentTechnology::initializeInputLocations( const string& aRegionName, + const string& aSectorName, + const int aPeriod ) +{ + // Set the inputs to the error value. + mBackupCapCostInput = mTechCostInput = mResourceInput = mBackupInput = mInputs.end(); + + for( InputIterator i = mInputs.begin(); i != mInputs.end(); ++i ){ + // Parse location for energy inputs. + if( ( *i )->hasTypeFlag( IInput::ENERGY | IInput::RESOURCE ) ){ + if( mResourceInput != mInputs.end() ){ + // There already was a resource input. + ILogger& mainLog = ILogger::getLogger( "main_log" ); + mainLog.setLevel( ILogger::NOTICE ); + mainLog << "Intermittent technology " << mName << " in sector " << aSectorName + << " in region " << aRegionName << " has more than one variable resource input." << endl; + } + else { + mResourceInput = i; + } + } + else if( ( *i )->hasTypeFlag( IInput::ENERGY | IInput::BACKUP_ENERGY ) ){ + if( mBackupInput != mInputs.end() ){ + // There already was a resource input. + ILogger& mainLog = ILogger::getLogger( "main_log" ); + mainLog.setLevel( ILogger::NOTICE ); + mainLog << "Intermittent technology " << mName << " in sector " << aSectorName + << " in region " << aRegionName << " has more than one backup input." << endl; + } + else { + mBackupInput = i; + } + } + // Parse location for non-energy inputs. + else{ + if ( ( *i )->getName() == getBackupCapCostName() && ( getBackupCapCostName() != "" ) ) { + mBackupCapCostInput = i; + continue; + } + else if ( ( *i )->getName() == getTechCostName() && ( getTechCostName() != "" ) ) { + mTechCostInput = i; + continue; + } + } + } + + // Check that both the resource and backup input were set. + if( mResourceInput == mInputs.end() || mBackupInput == mInputs.end() ){ + // There already was a resource input. + ILogger& mainLog = ILogger::getLogger( "main_log" ); + mainLog.setLevel( ILogger::SEVERE ); + mainLog << "Intermittent technology " << mName << " in sector " << aSectorName + << " in region " << aRegionName << " does not have the required resource and backup inputs." + << endl; + abort(); + } +} + +/*! + * \brief Determine the amount of energy produced by the backup per unit of + * capacity. + * \details Determines the amount of energy produced per unit of backup capacity + * by adjusting for the backup capacity factor and converting the + * resulting operating backup into energy. + * \return Capacity to energy production conversion factor. + * \todo Move all units conversion to utilities. + */ +double BackupIntermittentTechnology::calcEnergyFromBackup() const { + // Conversion: 1 gigaWattHour of electricity = 3.6E-6 ExaJoules + const double EJ_PER_GWH = 0.0000036; + // Number of hours in a year. + const int HOURS_PER_YEAR = 8760; + return HOURS_PER_YEAR * mBackupCapacityFactor * EJ_PER_GWH; +} diff --git a/cvs/objects/technologies/source/intermittent_technology.cpp b/cvs/objects/technologies/source/intermittent_technology.cpp index 374f28c679..c34a8a9c18 100644 --- a/cvs/objects/technologies/source/intermittent_technology.cpp +++ b/cvs/objects/technologies/source/intermittent_technology.cpp @@ -32,10 +32,10 @@ /*! -* \file interm_subsector.cpp +* \file intermittent_technology.cpp * \ingroup Objects -* \brief IntermittentSubsector class source file. -* \author Marshall Wise, Sonny Kim +* \brief IntermittentTechnology class source file. +* \author Marshall Wise, Sonny Kim, Matthew Binsted, Matt Mowers */ #include "util/base/include/definitions.h" @@ -51,6 +51,7 @@ #include "util/base/include/xml_helper.h" #include "marketplace/include/marketplace.h" #include "sectors/include/ibackup_calculator.h" +#include "sectors/include/value_factor_calculator.h" #include "sectors/include/sector_utils.h" #include "functions/include/iinput.h" #include "functions/include/non_energy_input.h" @@ -70,31 +71,19 @@ IntermittentTechnology::IntermittentTechnology( const string& aName, const int a :Technology( aName, aYear ) { mElectricSectorName = "electricity"; - mBackupCapacityFactor = 0.05; - mBackupCapitalCost = 0.0; - mElecReserveMargin = 0.15; - mAveGridCapacityFactor = 0.60; - mBackupCalculator = 0; + mValueFactorCalculator = 0; mResourceInput = mInputs.end(); - mBackupInput = mInputs.end(); - mBackupCapCostInput = mInputs.end(); mTechCostInput = mInputs.end(); } IntermittentTechnology::IntermittentTechnology() { mElectricSectorName = "electricity"; - mBackupCapacityFactor = 0.05; - mBackupCapitalCost = 0.0; - mElecReserveMargin = 0.15; - mAveGridCapacityFactor = 0.60; - mBackupCalculator = 0; + mValueFactorCalculator = 0; mResourceInput = mInputs.end(); - mBackupInput = mInputs.end(); - mBackupCapCostInput = mInputs.end(); mTechCostInput = mInputs.end(); } @@ -102,7 +91,7 @@ IntermittentTechnology::IntermittentTechnology() { * \brief Destructor. */ IntermittentTechnology::~IntermittentTechnology() { - delete mBackupCalculator; + delete mValueFactorCalculator; } IntermittentTechnology* IntermittentTechnology::clone() const { @@ -116,12 +105,10 @@ void IntermittentTechnology::copy( const IntermittentTechnology& aOther ) { mElectricSectorName = aOther.mElectricSectorName; mElectricSectorMarket = aOther.mElectricSectorMarket; mTrialMarketNameParsed = aOther.mTrialMarketNameParsed; - mBackupCapacityFactor = aOther.mBackupCapacityFactor; - mBackupCapitalCost = aOther.mBackupCapitalCost; - if( aOther.mBackupCalculator ) { - delete mBackupCalculator; - mBackupCalculator = aOther.mBackupCalculator->clone(); + if( aOther.mValueFactorCalculator) { + delete mValueFactorCalculator; + mValueFactorCalculator = aOther.mValueFactorCalculator->clone(); } /*! @@ -149,20 +136,11 @@ const string& IntermittentTechnology::getXMLNameStatic() { return XML_NAME; } -/*! \brief Return name to be used for input object containing backup capital costs. -* -* \author Steve Smith -* \return The constant XML_NAME as a static. -*/ -const string& IntermittentTechnology::getBackupCapCostName( ) const { - const static string BACKUP_CAPCOST_NAME = "backup-cap-cost"; - return BACKUP_CAPCOST_NAME; -} /*! \brief Return name to be used for input object containing technology costs. * * This input object will contain technology capital, operation, and any other costs -* exclusive of backup or fuel costs. Setting to blank indicates that this object does +* exclusive of fuel costs. Setting to blank indicates that this object does * not use this cost. * * \author Steve Smith @@ -177,16 +155,6 @@ void IntermittentTechnology::toDebugXMLDerived( const int period, ostream& aOut, XMLWriteElement( mElectricSectorName, "electric-sector-name", aOut, aTabs); XMLWriteElement( mElectricSectorMarket, "electric-sector-market", aOut, aTabs); XMLWriteElementCheckDefault( mTrialMarketNameParsed, "trial-market-name", aOut, aTabs, string("") ); - if( mBackupCapacityFactor.isInited() ){ - XMLWriteElement( mBackupCapacityFactor.get(), "backup-capacity-factor", aOut, aTabs ); - } - if( mBackupCapitalCost.isInited() ){ - XMLWriteElement( mBackupCapitalCost.get(), "backup-capital-cost", aOut, aTabs ); - } - XMLWriteElement( calcEnergyFromBackup(), "energy-to-backup", aOut, aTabs ); - if( mBackupCalculator ){ - mBackupCalculator->toDebugXML( period, aOut, aTabs ); - } } /*! \brief Create a trial market for the technology and complete the initialization. @@ -204,9 +172,9 @@ void IntermittentTechnology::toDebugXMLDerived( const int period, ostream& aOut, * trial market name is not given. * Use techInfo to pass infomation to SectorUtils for setting * market parameters, such as units. -* \todo Member constant values (Backup Capacity Factor, Backup Cost, -* Electricity Reserve Margin, and Ave grid Capacity Factor) could -* be dynamically calculated and utilized by intermittent technology. +* \todo Member constant values (Electricity Reserve Margin, and Ave grid +* Capacity Factor) could be dynamically calculated and utilized by +* intermittent technology. */ void IntermittentTechnology::completeInit( const string& aRegionName, const string& aSectorName, @@ -217,17 +185,6 @@ void IntermittentTechnology::completeInit( const string& aRegionName, // The parent method must be called first due to sequence issues Technology::completeInit( aRegionName, aSectorName, aSubsectorName, aSubsectorInfo, aLandAllocator ); - - // Initialize electric reserve margin and average grid capacity factor from the Sector. - mElecReserveMargin = aSubsectorInfo->getDouble( "electricity-reserve-margin", true ); - mAveGridCapacityFactor = aSubsectorInfo->getDouble( "average-grid-capacity-factor", true ); - - // Initialize a non-energy input to hold backup capacity charges - // This needs be be done before calling other methods so that 1) input vector size is fixed - // (so references won't change) and 2) so that initCalc() methods for new objects can be called. - if( util::searchForValue( mInputs, getBackupCapCostName() ) == mInputs.end() ){ - mInputs.push_back( new NonEnergyInput( getBackupCapCostName() ) ); - } // Inititalize info object mIntermittTechInfo.reset( InfoFactory::constructInfo( 0, getName() ) ); @@ -246,9 +203,8 @@ void IntermittentTechnology::completeInit( const string& aRegionName, mElectricSectorMarket = aRegionName; } - // Create trial market for intermettent technology if backup exists and needs to be - // calculated. - if( mBackupCalculator ){ + // Create trial market for intermittent technology + if(mValueFactorCalculator){ SectorUtils::createTrialSupplyMarket( aRegionName, mTrialMarketName, mIntermittTechInfo.get(), mElectricSectorMarket ); MarketDependencyFinder* depFinder = scenario->getMarketplace()->getDependencyFinder(); depFinder->addDependency( aSectorName, aRegionName, @@ -261,13 +217,14 @@ void IntermittentTechnology::completeInit( const string& aRegionName, } } - // Warn if a backup calculator was not read-in. - if( !mBackupCalculator ){ + // Warn if a value factor calculator was not read-in. + if( !mValueFactorCalculator){ ILogger& mainLog = ILogger::getLogger( "main_log" ); mainLog.setLevel( ILogger::NOTICE ); mainLog << "Intermittent technology " << mName << " in sector " << aSectorName << " in region " << aRegionName - << " did not read in a backup calculator. Backup costs will default to zero. " << endl; + << " did not read in a value factor calculator." + << "Results will not reflect decreasing value of intermittent generation as technology shares increase." << endl; } initializeInputLocations( aRegionName, aSectorName, 0 ); @@ -285,8 +242,8 @@ void IntermittentTechnology::initCalc( const string& aRegionName, // Note: initCalc is called for all past, current and future technologies. Technology::initCalc( aRegionName, aSectorName, aSubsectorInfo, aDemographics, aPrevPeriodInfo, aPeriod ); - if ( mBackupCalculator ) { - mBackupCalculator->initCalc( mIntermittTechInfo.get() ); + if (mValueFactorCalculator) { + mValueFactorCalculator->initCalc( mIntermittTechInfo.get() ); // The renewable trial market is a share calculation so we can give the // solver some additional hints that the range should be between 0 and 1. @@ -334,71 +291,30 @@ void IntermittentTechnology::production( const string& aRegionName, } // Multiple vintaged intermittent technology ratios are additive. This gives one - // share for backup calculation and proper behavior for vintaging intermittent technologies. + // share for value factor calculation and proper behavior for vintaging intermittent technologies. SectorUtils::addToTrialDemand( aRegionName, mTrialMarketName, mIntermitOutTechRatio, aPeriod ); } -/*! \brief Set tech shares based on backup energy needs for an intermittent -* resource. -* \author Marshall Wise -* \param aPeriod Model period. -*/ -void IntermittentTechnology::setCoefficients( const string& aRegionName, - const string& aSectorName, - const int aPeriod ) -{ - // Convert backup capacity per unit of resource energy to energy required - // (in EJ) per unit of resource energy (in EJ) using backup capacity factor. - // Based on average backup capacity as this is multiplied by sector output - // to get total backup electricity. - double backupEnergyFraction = getAverageBackupCapacity( aRegionName, aSectorName, - aPeriod ) * calcEnergyFromBackup(); - - /*! \invariant Backup energy fraction must be positive. */ - assert( util::isValidNumber( backupEnergyFraction ) && - backupEnergyFraction >= 0 ); - - // The inputs will only be invalid if the dataset was invalid. - if( mResourceInput != mInputs.end() && mBackupInput != mInputs.end() ){ - // Normalize coefficients so that the energy output of the sector is apportioned appropriately to the two energy inputs. - // - // NOTE: the version currently in the multi-inputs branch only changes the coefficient for - // backup, leaving the coefficient for the resource 1. This, essentially, assumes that as backup comes in - // some of the resource energy is lost. This assumption makes relatively little difference for wind - // (since the amount of energy from backup is small), but is not correct for CSP, where sector output is split between - // CSP and backup mode. - double newCoefficient = getResourceToEnergyRatio(aRegionName, aSectorName, aPeriod ) / - ( 1.0 + backupEnergyFraction ); - ( *mResourceInput )->setCoefficient( newCoefficient, aPeriod ); - double newBackupCoef = aPeriod > scenario->getModeltime()->getFinalCalibrationPeriod() ? - backupEnergyFraction / ( 1.0 + backupEnergyFraction ) : - // we do not include the back up energy in the calibration energy balance so we - // will have to turn off the energy demand in the historical years - 0.0; - ( *mBackupInput )->setCoefficient( newBackupCoef, aPeriod ); - } -} - /*! \brief Return amount of resource needed per unit of energy output. * This method should be used when a technology uses a resource that is -* not in energy units. +* not in energy units. * \author Steve Smith * \param aPeriod Model period. */ -double IntermittentTechnology::getResourceToEnergyRatio( const string& aRegionName, - const string& aSectorName, - const int aPeriod ) +double IntermittentTechnology::getResourceToEnergyRatio(const string& aRegionName, + const string& aSectorName, + const int aPeriod) { // Default assumpion is that resource is in energy units - return 1.0; + return 1.0; } -/*! \brief Computes weighted cost of all technologies in Subsector plus backup -* costs. -* \details Computes a total cost of the subsector by adding the weighted -* technology costs and adding the additional backup cost based on the -* backup capacity required. -* \author Marshall Wise, Sonny Kim +/*! \brief Computes weighted cost of all technologies in Subsector, +* adjusted by value factor. +* \details Computes a total cost of the subsector by adjusting the weighted +* technology costs by value factor. The result is +* "profitability-adjusted LCOE" (PLCOE = LCOE/VF). +* \author Marshall Wise, Sonny Kim, Matthew Binsted, Matt Mowers * \param aGDP Regional GDP container. * \param aPeriod Model period. */ @@ -406,98 +322,29 @@ void IntermittentTechnology::calcCost( const string& aRegionName, const string& aSectorName, const int aPeriod ) { - // Set marginal cost for backup to the input object set asside for this - ( *mBackupCapCostInput )->setPrice( aRegionName, - getMarginalBackupCapCost( aRegionName, mTrialMarketName, aPeriod ), - aPeriod ); - - // Set the coefficients for energy and backup in the production function. - // Must call this after costs for backup capital and technology have been set. - setCoefficients( aRegionName, mTrialMarketName, aPeriod ); - - // Calculate the base technology cost. This will use the standard leontief - // production function with updated coefficients for the fuel and the - // backup. - Technology::calcCost( aRegionName, aSectorName, aPeriod ); -} + if (mProductionState[aPeriod]->isOperating()) { -/*! \brief Returns marginal cost for backup capacity -* \author Marshall Wise, Steve Smith -* \param aSectorName Sector name. -* \param aRegionName Region name. -* \param aPeriod Model period. -*/ -double IntermittentTechnology::getMarginalBackupCapCost( const string& aRegionName, - const string& aSectorName, - const int aPeriod ) const -{ - // Add per unit cost of backup capacity to subsector price backup capacity - // is in GW/EJ, so have to convert to kW/GJ (multiply numerator by 1E6 and - // denominator by 1E9 to get * 1/1000) to make consistent with market price - // which is in $/GJ. BackupCost is in $/kw/yr. - double backupCost = getMarginalBackupCapacity( aRegionName, aSectorName, aPeriod ) - / 1000 * mBackupCapitalCost; - return backupCost; -} + double cost = getTotalInputCost(aRegionName, aSectorName, aPeriod) + * mPMultiplier - + calcSecondaryValue(aRegionName, aPeriod); -/*! - * \brief Get the marginal backup capacity required per unit of energy output. - * \details Uses the internal backup calculator to determine the marginal backup - * capacity per unit output. If a backup calculator was not read-in, - * this is assumed to be zero. - * \author Marshall Wise, Steve Smith, Sonny Kim - * \param aPeriod Model period. - * \return Marginal backup capacity per unit of energy output. - */ -double IntermittentTechnology::getMarginalBackupCapacity( const string& aRegionName, - const string& aSectorName, - const int aPeriod ) const { - double backupCapacity = 0; - if( mBackupCalculator && mResourceInput != mInputs.end() ){ - const string& resourceName = ( *mResourceInput )->getName(); - backupCapacity = mBackupCalculator->getMarginalBackupCapacity( aSectorName, - mElectricSectorName, resourceName, aRegionName, - mCapacityFactor, mElecReserveMargin, mAveGridCapacityFactor, aPeriod ); - } + double valueFactor = 1; - /*! \post Backup capacity is a valid number and positive. */ - assert( backupCapacity >= 0 && util::isValidNumber( backupCapacity ) ); - return backupCapacity; -} + if ( mValueFactorCalculator ) { + valueFactor = mValueFactorCalculator->getValueFactor(mTrialMarketName, mElectricSectorMarket, aRegionName, aPeriod); + } -/*! - * \brief Get the average backup capacity per unit output for the intermittent - * subsector. - * \details Uses the internal backup calculator to determine the average backup - * capacity per unit output. If a backup calculator was not read-in, - * this is assumed to be zero. - * \author Marshall Wise, Steve Smith, Sonny Kim - * \param aPeriod Model period. - * \return Average backup capacity per unit output. - */ -double IntermittentTechnology::getAverageBackupCapacity( const string& aRegionName, - const string& aSectorName, - const int aPeriod ) const -{ - double backupCapacity = 0; - if( mBackupCalculator ){ - const string& resourceName = ( *mResourceInput )->getName(); - backupCapacity = mBackupCalculator->getAverageBackupCapacity( aSectorName, - mElectricSectorName, resourceName, aRegionName, - mCapacityFactor, mElecReserveMargin, mAveGridCapacityFactor, aPeriod ); - } + mCosts[aPeriod] = cost / valueFactor; - /*! \post Backup capacity is a valid number and positive. */ - assert( backupCapacity >= 0 && util::isValidNumber( backupCapacity ) ); - return backupCapacity; + assert(util::isValidNumber(mCosts[aPeriod])); + } } /*! - * \brief Initialize the cached locations of the resource and backup inputs. - * \details Determines and caches the locations of the resource and backup - * inputs. The resource input is assumed to be the input with a - * variance. The backup input is assumed to be the remaining energy - * input. + * \brief Initialize the cached locations of the resource input. + * \details Determines and caches the locations of the resource + * input. The resource input is assumed to be the input with a + * variance. * \param aRegionName Name of the containing region. * \param aSectorName Name of the containing sector. * \param aPeriod Period. @@ -508,7 +355,7 @@ void IntermittentTechnology::initializeInputLocations( const string& aRegionName const int aPeriod ) { // Set the inputs to the error value. - mBackupCapCostInput = mTechCostInput = mResourceInput = mBackupInput = mInputs.end(); + mTechCostInput = mResourceInput = mInputs.end(); for( InputIterator i = mInputs.begin(); i != mInputs.end(); ++i ){ // Parse location for energy inputs. @@ -524,56 +371,25 @@ void IntermittentTechnology::initializeInputLocations( const string& aRegionName mResourceInput = i; } } - else if( ( *i )->hasTypeFlag( IInput::ENERGY | IInput::BACKUP_ENERGY ) ){ - if( mBackupInput != mInputs.end() ){ - // There already was a resource input. - ILogger& mainLog = ILogger::getLogger( "main_log" ); - mainLog.setLevel( ILogger::NOTICE ); - mainLog << "Intermittent technology " << mName << " in sector " << aSectorName - << " in region " << aRegionName << " has more than one backup input." << endl; - } - else { - mBackupInput = i; - } - } + // Parse location for non-energy inputs. else{ - if ( ( *i )->getName() == getBackupCapCostName() && ( getBackupCapCostName() != "" ) ) { - mBackupCapCostInput = i; - continue; - } - else if ( ( *i )->getName() == getTechCostName() && ( getTechCostName() != "" ) ) { + if ( ( *i )->getName() == getTechCostName() && ( getTechCostName() != "" ) ) { mTechCostInput = i; continue; } } } - // Check that both the resource and backup input were set. - if( mResourceInput == mInputs.end() || mBackupInput == mInputs.end() ){ + // Check that the resource input was set. + if( mResourceInput == mInputs.end() ){ // There already was a resource input. ILogger& mainLog = ILogger::getLogger( "main_log" ); mainLog.setLevel( ILogger::SEVERE ); mainLog << "Intermittent technology " << mName << " in sector " << aSectorName - << " in region " << aRegionName << " does not have the required resource and backup inputs." + << " in region " << aRegionName << " does not have the required resource inputs." << endl; abort(); } } -/*! - * \brief Determine the amount of energy produced by the backup per unit of - * capacity. - * \details Determines the amount of energy produced per unit of backup capacity - * by adjusting for the backup capacity factor and converting the - * resulting operating backup into energy. - * \return Capacity to energy production conversion factor. - * \todo Move all units conversion to utilities. - */ -double IntermittentTechnology::calcEnergyFromBackup() const { - // Conversion: 1 gigaWattHour of electricity = 3.6E-6 ExaJoules - const double EJ_PER_GWH = 0.0000036; - // Number of hours in a year. - const int HOURS_PER_YEAR = 8760; - return HOURS_PER_YEAR * mBackupCapacityFactor * EJ_PER_GWH; -} diff --git a/cvs/objects/technologies/source/technology_container.cpp b/cvs/objects/technologies/source/technology_container.cpp index 94dfc04191..3dc0edf4ba 100644 --- a/cvs/objects/technologies/source/technology_container.cpp +++ b/cvs/objects/technologies/source/technology_container.cpp @@ -53,6 +53,7 @@ #include "technologies/include/technology.h" #include "technologies/include/itechnology.h" #include "technologies/include/default_technology.h" +#include "technologies/include/backup_intermittent_technology.h" #include "technologies/include/intermittent_technology.h" #include "technologies/include/wind_technology.h" #include "technologies/include/solar_technology.h" @@ -127,6 +128,7 @@ ITechnologyContainer* TechnologyContainer::clone() const { */ bool TechnologyContainer::hasTechnologyType( const string& aTechNodeName ) { return ( aTechNodeName == DefaultTechnology::getXMLNameStatic() || + aTechNodeName == BackupIntermittentTechnology::getXMLNameStatic() || aTechNodeName == IntermittentTechnology::getXMLNameStatic() || aTechNodeName == WindTechnology::getXMLNameStatic() || aTechNodeName == SolarTechnology::getXMLNameStatic() || diff --git a/cvs/objects/util/base/include/gcam_data_containers.h b/cvs/objects/util/base/include/gcam_data_containers.h index ddfbe6a7ca..23e93fb993 100644 --- a/cvs/objects/util/base/include/gcam_data_containers.h +++ b/cvs/objects/util/base/include/gcam_data_containers.h @@ -153,6 +153,7 @@ #include "sectors/include/subsector_add_techcosts.h" #include "sectors/include/supply_sector.h" #include "sectors/include/tran_subsector.h" +#include "sectors/include/value_factor_calculator.h" #include "solution/util/include/solution_info_param_parser.h" #include "technologies/include/global_technology_database.h" #include "technologies/include/ag_production_technology.h" @@ -167,6 +168,7 @@ #include "technologies/include/output_accounting.h" #include "technologies/include/ical_data.h" #include "technologies/include/icapture_component.h" +#include "technologies/include/backup_intermittent_technology.h" #include "technologies/include/intermittent_technology.h" #include "technologies/include/internal_gains.h" #include "technologies/include/ioutput.h" diff --git a/cvs/objects/util/base/include/version.h b/cvs/objects/util/base/include/version.h index 06ba106a3b..91701c888b 100644 --- a/cvs/objects/util/base/include/version.h +++ b/cvs/objects/util/base/include/version.h @@ -41,10 +41,10 @@ * NOTE: ADD 1 TO LATEST SUBVERSION REVISION NUMBER */ //! The latest SVN revision number for identification of the build. -#define __REVISION_NUMBER__ "gcam-v7.2" +#define __REVISION_NUMBER__ "gcam-v7.3" /*****************************************************************************/ //! GCAM model version. -#define __ObjECTS_VER__ "7.2" +#define __ObjECTS_VER__ "7.3" #endif // _VERSION_H_ diff --git a/input/gcamdata/R/constants.R b/input/gcamdata/R/constants.R index d26bc8d724..d736298c84 100644 --- a/input/gcamdata/R/constants.R +++ b/input/gcamdata/R/constants.R @@ -477,6 +477,11 @@ energy.SATIATION_YEAR <- max(MODEL_BASE_YEARS) # Needs to be the las energy.UCD_EN_YEAR <- 2005 # UCD transportation year to use to compute shares for allocation of energy to mode/technology/fuel within category/fuel energy.WIND.BASE.COST.YEAR <- 2005 # Base cost year for wind, used in capacity factor calculations +energy.ELEC_USE_BACKUP <- FALSE # constant for switching to old approach to variable renewable integration + # FALSE (default) uses new value factor approach + # TRUE eschews new approach and uses older backup capacity / backup electricity approach +energy.BACKUP_SECTORS <- c("backup_electricity", "csp_backup") + energy.REG_NG_MARKET <- "regional natural gas" #Name of the regional natural gas market energy.MIN_WEIGHT_EJ <- 1e-08 diff --git a/input/gcamdata/R/sysdata.rda b/input/gcamdata/R/sysdata.rda index 36baa2447aa03e833a946c1624b9c0433bee25e4..10016485620a27806fbcbf0208663e367a9bf2b6 100644 GIT binary patch literal 6493 zcmV-j8KUMwT4*^jL0KkKSu{_m5dc59e~|zG|NnXeegHr3-*CVG|L_0^00CelpLpOm z+dyA)J?q?a?O~50RYHrtuE2ZV;52b39`=l}ZJT2l=XQaD<22G%+gck7S+W~zCSkTw zGB6EmBe!zdIV(guY{ZtZJ{X}i0i-l3Nciu$kQW0(9pn%5dspP z)l>Xx6KW=>lT*`B_NS_OO{m(2^(Uy&>HrT@)D1MQ_Cx^Y7$XG|1p$N- zPzV4dQGp}@7!m{qNkB*;5n==aAQd7M1LhBc{{K(y%^JfW?eu*5Hr&u-h7i4_?`Ql_ z^V9QAeyVpRFvo)t0@Qkc)exJ?mxdSP1o={UhjVq_;L zbBaD>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ow@(yjzzsX+$AHp<`o{+K>f`5g3v|(HP9O$ymi{ su+^hwWm%SL{d8zsC^LQU;da}@?CT(Lk1GBL{6F}+k}1N3fZUD@NO!u7(*OVf diff --git a/input/gcamdata/R/xml.R b/input/gcamdata/R/xml.R index 6a9f62d4bd..22c0ecd301 100644 --- a/input/gcamdata/R/xml.R +++ b/input/gcamdata/R/xml.R @@ -505,7 +505,7 @@ XML_NODE_EQUIV <- list( "sector" = c("supplysector", "AgSupplySector", "pass-through-sector"), "subsector" = c("subsector", "AgSupplySubsector", "tranSubsector", "nesting-subsector"), - "technology" = c("technology", "stub-technology", "intermittent-technology", + "technology" = c("technology", "stub-technology", "intermittent-technology", "backup-intermittent-technology", "tranTechnology", "AgProductionTechnology", "pass-through-technology", "resource-reserve-technology"), "discrete-choice" = c("dummy-logit-tag", "relative-cost-logit", diff --git a/input/gcamdata/R/zenergy_L223.electricity.R b/input/gcamdata/R/zenergy_L223.electricity.R index 6845630506..ad5439f88a 100644 --- a/input/gcamdata/R/zenergy_L223.electricity.R +++ b/input/gcamdata/R/zenergy_L223.electricity.R @@ -18,13 +18,13 @@ #' \code{L223.GlobalTechOMvar_elec}, \code{L223.GlobalIntTechOMvar_elec}, \code{L223.GlobalTechShrwt_elec}, #' \code{L223.GlobalTechInterp_elec}, \code{L223.GlobalIntTechShrwt_elec}, \code{L223.PrimaryRenewKeyword_elec}, #' \code{L223.PrimaryRenewKeywordInt_elec}, \code{L223.AvgFossilEffKeyword_elec}, \code{L223.GlobalTechCapture_elec}, -#' \code{L223.GlobalIntTechBackup_elec}, \code{L223.StubTechCapFactor_elec}, \code{L223.StubTechCost_offshore_wind}, -#' \code{L223.GlobalTechShutdown_elec}, \code{L223.GlobalIntTechShutdown_elec}, \code{L223.GlobalTechSCurve_elec}, -#' \code{L223.GlobalIntTechSCurve_elec}, \code{L223.GlobalTechLifetime_elec}, \code{L223.GlobalIntTechLifetime_elec}, -#' \code{L223.GlobalTechProfitShutdown_elec}, \code{L223.GlobalIntTechProfitShutdown_elec}, +#' \code{L223.GlobalIntTechValueFactor_elec}, \code{L223.GlobalIntTechBackup_elec}, \code{L223.StubTechCapFactor_elec}, +#' \code{L223.StubTechCost_offshore_wind}, \code{L223.GlobalTechShutdown_elec}, \code{L223.GlobalIntTechShutdown_elec}, +#' \code{L223.GlobalTechSCurve_elec}, \code{L223.GlobalIntTechSCurve_elec}, \code{L223.GlobalTechLifetime_elec}, +#' \code{L223.GlobalIntTechLifetime_elec}, \code{L223.GlobalTechProfitShutdown_elec}, \code{L223.GlobalIntTechProfitShutdown_elec}, #' \code{L223.StubTechCalInput_elec}, \code{L223.StubTechFixOut_elec}, \code{L223.StubTechFixOut_hydro}, -#' \code{L223.StubTechProd_elec}, \code{L223.StubTechEff_elec}, \code{L223.StubTechSecOut_desal}, \code{L223.GlobalTechCapital_sol_adv}, -#' \code{L223.GlobalIntTechCapital_sol_adv}, \code{L223.GlobalTechCapital_wind_adv}, +#' \code{L223.StubTechProd_elec}, \code{L223.StubTechEff_elec}, \code{L223.StubTechSecOut_desal}, +#' \code{L223.GlobalTechCapital_sol_adv}, \code{L223.GlobalIntTechCapital_sol_adv}, \code{L223.GlobalTechCapital_wind_adv}, #' \code{L223.GlobalIntTechCapital_wind_adv}, \code{L223.GlobalTechCapital_geo_adv}, #' \code{L223.GlobalTechCapital_nuc_adv}, \code{L223.GlobalTechCapital_sol_low}, #' \code{L223.GlobalIntTechCapital_sol_low}, \code{L223.GlobalTechCapital_wind_low}, @@ -53,6 +53,7 @@ module_energy_L223.electricity <- function(command, ...) { FILE = "energy/A23.subsector_shrwt_nuc_R", FILE = "energy/A23.subsector_shrwt_renew_R", FILE = "energy/A23.globalinttech", + FILE = "energy/A23.globalinttech_backup", FILE = "energy/A23.globaltech_shrwt", FILE = "energy/A23.globaltech_interp", FILE = "energy/A23.globaltech_keyword", @@ -106,6 +107,7 @@ module_energy_L223.electricity <- function(command, ...) { "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", "L223.GlobalTechCapture_elec", + "L223.GlobalIntTechValueFactor_elec", "L223.GlobalIntTechBackup_elec", "L223.StubTechCapFactor_elec", "L223.StubTechCost_offshore_wind", @@ -165,6 +167,7 @@ module_energy_L223.electricity <- function(command, ...) { A23.subsector_shrwt_nuc_R <- get_data(all_data, "energy/A23.subsector_shrwt_nuc_R") A23.subsector_shrwt_renew_R <- get_data(all_data, "energy/A23.subsector_shrwt_renew_R") A23.globalinttech <- get_data(all_data, "energy/A23.globalinttech", strip_attributes = TRUE) + A23.globalinttech_backup <- get_data(all_data, "energy/A23.globalinttech_backup", strip_attributes = TRUE) A23.globaltech_shrwt <- get_data(all_data, "energy/A23.globaltech_shrwt", strip_attributes = TRUE) A23.globaltech_interp <- get_data(all_data, "energy/A23.globaltech_interp", strip_attributes = TRUE) A23.globaltech_keyword <- get_data(all_data, "energy/A23.globaltech_keyword", strip_attributes = TRUE) @@ -360,7 +363,9 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechEff_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechEff_elec # Hard code in type "Resource" for intermittent technology resource input only @@ -368,7 +373,9 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechEff_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechEff_elec # Capacity factor of global technologies @@ -385,13 +392,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechCapFac_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechCapFac_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechCapFac_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechCapFac_elec # Calculate base case capital costs of global electricity generation technologies in L223.GlobalTechCapital_elec @@ -407,13 +418,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechCapital_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechCapital_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechCapital_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechCapital_elec # Calculate advanced technology capital costs of global electricity generation technologies in L223.GlobalTechCapital_elec_adv @@ -430,13 +445,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechCapital_elec_adv_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechCapital_elec_adv # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechCapital_elec_adv_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechCapital_elec_adv # Separate capital costs of global electricity technologies into separate files for each technology @@ -476,13 +495,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechCapital_elec_low_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechCapital_elec_low # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechCapital_elec_low_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechCapital_elec_low # Separate low tech capital costs of global electricity technologies into separate files for each technology @@ -526,13 +549,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.globaltech_OMfixed_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechOMfixed_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.globaltech_OMfixed_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechOMfixed_elec # Calculate variable O&M costs of global electricity generation technologies for L223.GlobalTechOMvar_elec @@ -549,13 +576,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.globaltech_OMvar_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechOMvar_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.globaltech_OMvar_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechOMvar_elec # Interpolate Shareweights of global electricity generation technologies for L223.GlobalTechShrwt_elec and L223.GlobalIntTechShrwt_elec @@ -577,13 +608,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechShrwt_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechShrwt_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechShrwt_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechShrwt_elec # Interpolation rules for L223.GlobalTechInterp_elec @@ -615,13 +650,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.PrimaryRenewKeyword_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.PrimaryRenewKeywordInt_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.PrimaryRenewKeyword_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.PrimaryRenewKeyword_elec # L223.AvgFossilEffKeyword_elec: Keywords of fossil/bio electric generation technologies @@ -649,16 +688,26 @@ module_energy_L223.electricity <- function(command, ...) { # reorders columns to match expected model interface input L223.GlobalTechCapture_elec <- L223.GlobalTechCapture_elec[c(LEVEL2_DATA_NAMES[["GlobalTechYr"]], "remove.fraction", "storage.market")] - # Set backup parameters for global electricity generation technologies for L223.GlobalIntTechBackup_elec + # Set backup parameters for global electricity generation technologies for L223.GlobalIntTechValueFactor_elec and L223.GlobalIntTechBackup_elec # ------------------------------------------------------------------------------------------------------ # Copy assumed parameters to all model years A23.globalinttech %>% repeat_add_columns(tibble(year = MODEL_YEARS)) %>% rename(sector.name = supplysector, subsector.name = subsector) -> + L223.GlobalIntTechValueFactor_elec + # reorders columns to match expected model interface input + L223.GlobalIntTechValueFactor_elec <- L223.GlobalIntTechValueFactor_elec[c(LEVEL2_DATA_NAMES[["GlobalIntTechValueFactor"]])] + + # NOTE: this is the previous approach to renewable integration and will not be used by default + A23.globalinttech_backup %>% + repeat_add_columns(tibble(year = MODEL_YEARS)) %>% + rename(sector.name = supplysector, + subsector.name = subsector, + backup.intermittent.technology = technology) -> L223.GlobalIntTechBackup_elec # reorders columns to match expected model interface input - L223.GlobalIntTechBackup_elec <- L223.GlobalIntTechBackup_elec[c(LEVEL2_DATA_NAMES[["GlobalTechBackup"]])] + L223.GlobalIntTechBackup_elec <- L223.GlobalIntTechBackup_elec[c(LEVEL2_DATA_NAMES[["GlobalIntTechBackup"]])] # Set global technology retirement information for all electricity sector technologies # ------------------------------------------------------------------------------------ @@ -692,13 +741,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechShutdown_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechShutdown_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechShutdown_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechShutdown_elec # S-CURVE RETIREMENT @@ -710,13 +763,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechSCurve_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechSCurve_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechSCurve_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechSCurve_elec # NO RETIREMENT FUNCTION (FULL LIFETIME) @@ -728,13 +785,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechLifetime_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechLifetime_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechLifetime_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechLifetime_elec @@ -747,13 +808,17 @@ module_energy_L223.electricity <- function(command, ...) { # Subsets the intermittent technologies by checking it against the list in A23.globalinttech L223.GlobalTechProfitShutdown_elec_all %>% - semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) %>% + semi_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) %>% rename(intermittent.technology = technology) -> L223.GlobalIntTechProfitShutdown_elec # Subsets the non-intermittent technologies by checking against any not listed in A23.globalinttech L223.GlobalTechProfitShutdown_elec_all %>% - anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", "subsector.name" = "subsector", "technology")) -> + anti_join(A23.globalinttech, by = c("sector.name" = "supplysector", + "subsector.name" = "subsector", + "technology" = "intermittent.technology")) -> L223.GlobalTechProfitShutdown_elec # Removes any empty data frames (if above subsets return 0 rows) @@ -1295,12 +1360,22 @@ module_energy_L223.electricity <- function(command, ...) { add_precursors("energy/A23.globaltech_co2capture") -> L223.GlobalTechCapture_elec + L223.GlobalIntTechValueFactor_elec %>% + add_title("Value factor equations for intermittent technologies") %>% + add_units("value.factor.intercept = fraction of PLCOE observed at 0% market share (LCOE is divided by this value); + value.factor.slope = % reduction in PLCOE obsrved per % increase in market share") %>% + add_comments("Assumptions contained within A23.globalinttech") %>% + add_legacy_name("L223.GlobalIntTechValueFactor_elec") %>% + add_precursors("energy/A23.globalinttech") -> + L223.GlobalIntTechValueFactor_elec + L223.GlobalIntTechBackup_elec %>% - add_title("Capital costs of backup technologies for intermittent techs") %>% + add_title("Backup cost and demand function parameters for intermittent techs") %>% add_units("1975 USD/kW/yr") %>% - add_comments("Assumptions contained within A23.globalinttech") %>% + add_comments("NOTE: this is the previous approach to renewable integration and will not be used by default") %>% + add_comments("Assumptions contained within A23.globalinttech_backup") %>% add_legacy_name("L223.GlobalIntTechBackup_elec") %>% - add_precursors("energy/A23.globalinttech") -> + add_precursors("energy/A23.globalinttech_backup") -> L223.GlobalIntTechBackup_elec L223.StubTechCapFactor_elec %>% @@ -1603,7 +1678,7 @@ module_energy_L223.electricity <- function(command, ...) { L223.GlobalTechOMfixed_elec, L223.GlobalIntTechOMfixed_elec, L223.GlobalTechOMvar_elec, L223.GlobalIntTechOMvar_elec, L223.GlobalTechShrwt_elec, L223.GlobalTechInterp_elec, L223.GlobalIntTechShrwt_elec, L223.PrimaryRenewKeyword_elec, L223.PrimaryRenewKeywordInt_elec, - L223.AvgFossilEffKeyword_elec, L223.GlobalTechCapture_elec, L223.GlobalIntTechBackup_elec, + L223.AvgFossilEffKeyword_elec, L223.GlobalTechCapture_elec, L223.GlobalIntTechValueFactor_elec, L223.GlobalIntTechBackup_elec, L223.StubTechCapFactor_elec,L223.StubTechCost_offshore_wind, L223.GlobalTechShutdown_elec, L223.GlobalIntTechShutdown_elec, L223.GlobalTechSCurve_elec, L223.GlobalIntTechSCurve_elec, L223.GlobalTechLifetime_elec, L223.GlobalIntTechLifetime_elec, L223.GlobalTechProfitShutdown_elec, diff --git a/input/gcamdata/R/zenergy_L226.en_distribution.R b/input/gcamdata/R/zenergy_L226.en_distribution.R index 8f72fa7a2f..f147842cb2 100644 --- a/input/gcamdata/R/zenergy_L226.en_distribution.R +++ b/input/gcamdata/R/zenergy_L226.en_distribution.R @@ -72,6 +72,28 @@ module_energy_L226.en_distribution <- function(command, ...) { L126.IO_R_electd_F_Yh <- get_data(all_data, "L126.IO_R_electd_F_Yh") L126.IO_R_gaspipe_F_Yh <- get_data(all_data, "L126.IO_R_gaspipe_F_Yh") + + # =================================================== + # Remove backup electricity sector (by default) + + remove_backup_sector <- function(data, type = "global") { + data %>% + filter(!(supplysector %in% energy.BACKUP_SECTORS)) + } + + if(energy.ELEC_USE_BACKUP) { + # DO NOTHING + } else { + # REMOVE BACKUP ELECTRICITY SECTORS + A26.sector %<>% remove_backup_sector + A26.subsector_logit %<>% remove_backup_sector + A26.subsector_shrwt %<>% remove_backup_sector + A26.subsector_interp %<>% remove_backup_sector + A26.globaltech_eff %<>% remove_backup_sector + A26.globaltech_cost %<>% remove_backup_sector + A26.globaltech_shrwt %<>% remove_backup_sector + } + # =================================================== # 2. Build tables for CSVs diff --git a/input/gcamdata/R/zenergy_xml_electricity.R b/input/gcamdata/R/zenergy_xml_electricity.R index 168a3cb5b6..0c1782ee3c 100644 --- a/input/gcamdata/R/zenergy_xml_electricity.R +++ b/input/gcamdata/R/zenergy_xml_electricity.R @@ -13,47 +13,48 @@ module_energy_electricity_xml <- function(command, ...) { if(command == driver.DECLARE_INPUTS) { return(c("L223.Supplysector_elec", - "L223.ElecReserve", - "L223.SectorUseTrialMarket_elec", - "L223.SubsectorLogit_elec", - "L223.SubsectorShrwtFllt_elec", - "L223.SubsectorShrwt_elec", - "L223.SubsectorShrwt_coal", - "L223.SubsectorShrwt_nuc", - "L223.SubsectorShrwt_renew", - "L223.SubsectorInterp_elec", - "L223.SubsectorInterpTo_elec", - "L223.StubTech_elec", - "L223.GlobalIntTechEff_elec", - "L223.GlobalTechEff_elec", - "L223.GlobalTechCapFac_elec", - "L223.GlobalIntTechCapFac_elec", - "L223.GlobalTechCapital_elec", - "L223.GlobalIntTechCapital_elec", - "L223.GlobalTechOMfixed_elec", - "L223.GlobalIntTechOMfixed_elec", - "L223.GlobalTechOMvar_elec", - "L223.GlobalIntTechOMvar_elec", - "L223.GlobalTechShrwt_elec", - "L223.GlobalTechInterp_elec", - "L223.GlobalIntTechShrwt_elec", - "L223.PrimaryRenewKeyword_elec", - "L223.PrimaryRenewKeywordInt_elec", - "L223.AvgFossilEffKeyword_elec", - "L223.GlobalTechCapture_elec", - "L223.GlobalIntTechBackup_elec", - "L223.StubTechCapFactor_elec", - "L223.StubTechCost_offshore_wind", - "L223.GlobalTechSCurve_elec", - "L223.GlobalTechLifetime_elec", - "L223.GlobalIntTechLifetime_elec", - "L223.GlobalTechProfitShutdown_elec", - "L223.StubTechCalInput_elec", - "L223.StubTechFixOut_elec", - "L223.StubTechFixOut_hydro", - "L223.StubTechProd_elec", - "L223.StubTechEff_elec", - "L223.StubTechSecOut_desal")) + "L223.ElecReserve", + "L223.SectorUseTrialMarket_elec", + "L223.SubsectorLogit_elec", + "L223.SubsectorShrwtFllt_elec", + "L223.SubsectorShrwt_elec", + "L223.SubsectorShrwt_coal", + "L223.SubsectorShrwt_nuc", + "L223.SubsectorShrwt_renew", + "L223.SubsectorInterp_elec", + "L223.SubsectorInterpTo_elec", + "L223.StubTech_elec", + "L223.GlobalIntTechEff_elec", + "L223.GlobalTechEff_elec", + "L223.GlobalTechCapFac_elec", + "L223.GlobalIntTechCapFac_elec", + "L223.GlobalTechCapital_elec", + "L223.GlobalIntTechCapital_elec", + "L223.GlobalTechOMfixed_elec", + "L223.GlobalIntTechOMfixed_elec", + "L223.GlobalTechOMvar_elec", + "L223.GlobalIntTechOMvar_elec", + "L223.GlobalTechShrwt_elec", + "L223.GlobalTechInterp_elec", + "L223.GlobalIntTechShrwt_elec", + "L223.PrimaryRenewKeyword_elec", + "L223.PrimaryRenewKeywordInt_elec", + "L223.AvgFossilEffKeyword_elec", + "L223.GlobalTechCapture_elec", + "L223.GlobalIntTechValueFactor_elec", + "L223.GlobalIntTechBackup_elec", + "L223.StubTechCapFactor_elec", + "L223.StubTechCost_offshore_wind", + "L223.GlobalTechSCurve_elec", + "L223.GlobalTechLifetime_elec", + "L223.GlobalIntTechLifetime_elec", + "L223.GlobalTechProfitShutdown_elec", + "L223.StubTechCalInput_elec", + "L223.StubTechFixOut_elec", + "L223.StubTechFixOut_hydro", + "L223.StubTechProd_elec", + "L223.StubTechEff_elec", + "L223.StubTechSecOut_desal")) } else if(command == driver.DECLARE_OUTPUTS) { return(c(XML = "electricity.xml")) } else if(command == driver.MAKE) { @@ -90,6 +91,7 @@ module_energy_electricity_xml <- function(command, ...) { L223.PrimaryRenewKeywordInt_elec <- get_data(all_data, "L223.PrimaryRenewKeywordInt_elec") L223.AvgFossilEffKeyword_elec <- get_data(all_data, "L223.AvgFossilEffKeyword_elec") L223.GlobalTechCapture_elec <- get_data(all_data, "L223.GlobalTechCapture_elec") + L223.GlobalIntTechValueFactor_elec <- get_data(all_data, "L223.GlobalIntTechValueFactor_elec") L223.GlobalIntTechBackup_elec <- get_data(all_data, "L223.GlobalIntTechBackup_elec") L223.StubTechCapFactor_elec <- get_data(all_data, "L223.StubTechCapFactor_elec") L223.StubTechCost_offshore_wind<- get_data(all_data, "L223.StubTechCost_offshore_wind") @@ -128,6 +130,22 @@ module_energy_electricity_xml <- function(command, ...) { add_xml_data(L223.SubsectorInterp_elec, "SubsectorInterp") %>% add_xml_data(L223.SubsectorInterpTo_elec, "SubsectorInterpTo") %>% add_xml_data(L223.StubTech_elec, "StubTech") %>% + add_node_equiv_xml("technology") -> + electricity.xml + + if(energy.ELEC_USE_BACKUP) { + electricity.xml %>% + add_xml_data(L223.GlobalIntTechBackup_elec, "GlobalIntTechBackup") %>% + add_precursors("L223.GlobalIntTechBackup_elec") -> + electricity.xml + } else { + electricity.xml %>% + add_xml_data(L223.GlobalIntTechValueFactor_elec, "GlobalIntTechValueFactor") %>% + add_precursors("L223.GlobalIntTechValueFactor_elec") -> + electricity.xml + } + + electricity.xml %>% add_xml_data(L223.GlobalIntTechEff_elec, "GlobalIntTechEff") %>% add_xml_data(L223.GlobalTechEff_elec, "GlobalTechEff") %>% add_xml_data(L223.GlobalTechCapFac_elec, "GlobalTechCapFac") %>% @@ -145,7 +163,6 @@ module_energy_electricity_xml <- function(command, ...) { add_xml_data(L223.PrimaryRenewKeywordInt_elec, "PrimaryRenewKeywordInt") %>% add_xml_data(L223.AvgFossilEffKeyword_elec, "AvgFossilEffKeyword") %>% add_xml_data(L223.GlobalTechCapture_elec, "GlobalTechCapture") %>% - add_xml_data(L223.GlobalIntTechBackup_elec, "GlobalIntTechBackup") %>% add_xml_data(L223.StubTechCapFactor_elec, "StubTechCapFactor") %>% add_xml_data(L223.StubTechCost_offshore_wind, "StubTechCost") %>% add_xml_data(L223.GlobalTechSCurve_elec, "GlobalTechSCurve") %>% @@ -187,7 +204,6 @@ module_energy_electricity_xml <- function(command, ...) { "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", "L223.GlobalTechCapture_elec", - "L223.GlobalIntTechBackup_elec", "L223.StubTechCapFactor_elec", "L223.StubTechCost_offshore_wind", "L223.GlobalTechSCurve_elec", diff --git a/input/gcamdata/R/zgcamusa_L223.electricity.R b/input/gcamdata/R/zgcamusa_L223.electricity.R index 630ceb3615..6b7a7c4428 100644 --- a/input/gcamdata/R/zgcamusa_L223.electricity.R +++ b/input/gcamdata/R/zgcamusa_L223.electricity.R @@ -510,8 +510,8 @@ module_gcamusa_L223.electricity <- function(command, ...) { L223.GlobalIntTechBackup_elec %>% mutate(supplysector = sector.name, subsector = subsector.name) %>% write_to_all_states(names = c(names(.), 'region')) %>% - filter(!(region %in% CSP_states_noresource) | !grepl("CSP", technology)) %>% - mutate(market.name = gcam.USA_REGION, stub.technology = technology) %>% + filter(!(region %in% CSP_states_noresource) | !grepl("CSP", backup.intermittent.technology)) %>% + mutate(market.name = gcam.USA_REGION, stub.technology = backup.intermittent.technology) %>% # Wind & utility-scale (i.e. non-rooftop) solar are assumed to be infeasible in DC. # Thus, no wind & solar subsectors should be created in DC's electricity sector. # Use anti_join to remove them from the table. diff --git a/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R b/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R index 37b9f31415..9a3753b023 100644 --- a/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R +++ b/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R @@ -11,7 +11,8 @@ #' the generated outputs: \code{L2233.GlobalTechEff_elecS_cool_USA}, \code{L2233.GlobalTechShrwt_elecS_cool_USA}, \code{L2233.GlobalTechProfitShutdown_elecS_cool_USA}, #' \code{L2233.GlobalTechOMvar_elecS_cool_USA}, \code{L2233.GlobalTechOMfixed_elecS_cool_USA}, \code{L2233.GlobalTechCapital_elecS_USA}, \code{L2233.GlobalTechCapital_elecS_cool_USA}, #' \code{L2233.GlobalTechCapFac_elecS_cool_USA}, \code{L2233.GlobalTechSCurve_elecS_cool_USA}, \code{L2233.GlobalTechCoef_elecS_cool_USA}, \code{L2233.GlobalTechCapture_elecS_cool_USA}, -#' \code{L2233.GlobalTechLifetime_elecS_cool_USA}, \code{L2233.AvgFossilEffKeyword_elecS_cool_USA}, \code{L2233.GlobalIntTechBackup_elecS_cool_USA}, \code{L2233.GlobalIntTechCapital_elecS_USA}, +#' \code{L2233.GlobalTechLifetime_elecS_cool_USA}, \code{L2233.AvgFossilEffKeyword_elecS_cool_USA}, \code{L2233.GlobalIntTechBackup_elecS_cool_USA}, +#' \code{L2233.GlobalIntTechValueFactor_elecS_cool_USA}, \code{L2233.GlobalIntTechCapital_elecS_USA}, #' \code{L2233.GlobalIntTechCapital_elecS_cool_USA}, \code{L2233.GlobalIntTechEff_elecS_USA}, \code{L2233.GlobalIntTechEff_elecS_cool_USA}, \code{L2233.GlobalIntTechLifetime_elecS_cool_USA}, #' \code{L2233.GlobalIntTechOMfixed_elecS_cool_USA}, \code{L2233.GlobalIntTechOMvar_elecS_cool_USA}, \code{L2233.GlobalIntTechShrwt_elecS_cool_USA}, \code{L2233.GlobalIntTechCoef_elecS_cool_USA}, #' \code{L2233.PrimaryRenewKeyword_elecS_cool_USA}, \code{L2233.PrimaryRenewKeywordInt_elecS_cool_USA}, \code{L2233.StubTechEff_elecS_cool_USA}, \code{L2233.StubTechCoef_elecS_cool_USA}, @@ -46,6 +47,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "L2233.GlobalIntTechCoef_elec_cool", "L2234.AvgFossilEffKeyword_elecS_USA", "L2234.GlobalIntTechBackup_elecS_USA", + "L2234.GlobalIntTechValueFactor_elecS_USA", "L2234.GlobalIntTechCapital_elecS_USA", "L2234.GlobalIntTechEff_elecS_USA", "L2234.GlobalIntTechLifetime_elecS_USA", @@ -116,6 +118,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "L2233.GlobalTechLifetime_elecS_cool_USA", "L2233.AvgFossilEffKeyword_elecS_cool_USA", "L2233.GlobalIntTechBackup_elecS_cool_USA", + "L2233.GlobalIntTechValueFactor_elecS_cool_USA", "L2233.GlobalIntTechCapital_elecS_USA", "L2233.GlobalIntTechCapital_elecS_cool_USA", "L2233.GlobalIntTechEff_elecS_USA", @@ -195,6 +198,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { L2233.GlobalIntTechCoef_elec_cool <- get_data(all_data, "L2233.GlobalIntTechCoef_elec_cool", strip_attributes = TRUE) L2234.AvgFossilEffKeyword_elecS_USA <- get_data(all_data, "L2234.AvgFossilEffKeyword_elecS_USA", strip_attributes = TRUE) L2234.GlobalIntTechBackup_elecS_USA <- get_data(all_data,"L2234.GlobalIntTechBackup_elecS_USA", strip_attributes = TRUE) + L2234.GlobalIntTechValueFactor_elecS_USA <- get_data(all_data,"L2234.GlobalIntTechValueFactor_elecS_USA", strip_attributes = TRUE) L2234.GlobalIntTechCapital_elecS_USA <- get_data(all_data,"L2234.GlobalIntTechCapital_elecS_USA", strip_attributes = TRUE) L2234.GlobalIntTechEff_elecS_USA <- get_data(all_data,"L2234.GlobalIntTechEff_elecS_USA", strip_attributes = TRUE) L2234.GlobalIntTechLifetime_elecS_USA <- get_data(all_data,"L2234.GlobalIntTechLifetime_elecS_USA", strip_attributes = TRUE) @@ -531,9 +535,9 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { } # no changes needed for backup techs as cooling is not directly associated in previous cooling files - L2234.GlobalIntTechBackup_elecS_USA %>% + L2234.GlobalIntTechValueFactor_elecS_USA %>% csp_filter() %>% - bind_rows(L2234.GlobalIntTechBackup_elecS_USA %>% + bind_rows(L2234.GlobalIntTechValueFactor_elecS_USA %>% filter(grepl("CSP", intermittent.technology)) %>% left_join(A23.elecS_tech_mapping_cool, # Left_join used as each power plant type will now be multiplied @@ -546,6 +550,26 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { subsector = intermittent.technology, intermittent.technology = to.technology)) %>% arrange(supplysector, subsector0, subsector, intermittent.technology, year)-> + L2233.GlobalIntTechValueFactor_elecS_USA + # Old approach to intermittent renewable integration (no longer the default) + L2234.GlobalIntTechBackup_elecS_USA %>% + filter(!grepl("CSP", backup.intermittent.technology)) %>% + rename(subsector0 = subsector, + subsector = backup.intermittent.technology) %>% + mutate(backup.intermittent.technology = subsector) %>% + bind_rows(L2234.GlobalIntTechBackup_elecS_USA %>% + filter(grepl("CSP", backup.intermittent.technology)) %>% + left_join(A23.elecS_tech_mapping_cool, + # Left_join used as each power plant type will now be multiplied + # by up to five cooling technologies, thus increasing tibble size + by = c("supplysector" = "Electric.sector", + "backup.intermittent.technology" = "Electric.sector.technology", + "subsector")) %>% + select(-technology, -subsector_1) %>% + rename(subsector0 = subsector, + subsector = backup.intermittent.technology, + backup.intermittent.technology = to.technology)) %>% + arrange(supplysector, subsector0, subsector, backup.intermittent.technology, year)-> L2233.GlobalIntTechBackup_elecS_USA # isolate int techs that do not have cooling techs associated @@ -661,13 +685,11 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { L2233.GlobalIntTechOMfixed_elecS_cool_USA L2234.GlobalIntTechOMvar_elecS_USA %>% - mutate(subsector0 = subsector, - subsector = intermittent.technology) -> - L2233.GlobalIntTechOMvar_elecS_cool_USA - - L2234.GlobalIntTechOMvar_elecS_USA %>% - mutate(subsector0 = subsector, - subsector = intermittent.technology) -> + csp_filter() %>% + bind_rows(L2234.GlobalIntTechOMvar_elecS_USA %>% + filter(grepl("CSP", intermittent.technology)) %>% + add_int_cooling_techs) %>% + arrange(supplysector, subsector0, subsector, intermittent.technology, year) -> L2233.GlobalIntTechOMvar_elecS_cool_USA L2234.GlobalIntTechShrwt_elecS_USA %>% @@ -1273,6 +1295,14 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { add_precursors("L2234.GlobalIntTechBackup_elecS_USA") -> L2233.GlobalIntTechBackup_elecS_cool_USA + L2233.GlobalIntTechValueFactor_elecS_USA %>% + add_title("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% + add_units("value.factor.intercept = fraction of PLCOE observed at 0% market share (LCOE is divided by this value); + value.factor.slope = % reduction in PLCOE obsrved per % increase in market share") %>% + add_comments("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% + add_precursors("L2234.GlobalIntTechValueFactor_elecS_USA") -> + L2233.GlobalIntTechValueFactor_elecS_cool_USA + L2233.GlobalIntTechCapital_elecS_USA %>% add_title("Electricity Load Segments Intermittent Technology Capital Costs") %>% add_units("none") %>% @@ -1593,6 +1623,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { L2233.GlobalTechLifetime_elecS_cool_USA, L2233.AvgFossilEffKeyword_elecS_cool_USA, L2233.GlobalIntTechBackup_elecS_cool_USA, + L2233.GlobalIntTechValueFactor_elecS_cool_USA, L2233.GlobalIntTechCapital_elecS_USA, L2233.GlobalIntTechCapital_elecS_cool_USA, L2233.GlobalIntTechEff_elecS_USA, diff --git a/input/gcamdata/R/zgcamusa_L2234.elec_segments.R b/input/gcamdata/R/zgcamusa_L2234.elec_segments.R index e9ad67e753..bb1bba0bf2 100644 --- a/input/gcamdata/R/zgcamusa_L2234.elec_segments.R +++ b/input/gcamdata/R/zgcamusa_L2234.elec_segments.R @@ -18,8 +18,8 @@ #' \code{L2234.GlobalIntTechOMfixed_elecS_USA}, \code{L2234.GlobalTechOMvar_elecS_USA}, \code{L2234.GlobalIntTechOMvar_elecS_USA}, #' \code{L2234.GlobalTechCapFac_elecS_USA}, \code{L2234.GlobalTechEff_elecS_USA}, \code{L2234.GlobalIntTechEff_elecS_USA}, #' \code{L2234.GlobalTechLifetime_elecS_USA}, \code{L2234.GlobalIntTechLifetime_elecS_USA}, \code{L2234.GlobalTechProfitShutdown_elecS_USA}, -#' \code{L2234.GlobalTechSCurve_elecS_USA}, \code{L2234.GlobalTechCapture_elecS_USA}, \code{L2234.GlobalIntTechBackup_elecS_USA}, -#' \code{L2234.StubTechMarket_elecS_USA}, \code{L2234.StubTechMarket_backup_elecS_USA}, \code{L2234.StubTechElecMarket_backup_elecS_USA}, +#' \code{L2234.GlobalTechSCurve_elecS_USA}, \code{L2234.GlobalTechCapture_elecS_USA}, \code{L2234.GlobalIntTechValueFactor_elecS_USA}, +#' \code{L2234.GlobalIntTechBackup_elecS_USA},\code{L2234.StubTechMarket_elecS_USA}, \code{L2234.StubTechMarket_backup_elecS_USA}, \code{L2234.StubTechElecMarket_backup_elecS_USA}, #' \code{L2234.StubTechProd_elecS_USA}, \code{L2234.StubTechFixOut_elecS_USA}, \code{L2234.StubTechFixOut_hydro_elecS_USA}, \code{L2234.StubTechCost_offshore_wind_elecS_USA}, #' \code{L2234.TechShrwt_elecS_grid_USA}, \code{L2234.TechCoef_elecS_grid_USA}, \code{L2234.TechProd_elecS_grid_USA}. #' The corresponding file in the original data system was \code{L2234.elec_segments_USA.R} (gcam-usa level2). @@ -51,7 +51,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { FILE = "gcam-usa/NREL_us_re_technical_potential", FILE = "gcam-usa/elecS_time_fraction", FILE = "gcam-usa/A10.renewable_resource_delete", - "L113.elecS_globaltech_capital_battery_ATB", + "L113.elecS_globaltech_capital_battery_ATB", "L119.CapFacScaler_CSP_state", "L1239.state_elec_supply_USA", "L223.StubTechEff_elec_USA", @@ -78,6 +78,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L223.GlobalTechProfitShutdown_elec", "L223.GlobalTechCapture_elec", "L223.GlobalIntTechBackup_elec", + "L223.GlobalIntTechValueFactor_elec", "L223.PrimaryRenewKeyword_elec", "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", @@ -116,6 +117,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L2234.GlobalTechSCurve_elecS_USA", "L2234.GlobalTechCapture_elecS_USA", "L2234.GlobalIntTechBackup_elecS_USA", + "L2234.GlobalIntTechValueFactor_elecS_USA", "L2234.StubTechMarket_elecS_USA", "L2234.StubTechMarket_backup_elecS_USA", "L2234.StubTechElecMarket_backup_elecS_USA", @@ -196,6 +198,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L223.GlobalTechProfitShutdown_elec <- get_data(all_data, "L223.GlobalTechProfitShutdown_elec", strip_attributes = TRUE) L223.GlobalTechCapture_elec <- get_data(all_data, "L223.GlobalTechCapture_elec", strip_attributes = TRUE) L223.GlobalIntTechBackup_elec <- get_data(all_data, "L223.GlobalIntTechBackup_elec", strip_attributes = TRUE) + L223.GlobalIntTechValueFactor_elec <- get_data(all_data, "L223.GlobalIntTechValueFactor_elec", strip_attributes = TRUE) L223.PrimaryRenewKeyword_elec <- get_data(all_data, "L223.PrimaryRenewKeyword_elec", strip_attributes = TRUE) L223.PrimaryRenewKeywordInt_elec <- get_data(all_data, "L223.PrimaryRenewKeywordInt_elec", strip_attributes = TRUE) L223.AvgFossilEffKeyword_elec <- get_data(all_data, "L223.AvgFossilEffKeyword_elec", strip_attributes = TRUE) @@ -277,16 +280,16 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { # Create horizontal generation supplysectors L2234.Supplysector_elecS_USA <- write_to_all_states(A23.elecS_sector, c("region", "supplysector", "output.unit", "input.unit", "price.unit", - "logit.year.fillout", "logit.exponent", "logit.type" )) + "logit.year.fillout", "logit.exponent", "logit.type" )) L2234.ElecReserve_elecS_USA <- write_to_all_states(A23.elecS_metainfo, c("region", "supplysector","electricity.reserve.margin", - "average.grid.capacity.factor")) + "average.grid.capacity.factor")) # 2b. Subsector information L2234.SubsectorLogit_elecS_USA <- write_to_all_states(A23.elecS_subsector_logit, c("region", "supplysector", "subsector", "logit.year.fillout", - "logit.exponent" , "logit.type" )) %>% + "logit.exponent" , "logit.type" )) %>% # Wind & utility-scale (i.e. non-rooftop) solar are assumed to be infeasible in DC. # Thus, no wind & solar subsectors should be created in DC's electricity sector. # Use anti_join to remove them from the table. @@ -304,7 +307,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L2234.SubsectorShrwtInterp_elecS_USA <- write_to_all_states(A23.elecS_subsector_shrwt_interp, c("region", "supplysector","subsector","apply.to", - "from.year","to.year", "interpolation.function")) %>% + "from.year","to.year", "interpolation.function")) %>% # Wind & utility-scale (i.e. non-rooftop) solar are assumed to be infeasible in DC. # Thus, no wind & solar subsectors should be created in DC's electricity sector. # Use anti_join to remove them from the table. @@ -313,7 +316,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L2234.SubsectorShrwtInterpTo_elecS_USA <- write_to_all_states(A23.elecS_subsector_shrwt_interpto, c("region", "supplysector","subsector", "apply.to", - "from.year","to.year","to.value", "interpolation.function")) %>% + "from.year","to.year","to.value", "interpolation.function")) %>% # Wind & utility-scale (i.e. non-rooftop) solar are assumed to be infeasible in DC. # Thus, no wind & solar subsectors should be created in DC's electricity sector. # Use anti_join to remove them from the table. @@ -516,10 +519,18 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { # Additional characteristics for intermittent technologies A23.elecS_inttech_mapping %>% # join is intended to duplicate rows; left_join_error_no_match throws error, so left_join used - left_join(L223.GlobalIntTechBackup_elec, by= c("subsector"= "subsector.name", "intermittent.technology" = "technology")) %>% - filter(!is.na(capacity.limit)) %>% + left_join(L223.GlobalIntTechValueFactor_elec, by= c("subsector" = "subsector.name", "intermittent.technology")) %>% + filter(!is.na(value.factor.intercept)) %>% select(-supplysector, -subsector_1, -intermittent.technology, -sector.name) %>% rename(supplysector = Electric.sector, intermittent.technology = Electric.sector.intermittent.technology) -> + L2234.GlobalIntTechValueFactor_elecS + # Old approach to intermittent renewable integration (no longer the default) + A23.elecS_inttech_mapping %>% + # join is intended to duplicate rows; left_join_error_no_match throws error, so left_join used + left_join(L223.GlobalIntTechBackup_elec, by= c("subsector"= "subsector.name", "intermittent.technology" = "backup.intermittent.technology")) %>% + filter(!is.na(capacity.limit)) %>% + select(-supplysector, -subsector_1, -intermittent.technology, -sector.name) %>% + rename(supplysector = Electric.sector, backup.intermittent.technology = Electric.sector.intermittent.technology) -> L2234.GlobalIntTechBackup_elecS # Energy inputs @@ -1445,6 +1456,16 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L223.GlobalIntTechBackup_elec") -> L2234.GlobalIntTechBackup_elecS_USA + L2234.GlobalIntTechValueFactor_elecS %>% + add_title("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% + add_units("value.factor.intercept = fraction of PLCOE observed at 0% market share (LCOE is divided by this value); + value.factor.slope = % reduction in PLCOE obsrved per % increase in market share") %>% + add_comments("Backup characteristics for electricity load segments intermittent technologies") %>% + add_precursors("gcam-usa/A23.elecS_inttech_mapping", + "gcam-usa/A23.elecS_tech_availability", + "L223.GlobalIntTechValueFactor_elec") -> + L2234.GlobalIntTechValueFactor_elecS_USA + L2234.StubTechMarket_elecS_USA %>% add_title("Energy Inputs for Electricity Load Segments Technologies") %>% add_units("NA") %>% @@ -1474,7 +1495,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { add_precursors("gcam-usa/states_subregions", "gcam-usa/A23.elecS_inttech_mapping", "gcam-usa/A23.elecS_tech_availability", - "L223.StubTechMarket_backup_USA") -> + "L223.StubTechMarket_elec_USA") -> L2234.StubTechElecMarket_backup_elecS_USA L2234.StubTechProd_elecS_USA %>% @@ -1587,6 +1608,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L2234.GlobalTechSCurve_elecS_USA, L2234.GlobalTechCapture_elecS_USA, L2234.GlobalIntTechBackup_elecS_USA, + L2234.GlobalIntTechValueFactor_elecS_USA, L2234.StubTechMarket_elecS_USA, L2234.StubTechMarket_backup_elecS_USA, L2234.StubTechElecMarket_backup_elecS_USA, diff --git a/input/gcamdata/R/zgcamusa_xml_elec_segments.R b/input/gcamdata/R/zgcamusa_xml_elec_segments.R index 7ab17a3b79..7c0af2808c 100644 --- a/input/gcamdata/R/zgcamusa_xml_elec_segments.R +++ b/input/gcamdata/R/zgcamusa_xml_elec_segments.R @@ -45,6 +45,7 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { "L2234.GlobalTechSCurve_elecS_USA", "L2234.GlobalTechCapture_elecS_USA", "L2234.GlobalIntTechBackup_elecS_USA", + "L2234.GlobalIntTechValueFactor_elecS_USA", "L2234.StubTechMarket_elecS_USA", "L2234.StubTechMarket_backup_elecS_USA", "L2234.StubTechElecMarket_backup_elecS_USA", @@ -127,6 +128,7 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { L2234.GlobalTechSCurve_elecS_USA <- get_data(all_data, "L2234.GlobalTechSCurve_elecS_USA") L2234.GlobalTechCapture_elecS_USA <- get_data(all_data, "L2234.GlobalTechCapture_elecS_USA") L2234.GlobalIntTechBackup_elecS_USA <- get_data(all_data, "L2234.GlobalIntTechBackup_elecS_USA") + L2234.GlobalIntTechValueFactor_elecS_USA <- get_data(all_data, "L2234.GlobalIntTechValueFactor_elecS_USA") L2234.StubTechMarket_elecS_USA <- get_data(all_data, "L2234.StubTechMarket_elecS_USA") L2234.StubTechMarket_backup_elecS_USA <- get_data(all_data, "L2234.StubTechMarket_backup_elecS_USA") L2234.StubTechElecMarket_backup_elecS_USA <- get_data(all_data, "L2234.StubTechElecMarket_backup_elecS_USA") @@ -199,11 +201,8 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { L2234.GlobalTechProfitShutdown_elecS_USA <- fix_global_tech_names(L2234.GlobalTechProfitShutdown_elecS_USA) L2234.GlobalTechSCurve_elecS_USA <- fix_global_tech_names(L2234.GlobalTechSCurve_elecS_USA) L2234.GlobalTechCapture_elecS_USA <- fix_global_tech_names(L2234.GlobalTechCapture_elecS_USA) - # NOTE: below is an issue with LEVEL2_DATA_NAMES... GlobalIntTechBackup name should be intermittent.technology, - # as the table is for intermittent technologies and the old DS MI header name is intermittent.technology - L2234.GlobalIntTechBackup_elecS_USA <- L2234.GlobalIntTechBackup_elecS_USA %>% - fix_global_tech_names() %>% - rename(technology = intermittent.technology) + L2234.GlobalIntTechBackup_elecS_USA <- fix_global_tech_names(L2234.GlobalIntTechBackup_elecS_USA) + L2234.GlobalIntTechValueFactor_elecS_USA <- fix_global_tech_names(L2234.GlobalIntTechValueFactor_elecS_USA) L2234.StubTechProd_elecS_USA <- rename(L2234.StubTechProd_elecS_USA, tech.share.weight = share.weight) L2234.TechProd_elecS_grid_USA <- rename(L2234.TechProd_elecS_grid_USA, tech.share.weight = share.weight) @@ -217,7 +216,24 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { add_xml_data(L2234.PassThroughTech_elecS_grid_USA, "PassThroughTech") %>% add_logit_tables_xml(L2234.Supplysector_elecS_USA, "Supplysector") %>% add_xml_data(L2234.ElecReserve_elecS_USA, "ElecReserve") %>% - add_logit_tables_xml(L2234.SubsectorLogit_elecS_USA, "SubsectorLogit") %>% + add_logit_tables_xml(L2234.SubsectorLogit_elecS_USA, "SubsectorLogit") -> + elec_segments_USA.xml + + if(energy.ELEC_USE_BACKUP) { + elec_segments_USA.xml %>% + add_xml_data(L2234.GlobalIntTechBackup_elecS_USA, "GlobalIntTechBackup") %>% + add_xml_data(L2234.StubTechMarket_backup_elecS_USA, "StubTechMarket") %>% + add_precursors("L2234.GlobalIntTechBackup_elecS_USA", + "L2234.StubTechMarket_backup_elecS_USA") -> + elec_segments_USA.xml + } else { + elec_segments_USA.xml %>% + add_xml_data(L2234.GlobalIntTechValueFactor_elecS_USA, "GlobalIntTechValueFactor") %>% + add_precursors("L2234.GlobalIntTechValueFactor_elecS_USA") -> + elec_segments_USA.xml + } + + elec_segments_USA.xml %>% add_xml_data(L2234.GlobalTechShrwt_elecS_USA, "GlobalTechShrwt") %>% add_xml_data(L2234.GlobalIntTechShrwt_elecS_USA, "GlobalIntTechShrwt") %>% add_xml_data(L2234.PrimaryRenewKeyword_elecS_USA, "PrimaryRenewKeyword") %>% @@ -237,9 +253,7 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { add_xml_data(L2234.GlobalTechProfitShutdown_elecS_USA, "GlobalTechProfitShutdown") %>% add_xml_data(L2234.GlobalTechSCurve_elecS_USA, "GlobalTechSCurve") %>% add_xml_data(L2234.GlobalTechCapture_elecS_USA, "GlobalTechCapture") %>% - add_xml_data(L2234.GlobalIntTechBackup_elecS_USA, "GlobalIntTechBackup") %>% add_xml_data(L2234.StubTechMarket_elecS_USA, "StubTechMarket") %>% - add_xml_data(L2234.StubTechMarket_backup_elecS_USA, "StubTechMarket") %>% add_xml_data(L2234.StubTechElecMarket_backup_elecS_USA, "StubTechElecMarket") %>% add_xml_data(L2234.StubTechProd_elecS_USA, "StubTechProd") %>% add_xml_data(L2234.SubsectorShrwt_elecS_USA, "SubsectorShrwt") %>% @@ -317,9 +331,7 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "L2234.GlobalTechSCurve_elecS_USA", "L2234.GlobalTechCapture_elecS_USA", - "L2234.GlobalIntTechBackup_elecS_USA", "L2234.StubTechMarket_elecS_USA", - "L2234.StubTechMarket_backup_elecS_USA", "L2234.StubTechElecMarket_backup_elecS_USA", "L2234.StubTechProd_elecS_USA", "L2234.StubTechFixOut_elecS_USA", diff --git a/input/gcamdata/R/zgcamusa_xml_elec_segments_water.R b/input/gcamdata/R/zgcamusa_xml_elec_segments_water.R index 3332fff39b..ab416e8247 100644 --- a/input/gcamdata/R/zgcamusa_xml_elec_segments_water.R +++ b/input/gcamdata/R/zgcamusa_xml_elec_segments_water.R @@ -27,6 +27,7 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { "L2233.GlobalTechLifetime_elecS_cool_USA", "L2233.AvgFossilEffKeyword_elecS_cool_USA", "L2233.GlobalIntTechBackup_elecS_cool_USA", + "L2233.GlobalIntTechValueFactor_elecS_cool_USA", "L2233.GlobalIntTechCapital_elecS_USA", "L2233.GlobalIntTechCapital_elecS_cool_USA", "L2233.GlobalIntTechEff_elecS_USA", @@ -124,7 +125,8 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { L2233.GlobalTechCapture_elecS_cool_USA <- get_data(all_data, "L2233.GlobalTechCapture_elecS_cool_USA") L2233.GlobalTechLifetime_elecS_cool_USA <- get_data(all_data, "L2233.GlobalTechLifetime_elecS_cool_USA") L2233.AvgFossilEffKeyword_elecS_cool_USA <- get_data(all_data,"L2233.AvgFossilEffKeyword_elecS_cool_USA") - L2233.GlobalIntTechBackup_elecS_cool_USA<- get_data(all_data,"L2233.GlobalIntTechBackup_elecS_cool_USA") + L2233.GlobalIntTechBackup_elecS_cool_USA <- get_data(all_data,"L2233.GlobalIntTechBackup_elecS_cool_USA") + L2233.GlobalIntTechValueFactor_elecS_cool_USA <- get_data(all_data,"L2233.GlobalIntTechValueFactor_elecS_cool_USA") L2233.GlobalIntTechCapital_elecS_USA<- get_data(all_data,"L2233.GlobalIntTechCapital_elecS_USA") L2233.GlobalIntTechCapital_elecS_cool_USA <- get_data(all_data,"L2233.GlobalIntTechCapital_elecS_cool_USA") L2233.GlobalIntTechEff_elecS_USA <- get_data(all_data, "L2233.GlobalIntTechEff_elecS_USA") @@ -213,15 +215,15 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { return(data_new) } - - L2233.GlobalIntTechBackup_elecS_cool_USA<- fix_global_tech_names(L2233.GlobalIntTechBackup_elecS_cool_USA) - L2233.GlobalIntTechCapital_elecS_USA<- fix_global_tech_names(L2233.GlobalIntTechCapital_elecS_USA) + L2233.GlobalIntTechBackup_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechBackup_elecS_cool_USA) + L2233.GlobalIntTechValueFactor_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechValueFactor_elecS_cool_USA) + L2233.GlobalIntTechCapital_elecS_USA <- fix_global_tech_names(L2233.GlobalIntTechCapital_elecS_USA) L2233.GlobalIntTechCapital_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechCapital_elecS_cool_USA) L2233.GlobalIntTechEff_elecS_USA <- fix_global_tech_names(L2233.GlobalIntTechEff_elecS_USA) - L2233.GlobalIntTechEff_elecS_cool_USA<- fix_global_tech_names(L2233.GlobalIntTechEff_elecS_cool_USA) - L2233.GlobalIntTechLifetime_elecS_cool_USA<- fix_global_tech_names(L2233.GlobalIntTechLifetime_elecS_cool_USA) - L2233.GlobalIntTechOMfixed_elecS_cool_USA<- fix_global_tech_names(L2233.GlobalIntTechOMfixed_elecS_cool_USA) - L2233.GlobalIntTechOMvar_elecS_cool_USA<- fix_global_tech_names(L2233.GlobalIntTechOMvar_elecS_cool_USA) + L2233.GlobalIntTechEff_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechEff_elecS_cool_USA) + L2233.GlobalIntTechLifetime_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechLifetime_elecS_cool_USA) + L2233.GlobalIntTechOMfixed_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechOMfixed_elecS_cool_USA) + L2233.GlobalIntTechOMvar_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechOMvar_elecS_cool_USA) L2233.GlobalIntTechCoef_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalIntTechCoef_elecS_cool_USA) L2233.GlobalTechProfitShutdown_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalTechProfitShutdown_elecS_cool_USA) L2233.GlobalTechCoef_elecS_cool_USA <- fix_global_tech_names(L2233.GlobalTechCoef_elecS_cool_USA) @@ -231,7 +233,6 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { L2233.GlobalTechLifetime_elecS_cool_USA <- rename(L2233.GlobalTechLifetime_elecS_cool_USA, sector.name = supplysector) L2233.GlobalTechCapture_elecS_cool_USA <- rename(L2233.GlobalTechCapture_elecS_cool_USA, sector.name = supplysector) L2233.PrimaryRenewKeywordInt_elecS_cool_USA <- rename(L2233.PrimaryRenewKeywordInt_elecS_cool_USA, technology = intermittent.technology) - L2233.GlobalIntTechBackup_elecS_cool_USA <- rename(L2233.GlobalIntTechBackup_elecS_cool_USA, technology = intermittent.technology) L2233.GlobalIntTechCoef_elecS_cool_USA <- rename(L2233.GlobalIntTechCoef_elecS_cool_USA,technology = intermittent.technology) L2233.StubTechMarket_elecS_cool_USA <- rename(L2233.StubTechMarket_elecS_cool_USA, stub.technology = technology) @@ -282,7 +283,25 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { # replace global rooftop_pv to avoid capital tracking input add_xml_data(L223.StubTechCapFactor_elec, "DeleteStubTech") %>% add_xml_data(L223.StubTechCapFactor_elec, "StubTechCapFactor") %>% - add_xml_data(L2233.GlobalTechCapital_elecS_cool_USA, "GlobalTechCapital") %>% + add_xml_data(L2233.GlobalTechCapital_elecS_cool_USA, "GlobalTechCapital") -> + elec_segments_water_USA.xml + + if(energy.ELEC_USE_BACKUP) { + elec_segments_water_USA.xml %>% + add_xml_data(L2233.GlobalIntTechBackup_elecS_cool_USA, "GlobalIntTechBackup") %>% + add_xml_data_generate_levels(L2233.StubTechMarket_backup_elecS_cool_USA, + "StubTechMarket","subsector","nesting-subsector",1,FALSE) %>% + add_precursors("L2233.GlobalIntTechBackup_elecS_cool_USA", + "L2233.StubTechMarket_backup_elecS_cool_USA") -> + elec_segments_water_USA.xml + } else { + elec_segments_water_USA.xml %>% + add_xml_data(L2233.GlobalIntTechValueFactor_elecS_cool_USA, "GlobalIntTechValueFactor") %>% + add_precursors("L2233.GlobalIntTechValueFactor_elecS_cool_USA") -> + elec_segments_water_USA.xml + } + + elec_segments_water_USA.xml %>% add_xml_data(L2233.GlobalIntTechCapital_elecS_USA, "GlobalIntTechCapital") %>% add_xml_data(L2233.GlobalIntTechCapital_elecS_cool_USA, "GlobalIntTechCapital") %>% add_xml_data(L2233.GlobalTechOMfixed_elecS_cool_USA, "GlobalTechOMfixed") %>% @@ -300,7 +319,6 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { add_xml_data(L2233.GlobalTechSCurve_elecS_cool_USA, "GlobalTechSCurve") %>% add_xml_data(L2233.GlobalTechCapture_elecS_cool_USA, "GlobalTechCapture") %>% add_xml_data(L2233.GlobalTechLifetime_elecS_cool_USA, "GlobalTechLifetime") %>% - add_xml_data(L2233.GlobalIntTechBackup_elecS_cool_USA, "GlobalIntTechBackup") %>% add_xml_data(L2233.GlobalTechShrwt_elecS_cool_USA, "GlobalTechShrwt") %>% add_xml_data(L2233.GlobalIntTechShrwt_elecS_cool_USA, "GlobalIntTechShrwt") %>% add_logit_tables_xml_generate_levels(L2233.SubsectorLogit_elecS_cool_USA, @@ -309,8 +327,6 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { "SubsectorShrwt","subsector","nesting-subsector",1,FALSE) %>% add_xml_data_generate_levels(L2233.StubTechMarket_elecS_cool_USA, "StubTechMarket","subsector","nesting-subsector",1,FALSE) %>% - add_xml_data_generate_levels(L2233.StubTechMarket_backup_elecS_cool_USA, - "StubTechMarket","subsector","nesting-subsector",1,FALSE) %>% add_xml_data_generate_levels(L2233.StubTechElecMarket_backup_elecS_cool_USA, "StubTechElecMarket","subsector","nesting-subsector",1,FALSE) %>% add_xml_data_generate_levels(L2233.StubTechProd_elecS_cool_USA, @@ -391,7 +407,6 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { "L2233.GlobalTechCapture_elecS_cool_USA", "L2233.GlobalTechLifetime_elecS_cool_USA", "L2233.AvgFossilEffKeyword_elecS_cool_USA", - "L2233.GlobalIntTechBackup_elecS_cool_USA", "L2233.GlobalIntTechCapital_elecS_USA", "L2233.GlobalIntTechCapital_elecS_cool_USA", "L2233.GlobalIntTechEff_elecS_USA", @@ -413,7 +428,6 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { "L2233.StubTechElecMarket_backup_elecS_cool_USA", "L2233.StubTechFixOut_elecS_cool_USA", "L2233.StubTechFixOut_hydro_elecS_cool_USA", - "L2233.StubTechMarket_backup_elecS_cool_USA", "L2233.StubTechProfitShutdown_elecS_cool_USA", "L2233.StubTechSCurve_elecS_cool_USA", "L2233.StubTechShrwt_elecS_cool_USA", diff --git a/input/gcamdata/R/zgcamusa_xml_electricity.R b/input/gcamdata/R/zgcamusa_xml_electricity.R index 09ef624fca..beaabefa2b 100644 --- a/input/gcamdata/R/zgcamusa_xml_electricity.R +++ b/input/gcamdata/R/zgcamusa_xml_electricity.R @@ -162,7 +162,6 @@ module_gcamusa_electricity_xml <- function(command, ...) { add_xml_data(L223.StubTechFixOut_hydro_USA, "StubTechFixOut") %>% add_xml_data(L223.StubTechProd_elec_USA, "StubTechProd") %>% add_xml_data(L223.StubTechMarket_elec_USA, "StubTechMarket") %>% - add_xml_data(L223.StubTechMarket_backup_USA, "StubTechMarket") %>% add_xml_data(L223.StubTechElecMarket_backup_USA, "StubTechElecMarket") %>% add_xml_data(L223.StubTechCapFactor_elec_wind_USA, "StubTechCapFactor") %>% add_xml_data(L223.StubTechCapFactor_elec_solar_USA, "StubTechCapFactor") %>% @@ -213,7 +212,6 @@ module_gcamusa_electricity_xml <- function(command, ...) { "L223.StubTechFixOut_hydro_USA", "L223.StubTechProd_elec_USA", "L223.StubTechMarket_elec_USA", - "L223.StubTechMarket_backup_USA", "L223.StubTechElecMarket_backup_USA", "L223.StubTechCapFactor_elec_wind_USA", "L223.StubTechCapFactor_elec_solar_USA", @@ -239,6 +237,15 @@ module_gcamusa_electricity_xml <- function(command, ...) { "L223.StubTechCost_offshore_wind_USA") -> electricity_USA.xml + if(energy.ELEC_USE_BACKUP) { + electricity_USA.xml %>% + add_xml_data(L223.StubTechMarket_backup_USA, "StubTechMarket") %>% + add_precursors("L223.StubTechMarket_backup_USA") -> + electricity_USA.xml + } else { + # DO NOTHING + } + return_data(electricity_USA.xml) } else { stop("Unknown command") diff --git a/input/gcamdata/R/zwater_L2233.electricity_water.R b/input/gcamdata/R/zwater_L2233.electricity_water.R index 24868f89c8..980e119924 100644 --- a/input/gcamdata/R/zwater_L2233.electricity_water.R +++ b/input/gcamdata/R/zwater_L2233.electricity_water.R @@ -36,7 +36,7 @@ module_water_L2233.electricity_water <- function(command, ...) { # Read in 24 L223 file names - L223_fileNames <- c("AvgFossilEffKeyword_elec", "GlobalIntTechBackup_elec", "GlobalIntTechCapital_elec", + L223_fileNames <- c("AvgFossilEffKeyword_elec", "GlobalIntTechValueFactor_elec", "GlobalIntTechBackup_elec", "GlobalIntTechCapital_elec", "GlobalIntTechEff_elec", "GlobalIntTechLifetime_elec", "GlobalIntTechOMfixed_elec", "GlobalIntTechOMvar_elec", "GlobalIntTechShrwt_elec", "GlobalTechCapture_elec", "GlobalTechCapital_elec", "GlobalTechEff_elec", "GlobalTechInterp_elec", @@ -99,6 +99,7 @@ module_water_L2233.electricity_water <- function(command, ...) { "L2233.GlobalTechCoef_elec_cool", "L2233.GlobalIntTechCoef_elec_cool", "L2233.AvgFossilEffKeyword_elec_cool", + "L2233.GlobalIntTechValueFactor_elec_cool", "L2233.GlobalIntTechBackup_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", @@ -266,7 +267,7 @@ module_water_L2233.electricity_water <- function(command, ...) { select(from.supplysector, from.subsector, from.technology, to.supplysector) %>% filter(from.supplysector %in% A23.globalinttech$supplysector, from.subsector %in% A23.globalinttech$subsector, - from.technology %in% A23.globalinttech$technology) %>% + from.technology %in% A23.globalinttech$intermittent.technology) %>% select(to.supplysector) %>% unique -> L2233.elec_cool_Int_supplysectors L2233.supplysector_info %>% @@ -370,7 +371,7 @@ module_water_L2233.electricity_water <- function(command, ...) { GlobalTechCapital_elecPassthru %>% filter(sector.name == to.supplysector & sector.name %in% A23.globalinttech$supplysector) %>% filter(subsector.name == to.subsector & subsector.name %in% A23.globalinttech$subsector) %>% - filter(technology == to.technology & technology %in% A23.globalinttech$technology) %>% + filter(technology == to.technology & technology %in% A23.globalinttech$intermittent.technology) %>% select(LEVEL2_DATA_NAMES[["GlobalTechCapital"]]) -> L2233.GlobalIntTechCapital_elec # --OUTPUT-- @@ -411,7 +412,7 @@ module_water_L2233.electricity_water <- function(command, ...) { GlobalTechOMfixed_elecPassthru %>% filter(sector.name == to.supplysector & sector.name %in% A23.globalinttech$supplysector) %>% filter(subsector.name == to.subsector & subsector.name %in% A23.globalinttech$subsector) %>% - filter(technology == to.technology & technology %in% A23.globalinttech$technology) %>% + filter(technology == to.technology & technology %in% A23.globalinttech$intermittent.technology) %>% select(LEVEL2_DATA_NAMES[["GlobalTechOMfixed"]]) -> L2233.GlobalIntTechOMfixed_elec # --OUTPUT-- @@ -427,7 +428,7 @@ module_water_L2233.electricity_water <- function(command, ...) { GlobalTechOMvar_elecPassthru %>% filter(sector.name == to.supplysector & sector.name %in% A23.globalinttech$supplysector) %>% filter(subsector.name == to.subsector & subsector.name %in% A23.globalinttech$subsector) %>% - filter(technology == to.technology & technology %in% A23.globalinttech$technology) %>% + filter(technology == to.technology & technology %in% A23.globalinttech$intermittent.technology) %>% select(LEVEL2_DATA_NAMES[["GlobalTechOMvar"]]) -> L2233.GlobalIntTechOMvar_elec # --OUTPUT-- @@ -457,6 +458,7 @@ module_water_L2233.electricity_water <- function(command, ...) { tableName <- paste0("L2233.", elecTableName, "_cool") elecTable <- L2233.Elec_tables_globaltech_nocost[[which(names(L2233.Elec_tables_globaltech_nocost) == elecTableName)]] names(elecTable)[names(elecTable) == "intermittent.technology"] <- "technology" + names(elecTable)[names(elecTable) == "backup.intermittent.technology"] <- "technology" defCols <- names(elecTable) %in% c("sector.name", "subsector.name", "technology", "year") nondataCols <- names(elecTable)[defCols] dataCols <- names(elecTable)[!defCols] @@ -527,13 +529,13 @@ module_water_L2233.electricity_water <- function(command, ...) { L2233.GlobalTechCapital_elec_cool_all %>% filter(from.supplysector %in% A23.globalinttech$supplysector & from.subsector %in% A23.globalinttech$subsector & - from.technology %in% A23.globalinttech$technology) %>% + from.technology %in% A23.globalinttech$intermittent.technology) %>% select(LEVEL2_DATA_NAMES[["GlobalTechCapital"]]) -> L2233.GlobalIntTechCapital_elec_cool # --OUTPUT-- L2233.GlobalTechCapital_elec_cool_all %>% filter(!(from.supplysector %in% A23.globalinttech$supplysector & from.subsector %in% A23.globalinttech$subsector & - from.technology %in% A23.globalinttech$technology)) %>% + from.technology %in% A23.globalinttech$intermittent.technology)) %>% select(LEVEL2_DATA_NAMES[["GlobalTechCapital"]]) -> L2233.GlobalTechCapital_elec_cool # --OUTPUT-- @@ -566,14 +568,14 @@ module_water_L2233.electricity_water <- function(command, ...) { L2233.GlobalTechCoef_elec_cool_all %>% filter(!(from.supplysector %in% A23.globalinttech$supplysector & from.subsector %in% A23.globalinttech$subsector & - from.technology %in% A23.globalinttech$technology)) %>% + from.technology %in% A23.globalinttech$intermittent.technology)) %>% select(LEVEL2_DATA_NAMES[["GlobalTechCoef"]]) -> L2233.GlobalTechCoef_elec_cool # --OUTPUT-- L2233.GlobalTechCoef_elec_cool_all %>% filter(from.supplysector %in% A23.globalinttech$supplysector & from.subsector %in% A23.globalinttech$subsector & - from.technology %in% A23.globalinttech$technology) %>% + from.technology %in% A23.globalinttech$intermittent.technology) %>% select(LEVEL2_DATA_NAMES[["GlobalTechCoef"]]) -> L2233.GlobalIntTechCoef_elec_cool # --OUTPUT-- @@ -730,9 +732,17 @@ module_water_L2233.electricity_water <- function(command, ...) { add_units("unitless") -> L2233.AvgFossilEffKeyword_elec_cool + L2233.Elec_tables_globaltech_nocost_$GlobalIntTechValueFactor_elec %>% + add_title("Value factor function parameters for intermittent techs") %>% + add_units("value.factor.intercept = fraction of PLCOE observed at 0% market share (LCOE is divided by this value); + value.factor.slope = % reduction in PLCOE obsrved per % increase in market share") -> + L2233.GlobalIntTechValueFactor_elec_cool + L2233.Elec_tables_globaltech_nocost_$GlobalIntTechBackup_elec %>% - add_title("Capital costs of backup technologies for intermittent techs") %>% - add_units("1975 USD/kW/yr") -> + add_title("Backup cost and demand function parameters for intermittent techs") %>% + add_units("1975 USD/kW/yr") %>% + add_comments("NOTE: this is the previous approach to renewable integration and will not be used by default") %>% + add_comments("Assumptions contained within A23.globalinttech_backup") -> L2233.GlobalIntTechBackup_elec_cool L2233.Elec_tables_globaltech_nocost_$GlobalIntTechEff_elec %>% @@ -1136,6 +1146,7 @@ module_water_L2233.electricity_water <- function(command, ...) { L2233.GlobalTechCoef_elec_cool, L2233.GlobalIntTechCoef_elec_cool, L2233.AvgFossilEffKeyword_elec_cool, + L2233.GlobalIntTechValueFactor_elec_cool, L2233.GlobalIntTechBackup_elec_cool, L2233.GlobalIntTechEff_elec_cool, L2233.GlobalIntTechLifetime_elec_cool, diff --git a/input/gcamdata/R/zwater_xml_electricity_water.R b/input/gcamdata/R/zwater_xml_electricity_water.R index 6f730b4676..4458694afd 100644 --- a/input/gcamdata/R/zwater_xml_electricity_water.R +++ b/input/gcamdata/R/zwater_xml_electricity_water.R @@ -25,6 +25,7 @@ module_water_electricity_water_xml <- function(command, ...) { "L223.SubsectorShrwt_nuc", "L223.SubsectorShrwt_renew", "L2233.AvgFossilEffKeyword_elec_cool", + "L2233.GlobalIntTechValueFactor_elec_cool", "L2233.GlobalIntTechBackup_elec_cool", "L2233.GlobalIntTechCapFac_elec_cool", "L2233.GlobalIntTechEff_elec_cool", @@ -93,7 +94,8 @@ module_water_electricity_water_xml <- function(command, ...) { L2233.GlobalIntTechLifetime_elec_cool <- rename(L2233.GlobalIntTechLifetime_elec_cool, `intermittent.technology` = technology ) L2233.GlobalIntTechShrwt_elec_cool <- rename(L2233.GlobalIntTechShrwt_elec_cool, `intermittent.technology` = technology ) L2233.GlobalIntTechCapFac_elec_cool <- rename(L2233.GlobalIntTechCapFac_elec_cool, `intermittent.technology` = technology ) - + L2233.GlobalIntTechValueFactor_elec_cool <- rename(L2233.GlobalIntTechValueFactor_elec_cool, `intermittent.technology` = technology ) + L2233.GlobalIntTechBackup_elec_cool <- rename(L2233.GlobalIntTechBackup_elec_cool, `backup.intermittent.technology` = technology ) # Produce outputs create_xml("electricity_water.xml") %>% @@ -110,8 +112,22 @@ module_water_electricity_water_xml <- function(command, ...) { add_xml_data(L223.SubsectorShrwt_coal, "SubsectorShrwt") %>% add_xml_data(L223.SubsectorShrwt_nuc, "SubsectorShrwt") %>% add_xml_data(L223.SubsectorShrwt_renew, "SubsectorShrwt") %>% - add_xml_data(L2233.AvgFossilEffKeyword_elec_cool, "AvgFossilEffKeyword") %>% - add_xml_data(L2233.GlobalIntTechBackup_elec_cool, "GlobalIntTechBackup") %>% + add_xml_data(L2233.AvgFossilEffKeyword_elec_cool, "AvgFossilEffKeyword") -> + electricity_water.xml + + if(energy.ELEC_USE_BACKUP) { + electricity_water.xml %>% + add_xml_data(L2233.GlobalIntTechBackup_elec_cool, "GlobalIntTechBackup") %>% + add_precursors("L2233.GlobalIntTechBackup_elec_cool") -> + electricity_water.xml + } else { + electricity_water.xml %>% + add_xml_data(L2233.GlobalIntTechValueFactor_elec_cool, "GlobalIntTechValueFactor") %>% + add_precursors("L2233.GlobalIntTechValueFactor_elec_cool") -> + electricity_water.xml + } + + electricity_water.xml %>% add_xml_data(L2233.GlobalIntTechCapFac_elec_cool, "GlobalIntTechCapFac") %>% add_xml_data(L2233.GlobalIntTechEff_elec_cool, "GlobalIntTechEff") %>% add_xml_data(L2233.GlobalIntTechLifetime_elec_cool, "GlobalIntTechLifetime") %>% diff --git a/input/gcamdata/data-raw/generate_package_data.R b/input/gcamdata/data-raw/generate_package_data.R index 777b3c8413..1287f8666b 100644 --- a/input/gcamdata/data-raw/generate_package_data.R +++ b/input/gcamdata/data-raw/generate_package_data.R @@ -190,8 +190,6 @@ generate_level2_data_names <- function() { level2_data_names[["GlobalTechFCROnly"]] <- c(level2_data_names[["GlobalTechYr"]], "input.capital", "fixed.charge.rate") level2_data_names[["GlobalTechOMfixed"]] <- c(level2_data_names[["GlobalTechYr"]], "input.OM.fixed", "OM.fixed") level2_data_names[["GlobalTechOMvar"]] <- c(level2_data_names[["GlobalTechYr"]], "input.OM.var", "OM.var") - level2_data_names[["GlobalTechBackup"]] <- c(level2_data_names[["GlobalTechYr"]], "electric.sector.name", "trial.market.name", "backup.capital.cost", - "backup.capacity.factor", "capacity.limit", "minicam.energy.input", "minicam.non.energy.input", "flag") level2_data_names[["GlobalCarbonCapture"]] <- c(level2_data_names[["GlobalTechYr"]], "storage.market", "remove.fraction") level2_data_names[["GlobalRenewTech"]] <- c(level2_data_names[["GlobalTechYr"]], "renewable.input") level2_data_names[["GlobalTechSecOut"]] <- c(level2_data_names[["GlobalTechYr"]], "secondary.output", "output.ratio") @@ -217,7 +215,10 @@ generate_level2_data_names <- function() { level2_data_names[["GlobalIntTechShutdown"]] <- c("sector.name", "subsector.name", "intermittent.technology", "year", "lifetime", "shutdown.rate") level2_data_names[["GlobalIntTechProfitShutdown"]] <- c("sector.name", "subsector.name", "intermittent.technology", "year", "median.shutdown.point", "steepness") level2_data_names[["GlobalIntTechSCurve"]] <- c("sector.name", "subsector.name", "intermittent.technology", "year", "lifetime", "steepness", "half.life") - level2_data_names[["GlobalIntTechBackup"]] <- c("sector.name", "subsector.name", "technology", "year", "electric.sector.name", "trial.market.name", "backup.capital.cost", "backup.capacity.factor", "capacity.limit", "minicam.energy.input", "minicam.non.energy.input", "flag") + level2_data_names[["GlobalIntTechBackup"]] <- c("sector.name", "subsector.name", "backup.intermittent.technology", "year", "electric.sector.name", "trial.market.name", + "backup.capital.cost", "backup.capacity.factor", "capacity.limit", "minicam.energy.input", "minicam.non.energy.input", "flag") + level2_data_names[["GlobalIntTechValueFactor"]] <- c("sector.name", "subsector.name", "intermittent.technology", "year", "electric.sector.name", "trial.market.name", + "value.factor.intercept", "value.factor.slope") level2_data_names[["GlobalTranTechShrwt"]] <- c("sector.name", "subsector.name", "tranTechnology", "year", "share.weight") level2_data_names[["GlobalTranTechInterp"]] <- c("sector.name", "subsector.name", "tranTechnology", "apply.to", "from.year", "to.year", "interpolation.function") level2_data_names[["GlobalTranTechSCurve"]] <- c("sector.name", "subsector.name", "tranTechnology", "year", "lifetime", "steepness", "half.life") diff --git a/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv b/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv index f63de4ef7f..351807389a 100644 --- a/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv +++ b/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv @@ -1,14 +1,12 @@ # File: A23.globalinttech.csv # Title: Electricity sector intermittent technology information -# Units: USD1975/kW/yr for 'backup.capital.cost'; Unitless for 'backup.capacity.factor'; Unitless for 'capacity.limit' -# Description: (1) Annualized capital cost per kW of backup capacity that intermittent renewable technologies may be required to purchase to ensure electrical supply reliability -# (2) Assumed capacity factor of purchased backup capacity -# (3) Mid-point of backup capacity requirement curve: an s-curve describing the amount of backup capacity required per unit of installed capacity of the given technology. -# Column types: cccccinnccc +# Units: unitless for value factor intercept and slope +# Description: parameters used to calculate value factors for variable techs as a linear function of market share (bounds = (0;1)) +# Column types: cccccnn # ---------- -supplysector,subsector,technology,electric.sector.name,trial.market.name,backup.capital.cost,backup.capacity.factor,capacity.limit,minicam.energy.input,minicam.non.energy.input,flag -electricity,wind,wind,electricity,wind,36,0.05,0.4,backup_electricity,backup-cap-cost,BackupEnergy -electricity,solar,PV,electricity,solar,36,0.05,0.45,backup_electricity,backup-cap-cost,BackupEnergy -electricity,solar,CSP,electricity,solar,36,0.05,0.45,csp_backup,backup-cap-cost,BackupEnergy -elect_td_bld,rooftop_pv,rooftop_pv,electricity,solar,36,0.05,0.45,backup_electricity,backup-cap-cost,BackupEnergy -electricity,wind,wind_offshore,electricity,wind,36,0.05,0.4,backup_electricity,backup-cap-cost,BackupEnergy +supplysector,subsector,intermittent.technology,electric.sector.name,trial.market.name,value.factor.intercept,value.factor.slope +electricity,wind,wind,electricity,wind,0.91,-1.2 +electricity,solar,PV,electricity,solar,0.972,-1.443 +electricity,solar,CSP,electricity,solar,0.972,-1.443 +elect_td_bld,rooftop_pv,rooftop_pv,electricity,solar,0.972,-1.443 +electricity,wind,wind_offshore,electricity,wind_offshore,0.946,-1.661 diff --git a/input/gcamdata/inst/extdata/energy/A23.globalinttech_backup.csv b/input/gcamdata/inst/extdata/energy/A23.globalinttech_backup.csv new file mode 100644 index 0000000000..dd555ad997 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A23.globalinttech_backup.csv @@ -0,0 +1,15 @@ +# File: A23.globalinttech_backup.csv +# Title: Electricity sector backup intermittent technology information +# Units: USD1975/kW/yr for 'backup.capital.cost'; Unitless for 'backup.capacity.factor'; Unitless for 'capacity.limit' +# Description: (1) Annualized capital cost per kW of backup capacity that intermittent renewable technologies may be required to purchase to ensure electrical supply reliability +# (2) Assumed capacity factor of purchased backup capacity +# (3) Mid-point of backup capacity requirement curve: an s-curve describing the amount of backup capacity required per unit of installed capacity of the given technology. +# This file corresponds to the previous (GCAM v7.1 and earlier) approach to representing variable renewable energy integration. This approach remains available but is not used by default. +# Column types: cccccinnccc +# ---------- +supplysector,subsector,technology,electric.sector.name,trial.market.name,backup.capital.cost,backup.capacity.factor,capacity.limit,minicam.energy.input,minicam.non.energy.input,flag +electricity,wind,wind,electricity,wind,36,0.05,0.4,backup_electricity,backup-cap-cost,BackupEnergy +electricity,solar,PV,electricity,solar,36,0.05,0.45,backup_electricity,backup-cap-cost,BackupEnergy +electricity,solar,CSP,electricity,solar,36,0.05,0.45,csp_backup,backup-cap-cost,BackupEnergy +elect_td_bld,rooftop_pv,rooftop_pv,electricity,solar,36,0.05,0.45,backup_electricity,backup-cap-cost,BackupEnergy +electricity,wind,wind_offshore,electricity,wind,36,0.05,0.4,backup_electricity,backup-cap-cost,BackupEnergy \ No newline at end of file diff --git a/input/gcamdata/inst/extdata/energy/A23.globaltech_eff.csv b/input/gcamdata/inst/extdata/energy/A23.globaltech_eff.csv index 279be1019d..23e14779e0 100644 --- a/input/gcamdata/inst/extdata/energy/A23.globaltech_eff.csv +++ b/input/gcamdata/inst/extdata/energy/A23.globaltech_eff.csv @@ -30,5 +30,4 @@ electricity,solar,CSP,global solar resource,1,1,1,1,1,1,,, electricity,solar,CSP_storage,global solar resource,1,1,1,1,1,1,,, electricity,geothermal,geothermal,geothermal,0.1,0.1,0.1,0.1,0.1,0.1,,, elect_td_bld,rooftop_pv,rooftop_pv,distributed_solar,1,1,1,1,1,1,,, -elect_td_bld,rooftop_pv,rooftop_pv,backup_electricity,1,1,1,1,1,1,,, electricity,wind,wind_offshore,offshore wind resource,1,1,1,1,1,1,,, diff --git a/input/gcamdata/inst/extdata/energy/A23.subsector_interp.csv b/input/gcamdata/inst/extdata/energy/A23.subsector_interp.csv index ee29d8bf29..5f0785ad96 100644 --- a/input/gcamdata/inst/extdata/energy/A23.subsector_interp.csv +++ b/input/gcamdata/inst/extdata/energy/A23.subsector_interp.csv @@ -13,7 +13,7 @@ electricity,nuclear,share-weight,final-calibration-year,initial-future-year,,lin electricity,nuclear,share-weight,initial-future-year,2035,,linear electricity,nuclear,share-weight,2035,2050,,linear electricity,nuclear,share-weight,2050,2300,1,s-curve -electricity,wind,share-weight,final-calibration-year,2100,,linear -electricity,solar,share-weight,final-calibration-year,2100,,linear +electricity,wind,share-weight,final-calibration-year,2030,,linear +electricity,solar,share-weight,final-calibration-year,2030,,linear electricity,geothermal,share-weight,final-calibration-year,2100,,linear -elect_td_bld,rooftop_pv,share-weight,final-calibration-year,2100,1,linear \ No newline at end of file +elect_td_bld,rooftop_pv,share-weight,final-calibration-year,2100,1,linear diff --git a/input/gcamdata/inst/extdata/energy/A23.subsector_shrwt.csv b/input/gcamdata/inst/extdata/energy/A23.subsector_shrwt.csv index f4db4c6925..d35c76af00 100644 --- a/input/gcamdata/inst/extdata/energy/A23.subsector_shrwt.csv +++ b/input/gcamdata/inst/extdata/energy/A23.subsector_shrwt.csv @@ -11,8 +11,8 @@ electricity,gas,start-year,,1 electricity,biomass,2100,,1 electricity,nuclear,start-year,,0 electricity,hydro,start-year,,0 -electricity,wind,2100,,1 -electricity,solar,2100,,1 +electricity,wind,2030,,1 +electricity,solar,2030,,1 electricity,geothermal,2100,,1 elect_td_bld,rooftop_pv,start-year,,0 elect_td_bld,rooftop_pv,2100,,1 diff --git a/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt b/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt index 2abbe26a6b..4d0c24ea35 100644 --- a/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt +++ b/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt @@ -391,7 +391,9 @@ GlobalIntTechLifetime, global-technology-database/+{sector-name}location-info, g GlobalIntTechProfitShutdown, global-technology-database/+{sector-name}location-info, global-technology-database/+{subsector-name}location-info, location-info/+{name}intermittent-technology, intermittent-technology/+{year}period, profit-shutdown-decider/+median-shutdown-point, profit-shutdown-decider/+steepness, scenario, scenario/world, world/global-technology-database, period/{name=profit}profit-shutdown-decider -GlobalIntTechBackup, global-technology-database/+{sector-name}location-info, global-technology-database/+{subsector-name}location-info, location-info/+{name}intermittent-technology, intermittent-technology/+{year}period, period/+electric-sector-name, period/+trial-market-name, period/+backup-capital-cost, period/+backup-capacity-factor, capacity-limit-backup-calculator/+capacity-limit, period/+{name}minicam-energy-input, period/+{name}minicam-non-energy-input, minicam-energy-input/+flag, scenario, scenario/world, world/global-technology-database, period/capacity-limit-backup-calculator +GlobalIntTechBackup, global-technology-database/+{sector-name}location-info, global-technology-database/+{subsector-name}location-info, location-info/+{name}backup-intermittent-technology, backup-intermittent-technology/+{year}period, period/+electric-sector-name, period/+trial-market-name, period/+backup-capital-cost, period/+backup-capacity-factor, capacity-limit-backup-calculator/+capacity-limit, period/+{name}minicam-energy-input, period/+{name}minicam-non-energy-input, minicam-energy-input/+flag, scenario, scenario/world, world/global-technology-database, period/capacity-limit-backup-calculator + +GlobalIntTechValueFactor, global-technology-database/+{sector-name}location-info, global-technology-database/+{subsector-name}location-info, location-info/+{name}intermittent-technology, intermittent-technology/+{year}period, period/+electric-sector-name, period/+trial-market-name, value-factor-calculator/+value-factor-intercept, value-factor-calculator/+value-factor-slope, scenario, scenario/world, world/global-technology-database, period/value-factor-calculator GlobalIntTechCost, global-technology-database/+{sector-name}location-info, global-technology-database/+{subsector-name}location-info, location-info/+{name}intermittent-technology, intermittent-technology/+{year}period, period/+{name}minicam-non-energy-input, minicam-non-energy-input/+input-cost, scenario, scenario/world, world/global-technology-database diff --git a/input/gcamdata/man/module_energy_L223.electricity.Rd b/input/gcamdata/man/module_energy_L223.electricity.Rd index c5f38f3b3f..509db42ecf 100644 --- a/input/gcamdata/man/module_energy_L223.electricity.Rd +++ b/input/gcamdata/man/module_energy_L223.electricity.Rd @@ -24,7 +24,7 @@ the generated outputs: \code{L223.Supplysector_elec}, \code{L223.ElecReserve}, \ \code{L223.GlobalTechOMvar_elec}, \code{L223.GlobalIntTechOMvar_elec}, \code{L223.GlobalTechShrwt_elec}, \code{L223.GlobalTechInterp_elec}, \code{L223.GlobalIntTechShrwt_elec}, \code{L223.PrimaryRenewKeyword_elec}, \code{L223.PrimaryRenewKeywordInt_elec}, \code{L223.AvgFossilEffKeyword_elec}, \code{L223.GlobalTechCapture_elec}, -\code{L223.GlobalIntTechBackup_elec}, \code{L223.StubTechCapFactor_elec}, \code{L223.StubTechCost_offshore_wind}, +\code{L223.GlobalIntTechValueFactor_elec}, \code{L223.StubTechCapFactor_elec}, \code{L223.StubTechCost_offshore_wind}, \code{L223.GlobalTechShutdown_elec}, \code{L223.GlobalIntTechShutdown_elec}, \code{L223.GlobalTechSCurve_elec}, \code{L223.GlobalIntTechSCurve_elec}, \code{L223.GlobalTechLifetime_elec}, \code{L223.GlobalIntTechLifetime_elec}, \code{L223.GlobalTechProfitShutdown_elec}, \code{L223.GlobalIntTechProfitShutdown_elec}, diff --git a/input/gcamdata/man/module_gcamusa_L223.electricity.Rd b/input/gcamdata/man/module_gcamusa_L223.electricity.Rd index 2925ff14be..e1e6041599 100644 --- a/input/gcamdata/man/module_gcamusa_L223.electricity.Rd +++ b/input/gcamdata/man/module_gcamusa_L223.electricity.Rd @@ -26,7 +26,7 @@ the generated outputs: \code{L223.DeleteSubsector_USAelec}, \code{L223.SubsectorShrwt_renew_USA}, \code{L223.SubsectorInterp_elec_USA}, \code{L223.SubsectorInterpTo_elec_USA}, \code{L223.StubTech_elec_USA}, \code{L223.StubTechEff_elec_USA}, \code{L223.StubTechCapFactor_elec_USA}, \code{L223.StubTechFixOut_elec_USA}, \code{L223.StubTechFixOut_hydro_USA}, \code{L223.StubTechProd_elec_USA}, -\code{L223.StubTechMarket_elec_USA}, \code{L223.StubTechMarket_backup_USA}, \code{L223.StubTechElecMarket_backup_USA}, +\code{L223.StubTechMarket_elec_USA}, \code{L223.StubTechElecMarket_backup_USA}, \code{L223.StubTechCapFactor_elec_wind_USA}, \code{L223.StubTechCapFactor_elec_solar_USA}, \code{L223.StubTechCost_offshore_wind_USA}. The corresponding file in the original data system was \code{L223.electricity_USA.R} (gcam-usa level2). } diff --git a/input/gcamdata/man/module_gcamusa_L2233.elec_segments_water.Rd b/input/gcamdata/man/module_gcamusa_L2233.elec_segments_water.Rd index a52aea0bea..456bda6d39 100644 --- a/input/gcamdata/man/module_gcamusa_L2233.elec_segments_water.Rd +++ b/input/gcamdata/man/module_gcamusa_L2233.elec_segments_water.Rd @@ -17,13 +17,13 @@ a vector of output names, or (if \code{command} is "MAKE") all the generated outputs: \code{L2233.GlobalTechEff_elecS_cool_USA}, \code{L2233.GlobalTechShrwt_elecS_cool_USA}, \code{L2233.GlobalTechProfitShutdown_elecS_cool_USA}, \code{L2233.GlobalTechOMvar_elecS_cool_USA}, \code{L2233.GlobalTechOMfixed_elecS_cool_USA}, \code{L2233.GlobalTechCapital_elecS_USA}, \code{L2233.GlobalTechCapital_elecS_cool_USA}, \code{L2233.GlobalTechCapFac_elecS_cool_USA}, \code{L2233.GlobalTechSCurve_elecS_cool_USA}, \code{L2233.GlobalTechCoef_elecS_cool_USA}, \code{L2233.GlobalTechCapture_elecS_cool_USA}, -\code{L2233.GlobalTechLifetime_elecS_cool_USA}, \code{L2233.AvgFossilEffKeyword_elecS_cool_USA}, \code{L2233.GlobalIntTechBackup_elecS_cool_USA}, \code{L2233.GlobalIntTechCapital_elecS_USA}, +\code{L2233.GlobalTechLifetime_elecS_cool_USA}, \code{L2233.AvgFossilEffKeyword_elecS_cool_USA}, \code{L2233.GlobalIntTechValueFactor_elecS_cool_USA}, \code{L2233.GlobalIntTechCapital_elecS_USA}, \code{L2233.GlobalIntTechCapital_elecS_cool_USA}, \code{L2233.GlobalIntTechEff_elecS_USA}, \code{L2233.GlobalIntTechEff_elecS_cool_USA}, \code{L2233.GlobalIntTechLifetime_elecS_cool_USA}, \code{L2233.GlobalIntTechOMfixed_elecS_cool_USA}, \code{L2233.GlobalIntTechOMvar_elecS_cool_USA}, \code{L2233.GlobalIntTechShrwt_elecS_cool_USA}, \code{L2233.GlobalIntTechCoef_elecS_cool_USA}, \code{L2233.PrimaryRenewKeyword_elecS_cool_USA}, \code{L2233.PrimaryRenewKeywordInt_elecS_cool_USA}, \code{L2233.StubTechEff_elecS_cool_USA}, \code{L2233.StubTechCoef_elecS_cool_USA}, \code{L2233.StubTechMarket_elecS_cool_USA}, \code{L2233.StubTechProd_elecS_cool_USA}, \code{L2233.StubTechSCurve_elecS_cool_USA}, \code{L2233.StubTechCapFactor_elecS_solar_USA}, \code{L2233.StubTechCapFactor_elecS_wind_USA}, \code{L2233.StubTechElecMarket_backup_elecS_cool_USA}, \code{L2233.StubTechFixOut_elecS_cool_USA}, \code{L2233.StubTechFixOut_hydro_elecS_cool_USA}, -\code{L2233.StubTechMarket_backup_elecS_cool_USA}, \code{L2233.StubTechProfitShutdown_elecS_cool_USA}, \code{L2233.StubTechShrwt_elecS_cool_USA}, \code{L2233.StubTechInterp_elecS_cool_USA}, +\code{L2233.StubTechProfitShutdown_elecS_cool_USA}, \code{L2233.StubTechShrwt_elecS_cool_USA}, \code{L2233.StubTechInterp_elecS_cool_USA}, \code{L2233.StubTechCost_offshore_wind_elecS_cool_USA}, \code{L2233.SubsectorLogit_elecS_USA}, \code{L2233.SubsectorLogit_elecS_cool_USA}, \code{L2233.SubsectorShrwt_elecS_USA}, \code{L2233.SubsectorShrwt_elecS_cool_USA}, \code{L2233.SubsectorShrwtInterp_elecS_USA}, \code{L2233.SubsectorShrwtInterpTo_elecS_USA}, \code{L2233.Supplysector_elecS_cool_USA}. The corresponding file in the original data system was \code{LA2233.electricity_water_USA} (gcam-usa level2) diff --git a/input/gcamdata/man/module_gcamusa_L2234.elec_segments.Rd b/input/gcamdata/man/module_gcamusa_L2234.elec_segments.Rd index a65d95992b..1f0ff20f3a 100644 --- a/input/gcamdata/man/module_gcamusa_L2234.elec_segments.Rd +++ b/input/gcamdata/man/module_gcamusa_L2234.elec_segments.Rd @@ -24,8 +24,8 @@ the generated outputs: \code{L2234.Supplysector_elecS_USA}, \code{L2234.ElecRese \code{L2234.GlobalIntTechOMfixed_elecS_USA}, \code{L2234.GlobalTechOMvar_elecS_USA}, \code{L2234.GlobalIntTechOMvar_elecS_USA}, \code{L2234.GlobalTechCapFac_elecS_USA}, \code{L2234.GlobalTechEff_elecS_USA}, \code{L2234.GlobalIntTechEff_elecS_USA}, \code{L2234.GlobalTechLifetime_elecS_USA}, \code{L2234.GlobalIntTechLifetime_elecS_USA}, \code{L2234.GlobalTechProfitShutdown_elecS_USA}, -\code{L2234.GlobalTechSCurve_elecS_USA}, \code{L2234.GlobalTechCapture_elecS_USA}, \code{L2234.GlobalIntTechBackup_elecS_USA}, -\code{L2234.StubTechMarket_elecS_USA}, \code{L2234.StubTechMarket_backup_elecS_USA}, \code{L2234.StubTechElecMarket_backup_elecS_USA}, +\code{L2234.GlobalTechSCurve_elecS_USA}, \code{L2234.GlobalTechCapture_elecS_USA}, \code{L2234.GlobalIntTechValueFactor_elecS_USA}, +\code{L2234.StubTechMarket_elecS_USA}, \code{L2234.StubTechElecMarket_backup_elecS_USA}, \code{L2234.StubTechProd_elecS_USA}, \code{L2234.StubTechFixOut_elecS_USA}, \code{L2234.StubTechFixOut_hydro_elecS_USA}, \code{L2234.StubTechCost_offshore_wind_elecS_USA}, \code{L2234.TechShrwt_elecS_grid_USA}, \code{L2234.TechCoef_elecS_grid_USA}, \code{L2234.TechProd_elecS_grid_USA}. The corresponding file in the original data system was \code{L2234.elec_segments_USA.R} (gcam-usa level2).