diff --git a/cvs/objects/build/vc10/objects.vcxproj b/cvs/objects/build/vc10/objects.vcxproj index ef7bcff13c..eedbce5646 100644 --- a/cvs/objects/build/vc10/objects.vcxproj +++ b/cvs/objects/build/vc10/objects.vcxproj @@ -642,6 +642,7 @@ + @@ -681,6 +682,7 @@ + @@ -923,6 +925,7 @@ + @@ -969,6 +972,7 @@ + diff --git a/cvs/objects/build/vc10/objects.vcxproj.filters b/cvs/objects/build/vc10/objects.vcxproj.filters index 38bc67efec..1c6f98096f 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 + @@ -1072,12 +1078,6 @@ Header Files\sectors - - Header Files\sectors - - - Header Files\sectors - Header Files\sectors @@ -1897,5 +1897,17 @@ Header Files\technologies + + Header Files\sectors + + + Header Files\sectors + + + Header Files\sectors + + + Header Files\technologies + - + \ 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 e2ae522340..1a5a38331d 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; @@ -230,7 +231,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, 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 93e0357fdd..a3039844b3 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" @@ -126,6 +127,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 4deafeb06b..886563e674 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/input/gcamdata/R/constants.R b/input/gcamdata/R/constants.R index 8127d2278a..4c88eb798a 100644 --- a/input/gcamdata/R/constants.R +++ b/input/gcamdata/R/constants.R @@ -453,6 +453,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 ff1573661b..ba97d9a14c 100644 Binary files a/input/gcamdata/R/sysdata.rda and b/input/gcamdata/R/sysdata.rda differ diff --git a/input/gcamdata/R/xml.R b/input/gcamdata/R/xml.R index 964b510472..d7f98edfb1 100644 --- a/input/gcamdata/R/xml.R +++ b/input/gcamdata/R/xml.R @@ -500,7 +500,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 2a5c3e5f53..8c4fbb47b3 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 339a8e477c..2a4d3f2556 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 9ad7fcdd16..4fddc2227d 100644 --- a/input/gcamdata/R/zwater_xml_electricity_water.R +++ b/input/gcamdata/R/zwater_xml_electricity_water.R @@ -24,6 +24,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", @@ -85,6 +86,7 @@ module_water_electricity_water_xml <- function(command, ...) { L223.SubsectorShrwt_nuc <- get_data(all_data, "L223.SubsectorShrwt_nuc") L223.SubsectorShrwt_renew <- get_data(all_data, "L223.SubsectorShrwt_renew") L2233.AvgFossilEffKeyword_elec_cool <- get_data(all_data, "L2233.AvgFossilEffKeyword_elec_cool") + L2233.GlobalIntTechValueFactor_elec_cool <- get_data(all_data, "L2233.GlobalIntTechValueFactor_elec_cool") L2233.GlobalIntTechBackup_elec_cool <- get_data(all_data, "L2233.GlobalIntTechBackup_elec_cool") L2233.GlobalIntTechCapFac_elec_cool <- get_data(all_data, "L2233.GlobalIntTechCapFac_elec_cool") L2233.GlobalIntTechEff_elec_cool <- get_data(all_data, "L2233.GlobalIntTechEff_elec_cool") @@ -140,7 +142,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") %>% @@ -157,8 +160,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") %>% @@ -213,7 +230,6 @@ module_water_electricity_water_xml <- function(command, ...) { "L223.SubsectorShrwt_nuc", "L223.SubsectorShrwt_renew", "L2233.AvgFossilEffKeyword_elec_cool", - "L2233.GlobalIntTechBackup_elec_cool", "L2233.GlobalIntTechCapFac_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", diff --git a/input/gcamdata/data-raw/generate_package_data.R b/input/gcamdata/data-raw/generate_package_data.R index 45e683ad93..5158061250 100644 --- a/input/gcamdata/data-raw/generate_package_data.R +++ b/input/gcamdata/data-raw/generate_package_data.R @@ -181,8 +181,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") @@ -208,7 +206,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 b151a1d1d4..a42f52771a 100644 --- a/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt +++ b/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt @@ -376,7 +376,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).