From 563dd2ffc8d13b6c426339f8db403cc544bceddb Mon Sep 17 00:00:00 2001 From: Matt Mowers Date: Sun, 11 Dec 2022 17:12:11 -0500 Subject: [PATCH 01/16] Convert to PLCOE-based competition (non-functional) --- .../capacity_limit_backup_calculator.h | 4 +++ .../capacity_limit_backup_calculator.cpp | 9 ++++++ .../source/intermittent_technology.cpp | 29 ++++++++++--------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/cvs/objects/sectors/include/capacity_limit_backup_calculator.h b/cvs/objects/sectors/include/capacity_limit_backup_calculator.h index 3ca03d0b56..b1b6104e2d 100644 --- a/cvs/objects/sectors/include/capacity_limit_backup_calculator.h +++ b/cvs/objects/sectors/include/capacity_limit_backup_calculator.h @@ -96,6 +96,10 @@ class CapacityLimitBackupCalculator: public IBackupCalculator { virtual void toDebugXML( const int aPeriod, std::ostream& aOut, Tabs* aTabs ) const; virtual void initCalc( const IInfo* aTechInfo ); + virtual double getValueFactor( const std::string& aSector, + const std::string& aRegion, + const int aPeriod ) const; + virtual double getMarginalBackupCapacity( const std::string& aSector, const std::string& aElectricSector, const std::string& aResource, diff --git a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp index ec29b679e1..8225e3eeae 100644 --- a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp +++ b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp @@ -117,6 +117,15 @@ void CapacityLimitBackupCalculator::initCalc( const IInfo* aTechInfo ) { // No information needs to be passed in } +double CapacityLimitBackupCalculator::getValueFactor( const string& aSector, + const string& aRegion, + const int aPeriod ) const +{ + double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); + //TODO: Replace value factor slope and intercept below with new technology-specific inputs + return std::max( ( 0.945 - 1.326 * renewElecShare ), 0.00001 ); +} + double CapacityLimitBackupCalculator::getMarginalBackupCapacity( const string& aSector, const string& aElectricSector, const string& aResource, diff --git a/cvs/objects/technologies/source/intermittent_technology.cpp b/cvs/objects/technologies/source/intermittent_technology.cpp index d64085bfa2..4bf81a1e00 100644 --- a/cvs/objects/technologies/source/intermittent_technology.cpp +++ b/cvs/objects/technologies/source/intermittent_technology.cpp @@ -407,19 +407,22 @@ 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() ) { + + double cost = getTotalInputCost( aRegionName, aSectorName, aPeriod ) + * mPMultiplier - + calcSecondaryValue( aRegionName, aPeriod ); + + double valueFactor = 1 ; + + if( mBackupCalculator && mResourceInput != mInputs.end() ){ + valueFactor = mBackupCalculator->getValueFactor( mTrialMarketName, aRegionName, aPeriod ); + } + + mCosts[ aPeriod ] = cost / valueFactor; + + assert( util::isValidNumber( mCosts[ aPeriod ] ) ); + } } /*! \brief Returns marginal cost for backup capacity From 82e33fef9524dc356e604e2ddeb4b34138ebe39d Mon Sep 17 00:00:00 2001 From: Matt Mowers Date: Fri, 16 Dec 2022 11:58:39 -0500 Subject: [PATCH 02/16] Add technology value factor intercept and slope variables for clarity --- .../sectors/source/capacity_limit_backup_calculator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp index 8225e3eeae..59cf761d2e 100644 --- a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp +++ b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp @@ -123,7 +123,9 @@ double CapacityLimitBackupCalculator::getValueFactor( const string& aSector, { double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); //TODO: Replace value factor slope and intercept below with new technology-specific inputs - return std::max( ( 0.945 - 1.326 * renewElecShare ), 0.00001 ); + double techVFIntercept = 0.945; + double techVFSlope = -1.326; + return std::max( (techVFIntercept + techVFSlope * renewElecShare ), 0.00001 ); } double CapacityLimitBackupCalculator::getMarginalBackupCapacity( const string& aSector, From a8ae1aa8888fd25f621d9099a786d0959b3732e8 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Fri, 3 Feb 2023 17:45:18 -0500 Subject: [PATCH 03/16] Initial implementation of value factor in GCAM. Code changes only in this commit; data changes to follow in a separate commit. Model runs and solves normally, but results have not been explored / vetted. --- cvs/objects/build/vc10/objects.vcxproj | 8 +- .../build/vc10/objects.vcxproj.filters | 2429 ++++------------- .../sectors/include/CSP_backup_calculator.h | 128 - .../capacity_limit_backup_calculator.h | 161 -- .../sectors/include/ibackup_calculator.h | 6 +- .../sectors/include/value_factor_calculator.h | 123 + .../sectors/source/CSP_backup_calculator.cpp | 224 -- .../capacity_limit_backup_calculator.cpp | 316 --- .../source/value_factor_calculator.cpp | 207 ++ .../include/intermittent_technology.h | 41 +- .../source/intermittent_technology.cpp | 236 +- .../util/base/include/gcam_data_containers.h | 3 +- 12 files changed, 946 insertions(+), 2936 deletions(-) delete mode 100644 cvs/objects/sectors/include/CSP_backup_calculator.h delete mode 100644 cvs/objects/sectors/include/capacity_limit_backup_calculator.h create mode 100644 cvs/objects/sectors/include/value_factor_calculator.h delete mode 100644 cvs/objects/sectors/source/CSP_backup_calculator.cpp delete mode 100644 cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp create mode 100644 cvs/objects/sectors/source/value_factor_calculator.cpp diff --git a/cvs/objects/build/vc10/objects.vcxproj b/cvs/objects/build/vc10/objects.vcxproj index 5a06736eb2..5a4f793c15 100644 --- a/cvs/objects/build/vc10/objects.vcxproj +++ b/cvs/objects/build/vc10/objects.vcxproj @@ -72,7 +72,7 @@ Application MultiByte - v142 + v143 Application @@ -623,8 +623,6 @@ - - @@ -634,6 +632,7 @@ + @@ -896,8 +895,6 @@ - - @@ -908,6 +905,7 @@ + diff --git a/cvs/objects/build/vc10/objects.vcxproj.filters b/cvs/objects/build/vc10/objects.vcxproj.filters index 22a30b392c..30abcd6815 100644 --- a/cvs/objects/build/vc10/objects.vcxproj.filters +++ b/cvs/objects/build/vc10/objects.vcxproj.filters @@ -1,1869 +1,572 @@  - - {e3e4781a-407b-457f-83f9-c07e1f4fe564} - cpp - - - {8f7048a3-4d6f-4a38-8d3e-b623f62ee564} - - - {ac9ac84d-ab20-421d-8e31-ae30f7117a46} - - - {07c2947e-8b2d-42c5-95c4-62d49f1b6916} - - - {77a112d6-8f7a-4b24-99e7-feb24f55580e} - - - {c20a4dc4-a4d0-4a64-b652-2c066d62430e} - - - {7a6f00ec-e2bb-4c5b-a547-00951b187eb1} - - - {9286af08-633a-4433-905b-b8f14aced08d} - - - {8a2639cf-b415-4645-88e8-e5773625ba29} - - - {c8192d80-85d6-4aef-9844-850e9899329e} - - - {7b371689-5fc5-4ff8-840b-83b64365e8cc} - - - {1b7875b9-eab6-4b78-b161-c82543144cab} - - - {e63ba312-824a-4744-bf79-2053eacb634a} - - - {e7c9badc-94be-48ae-8ca9-672ff0d5a18a} - - - {7456f06c-269e-4ce0-9f31-7c3da9b9ba4e} - - - {ec757e25-b364-484e-b9b5-091d051710f4} - - - {c7f72b39-bb21-4692-8088-f366ead86d79} - - - {1f5b58d0-8e57-47c9-9cd6-18c00a4d1293} - - - {c1a72959-9a1d-45e9-a7c7-0ef533dba1cc} - - - {7ab6e32f-d82c-4af4-bff2-dae806623fde} - - - {74c7fc78-1a85-4183-94a3-8b16364e25dc} - - - {736c7c11-8afe-4bd5-9d18-0255f64712e2} - - - {2a860b6e-1238-4a72-860f-ed0028ed4ad1} - - - {64c9cd04-590e-4607-9c8e-19399d6ba325} - - - {f3c20036-5b61-4188-a152-0a918586d252} - h;hpp;hxx;hm;inl;inc - - - {523174cc-8492-4a3b-8f3e-69a3598f961f} - - - {0f6f5a35-15f0-4664-a8c7-dc744d7c3cdf} - - - {c26e889b-4600-4159-88dd-956a67fa4cdc} - - - {98ee5f2d-45cb-4e48-9a52-70673557ac24} - - - {bad66375-d96a-4ffa-82e5-70ee4b65f064} - - - {598e79b3-54ec-4791-9b12-183fee7be709} - - - {bdbbb8c1-ff58-4ca6-8143-9db15d11a5f9} - - - {e76de1ec-9bc3-452a-a1f4-81796714f1f4} - - - {61a7ab3b-f106-47f6-a52c-1002c747c654} - - - {4facf15c-937e-429b-9599-9a049e8e7b68} - - - {040a7511-1764-40f0-9d02-289211842ea1} - - - {90eb9457-9b2a-44be-b398-de6d59ca300f} - - - {e3beed39-6974-438b-b2c9-5c1f719ea0b3} - - - {d6a20b1f-d5de-4b0f-b16f-e8b8c9e7d7d5} - - - {5d385391-1cd8-4219-ac61-a94c3dc289b5} - - - {c5f182eb-bda4-4729-b4d4-99ee08b63e00} - - - {51e2e12c-93f9-4571-a291-d23dff493c59} - - - {2741b9fc-90db-4ca6-bdc9-04159daf3eda} - - - {1d005fc2-a6d3-411c-9c75-939b2cfcb570} - - - {a51e5deb-af6d-4f09-a603-b8ae063e0478} - - - {c7a1d0c7-52d2-4f90-a12e-e89109d9ba62} - - - {faa4b2da-4e16-41a9-ac39-838da9a72319} - - - {9fa177e1-95f5-473b-bdb9-b4d2441a4620} - - - {cedec6da-9927-4422-a273-00598d0a342f} - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\demographics - - - Source Files\demographics - - - Source Files\demographics - - - Source Files\demographics - - - Source Files\demographics - - - Source Files\demographics - - - Source Files\demographics - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\marketplace - - - Source Files\resources - - - Source Files\resources - - - Source Files\resources - - - Source Files\resources - - - Source Files\resources - - - Source Files\resources - - - Source Files\resources - - - Source Files\resources - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\solvers - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\util\logger - - - Source Files\util\logger - - - Source Files\util\logger - - - Source Files\util\logger - - - Source Files\util\curves - - - Source Files\util\curves - - - Source Files\util\curves - - - Source Files\util\curves - - - Source Files\util\curves - - - Source Files\util\curves - - - Source Files\consumers - - - Source Files\reporting - - - Source Files\reporting - - - Source Files\reporting - - - Source Files\reporting - - - Source Files\reporting - - - Source Files\reporting - - - Source Files\climate - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\land_allocator - - - Source Files\land_allocator - - - Source Files\land_allocator - - - Source Files\land_allocator - - - Source Files\land_allocator - - - Source Files\main - - - Source Files\policy - - - Source Files\policy - - - Source Files\ccarbon_model - - - Source Files\ccarbon_model - - - Source Files\ccarbon_model - - - Source Files\climate - - - Source Files\climate - - - Source Files\climate - - - Source Files\climate - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\land_allocator - - - Source Files\land_allocator - - - Source Files\sectors - - - Source Files\sectors - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\technology - - - Source Files\marketplace - - - Source Files\target_finder - - - Source Files\target_finder - - - Source Files\consumers - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\functions - - - Source Files\containers - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\solution\util - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\containers - - - Source Files\functions - - - Source Files\parallel - - - Source Files\solution\solvers - - - Source Files\solution\util - - - Source Files\ccarbon_model - - - Source Files\ccarbon_model - - - Source Files\marketplace - - - Source Files\policy - - - Source Files\target_finder - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\emissions - - - Source Files\solution\util - - - Source Files\target_finder - - - Source Files\functions - - - Source Files\functions - - - Source Files\solution\solvers - - - Source Files\climate - - - Source Files\technology - - - Source Files\sectors - - - Source Files\technology - - - Source Files\util\base - - - Source Files\marketplace - - - Source Files\emissions - - - Source Files\util\base - - - Source Files\functions - - - Source Files\emissions - - - Source Files\util\base - - - Source Files\util\base - - - Source Files\climate - - - Source Files\resources - - - Source Files\technology - - - Source Files\sectors - - - Source Files\functions - - - Source Files\functions - - - Source Files - - - Source Files\util\base - - - Source Files\util\base - - Source Files\functions - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\demographics - - - Header Files\demographics - - - Header Files\demographics - - - Header Files\demographics - - - Header Files\demographics - - - Header Files\demographics - - - Header Files\demographics - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\marketplace - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\resources - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\solvers - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\logger - - - Header Files\util\logger - - - Header Files\util\logger - - - Header Files\util\logger - - - Header Files\util\logger - - - Header Files\util\curves - - - Header Files\util\curves - - - Header Files\util\curves - - - Header Files\util\curves - - - Header Files\util\curves - - - Header Files\util\curves - - - Header Files\util\curves - - - Header Files\consumers - - - Header Files\reporting - - - Header Files\reporting - - - Header Files\reporting - - - Header Files\reporting - - - Header Files\reporting - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\climate - - - Header Files\climate - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\land_allocator - - - Header Files\land_allocator - - - Header Files\land_allocator - - - Header Files\land_allocator - - - Header Files\land_allocator - - - Header Files\policy - - - Header Files\policy - - - Header Files\ccarbon_model - - - Header Files\ccarbon_model - - - Header Files\ccarbon_model - - - Header Files\ccarbon_model - - - Header Files\climate - - - Header Files\climate - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\land_allocator - - - Header Files\land_allocator - - - Header Files\land_allocator - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\sectors - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\technologies - - - Header Files\marketplace - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\target_finder - - - Header Files\consumers - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\containers - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\containers - - - Header Files\functions - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\parallel - - - Header Files\solution\solvers - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\solution\util - - - Header Files\util\base - - - Header Files\ccarbon_model - - - Header Files\ccarbon_model - - - Header Files\marketplace - - - Header Files\policy - - - Header Files\target_finder - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\emissions - - - Header Files\solution\util - - - Header Files\target_finder - - - Header Files\functions - - - Header Files\functions - - - Header Files\functions - - - Header Files\solution\solvers - - - Header Files\climate - - - Header Files\technologies - - - Header Files\sectors - - - Header Files\technologies - - - Header Files\containers - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\marketplace - - - Header Files\emissions - - - Header Files\util\base - - - Header Files\functions - - - Header Files\emissions - - - Header Files\util\base - - - Header Files\util\base - - - Header Files\climate - - - Header Files\resources - - - Header Files\technologies - - - Header Files\sectors - - - Header Files\functions - - - Header Files\functions - - - Header Files\util\base - - - Header Files\util\base - - Header Files\functions - - - + \ No newline at end of file diff --git a/cvs/objects/sectors/include/CSP_backup_calculator.h b/cvs/objects/sectors/include/CSP_backup_calculator.h deleted file mode 100644 index d68a9bd8e1..0000000000 --- a/cvs/objects/sectors/include/CSP_backup_calculator.h +++ /dev/null @@ -1,128 +0,0 @@ -/* -* 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 _CSP_BACKUP_CALCULATOR_H_ -#define _CSP_BACKUP_CALCULATOR_H_ -#if defined(_MSC_VER) -#pragma once -#endif - -/*! - * \file CSP_backup_calculator.h - * \ingroup Objects - * \brief The CSPBackupCalculator class header file. - * \author Marshall Wise - */ - -#include -#include "sectors/include/ibackup_calculator.h" -/*! - * \ingroup Objects - * \brief The backup calculator for the CSP (concentrated solar trough) technology. - * \details Calculates the amount of backup energy required per unit of output. This - * differs from the capacity_limit_backup_calculator in that the CSP - * backup retunrs energy reuqired rather than capacity.
- * - * - * XML specification for CSPBackupCalculator - * - XML name: \c CSP-backup-calculator - * - Contained by: IntermittentSubsector - * - Parsing inherited from class: None - * - Attributes: None - * - Elements: None - * - * \author Marshall Wise - */ -class CSPBackupCalculator: public IBackupCalculator { -public: - CSPBackupCalculator(); - virtual CSPBackupCalculator* clone() const; - static const std::string& getXMLNameStatic(); - 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; -protected: - - double calcIntermittentShare( 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; - - // 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, - - // Parameters hard-coded in constructor for first step - //! Maximum Backup Fraction is the maximum backup fraction required. - DEFINE_VARIABLE( SIMPLE, "max-backup-fraction", mMaxBackupFraction, double ), - - //! Fraction of electric sector that is intermediate and peak - DEFINE_VARIABLE( SIMPLE, "max-sector-load-served", mMaxSectorLoadServed, double ), - - //! Backup function exponent parameter - DEFINE_VARIABLE( SIMPLE, "backup-exponent", mBackupExponent, double ), - - //! Fraction of year backup mode operates (during no-sun days) - DEFINE_VARIABLE( SIMPLE, "no-sun-days", mNoSunDayBackup, double ) - ) - - //! Backup fraction -- cached for reporting - mutable double mBackupFraction; -}; - -#endif // _CSP_BACKUP_CALCULATOR_H_ diff --git a/cvs/objects/sectors/include/capacity_limit_backup_calculator.h b/cvs/objects/sectors/include/capacity_limit_backup_calculator.h deleted file mode 100644 index b1b6104e2d..0000000000 --- a/cvs/objects/sectors/include/capacity_limit_backup_calculator.h +++ /dev/null @@ -1,161 +0,0 @@ -/* -* 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 _CAPACITY_LIMIT_BACKUP_CALCULATOR_H_ -#define _CAPACITY_LIMIT_BACKUP_CALCULATOR_H_ -#if defined(_MSC_VER) -#pragma once -#endif - -/*! - * \file capacity_limit_backup_calculator.h - * \ingroup Objects - * \brief The CapacityLimitBackupCalculator class header file. - * \author Josh Lurz - */ - -#include -#include "sectors/include/ibackup_calculator.h" - -// Forward declaration -class IInfo; - -/*! - * \ingroup Objects - * \brief The backup calculator for a capacity limited resource. - * \details Calculates the amount of backup required per unit of output. The marginal - * backup requirement is computed as an exponential function with parameters that - * specify a maximum backup requirement, the point at which half of the maximum - * backup is required, and the steepness of the curve in reaching the maximum - * backup requirement
- * - * functional form of marginal backup requirement is - * - * backupCapacity = mFmax / (1.0 + exp( mC * ( xmid - elecShare ) / mTau )) - * where mFmax is the maximum backup fraction (defaults to 1) - * mC and mTau are shape parameters - * (ratio of mC to mTau determined steepness to reach fMax) - * xmid is the value of the share at which backupCapacity = 0.5*fMax - * - * - * The integral of this function, which is used to compute total and average bakcup - * is given by - * - * totalBackup = mFmax * mTau / mC * ( log ( 1.0 + exp( c * ( xmid - elecShare ) / mTau)) - * - mC * ( xmid - elecShare ) / mTau) - * - * - * XML specification for CapacityLimitBackupCalculator - * - XML name: \c capacity-limit-backup-calculator - * - Contained by: Technology - * - Parsing inherited from class: None - * - Attributes: None - * - Elements: - * - \c capacity-limit CapacityLimitBackupCalculator::mCapacityLimit - * - * \author Josh Lurz, Marshall Wise - */ -class CapacityLimitBackupCalculator: public IBackupCalculator { -public: - CapacityLimitBackupCalculator(); - virtual CapacityLimitBackupCalculator* 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 getValueFactor( const std::string& aSector, - const std::string& aRegion, - const int aPeriod ) const; - - 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; -protected: - - double getMarginalBackupCapacityFraction( 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; - - double calcIntermittentShare( 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; - - // 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, - - //! Capacity limit which sets the fraction of total output at which the backup curve - //! returns a value of 50% of the upper limit for backup (i.e.,50 of mFmax) - DEFINE_VARIABLE( SIMPLE, "capacity-limit", mCapacityLimit, double ), - - //! Parameter for max rate of back up (e.g. specify 1 for 1-to-1 backup as max) - DEFINE_VARIABLE( SIMPLE, "fmax", mFmax, double ), - - //! Parameter for steepness of backup curve. Higher number means steeper ascent. - DEFINE_VARIABLE( SIMPLE, "c", mC, double ), - - //! Parameter for steepness of backup curve. Lower means steeper ascent. Ascent depends - //! on the ratio of c/tau - DEFINE_VARIABLE( SIMPLE, "tau", mTau, double ) - ) -}; - -#endif // _CAPACITY_LIMIT_BACKUP_CALCULATOR_H_ diff --git a/cvs/objects/sectors/include/ibackup_calculator.h b/cvs/objects/sectors/include/ibackup_calculator.h index a17090ab49..877196b3bd 100644 --- a/cvs/objects/sectors/include/ibackup_calculator.h +++ b/cvs/objects/sectors/include/ibackup_calculator.h @@ -54,8 +54,7 @@ class IInfo; class Tabs; // Need to forward declare the subclasses as well. -class CapacityLimitBackupCalculator; -class CSPBackupCalculator; +class ValueFactorCalculator; /*! * \ingroup Objects @@ -151,8 +150,7 @@ class IBackupCalculator : public INamed, private boost::noncopyable { /* Declare all subclasses of Sector to allow automatic traversal of the * hierarchy under introspection. */ - DEFINE_SUBCLASS_FAMILY( IBackupCalculator, CapacityLimitBackupCalculator, - CSPBackupCalculator ) + DEFINE_SUBCLASS_FAMILY( IBackupCalculator, 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..9922f39787 --- /dev/null +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -0,0 +1,123 @@ +/* +* 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 Josh Lurz + */ + +#include +#include "sectors/include/ibackup_calculator.h" + + +// Forward declaration +class IInfo; + +/*! + * \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 + * 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. + * \author Josh Lurz + */ +class ValueFactorCalculator : public IBackupCalculator, private boost::noncopyable { +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 ValueFactorCalculator::getValueFactor(const std::string& aSector, + const std::string& aElectricSector, + const std::string& aRegion, + const int aPeriod) const; + +protected: + + double calcIntermittentShare(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; + + // 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, + + //! TODO: leave an explanatory comment + DEFINE_VARIABLE( SIMPLE, "value-factor-intercept", mValueFactorIntercept, double ), + + DEFINE_VARIABLE( SIMPLE, "value-factor-slope", mValueFactorSlope, double ) + + ) +}; + +#endif // _VALUE_FACTOR_CALCULATOR_H_ diff --git a/cvs/objects/sectors/source/CSP_backup_calculator.cpp b/cvs/objects/sectors/source/CSP_backup_calculator.cpp deleted file mode 100644 index ce980fe9de..0000000000 --- a/cvs/objects/sectors/source/CSP_backup_calculator.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* -* 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 CSP_backup_calculator.cpp - * \ingroup Objects - * \brief CSPBackupCalculator class source file. - * \author Josh Lurz - */ - -#include "util/base/include/definitions.h" -#include -#include - -#include "sectors/include/CSP_backup_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" -#include "containers/include/iinfo.h" - -using namespace std; - -/*! - * \brief Constructor. - */ -CSPBackupCalculator::CSPBackupCalculator() -{ - mMaxBackupFraction = 0.40; - mMaxSectorLoadServed = 0.15; - mBackupExponent = 4.0; -} - -// Documentation is inherited. -CSPBackupCalculator* CSPBackupCalculator::clone() const { - CSPBackupCalculator* clone = new CSPBackupCalculator(); - clone->mMaxBackupFraction = mMaxBackupFraction; - clone->mMaxSectorLoadServed = mMaxSectorLoadServed; - clone->mBackupExponent = mBackupExponent; - clone->mNoSunDayBackup = mNoSunDayBackup; - - return clone; -} - -// Documentation is inherited. -bool CSPBackupCalculator::isSameType( const std::string& aType ) const { - return aType == getXMLNameStatic(); -} - -// Documentation is inherited. -const string& CSPBackupCalculator::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. -* \author Josh Lurz, James Blackwood -* \return The constant XML_NAME as a static. -*/ -const string& CSPBackupCalculator::getXMLNameStatic() { - const static string XML_NAME = "CSP-backup-calculator"; - return XML_NAME; -} - -const string& CSPBackupCalculator::getXMLName() const { - return getXMLNameStatic(); -} - -// Documentation is inherited. -void CSPBackupCalculator::toDebugXML( const int aPeriod, ostream& aOut, Tabs* aTabs ) const { - XMLWriteOpeningTag( getXMLNameStatic(), aOut, aTabs ); - XMLWriteElement( mMaxBackupFraction, "max-backup-fraction", aOut, aTabs ); - XMLWriteElement( mNoSunDayBackup, "no-sun-days-backup", aOut, aTabs ); - XMLWriteElement( mBackupFraction, "backup-fraction", aOut, aTabs ); - XMLWriteElement( mBackupExponent, "backup-exponent", aOut, aTabs ); - XMLWriteClosingTag( getXMLNameStatic(), aOut, aTabs ); -} - -// Documentation is inherited. -void CSPBackupCalculator::initCalc( const IInfo* aTechInfo ) { - mMaxSectorLoadServed = aTechInfo->getDouble( "max-sector-load-served", true ); - double noSunDays = aTechInfo->getDouble( "no-sun-days", true ); - double randomMaintenanceFraction = aTechInfo->getDouble( "random-maintenance-fraction", true ); - double scheduledMaintenance = aTechInfo->getDouble( "scheduled-maintenance", true ); - - double justNoSunDayBackup = noSunDays / double( 365 ); - // The base level of backup needed is no-sun days minus time spent in scheduled maintenance that can occur on no-sun days - mNoSunDayBackup = justNoSunDayBackup - - min( scheduledMaintenance * ( 1 - randomMaintenanceFraction ), justNoSunDayBackup ); -} - -double CSPBackupCalculator::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 -{ - //! Marginal backup calculation is used for marginal cost of backup capacity - //! and used in the cost of backup for share equations. - //! This cost is not needed for CSP since the backup capacity comes as part - //! of the CSP technology and is contained in the CSP tech cost already. A zero is returned. - - return 0.0; -} -double CSPBackupCalculator::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 -{ - //! Average backup is needed for CSP since it is used to compute the amount - //! of energy used by the backup technology. - - // Preconditions - assert( !aSector.empty() ); - assert( !aElectricSector.empty() ); - assert( !aResource.empty() ); - assert( !aRegion.empty() ); - assert( aReserveMargin >= 0 ); - assert( aAverageGridCapacityFactor > 0 ); - - // Determine the intermittent share of output. - // Note that this method in CSP differs as it is based on energy share not capacity - double elecShare = calcIntermittentShare( aSector, aElectricSector, aResource, - aRegion, aTechCapacityFactor, aReserveMargin, aAverageGridCapacityFactor, - aPeriod ); - - // No backup required for zero share. - if( elecShare < util::getSmallNumber() ){ - return 0; - } - - // Calculate average backup energy not inclusing the no-sun days - // based on the approximation by Yabei Zhang - - mBackupFraction = mMaxBackupFraction * pow( elecShare, mBackupExponent ); - - // Convert to capacity. This needs to be done since Intermittent Subsector - // assumes it is getting a capacity number and converts back to energy. - // This will only work in energy units if we assign a capacity factor of 1 - // for the backup capacity factor and read in a one in the intermittent supply - // sector object for backup capacity factor - double backupCapacityFactor = 1.0; - - // Add no-sun days backup - mBackupFraction += mNoSunDayBackup; - - return SectorUtils::convertEnergyToCapacity( backupCapacityFactor, - mBackupFraction ); -} - -/*! - * \brief Calculate the share of the intermittent resource within the - * electricity sector. - * \details Calculates the share of energy of the intermittent resource within - * the electricity sector. This is determined using trial values for - * the intermittent sector and electricity sector production. - * \param aSector The name of the sector which requires backup capacity. - * \param aElectricSector The name of the electricity sector into which the - * sector having a backup amount calculated for will feed. - * \param aResource The name of the resource the sector consumes. - * \param aRegion Name of the containing region. - * \param aReserveMargin Reserve margin for the electricity sector. - * \param aAverageGridCapacityFactor The average electricity grid capacity - * factor. - * \param aPeriod Model period. - * \return Share of the intermittent resource within within the electricity - * sector. - */ -double CSPBackupCalculator::calcIntermittentShare( 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 -{ - //! Note that the CSP backup is based on share of energy, not capacity, - //! so capacity factor and conversions to capacity not used. - - return SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ) / mMaxSectorLoadServed; -} diff --git a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp deleted file mode 100644 index 59cf761d2e..0000000000 --- a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/* -* 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 capacity_limit_backup_calculator.cpp - * \ingroup Objects - * \brief CapacityLimitBackupCalculator class source file. - * \author Josh Lurz, Sonny Kim - */ - -#include "util/base/include/definitions.h" -#include -#include -#include - -#include "sectors/include/capacity_limit_backup_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. - */ -CapacityLimitBackupCalculator::CapacityLimitBackupCalculator() -{ - mCapacityLimit = 1.0; - mFmax = 1.0; - mC = 1.0; - mTau = 0.1; -} - -// Documentation is inherited. -CapacityLimitBackupCalculator* CapacityLimitBackupCalculator::clone() const { - CapacityLimitBackupCalculator* clone = new CapacityLimitBackupCalculator(); - clone->mCapacityLimit = mCapacityLimit; - clone->mFmax = mFmax; - clone->mC = mC; - clone->mTau = mTau; - - return clone; -} - -// Documentation is inherited. -bool CapacityLimitBackupCalculator::isSameType( const std::string& aType ) const { - return aType == getXMLNameStatic(); -} - -// Documentation is inherited. -const string& CapacityLimitBackupCalculator::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. -* \author Josh Lurz, James Blackwood -* \return The constant XML_NAME as a static. -*/ -const string& CapacityLimitBackupCalculator::getXMLNameStatic() { - const static string XML_NAME = "capacity-limit-backup-calculator"; - return XML_NAME; -} - -const string& CapacityLimitBackupCalculator::getXMLName() const { - return getXMLNameStatic(); -} - -// Documentation is inherited. -void CapacityLimitBackupCalculator::toDebugXML( const int aPeriod, ostream& aOut, Tabs* aTabs ) const { - XMLWriteOpeningTag( getXMLNameStatic(), aOut, aTabs ); - XMLWriteElement( mCapacityLimit, "capacity-limit", aOut, aTabs ); - XMLWriteElement( mFmax, "fmax", aOut, aTabs ); - XMLWriteElement( mC, "c", aOut, aTabs ); - XMLWriteElement( mTau, "tau", aOut, aTabs ); - XMLWriteClosingTag( getXMLNameStatic(), aOut, aTabs ); -} - -// Documentation is inherited. -void CapacityLimitBackupCalculator::initCalc( const IInfo* aTechInfo ) { - // No information needs to be passed in -} - -double CapacityLimitBackupCalculator::getValueFactor( const string& aSector, - const string& aRegion, - const int aPeriod ) const -{ - double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); - //TODO: Replace value factor slope and intercept below with new technology-specific inputs - double techVFIntercept = 0.945; - double techVFSlope = -1.326; - return std::max( (techVFIntercept + techVFSlope * renewElecShare ), 0.00001 ); -} - -double CapacityLimitBackupCalculator::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 -{ - // Preconditions - assert( !aSector.empty() ); - assert( !aElectricSector.empty() ); - assert( !aResource.empty() ); - assert( !aRegion.empty() ); - assert( aReserveMargin >= 0 ); - assert( aAverageGridCapacityFactor > 0 ); - - double marginalBackup = getMarginalBackupCapacityFraction( aSector, - aElectricSector, - aResource, - aRegion, - aTechCapacityFactor, - aReserveMargin, - aAverageGridCapacityFactor, - aPeriod ); - - - // This is confusing but mathematically correct. The marginal backupCapacityFraction is in units of - // GW per GW. The denominator (intermittent sector capacity GW) needs to be converted to energy, - // therefore the quotient is divided by the conversion from capacity to energy, - // using the technology capacity factor, which is the same as multiplying by - // the conversion from energy to capacity as done here. Units returned here are GW/EJ. - - return SectorUtils::convertEnergyToCapacity( aTechCapacityFactor, marginalBackup ); -} - -double CapacityLimitBackupCalculator::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 -{ - // Preconditions - assert( !aElectricSector.empty() ); - assert( !aResource.empty() ); - assert( !aRegion.empty() ); - assert( aReserveMargin >= 0 ); - assert( aAverageGridCapacityFactor > 0 ); - - // This function has an odd feature that at small shares the curve reverses sharply - // ultimately looking as if massive amounts of backup should be required. Clearly - // this isn't the intention so we will cap the trial share at the share value near - // the minimum "average backup" value. - double renewElecShare = std::max( - std::min( - SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), - // share should never exceed 1 - 1.0 ), - // avoid the steeply rising inflection point near the - // bottom of the curve by capping the share - 0.01 / mCapacityLimit ); - - - // Compute total backup using the integral of the marginal backup function - double xmid = mCapacityLimit; - double capacityRatio = aAverageGridCapacityFactor / aTechCapacityFactor; - double capacityShare = renewElecShare * capacityRatio; - - double totalBackup = mFmax * mTau / mC * ( log ( 1.0 + exp( mC * ( xmid - capacityShare ) / mTau ) ) - - mC * ( xmid - capacityShare ) / mTau ); - - // MAW believes this calculation of average backup is correct, but future generations should - // feel free to re-visit it. The S-curve backup function is - // already the marginal fraction of backup required as a function of the intermittent sector - // market share.(E.G., at 10% market share, the next unit of share needs 50% backup.) - // So integrating from 0 to the share does give the cumulative fraction of backup - // at that share, and dividing that integral by the share gives the average backup fraction - // up to that market share. - // This average is what is applied to the total output of the sector to get the total - // backup energy used. - double averageBackup = totalBackup / capacityShare; - - // This is confusing but mathematically correct. The averagebackupFraction is in units of - // GW per GW. The denominator (intermittent sector capacity GW) needs to be converted to energy, - // therefore the quotient is divided by the conversion from capacity to energy, - // using the technology capacity factor, which is the same as multiplying by - // the conversion from energy to capacity as done here. Units returned here are GW/EJ. - - return SectorUtils::convertEnergyToCapacity( aTechCapacityFactor, averageBackup ); -} - -/*! - * \brief Compute backup required per resource energy output. - * \details Compute backup required per resource energy output (since energy - * output is what the modeled market is based on). Convert intermittent - * resource output back to energy using the resource capacity factor. - * This is the cost of operating reserve or backup capacity. - * \param aSector The name of the sector which requires backup capacity. - * \param aElectricSector The name of the electricity sector into which the - * sector having a backup amount calculated for will feed. - * \param aResource The name of the resource the sector consumes. - * \param aRegion Name of the containing region. - * \param aReserveMargin Reserve margin for the electricity sector. - * \param aAverageGridCapacityFactor The average electricity grid capacity - * factor. - * \param aPeriod Model period. - * \return Reserve capacity per intermittent electricity resource output - * (GW/EJ). - */ -double CapacityLimitBackupCalculator::getMarginalBackupCapacityFraction( 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 -{ - // Preconditions - assert( aAverageGridCapacityFactor >= 0 && aAverageGridCapacityFactor <= 1 ); - assert( !aSector.empty() ); - assert( !aElectricSector.empty() ); - assert( !aResource.empty() ); - assert( !aRegion.empty() ); - - double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); - - // No backup required for zero share. - if( renewElecShare < util::getVerySmallNumber() ){ - return 0; - } - - // Capacity limit must be between 0 and 1 inclusive. - assert( mCapacityLimit >= 0 && mCapacityLimit <= 1 ); - - // Calculate the marginal backup requirement at this share of the total. - double backupCapacity; - double xmid = mCapacityLimit; - - double capacityRatio = aAverageGridCapacityFactor / aTechCapacityFactor; - double capacityShare = renewElecShare * capacityRatio; - - backupCapacity = mFmax / ( 1.0 + exp( mC * ( xmid - capacityShare ) / mTau ) ); - - // This returned value is in terms of fraction of backup capacity per capacity - // of intermittent sector capacity (e.g., GW/GW) - - return backupCapacity; -} - -/*! - * \brief Calculate the capacity share of the intermittent resource within the - * electricity sector. - * \details Calculates the share of capacity of the intermittent resource within - * the electricity sector. This is determined using trial values for - * the intermittent sector and electricity sector production. The - * production is converted to capacity using constant capacity factors. - * \param aSector The name of the sector which requires backup capacity. - * \param aElectricSector The name of the electricity sector into which the - * sector having a backup amount calculated for will feed. - * \param aResource The name of the resource the sector consumes. - * \param aRegion Name of the containing region. - * \param aReserveMargin Reserve margin for the electricity sector. - * \param aAverageGridCapacityFactor The average electricity grid capacity - * factor. - * \param aPeriod Model period. - * \return Share of the intermittent resource within within the electricity - * sector. - */ -double CapacityLimitBackupCalculator::calcIntermittentShare( 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 -{ - - double capacityShare = std::min( std::max( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 0.0 ), 1.0 ) * - aAverageGridCapacityFactor / aTechCapacityFactor; - return capacityShare; -} 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..945ee2e258 --- /dev/null +++ b/cvs/objects/sectors/source/value_factor_calculator.cpp @@ -0,0 +1,207 @@ +/* +* 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 Josh Lurz, Sonny Kim + */ + +#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 = 0.945; + mValueFactorSlope = -1.326; +} + +// 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. +* \author Josh Lurz, James Blackwood +* \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 intermittent technology. + * \details Compute value factor for intermittent technology, + * which will decrease as market share increases. + * This value factor will then be used to scale technology cost. + * \param aSector The name of the sector which requires backup capacity. + * \param aElectricSector The name of the electricity sector into which the + * sector having a backup amount calculated for will feed. + * \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( ( 0.945 - 1.326 * renewElecShare ), util::getVerySmallNumber() ); + + return valueFactor; + +} + +/*! + * \brief Calculate the capacity share of the intermittent resource within the + * electricity sector. + * \details Calculates the share of capacity of the intermittent resource within + * the electricity sector. This is determined using trial values for + * the intermittent sector and electricity sector production. The + * production is converted to capacity using constant capacity factors. + * \param aSector The name of the sector which requires backup capacity. + * \param aElectricSector The name of the electricity sector into which the + * sector having a backup amount calculated for will feed. + * \param aResource The name of the resource the sector consumes. + * \param aRegion Name of the containing region. + * \param aReserveMargin Reserve margin for the electricity sector. + * \param aAverageGridCapacityFactor The average electricity grid capacity + * factor. + * \param aPeriod Model period. + * \return Share of the intermittent resource within within the electricity + * sector. + */ +double ValueFactorCalculator::calcIntermittentShare( 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 +{ + + double capacityShare = std::min( std::max( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 0.0 ), 1.0 ) * + aAverageGridCapacityFactor / aTechCapacityFactor; + return capacityShare; +} diff --git a/cvs/objects/technologies/include/intermittent_technology.h b/cvs/objects/technologies/include/intermittent_technology.h index 91b7ad8017..90cc9e1e59 100644 --- a/cvs/objects/technologies/include/intermittent_technology.h +++ b/cvs/objects/technologies/include/intermittent_technology.h @@ -49,6 +49,7 @@ #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; /* @@ -134,7 +135,8 @@ class IntermittentTechnology: public Technology { Technology, //! A calculator which determines the amount of backup per unit output. - DEFINE_VARIABLE( CONTAINER, "backup-calculator", mBackupCalculator, IBackupCalculator* ), + // DEFINE_VARIABLE( CONTAINER, "backup-calculator", mBackupCalculator, IBackupCalculator* ), + 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 ), @@ -150,20 +152,24 @@ 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 ), @@ -172,7 +178,7 @@ class IntermittentTechnology: public Technology { //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 ) ) @@ -181,41 +187,16 @@ 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; }; diff --git a/cvs/objects/technologies/source/intermittent_technology.cpp b/cvs/objects/technologies/source/intermittent_technology.cpp index 4bf81a1e00..e0a74c55ee 100644 --- a/cvs/objects/technologies/source/intermittent_technology.cpp +++ b/cvs/objects/technologies/source/intermittent_technology.cpp @@ -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,21 @@ 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 +93,7 @@ IntermittentTechnology::IntermittentTechnology() { * \brief Destructor. */ IntermittentTechnology::~IntermittentTechnology() { - delete mBackupCalculator; + delete mValueFactorCalculator; } IntermittentTechnology* IntermittentTechnology::clone() const { @@ -116,12 +107,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,15 +138,6 @@ 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. * @@ -177,16 +157,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. @@ -222,12 +192,14 @@ void IntermittentTechnology::completeInit( const string& aRegionName, 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() ) ); @@ -248,7 +220,7 @@ void IntermittentTechnology::completeInit( const string& aRegionName, // Create trial market for intermettent technology if backup exists and needs to be // calculated. - if( mBackupCalculator ){ + if(mValueFactorCalculator){ SectorUtils::createTrialSupplyMarket( aRegionName, mTrialMarketName, mIntermittTechInfo.get(), mElectricSectorMarket ); MarketDependencyFinder* depFinder = scenario->getMarketplace()->getDependencyFinder(); depFinder->addDependency( aSectorName, aRegionName, @@ -262,12 +234,13 @@ void IntermittentTechnology::completeInit( const string& aRegionName, } // Warn if a backup calculator was not read-in. - if( !mBackupCalculator ){ + 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 +258,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. @@ -339,59 +312,18 @@ void IntermittentTechnology::production( const string& aRegionName, 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 @@ -407,95 +339,24 @@ void IntermittentTechnology::calcCost( const string& aRegionName, const string& aSectorName, const int aPeriod ) { - if( mProductionState[ aPeriod ]->isOperating() ) { + if (mProductionState[aPeriod]->isOperating()) { - double cost = getTotalInputCost( aRegionName, aSectorName, aPeriod ) + double cost = getTotalInputCost(aRegionName, aSectorName, aPeriod) * mPMultiplier - - calcSecondaryValue( aRegionName, aPeriod ); + calcSecondaryValue(aRegionName, aPeriod); - double valueFactor = 1 ; + double valueFactor = 1; - if( mBackupCalculator && mResourceInput != mInputs.end() ){ - valueFactor = mBackupCalculator->getValueFactor( mTrialMarketName, aRegionName, aPeriod ); + if ( mValueFactorCalculator ) { + valueFactor = mValueFactorCalculator->getValueFactor(mTrialMarketName, mElectricSectorMarket, aRegionName, aPeriod); } - mCosts[ aPeriod ] = cost / valueFactor; + mCosts[aPeriod] = cost / valueFactor; - assert( util::isValidNumber( mCosts[ aPeriod ] ) ); + assert(util::isValidNumber(mCosts[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 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; -} - -/*! - * \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 ); - } - - /*! \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 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 ); - } - - /*! \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 @@ -512,7 +373,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. @@ -528,25 +389,10 @@ 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; } @@ -554,30 +400,14 @@ void IntermittentTechnology::initializeInputLocations( const string& aRegionName } // Check that both the resource and backup input were set. - if( mResourceInput == mInputs.end() || mBackupInput == mInputs.end() ){ + 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/util/base/include/gcam_data_containers.h b/cvs/objects/util/base/include/gcam_data_containers.h index 5b389be2df..3406321f84 100644 --- a/cvs/objects/util/base/include/gcam_data_containers.h +++ b/cvs/objects/util/base/include/gcam_data_containers.h @@ -137,8 +137,6 @@ #include "sectors/include/afinal_demand.h" #include "sectors/include/ag_supply_sector.h" #include "sectors/include/ag_supply_subsector.h" -#include "sectors/include/capacity_limit_backup_calculator.h" -#include "sectors/include/CSP_backup_calculator.h" #include "sectors/include/energy_final_demand.h" #include "sectors/include/ibackup_calculator.h" #include "sectors/include/pass_through_sector.h" @@ -148,6 +146,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" From 2850cb25b8018ad34edb2bd874aa350a7f4a3b53 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Fri, 3 Feb 2023 17:48:33 -0500 Subject: [PATCH 04/16] Initial implementation of value factor in GCAM. Data changes only in this commit (code changes were in a previous commit). Model runs and solves normally, but results have not been explored / vetted. --- input/gcamdata/R/sysdata.rda | Bin 5803 -> 5830 bytes input/gcamdata/R/zchunk_L223.electricity.R | 122 +++++++++++++----- .../gcamdata/R/zchunk_L223.electricity_USA.R | 38 +----- .../R/zchunk_L2232.electricity_FERC_USA.R | 8 +- .../R/zchunk_L2233.electricity_water.R | 28 ++-- .../R/zchunk_L2234.elec_segments_USA.R | 55 +++----- .../R/zchunk_LA2233.elec_segments_water_USA.R | 43 ++---- .../R/zchunk_batch_elec_segments_USA_xml.R | 19 +-- ...zchunk_batch_elec_segments_water_USA_xml.R | 27 ++-- .../R/zchunk_batch_electricity_USA_xml.R | 4 - .../R/zchunk_batch_electricity_water_xml.R | 10 +- .../gcamdata/R/zchunk_batch_electricity_xml.R | 8 +- .../gcamdata/data-raw/generate_package_data.R | 5 +- .../inst/extdata/energy/A23.globalinttech.csv | 20 ++- .../extdata/energy/A23.globaltech_eff.csv | 1 - .../extdata/energy/A26.globaltech_cost.csv | 4 +- .../extdata/energy/A26.globaltech_eff.csv | 2 - .../extdata/energy/A26.globaltech_shrwt.csv | 2 - .../inst/extdata/energy/A26.sector.csv | 4 +- .../extdata/energy/A26.subsector_logit.csv | 2 - .../extdata/energy/A26.subsector_shrwt.csv | 2 - .../mi_headers/ModelInterface_headers.txt | 2 + .../man/module_energy_L223.electricity.Rd | 2 +- .../module_gcamusa_L223.electricity_USA.Rd | 2 +- .../module_gcamusa_L2234.elec_segments_USA.Rd | 4 +- ..._gcamusa_LA2233.elec_segments_water_USA.Rd | 4 +- 26 files changed, 183 insertions(+), 235 deletions(-) diff --git a/input/gcamdata/R/sysdata.rda b/input/gcamdata/R/sysdata.rda index 502336b6926ceb96e33ba16274c6b710e48b18a4..1948d934bbd6ac55becd0da4a99ae40b7d95ad73 100644 GIT binary patch literal 5830 zcmV;%7CGrcT4*^jL0KkKS({ih*#J2u|G@wM|Nn9WegHr3-*CVG|L`CH00Ceh+;PG0 zpLyeNdGhFe@)+`c4(&zbpjo{E>&xx;huLJ-$|GFt)!aFzO_7^zVTHD)TH2MyVW33Fm>CI#20&!c(?A%2h=5R@Nv2F`20+jN zXwU!v0i!{JLP@AJ10WhSXbk`W00E!|fuKT^M8OkHO((GW!fS zcugjrQ`019FdBxKGo__?$cGh_cHoG(fXI+2N~n;CKmiCcAj%L3q#+2YB&dWCC@~-` zK!QRD07>;9r{S-^wZ#x;=i+DiRw)4hVW+OvAcO6*FY>g?lVUK_Jzu_3ubI48&WjS^ zt0r5aRUmE02VrNFg|9IKyV^|QFtLanrIm7$-pw}c`%s)FloIzZg-nDrOt^nK!3`L8 z6qy7i22PVQgc(BOnwSkxy4$`oh9c_IT|^YssNnPOH|ecy<2N$d*w3<>2IrA;PYn(o zG}TP*nVeKxVnWs-LuW6(FGzhYl`}xVcH>h3BPrxU-8?g;MF@9vl1rF#001P7JbqCf z>{I~qML@PHf}@A=pa^a*8t~6+sK7o!Q800l9klDmJ9?YW`v9|dvoW+0K|X^09F|ZH|xH3J1#lC#BzJd ze$BNdgm$!xNU5b;`f{rugO5!&ZJu&fK@KoB1Ffi(y*lKSbejoX@w=clZ`IV>6Co25 zMN~r(O*K?iG*wJTPMdVsXDx?E?&#g7{ry@J0bOyb2aP1&$Vx77cv{f#eLk-r7Ntd? zk~)C~bD$ox)VQeHVWxwU4X^-cXD>(1ZP@O;`*gkz>r+tf&HMS-4^(o!Aw-OU4g``a zE{zr=LFTbu+v|)>gz)R(!&54{0VwND?Kds~V%AXL;|Ik74qb+a6KrjZVp^em^>$2P z44x6OW>_G&Z9%I$cDbObo%P@4F*?A!5y|t0VYwOsLF+#)kWY!wSe;PCgo^G6-vT_l6? z95qe6(PK1-U;`6Qc|QsI>bQ8Cv5g=r3>%?_F!J{lM45GQ`> zOK%KdX}!pK60P0C0t5g$&u)VgsROrn6VF0tTGc+r>g4P|lOqfpYgXQ523`ds6`{@{ z!r(h-UbNC!4moTRMTlAfB}z9{NuAa(y$Ur#3p=iCAv3o9Ja9Qfc}sbqUgK9P{Mw*h>fehyY8X*vZ9qXX-_jC}?crP=xt@_fT2QiI{jH8->WE=$<;ad>R z0~{jR+Fjn7kO;9uIYLB-0f)1G%B8^ejfXi+QQU>NI5A+2{4DLZAV^0-6ocoMEF}dM zL`Xrr+0ikA`pu-$ifl=>Ubz`} z9esFR1_h`29OXF-)~>^&5E%fYti-Af@<@WS1Z!Qbn-}iIJ;P=LjBdDvM2_LBS z*YomW9$Z9R*XHt_!V#0CY~sXl5-^nk#}66dAo&VJ1_n^Lg?TYfFH|${qJzj^n9v>5 z1H6iiW`fyX=h`3EE`g59H-2r*5>Oh=u*@zx)gOGU`Bm!ZvOFhilP8PqJkZ>!N7s)K+Rt4cqW?l3~sytBZ=oy2_&d} zejBZ$*cW?_iF==@ey?%IQ+JWkIH8V=V((7NXCpc7Hn*<2=^AJ;q)su1*LLG}?RReF zu>rG(bPi+q!qwAPF)w-mT^zfx`3q;dz4K&Jx?3~Bx*i`n4>5@ zI`a6E$jY=*pj)G_eH!6MYFx)$3%p)}!U)(qAlZSt@_;?s)G`oEn>aPq| z9n{^REHM-=WB@e4k9(T{l#PAa!0-tYeji6H(ebOyi@Bmun(aY`{F%oLyo z&oDg66z~$$x3`8#c;{J?)#n1EvyHZ2ltvpRX6I)NoswB=;;2!frBLSACTEFLxP#xG zo%lwOgV_P85PIVK^LH$FP0+X4O6dbhJ`I&acIo{i>h0WnEp1%=J>ID*;vXcJ+C(1Y z8O^ad$t&EAu7oAaa4AhiF1y5l%-ytHVRoIjOTKxTEJl*YY|mku9$F#lBMmPv3HuFu zHJHX7hkj-!k4=C{AQ3=;o}OLnhF~So83=&LBP`q^dBpIt-9(y!h4i`+2!XxP9Q}1{ z=+_qyPpyqBfu-d4EsuW1RaJ2IYEu%;;wollUS?&X-QC~2=lDLFbY_HSIjN|Kh>nmu z+VHh?pFMfb1DW6z&Qd{A@{n%Lj;126ALAR9&$$=Ew!W^Q23UtV7F3 z>*|bQ0EY$8P(JL607!#VGDQ;fPv3z-*}FxMWd&Rb5g4KaK<@x^yg-ryAR|D2RB`rB z^l!{)495jRloEki6$fG80vMFF1&=sh3g4C7iWo9PP1js4jHv+c>|Eo%GDZ8ez%qwX z9;c88G(O9e9^>o%1W4I&BOc&hsDukqjIA0YoUm26Lx-XNKJO=H@vbB#samuhcpZKU zgN_T>d`@&ntK;>Jy`NdP0Q?0rDg-@=&ME84tRu;5FmyIC#F*+2$t%XG_qNMnF$k1 z5(cIZt>4g;du2u5jGztxZvn^>4eme=)FBzD7E-+-(SR)Zz;n>7sx$jYgc zB&L9I!NYLmu~i}oFe^$W3KRmgAag$A_syZof(Qs<4?LjiIW}!9O6M;mF?$y=W~$P5 zR$VeU8&d|Tu@SQ5LJF}9nU3?t!$j9XN(3>IkQCY%Fw?9b7@@~t>u;k31@Gb2RQZ^| z{b$mMu0h3-&4On|-__IyBo1F3-MEI#NRbzq^xvuNb?HmhddIKNJrZz(c-h6~L^q_9 zxtpq53l7C4m1vhlP-}F8Pon^l=z7A0bO-@fznWTRs$c3kXagFvL{_1rbw0O;E&9 zKvO|ORHX<}LX@RdAxRQ7MR&fQaCxCAVpUkaXh-yQsfCFi**hjdckcnViKj{(|mmVkm=q4=m8Yilh$l!p8$ zW&>n=PjCD_Sv3UkJul|oZ|G<`5l98PA?+yx;P`n5BtIq~K={CjC$u|+GONK+>>bk= zMr3D)G_;y*3o`}qorVy*JlkGxBtkJ3*U1;*vw4{CMRCrtB~3^Fd@X=%2cZ{&!60ws zT;VxSA)@POjY1;^0~icqfJkvh%@N6Oa^65Zu@ccvg$s+S!qf|7inqJMAI#u<2e5eE z*@hxnQ<02OnBj&(XB4zBoNXMk&O3n4z!>%V@{5*akpS)i+CX`rAA|DrsZsg8qv$_V zZ_w4{0+x>94(0{fo)mI*n34Gg@@4EMl^7w)@li^aFs%Sez(mG|+{AW*@u!FgB!L;5 z%W@ne5Ro~JG^<~UH$8+uc=({0cz}X<0EcPoZKg0F3}i%p08Y^IrIA%IB{D)J?{ZB2 z0WwdWeB%legQ>{u=;#Ri{KduC4`^piNO@4pf`B#w>jOhaRW5=>*iMh5p#AjvkCcw( zJ`}c+>QK9iTZ-`ba?Q1B8$m5MMHl#5o>BTo2h4 zNdqvKnbb8vfeHbuK$_Tv?={HcFAu+jJf6GLAn80)5WE>(%> zA-XQ{2+tjQueZ)GaC+X|ueBX3$s}305rO1+2Zs=}qvK|w8ey^&LS;u0kOG+`AgCZl z8K)E{k>Ks^0DU4KN*B7XmN*R?2vZ1KM+LNG!Eb@(3VuzG;^x77e4*1oMnQrUqX3g_ zUTAWeP%&v82wn!1Q;csL&om|KlS-tws-^7MECglbihea5P?ZEWEUvb;7EZcmvLwc^ z=s@VmxL8?Gqr!6LaN_rJ+I(NTDM<)O;E$$=;vvI=ueGg15I)gCxZ0R7rzc`zCiHb| zP6Uy3`)Y3uOyRoo7Xf(u46b?=5P%6l2AWM?#7A0y{o@q6vh2)e9doogRsx2FRFE`<_S1P>_-_At7lXFgJwea}SBBtqV}~ zW^LLZQ{Q(au?;N*FbPaT0aV05mn@Jv6G|eZ@ z21Bp-VCz0${HDH+WCxl60Hi(w0Stp7Xh^wbDy&MXCaGj8vp~|^oF?kK>X&p>At0JH)q znMU+a&Y(t*$S8tPdbg(7hWL-jpbjDZUz^4}KsqE^VyKdWB2a{eQ6N2pGDr%B=~Qt< zhb0Oil+yzhuoBQ?B9$VM89+*q3a@9i8YLt&bJD44iJ(dzs>UGm{O}4G?hW)Z?B-B` z6ohXd%SLL5e196u!bA{KxTf*pB~?{WP^>JV511Ft<4u5&M{EqL0OC@_a2tT>q9}Vv zl0X6oQ7KAL2$6ZzNWd3FC<38OZDv|FK`;*;$QD4N8e&CKEhNi95ERD+CG zb3_H_1BnEX0X041c@4|x^^I}bmj-~k{1*toAP&F_Ra~$!rs%3>0Cp+dvFTmFpxAs+ zE!i%k3!x7^2$=gbUQX|C19mnIcWMU#_54-zoM30wf5cCXfwCdyb|Ryl8xsU)Y?1xJ z?=&EKY}ErIJHQC*HQ6K~17Fl+yA$o*GcVe2p2KV2#5Zqz9Y<5*_mjyfR3lW&B2p+q zM6)pz%oH0m8g;Om%8W3|CoG92C=r4IqXcmkJz5CjE?AKy!$85V34ogGnhZmv1_HL3 zri+RM(3DF#D3}8&Eikk>A(-G~s!A&sFh+`7uq0FqKq&S;#sN=*gAIo$NWPIE=R>$9 zFOb-%9#kJ}-B624v~M#|li+LvS|o)fL%Vt$yyp?dfC;>H8Qf=jonb;iaR6lZl{{+` z$`6OBG!jxn3Qdw6hyWmk7EAy#5Fb)e(D$-;bT|ow7J0+M1%my<(IQD02?G81ZWkOn zBAHO7Ffd&R0fgHVLlXej%xp;$#E!3D#FzuSehx-1A%_&AnLGy zu2GVTq!>F4H*~s+WTIS(hr5iy@Lj!#X5fWFUn6Rdxk_}mW(I$cf zWH1t(wqzi}!vYNqNo+s>XEd3!25A|Z@PZxW4P79JvtYYoNYiHe05nbQ9oWjM2bVW1 z?#&2iTv20K?qnij;YJwVs=&k{qzj5zS|aThmDkC@Q*s25h|xku>_UwNh*G=~+!m~0 zTGJ@*Gz!RX(#CF3S+#(qwwVCIgt%ctjwn-1nGcX)`XcCm6vi}xvIi5;B&8~lkWUDE zuUhgBBt+3MQc+ZtRTWf4MAa2l6;MRQKu}Q>%}qo^6xCGB%u!`;Z426?Uq*4}7Q<<% z|e(AW%Rwhg*u_u>jR)&Kwi literal 5803 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 diff --git a/input/gcamdata/R/zchunk_L223.electricity.R b/input/gcamdata/R/zchunk_L223.electricity.R index 6845630506..d0ddd8fc10 100644 --- a/input/gcamdata/R/zchunk_L223.electricity.R +++ b/input/gcamdata/R/zchunk_L223.electricity.R @@ -18,7 +18,7 @@ #' \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}, @@ -106,7 +106,7 @@ module_energy_L223.electricity <- function(command, ...) { "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", "L223.GlobalTechCapture_elec", - "L223.GlobalIntTechBackup_elec", + "L223.GlobalIntTechValueFactor_elec", "L223.StubTechCapFactor_elec", "L223.StubTechCost_offshore_wind", "L223.GlobalTechShutdown_elec", @@ -360,7 +360,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 +370,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 +389,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 +415,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 +442,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 +492,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 +546,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 +573,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 +605,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 +647,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 +685,16 @@ 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 # ------------------------------------------------------------------------------------------------------ # Copy assumed parameters to all model years A23.globalinttech %>% repeat_add_columns(tibble(year = MODEL_YEARS)) %>% rename(sector.name = supplysector, subsector.name = subsector) -> - L223.GlobalIntTechBackup_elec + L223.GlobalIntTechValueFactor_elec # reorders columns to match expected model interface input - L223.GlobalIntTechBackup_elec <- L223.GlobalIntTechBackup_elec[c(LEVEL2_DATA_NAMES[["GlobalTechBackup"]])] + L223.GlobalIntTechValueFactor_elec <- L223.GlobalIntTechValueFactor_elec[c(LEVEL2_DATA_NAMES[["GlobalIntTechValueFactor"]])] # Set global technology retirement information for all electricity sector technologies # ------------------------------------------------------------------------------------ @@ -692,13 +728,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 +750,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 +772,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 +795,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,13 +1347,13 @@ module_energy_L223.electricity <- function(command, ...) { add_precursors("energy/A23.globaltech_co2capture") -> L223.GlobalTechCapture_elec - L223.GlobalIntTechBackup_elec %>% + L223.GlobalIntTechValueFactor_elec %>% add_title("Capital costs of backup technologies for intermittent techs") %>% add_units("1975 USD/kW/yr") %>% add_comments("Assumptions contained within A23.globalinttech") %>% - add_legacy_name("L223.GlobalIntTechBackup_elec") %>% + add_legacy_name("L223.GlobalIntTechValueFactor_elec") %>% add_precursors("energy/A23.globalinttech") -> - L223.GlobalIntTechBackup_elec + L223.GlobalIntTechValueFactor_elec L223.StubTechCapFactor_elec %>% add_title("Capacity factors of stub technologies including wind and solar") %>% @@ -1603,7 +1655,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.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/zchunk_L223.electricity_USA.R b/input/gcamdata/R/zchunk_L223.electricity_USA.R index 723315ad6d..4705544ac2 100644 --- a/input/gcamdata/R/zchunk_L223.electricity_USA.R +++ b/input/gcamdata/R/zchunk_L223.electricity_USA.R @@ -20,7 +20,7 @@ #' \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). #' @details This chunk generates input files to create an annualized electricity generation sector for each state @@ -49,7 +49,6 @@ module_gcamusa_L223.electricity_USA <- function(command, ...) { "L223.StubTech_elec", "L223.StubTechEff_elec", "L223.StubTechCapFactor_elec", - "L223.GlobalIntTechBackup_elec", "L1231.in_EJ_state_elec_F_tech", "L1231.out_EJ_state_elec_F_tech", "L1232.out_EJ_sR_elec", @@ -93,7 +92,6 @@ module_gcamusa_L223.electricity_USA <- 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", @@ -129,7 +127,6 @@ module_gcamusa_L223.electricity_USA <- function(command, ...) { L223.StubTech_elec <- get_data(all_data, "L223.StubTech_elec", strip_attributes = TRUE) L223.StubTechEff_elec <- get_data(all_data, "L223.StubTechEff_elec", strip_attributes = TRUE) L223.StubTechCapFactor_elec <- get_data(all_data, "L223.StubTechCapFactor_elec", strip_attributes = TRUE) - L223.GlobalIntTechBackup_elec <- get_data(all_data, "L223.GlobalIntTechBackup_elec", strip_attributes = TRUE) L1231.in_EJ_state_elec_F_tech <- get_data(all_data, "L1231.in_EJ_state_elec_F_tech", strip_attributes = TRUE) L1231.out_EJ_state_elec_F_tech <- get_data(all_data, "L1231.out_EJ_state_elec_F_tech", strip_attributes = TRUE) L1232.out_EJ_sR_elec <- get_data(all_data, "L1232.out_EJ_sR_elec", strip_attributes = TRUE) @@ -512,20 +509,6 @@ module_gcamusa_L223.electricity_USA <- function(command, ...) { select(-grid_region) -> L223.StubTechMarket_elec_USA - # L223.StubTechMarket_backup_USA: market names of backup inputs to state electricity sectors - 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) %>% - # 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. - anti_join(A10.renewable_resource_delete, - by = c("region", "subsector" = "resource_elec_subsector")) %>% - select(LEVEL2_DATA_NAMES[["StubTechMarket"]]) -> - L223.StubTechMarket_backup_USA - # L223.StubTechCapFactor_elec_wind_USA: capacity factors for wind electricity in the states # Just use the subsector for matching - technologies include storage technologies as well L114.CapacityFactor_wind_state %>% @@ -593,12 +576,6 @@ module_gcamusa_L223.electricity_USA <- function(command, ...) { filter(stub.technology == "wind_offshore", region %in% offshore_wind_states)) -> L223.StubTechMarket_elec_USA - L223.StubTechMarket_backup_USA %>% - filter(stub.technology != "wind_offshore") %>% - bind_rows(L223.StubTechMarket_backup_USA %>% - filter(stub.technology == "wind_offshore", - region %in% offshore_wind_states)) -> L223.StubTechMarket_backup_USA - # Replacing with correct state-specific offshore wind capacity factors L223.StubTechCapFactor_elec_wind_USA %>% filter(stub.technology == "wind_offshore", @@ -934,17 +911,6 @@ module_gcamusa_L223.electricity_USA <- function(command, ...) { "L119.CapFacScaler_CSP_state") -> L223.StubTechMarket_elec_USA - L223.StubTechMarket_backup_USA %>% - add_title("Market names of backup inputs to state electricity sectors") %>% - add_units("Unitless") %>% - add_comments("Set market as USA") %>% - add_legacy_name("L223.StubTechMarket_backup_USA") %>% - add_precursors("L223.GlobalIntTechBackup_elec", - "gcam-usa/states_subregions", - "gcam-usa/A10.renewable_resource_delete", - "L119.CapFacScaler_CSP_state") -> - L223.StubTechMarket_backup_USA - if(exists("L223.StubTechElecMarket_backup_USA")) { L223.StubTechElecMarket_backup_USA %>% add_title("Market name of electricity sector for backup calculations") %>% @@ -1000,7 +966,6 @@ module_gcamusa_L223.electricity_USA <- function(command, ...) { "L223.StubTech_elec", "L223.StubTechEff_elec", "L223.StubTechCapFactor_elec", - "L223.GlobalIntTechBackup_elec", "L1231.in_EJ_state_elec_F_tech", "L1231.out_EJ_state_elec_F_tech", "L1232.out_EJ_sR_elec", @@ -1045,7 +1010,6 @@ module_gcamusa_L223.electricity_USA <- 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, diff --git a/input/gcamdata/R/zchunk_L2232.electricity_FERC_USA.R b/input/gcamdata/R/zchunk_L2232.electricity_FERC_USA.R index 69f7f77426..f6e182ec05 100644 --- a/input/gcamdata/R/zchunk_L2232.electricity_FERC_USA.R +++ b/input/gcamdata/R/zchunk_L2232.electricity_FERC_USA.R @@ -31,7 +31,7 @@ module_gcamusa_L2232.electricity_FERC_USA <- function(command, ...) { "L126.in_EJ_state_td_elec", "L132.out_EJ_state_indchp_F", "L1232.out_EJ_sR_elec", - "L223.StubTechMarket_backup_USA")) + "L2234.StubTechElecMarket_backup_elecS_USA")) } else if(command == driver.DECLARE_OUTPUTS) { return(c("L2232.DeleteSupplysector_USAelec", "L2232.Supplysector_USAelec", @@ -72,7 +72,7 @@ module_gcamusa_L2232.electricity_FERC_USA <- function(command, ...) { L126.in_EJ_state_td_elec <- get_data(all_data, "L126.in_EJ_state_td_elec") L132.out_EJ_state_indchp_F <- get_data(all_data, "L132.out_EJ_state_indchp_F") L1232.out_EJ_sR_elec <- get_data(all_data, "L1232.out_EJ_sR_elec") - L223.StubTechMarket_backup_USA <- get_data(all_data, "L223.StubTechMarket_backup_USA", strip_attributes = TRUE) + L2234.StubTechElecMarket_backup_elecS_USA <- get_data(all_data, "L2234.StubTechElecMarket_backup_elecS_USA", strip_attributes = TRUE) # This chunk builds the electric sector model with demand resolved at the grid region level. @@ -341,7 +341,7 @@ module_gcamusa_L2232.electricity_FERC_USA <- function(command, ...) { # PART 3: THE STATES # L2232.StubTechElecMarket_backup_USA_FERC: electric sector name for states # Reset the electric sector market to the grid regions (for backup calculations) - L223.StubTechMarket_backup_USA %>% + L2234.StubTechElecMarket_backup_elecS_USA %>% select(LEVEL2_DATA_NAMES[["StubTechYr"]]) %>% left_join_error_no_match(select(states_subregions, electric.sector.market = grid_region, state), by = c("region" = "state")) -> @@ -531,7 +531,7 @@ module_gcamusa_L2232.electricity_FERC_USA <- function(command, ...) { add_units("Unitless") %>% add_comments("Reset the electric sector market to the grid regions (for backup calculations)") %>% add_legacy_name("L2232.StubTechElecMarket_backup_USA") %>% - add_precursors("L223.StubTechMarket_backup_USA") -> + add_precursors("L2234.StubTechElecMarket_backup_elecS_USA") -> L2232.StubTechElecMarket_backup_USA return_data(L2232.DeleteSupplysector_USAelec, L2232.Supplysector_USAelec, L2232.SubsectorShrwtFllt_USAelec, diff --git a/input/gcamdata/R/zchunk_L2233.electricity_water.R b/input/gcamdata/R/zchunk_L2233.electricity_water.R index 581b79df31..564d2f0793 100644 --- a/input/gcamdata/R/zchunk_L2233.electricity_water.R +++ b/input/gcamdata/R/zchunk_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", "GlobalIntTechCapital_elec", "GlobalIntTechEff_elec", "GlobalIntTechLifetime_elec", "GlobalIntTechOMfixed_elec", "GlobalIntTechOMvar_elec", "GlobalIntTechShrwt_elec", "GlobalTechCapture_elec", "GlobalTechCapital_elec", "GlobalTechEff_elec", "GlobalTechInterp_elec", @@ -97,7 +97,7 @@ module_water_L2233.electricity_water <- function(command, ...) { "L2233.GlobalTechCoef_elec_cool", "L2233.GlobalIntTechCoef_elec_cool", "L2233.AvgFossilEffKeyword_elec_cool", - "L2233.GlobalIntTechBackup_elec_cool", + "L2233.GlobalIntTechValueFactor_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", "L2233.GlobalIntTechShrwt_elec_cool", @@ -263,7 +263,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 %>% @@ -367,7 +367,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-- @@ -384,7 +384,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-- @@ -400,7 +400,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-- @@ -500,13 +500,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-- @@ -539,14 +539,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-- @@ -703,10 +703,10 @@ module_water_L2233.electricity_water <- function(command, ...) { add_units("unitless") -> L2233.AvgFossilEffKeyword_elec_cool - L2233.Elec_tables_globaltech_nocost_$GlobalIntTechBackup_elec %>% - add_title("Capital costs of backup technologies for intermittent techs") %>% + L2233.Elec_tables_globaltech_nocost_$GlobalIntTechValueFactor_elec %>% + add_title("Value factor function parameters for intermittent techs") %>% add_units("1975 USD/kW/yr") -> - L2233.GlobalIntTechBackup_elec_cool + L2233.GlobalIntTechValueFactor_elec_cool L2233.Elec_tables_globaltech_nocost_$GlobalIntTechEff_elec %>% add_title("Cooling efficiencies of intermittent electricity generating technologies") %>% @@ -1100,7 +1100,7 @@ module_water_L2233.electricity_water <- function(command, ...) { L2233.GlobalTechCoef_elec_cool, L2233.GlobalIntTechCoef_elec_cool, L2233.AvgFossilEffKeyword_elec_cool, - L2233.GlobalIntTechBackup_elec_cool, + L2233.GlobalIntTechValueFactor_elec_cool, L2233.GlobalIntTechEff_elec_cool, L2233.GlobalIntTechLifetime_elec_cool, L2233.GlobalIntTechShrwt_elec_cool, diff --git a/input/gcamdata/R/zchunk_L2234.elec_segments_USA.R b/input/gcamdata/R/zchunk_L2234.elec_segments_USA.R index 527041abc4..ad182832a0 100644 --- a/input/gcamdata/R/zchunk_L2234.elec_segments_USA.R +++ b/input/gcamdata/R/zchunk_L2234.elec_segments_USA.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.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). @@ -59,7 +59,6 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { "L223.StubTechProd_elec_USA", "L223.StubTechFixOut_elec_USA", "L223.StubTechFixOut_hydro_USA", - "L223.StubTechMarket_backup_USA", "L223.StubTechCapFactor_elec_wind_USA", "L223.StubTechCapFactor_elec_solar_USA", "L223.GlobalTechCapFac_elec", @@ -77,7 +76,7 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { "L223.GlobalTechSCurve_elec", "L223.GlobalTechProfitShutdown_elec", "L223.GlobalTechCapture_elec", - "L223.GlobalIntTechBackup_elec", + "L223.GlobalIntTechValueFactor_elec", "L223.PrimaryRenewKeyword_elec", "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", @@ -115,9 +114,8 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "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", "L2234.StubTechProd_elecS_USA", "L2234.StubTechFixOut_elecS_USA", @@ -177,7 +175,6 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { L223.StubTechProd_elec_USA <- get_data(all_data, "L223.StubTechProd_elec_USA", strip_attributes = TRUE) L223.StubTechFixOut_elec_USA <- get_data(all_data, "L223.StubTechFixOut_elec_USA", strip_attributes = TRUE) L223.StubTechFixOut_hydro_USA <- get_data(all_data, "L223.StubTechFixOut_hydro_USA", strip_attributes = TRUE) - L223.StubTechMarket_backup_USA <- get_data(all_data, "L223.StubTechMarket_backup_USA", strip_attributes = TRUE) L223.StubTechCapFactor_elec_wind_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_wind_USA", strip_attributes = TRUE) L223.StubTechCapFactor_elec_solar_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_solar_USA", strip_attributes = TRUE) L223.GlobalTechCapFac_elec <- get_data(all_data, "L223.GlobalTechCapFac_elec", strip_attributes = TRUE) @@ -195,7 +192,7 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { L223.GlobalTechSCurve_elec <- get_data(all_data, "L223.GlobalTechSCurve_elec", strip_attributes = TRUE) 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) @@ -516,11 +513,11 @@ module_gcamusa_L2234.elec_segments_USA <- 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.GlobalIntTechBackup_elecS + L2234.GlobalIntTechValueFactor_elecS # Energy inputs A23.elecS_inttech_mapping %>% @@ -536,16 +533,9 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { year, minicam.energy.input, market.name) -> L2234.StubTechMarket_elecS_USA # Backup markets - L223.StubTechMarket_backup_USA %>% - # join is intended to duplicate rows; left_join_error_no_match throws error, so left_join used - left_join(A23.elecS_inttech_mapping, - by = c("supplysector", "subsector", "stub.technology" = "intermittent.technology")) %>% - filter(!is.na(minicam.energy.input)) %>% - select(region, supplysector = Electric.sector, subsector, stub.technology = Electric.sector.intermittent.technology, - year, minicam.energy.input, market.name) -> L2234.StubTechMarket_backup_elecS_USA - - L2234.StubTechMarket_backup_elecS_USA %>% - select(-minicam.energy.input, -market.name) %>% + L223.StubTechMarket_elec_USA %>% + distinct(region, supplysector, subsector, stub.technology, year) %>% + semi_join(L223.GlobalIntTechValueFactor_elec, by= c("subsector" = "subsector.name", "stub.technology" = "intermittent.technology")) %>% left_join_error_no_match(states_subregions, by = c("region" = "state")) %>% select(region, supplysector, subsector, stub.technology, year, electric.sector.market = grid_region) -> L2234.StubTechElecMarket_backup_elecS_USA @@ -1435,15 +1425,14 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { "L223.GlobalTechCapture_elec") -> L2234.GlobalTechCapture_elecS_USA - L2234.GlobalIntTechBackup_elecS %>% + L2234.GlobalIntTechValueFactor_elecS %>% add_title("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% add_units("1975$/kW/yr (backup.capital.cost); unitless") %>% add_comments("Backup characteristics for electricity load segments intermittent technologies") %>% - add_legacy_name("L2234.GlobalIntTechBackup_elecS") %>% add_precursors("gcam-usa/A23.elecS_inttech_mapping", "gcam-usa/A23.elecS_tech_availability", - "L223.GlobalIntTechBackup_elec") -> - L2234.GlobalIntTechBackup_elecS_USA + "L223.GlobalIntTechValueFactor_elec") -> + L2234.GlobalIntTechValueFactor_elecS_USA L2234.StubTechMarket_elecS_USA %>% add_title("Energy Inputs for Electricity Load Segments Technologies") %>% @@ -1456,16 +1445,6 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { "L223.StubTechMarket_elec_USA") -> L2234.StubTechMarket_elecS_USA - L2234.StubTechMarket_backup_elecS_USA %>% - add_title("Backup Energy Inputs for Electricity Load Segments Intermittent Technologies") %>% - add_units("NA") %>% - add_comments("Backup energy inputs for intermittent electricity load segments technologies") %>% - add_legacy_name("L2234.StubTechMarket_backup_elecS_USA") %>% - add_precursors("gcam-usa/A23.elecS_inttech_mapping", - "gcam-usa/A23.elecS_tech_availability", - "L223.StubTechMarket_backup_USA") -> - L2234.StubTechMarket_backup_elecS_USA - L2234.StubTechElecMarket_backup_elecS_USA %>% add_title("Electricity Load Segments Sector Name for Backup Markets") %>% add_units("NA") %>% @@ -1474,7 +1453,8 @@ module_gcamusa_L2234.elec_segments_USA <- 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.GlobalIntTechValueFactor_elec", + "L223.StubTechMarket_elec_USA") -> L2234.StubTechElecMarket_backup_elecS_USA L2234.StubTechProd_elecS_USA %>% @@ -1586,9 +1566,8 @@ module_gcamusa_L2234.elec_segments_USA <- function(command, ...) { L2234.GlobalTechProfitShutdown_elecS_USA, 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, L2234.StubTechProd_elecS_USA, L2234.StubTechFixOut_elecS_USA, diff --git a/input/gcamdata/R/zchunk_LA2233.elec_segments_water_USA.R b/input/gcamdata/R/zchunk_LA2233.elec_segments_water_USA.R index 657ada24c5..326d5bae70 100644 --- a/input/gcamdata/R/zchunk_LA2233.elec_segments_water_USA.R +++ b/input/gcamdata/R/zchunk_LA2233.elec_segments_water_USA.R @@ -11,13 +11,13 @@ #' 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) @@ -45,7 +45,7 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { "L2233.GlobalIntTechEff_elec_cool", "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", @@ -70,7 +70,6 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { "L2234.StubTechElecMarket_backup_elecS_USA", "L2234.StubTechFixOut_elecS_USA", "L2234.StubTechFixOut_hydro_elecS_USA", - "L2234.StubTechMarket_backup_elecS_USA", "L2234.StubTechMarket_elecS_USA", "L2234.StubTechProd_elecS_USA", "L2234.SubsectorLogit_elecS_USA", @@ -115,7 +114,7 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { "L2233.GlobalTechCapture_elecS_cool_USA", "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", @@ -137,7 +136,6 @@ module_gcamusa_LA2233.elec_segments_water_USA <- 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.StubTechShrwt_elecS_cool_USA", "L2233.StubTechInterp_elecS_cool_USA", @@ -194,7 +192,7 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { L2233.GlobalIntTechEff_elec_cool <- get_data(all_data, "L2233.GlobalIntTechEff_elec_cool", strip_attributes = TRUE) 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) @@ -219,7 +217,6 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { L2234.StubTechElecMarket_backup_elecS_USA <- get_data(all_data,"L2234.StubTechElecMarket_backup_elecS_USA", strip_attributes = TRUE) L2234.StubTechFixOut_elecS_USA <- get_data(all_data,"L2234.StubTechFixOut_elecS_USA", strip_attributes = TRUE) L2234.StubTechFixOut_hydro_elecS_USA <- get_data(all_data,"L2234.StubTechFixOut_hydro_elecS_USA", strip_attributes = TRUE) - L2234.StubTechMarket_backup_elecS_USA <- get_data(all_data,"L2234.StubTechMarket_backup_elecS_USA", strip_attributes = TRUE) L2234.StubTechMarket_elecS_USA <- get_data(all_data,"L2234.StubTechMarket_elecS_USA", strip_attributes = TRUE) L2234.StubTechProd_elecS_USA <- get_data(all_data,"L2234.StubTechProd_elecS_USA", strip_attributes = TRUE) L2234.SubsectorLogit_elecS_USA <- get_data(all_data,"L2234.SubsectorLogit_elecS_USA", strip_attributes = TRUE) @@ -531,9 +528,9 @@ module_gcamusa_LA2233.elec_segments_water_USA <- 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,7 +543,7 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { subsector = intermittent.technology, intermittent.technology = to.technology)) %>% arrange(supplysector, subsector0, subsector, intermittent.technology, year)-> - L2233.GlobalIntTechBackup_elecS_USA + L2233.GlobalIntTechValueFactor_elecS_USA # isolate int techs that do not have cooling techs associated L2234.GlobalIntTechCapital_elecS_USA %>% @@ -827,11 +824,6 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { add_cooling_techs() -> L2233.StubTechFixOut_hydro_elecS_USA - L2234.StubTechMarket_backup_elecS_USA %>% - add_cooling_techs() %>% - mutate(technology = if_else(subsector == "rooftop_pv" | grepl("wind_base", subsector), subsector, technology)) -> - L2233.StubTechMarket_backup_elecS_USA - L2234.StubTechCost_offshore_wind_elecS_USA %>% add_cooling_techs() -> L2233.StubTechCost_offshore_wind_elecS_USA @@ -1265,13 +1257,12 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { "gcam-usa/A23.elecS_tech_mapping_cool") -> L2233.AvgFossilEffKeyword_elecS_cool_USA - L2233.GlobalIntTechBackup_elecS_USA %>% + L2233.GlobalIntTechValueFactor_elecS_USA %>% add_title("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% add_units("none") %>% add_comments("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% - add_legacy_name("L2233.GlobalIntTechBackup_elec") %>% - add_precursors("L2234.GlobalIntTechBackup_elecS_USA") -> - L2233.GlobalIntTechBackup_elecS_cool_USA + add_precursors("L2234.GlobalIntTechValueFactor_elecS_USA") -> + L2233.GlobalIntTechValueFactor_elecS_cool_USA L2233.GlobalIntTechCapital_elecS_USA %>% add_title("Electricity Load Segments Intermittent Technology Capital Costs") %>% @@ -1495,15 +1486,6 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { "gcam-usa/A23.elecS_tech_mapping_cool") -> L2233.StubTechCost_offshore_wind_elecS_cool_USA - L2233.StubTechMarket_backup_elecS_USA %>% - add_title("Backup Energy Inputs for Electricity Load Segments Intermittent Technologies") %>% - add_units("none") %>% - add_comments("Backup Energy Inputs for Electricity Load Segments Intermittent Technologies") %>% - add_legacy_name("L2233.StubTechMarket_backup_elec") %>% - add_precursors("L2234.StubTechMarket_backup_elecS_USA", - "gcam-usa/A23.elecS_tech_mapping_cool") -> - L2233.StubTechMarket_backup_elecS_cool_USA - L2233.StubTechInterp_elecS_cool_USA %>% add_title("Electricity Load Segments Stub Tech Interpolation Rules") %>% add_units("none") %>% @@ -1592,7 +1574,7 @@ module_gcamusa_LA2233.elec_segments_water_USA <- function(command, ...) { L2233.GlobalTechCapture_elecS_cool_USA, 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, @@ -1614,7 +1596,6 @@ module_gcamusa_LA2233.elec_segments_water_USA <- 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.StubTechShrwt_elecS_cool_USA, L2233.StubTechInterp_elecS_cool_USA, diff --git a/input/gcamdata/R/zchunk_batch_elec_segments_USA_xml.R b/input/gcamdata/R/zchunk_batch_elec_segments_USA_xml.R index 4f1456a02b..106244ade6 100644 --- a/input/gcamdata/R/zchunk_batch_elec_segments_USA_xml.R +++ b/input/gcamdata/R/zchunk_batch_elec_segments_USA_xml.R @@ -44,9 +44,8 @@ module_gcamusa_batch_elec_segments_USA_xml <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "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", "L2234.StubTechProd_elecS_USA", "L2234.StubTechFixOut_elecS_USA", @@ -127,9 +126,8 @@ module_gcamusa_batch_elec_segments_USA_xml <- function(command, ...) { L2234.GlobalTechProfitShutdown_elecS_USA <- get_data(all_data, "L2234.GlobalTechProfitShutdown_elecS_USA") 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") L2234.StubTechProd_elecS_USA <- get_data(all_data, "L2234.StubTechProd_elecS_USA") L2234.StubTechFixOut_elecS_USA <- get_data(all_data, "L2234.StubTechFixOut_elecS_USA") @@ -201,11 +199,8 @@ module_gcamusa_batch_elec_segments_USA_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.GlobalIntTechValueFactor_elecS_USA <- L2234.GlobalIntTechValueFactor_elecS_USA %>% + fix_global_tech_names() 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) @@ -239,9 +234,8 @@ module_gcamusa_batch_elec_segments_USA_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.GlobalIntTechValueFactor_elecS_USA, "GlobalIntTechValueFactor") %>% 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") %>% @@ -320,9 +314,8 @@ module_gcamusa_batch_elec_segments_USA_xml <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "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", "L2234.StubTechProd_elecS_USA", "L2234.StubTechFixOut_elecS_USA", diff --git a/input/gcamdata/R/zchunk_batch_elec_segments_water_USA_xml.R b/input/gcamdata/R/zchunk_batch_elec_segments_water_USA_xml.R index aca00a3c1c..5a03508828 100644 --- a/input/gcamdata/R/zchunk_batch_elec_segments_water_USA_xml.R +++ b/input/gcamdata/R/zchunk_batch_elec_segments_water_USA_xml.R @@ -26,7 +26,7 @@ module_gcamusa_batch_elec_segments_water_USA_xml <- function(command, ...) { "L2233.GlobalTechCapture_elecS_cool_USA", "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", @@ -48,7 +48,6 @@ module_gcamusa_batch_elec_segments_water_USA_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", @@ -123,7 +122,7 @@ module_gcamusa_batch_elec_segments_water_USA_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.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") @@ -146,7 +145,6 @@ module_gcamusa_batch_elec_segments_water_USA_xml <- function(command, ...) { L2233.StubTechElecMarket_backup_elecS_cool_USA <- get_data(all_data,"L2233.StubTechElecMarket_backup_elecS_cool_USA") L2233.StubTechFixOut_elecS_cool_USA<- get_data(all_data,"L2233.StubTechFixOut_elecS_cool_USA") L2233.StubTechFixOut_hydro_elecS_cool_USA<- get_data(all_data,"L2233.StubTechFixOut_hydro_elecS_cool_USA") - L2233.StubTechMarket_backup_elecS_cool_USA <- get_data(all_data,"L2233.StubTechMarket_backup_elecS_cool_USA") L2233.StubTechShrwt_elecS_cool_USA <- get_data(all_data, "L2233.StubTechShrwt_elecS_cool_USA") L2233.StubTechInterp_elecS_cool_USA <- get_data(all_data, "L2233.StubTechInterp_elecS_cool_USA") L2233.StubTechCost_offshore_wind_elecS_cool_USA <- get_data(all_data,"L2233.StubTechCost_offshore_wind_elecS_cool_USA") @@ -214,14 +212,14 @@ module_gcamusa_batch_elec_segments_water_USA_xml <- function(command, ...) { } - 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.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,11 +229,9 @@ module_gcamusa_batch_elec_segments_water_USA_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) - L2233.StubTechMarket_backup_elecS_cool_USA <- rename(L2233.StubTechMarket_backup_elecS_cool_USA, stub.technology = technology) L2233.StubTechElecMarket_backup_elecS_cool_USA <- rename(L2233.StubTechElecMarket_backup_elecS_cool_USA, stub.technology = technology) L2233.StubTechProd_elecS_cool_USA <- rename(L2233.StubTechProd_elecS_cool_USA, stub.technology = technology) L2233.StubTechCapFactor_elecS_wind_USA <- rename(L2233.StubTechCapFactor_elecS_wind_USA, stub.technology = technology) @@ -287,7 +283,7 @@ module_gcamusa_batch_elec_segments_water_USA_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.GlobalIntTechValueFactor_elecS_cool_USA, "GlobalIntTechValueFactor") %>% 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, @@ -296,8 +292,6 @@ module_gcamusa_batch_elec_segments_water_USA_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, @@ -379,7 +373,7 @@ module_gcamusa_batch_elec_segments_water_USA_xml <- function(command, ...) { "L2233.GlobalTechCapture_elecS_cool_USA", "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", @@ -401,7 +395,6 @@ module_gcamusa_batch_elec_segments_water_USA_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/zchunk_batch_electricity_USA_xml.R b/input/gcamdata/R/zchunk_batch_electricity_USA_xml.R index 45d9c7d62d..add5790b42 100644 --- a/input/gcamdata/R/zchunk_batch_electricity_USA_xml.R +++ b/input/gcamdata/R/zchunk_batch_electricity_USA_xml.R @@ -40,7 +40,6 @@ module_gcamusa_batch_electricity_USA_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", @@ -102,7 +101,6 @@ module_gcamusa_batch_electricity_USA_xml <- function(command, ...) { L223.StubTechFixOut_hydro_USA <- get_data(all_data, "L223.StubTechFixOut_hydro_USA") L223.StubTechProd_elec_USA <- get_data(all_data, "L223.StubTechProd_elec_USA") L223.StubTechMarket_elec_USA <- get_data(all_data, "L223.StubTechMarket_elec_USA") - L223.StubTechMarket_backup_USA <- get_data(all_data, "L223.StubTechMarket_backup_USA") L223.StubTechElecMarket_backup_USA <- get_data(all_data, "L223.StubTechElecMarket_backup_USA") L223.StubTechCapFactor_elec_wind_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_wind_USA") L223.StubTechCapFactor_elec_solar_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_solar_USA") @@ -165,7 +163,6 @@ module_gcamusa_batch_electricity_USA_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") %>% @@ -217,7 +214,6 @@ module_gcamusa_batch_electricity_USA_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", diff --git a/input/gcamdata/R/zchunk_batch_electricity_water_xml.R b/input/gcamdata/R/zchunk_batch_electricity_water_xml.R index c1cb6fd309..b35a1df883 100644 --- a/input/gcamdata/R/zchunk_batch_electricity_water_xml.R +++ b/input/gcamdata/R/zchunk_batch_electricity_water_xml.R @@ -24,7 +24,7 @@ module_water_batch_electricity_water_xml <- function(command, ...) { "L223.SubsectorShrwt_nuc", "L223.SubsectorShrwt_renew", "L2233.AvgFossilEffKeyword_elec_cool", - "L2233.GlobalIntTechBackup_elec_cool", + "L2233.GlobalIntTechValueFactor_elec_cool", "L2233.GlobalIntTechCapFac_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", @@ -84,7 +84,7 @@ module_water_batch_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.GlobalIntTechBackup_elec_cool <- get_data(all_data, "L2233.GlobalIntTechBackup_elec_cool") + L2233.GlobalIntTechValueFactor_elec_cool <- get_data(all_data, "L2233.GlobalIntTechValueFactor_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") L2233.GlobalIntTechLifetime_elec_cool <- get_data(all_data, "L2233.GlobalIntTechLifetime_elec_cool") @@ -138,7 +138,7 @@ module_water_batch_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 ) # Produce outputs create_xml("electricity_water.xml") %>% @@ -156,7 +156,7 @@ module_water_batch_electricity_water_xml <- function(command, ...) { 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.GlobalIntTechValueFactor_elec_cool, "GlobalIntTechValueFactor") %>% add_xml_data(L2233.GlobalIntTechCapFac_elec_cool, "GlobalIntTechCapFac") %>% add_xml_data(L2233.GlobalIntTechEff_elec_cool, "GlobalIntTechEff") %>% add_xml_data(L2233.GlobalIntTechLifetime_elec_cool, "GlobalIntTechLifetime") %>% @@ -209,7 +209,7 @@ module_water_batch_electricity_water_xml <- function(command, ...) { "L223.SubsectorShrwt_nuc", "L223.SubsectorShrwt_renew", "L2233.AvgFossilEffKeyword_elec_cool", - "L2233.GlobalIntTechBackup_elec_cool", + "L2233.GlobalIntTechValueFactor_elec_cool", "L2233.GlobalIntTechCapFac_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", diff --git a/input/gcamdata/R/zchunk_batch_electricity_xml.R b/input/gcamdata/R/zchunk_batch_electricity_xml.R index 1cd173bea9..83a2c2cdad 100644 --- a/input/gcamdata/R/zchunk_batch_electricity_xml.R +++ b/input/gcamdata/R/zchunk_batch_electricity_xml.R @@ -41,7 +41,7 @@ module_energy_batch_electricity_xml <- function(command, ...) { "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", "L223.GlobalTechCapture_elec", - "L223.GlobalIntTechBackup_elec", + "L223.GlobalIntTechValueFactor_elec", "L223.StubTechCapFactor_elec", "L223.StubTechCost_offshore_wind", "L223.GlobalTechSCurve_elec", @@ -90,7 +90,7 @@ module_energy_batch_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.GlobalIntTechBackup_elec <- get_data(all_data, "L223.GlobalIntTechBackup_elec") + L223.GlobalIntTechValueFactor_elec <- get_data(all_data, "L223.GlobalIntTechValueFactor_elec") L223.StubTechCapFactor_elec <- get_data(all_data, "L223.StubTechCapFactor_elec") L223.StubTechCost_offshore_wind<- get_data(all_data, "L223.StubTechCost_offshore_wind") L223.GlobalTechSCurve_elec <- get_data(all_data, "L223.GlobalTechSCurve_elec") @@ -145,7 +145,7 @@ module_energy_batch_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.GlobalIntTechValueFactor_elec, "GlobalIntTechValueFactor") %>% add_xml_data(L223.StubTechCapFactor_elec, "StubTechCapFactor") %>% add_xml_data(L223.StubTechCost_offshore_wind, "StubTechCost") %>% add_xml_data(L223.GlobalTechSCurve_elec, "GlobalTechSCurve") %>% @@ -187,7 +187,7 @@ module_energy_batch_electricity_xml <- function(command, ...) { "L223.PrimaryRenewKeywordInt_elec", "L223.AvgFossilEffKeyword_elec", "L223.GlobalTechCapture_elec", - "L223.GlobalIntTechBackup_elec", + "L223.GlobalIntTechValueFactor_elec", "L223.StubTechCapFactor_elec", "L223.StubTechCost_offshore_wind", "L223.GlobalTechSCurve_elec", diff --git a/input/gcamdata/data-raw/generate_package_data.R b/input/gcamdata/data-raw/generate_package_data.R index 0ed2db541e..40c257f577 100644 --- a/input/gcamdata/data-raw/generate_package_data.R +++ b/input/gcamdata/data-raw/generate_package_data.R @@ -196,7 +196,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", "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..7fb72271bd 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 a value factor for variable techs (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,0.946,-1.661 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/A26.globaltech_cost.csv b/input/gcamdata/inst/extdata/energy/A26.globaltech_cost.csv index 7112a62ddc..c1861130ab 100644 --- a/input/gcamdata/inst/extdata/energy/A26.globaltech_cost.csv +++ b/input/gcamdata/inst/extdata/energy/A26.globaltech_cost.csv @@ -1,13 +1,11 @@ # File: A26.globaltech_cost.csv # Title: Final energy delivery cost adders # Units: 1975 USD/GJ -# Description: The added cost to producer prices to get final energy delivery prices. 0 values indicate the delivery cost is included elsewhere. Backup electricity costs represent the costs of a gas turbine to manage base load, but CSP backup is included in the primary tech cost. +# Description: The added cost to producer prices to get final energy delivery prices. 0 values indicate the delivery cost is included elsewhere. # Source: pre-2006 Minicam model inputs # Column types: ccccnnnn # ---------- supplysector,subsector,technology,minicam.non.energy.input,1971,1975,2005,2100 -backup_electricity,gas,gas (steam/CT),non-energy,1.84,1.84,1.84,1.69 -csp_backup,gas,CSP gas hybrid mode,non-energy,0,0,0,0 delivered biomass,delivered biomass,delivered biomass,non-energy,0.14,0.14,0.14,0.14 delivered coal,delivered coal,delivered coal,non-energy,0.14,0.14,0.14,0.14 electricity_net_ownuse,electricity_net_ownuse,electricity_net_ownuse,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv b/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv index 14042cafa2..abcd9de9f2 100644 --- a/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv +++ b/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv @@ -5,8 +5,6 @@ # Column types: ccccnnn # ---------- supplysector,subsector,technology,minicam.energy.input,1971,2005,2100 -backup_electricity,gas,gas (steam/CT),wholesale gas,0.377,0.377,0.428 -csp_backup,gas,CSP gas hybrid mode,wholesale gas,0.307,0.307,0.358 delivered biomass,delivered biomass,delivered biomass,regional biomass,1,1,1 delivered coal,delivered coal,delivered coal,regional coal,1,1,1 electricity_net_ownuse,electricity_net_ownuse,electricity_net_ownuse,electricity,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv b/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv index 375e62e1d8..a2e736c431 100644 --- a/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv +++ b/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv @@ -6,8 +6,6 @@ # Column types: cccii # ---------- supplysector,subsector,technology,1971,2100 -backup_electricity,gas,gas (steam/CT),1,1 -csp_backup,gas,CSP gas hybrid mode,1,1 delivered biomass,delivered biomass,delivered biomass,1,1 delivered coal,delivered coal,delivered coal,1,1 electricity_net_ownuse,electricity_net_ownuse,electricity_net_ownuse,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A26.sector.csv b/input/gcamdata/inst/extdata/energy/A26.sector.csv index 5faaffbf1a..df79830eac 100644 --- a/input/gcamdata/inst/extdata/energy/A26.sector.csv +++ b/input/gcamdata/inst/extdata/energy/A26.sector.csv @@ -1,13 +1,11 @@ # File: A26.sector.csv -# Title: Final energy delivery and reliability (backup) sectors - supplysector characteristics +# Title: Final energy delivery sectors - supplysector characteristics # Units: NA # Description: Characteristics of supply sectors for final energy delivery and reliability, setting the Units for price and inputs as well as the logit exponent. # Source: NA # Column types: ccccic # ---------- supplysector,output.unit,input.unit,price.unit,logit.exponent,logit.type -backup_electricity,EJ,EJ,1975$/GJ,-3, -csp_backup,EJ,EJ,1975$/GJ,-3, delivered biomass,EJ,EJ,1975$/GJ,-3, delivered coal,EJ,EJ,1975$/GJ,-3, electricity_net_ownuse,EJ,EJ,1975$/GJ,-3, diff --git a/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv b/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv index 046da86ecb..ed8e2d6840 100644 --- a/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv +++ b/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv @@ -6,8 +6,6 @@ # Column types: ccic # ---------- supplysector,subsector,logit.exponent,logit.type -backup_electricity,gas,-6, -csp_backup,gas,-6, delivered biomass,delivered biomass,-6, delivered coal,delivered coal,-6, electricity_net_ownuse,electricity_net_ownuse,-6, diff --git a/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv b/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv index a4ecbb5ca0..9ef107f939 100644 --- a/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv +++ b/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv @@ -6,8 +6,6 @@ # Column types: cccci # ---------- supplysector,subsector,year.fillout,year,share.weight -backup_electricity,gas,start-year,,1 -csp_backup,gas,start-year,,1 delivered biomass,delivered biomass,start-year,,1 delivered coal,delivered coal,start-year,,1 electricity_net_ownuse,electricity_net_ownuse,start-year,,1 diff --git a/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt b/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt index 0d7ee86e4e..fd1473d79f 100644 --- a/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt +++ b/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt @@ -349,6 +349,8 @@ GlobalIntTechProfitShutdown, global-technology-database/+{sector-name}location-i 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 +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 GlobalRenewTech, global-technology-database/+{sector-name}location-info, global-technology-database/+{subsector-name}location-info, location-info/+{name}technology, technology/+{year}period, period/+{name}renewable-input, scenario/world, scenario, world/global-technology-database, period/{name=CO2}CO2 diff --git a/input/gcamdata/man/module_energy_L223.electricity.Rd b/input/gcamdata/man/module_energy_L223.electricity.Rd index 8bd6e7992c..56271095cc 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_USA.Rd b/input/gcamdata/man/module_gcamusa_L223.electricity_USA.Rd index 22c763b273..a34fb072b5 100644 --- a/input/gcamdata/man/module_gcamusa_L223.electricity_USA.Rd +++ b/input/gcamdata/man/module_gcamusa_L223.electricity_USA.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_L2234.elec_segments_USA.Rd b/input/gcamdata/man/module_gcamusa_L2234.elec_segments_USA.Rd index 19ab8dcdba..a1069a6773 100644 --- a/input/gcamdata/man/module_gcamusa_L2234.elec_segments_USA.Rd +++ b/input/gcamdata/man/module_gcamusa_L2234.elec_segments_USA.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). diff --git a/input/gcamdata/man/module_gcamusa_LA2233.elec_segments_water_USA.Rd b/input/gcamdata/man/module_gcamusa_LA2233.elec_segments_water_USA.Rd index 4b55104187..51a2edd2a7 100644 --- a/input/gcamdata/man/module_gcamusa_LA2233.elec_segments_water_USA.Rd +++ b/input/gcamdata/man/module_gcamusa_LA2233.elec_segments_water_USA.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) From a3dd83027339ed454cbcaec80ff2360cf64fe707 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Tue, 14 Feb 2023 16:29:55 -0500 Subject: [PATCH 05/16] Update to use parsed-in values for value factor equation, rather than hard-coded values. --- cvs/objects/sectors/source/value_factor_calculator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvs/objects/sectors/source/value_factor_calculator.cpp b/cvs/objects/sectors/source/value_factor_calculator.cpp index 945ee2e258..55441515fb 100644 --- a/cvs/objects/sectors/source/value_factor_calculator.cpp +++ b/cvs/objects/sectors/source/value_factor_calculator.cpp @@ -166,7 +166,7 @@ double ValueFactorCalculator::getValueFactor( const string& aSector, double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); double valueFactor = 1.0; - valueFactor = std::max( ( 0.945 - 1.326 * renewElecShare ), util::getVerySmallNumber() ); + valueFactor = std::max( ( mValueFactorIntercept - mValueFactorSlope * renewElecShare ), util::getVerySmallNumber() ); return valueFactor; From c7b30e7716a38b292923aaff4377a1767aa724b5 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Wed, 1 Mar 2023 16:17:36 -0500 Subject: [PATCH 06/16] Removing extra qualification ValueFactorCalculator::getValueFactor --- cvs/objects/sectors/include/value_factor_calculator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvs/objects/sectors/include/value_factor_calculator.h b/cvs/objects/sectors/include/value_factor_calculator.h index 9922f39787..4a5bfb2ddf 100644 --- a/cvs/objects/sectors/include/value_factor_calculator.h +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -91,7 +91,7 @@ class ValueFactorCalculator : public IBackupCalculator, private boost::noncopyab const double aAverageGridCapacityFactor, const int aPeriod) const; - virtual double ValueFactorCalculator::getValueFactor(const std::string& aSector, + virtual double getValueFactor(const std::string& aSector, const std::string& aElectricSector, const std::string& aRegion, const int aPeriod) const; From 986ec4a3f9ec4deef310b5fb08571b4df9f5e0e8 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Mon, 6 Mar 2023 10:35:35 -0500 Subject: [PATCH 07/16] Removing errant declaration of boost::noncopyable. --- cvs/objects/sectors/include/value_factor_calculator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvs/objects/sectors/include/value_factor_calculator.h b/cvs/objects/sectors/include/value_factor_calculator.h index 4a5bfb2ddf..5f733aca83 100644 --- a/cvs/objects/sectors/include/value_factor_calculator.h +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -62,7 +62,7 @@ class IInfo; * sectors that produce electricity. * \author Josh Lurz */ -class ValueFactorCalculator : public IBackupCalculator, private boost::noncopyable { +class ValueFactorCalculator : public IBackupCalculator { public: ValueFactorCalculator(); virtual ValueFactorCalculator* clone() const; From 9fd62d08d1aab2a46854b890718176f690332bd2 Mon Sep 17 00:00:00 2001 From: Matt Mowers Date: Fri, 10 Mar 2023 13:33:45 -0500 Subject: [PATCH 08/16] Separate offshore wind from onshore wind trial market --- input/gcamdata/inst/extdata/energy/A23.globalinttech.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv b/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv index 7fb72271bd..97e2b31372 100644 --- a/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv +++ b/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv @@ -9,4 +9,4 @@ 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,0.946,-1.661 +electricity,wind,wind_offshore,electricity,wind_offshore,0.946,-1.661 From 5c98b79691531ad906d45ed8b089c2c16daab20e Mon Sep 17 00:00:00 2001 From: Matt Mowers Date: Fri, 17 Mar 2023 00:15:27 -0400 Subject: [PATCH 09/16] Fix electricity technology value factor calculation --- cvs/objects/sectors/source/value_factor_calculator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvs/objects/sectors/source/value_factor_calculator.cpp b/cvs/objects/sectors/source/value_factor_calculator.cpp index 55441515fb..70c46a6df6 100644 --- a/cvs/objects/sectors/source/value_factor_calculator.cpp +++ b/cvs/objects/sectors/source/value_factor_calculator.cpp @@ -166,7 +166,7 @@ double ValueFactorCalculator::getValueFactor( const string& aSector, double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); double valueFactor = 1.0; - valueFactor = std::max( ( mValueFactorIntercept - mValueFactorSlope * renewElecShare ), util::getVerySmallNumber() ); + valueFactor = std::max( ( mValueFactorIntercept + mValueFactorSlope * renewElecShare ), util::getVerySmallNumber() ); return valueFactor; From fb86da129ece9948d4b0ec2cd692557ddd3cfad0 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Mon, 26 Feb 2024 18:14:56 -0500 Subject: [PATCH 10/16] Fix error related to L2233.Elec_tables_globaltech[cost_SWInterp_Fltr] in module_water_L2233.electricity_water. --- input/gcamdata/R/zenergy_L223.electricity.R | 1 + 1 file changed, 1 insertion(+) diff --git a/input/gcamdata/R/zenergy_L223.electricity.R b/input/gcamdata/R/zenergy_L223.electricity.R index 3587766ea8..c8183295d2 100644 --- a/input/gcamdata/R/zenergy_L223.electricity.R +++ b/input/gcamdata/R/zenergy_L223.electricity.R @@ -1352,6 +1352,7 @@ module_energy_L223.electricity <- function(command, ...) { 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 From a607cc4c3408668723c622ae5fae97f6f06804c6 Mon Sep 17 00:00:00 2001 From: Matt Mowers Date: Mon, 18 Mar 2024 00:44:36 -0400 Subject: [PATCH 11/16] Update comments for new PLCOE and value factor approach --- .../sectors/include/ibackup_calculator.h | 17 +++--- .../sectors/include/value_factor_calculator.h | 17 +++--- .../source/value_factor_calculator.cpp | 18 +++---- .../include/intermittent_technology.h | 42 ++------------- .../source/intermittent_technology.cpp | 53 ++++++++----------- .../inst/extdata/energy/A23.globalinttech.csv | 2 +- 6 files changed, 52 insertions(+), 97 deletions(-) diff --git a/cvs/objects/sectors/include/ibackup_calculator.h b/cvs/objects/sectors/include/ibackup_calculator.h index 877196b3bd..1fee0dde50 100644 --- a/cvs/objects/sectors/include/ibackup_calculator.h +++ b/cvs/objects/sectors/include/ibackup_calculator.h @@ -41,7 +41,7 @@ * \file ibackup_calculator.h * \ingroup Objects * \brief The IBackupCalculator interface header file. - * \author Marshall Wise, Josh Lurz + * \author Marshall Wise, Josh Lurz, Matthew Binsted, Matt Mowers */ #include @@ -58,14 +58,13 @@ 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 - * 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. - * \author Josh Lurz + * \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 IBackupCalculator : public INamed, private boost::noncopyable { public: diff --git a/cvs/objects/sectors/include/value_factor_calculator.h b/cvs/objects/sectors/include/value_factor_calculator.h index 5f733aca83..a4b084a1e8 100644 --- a/cvs/objects/sectors/include/value_factor_calculator.h +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -41,7 +41,7 @@ * \file value_factor_calculator.h * \ingroup Objects * \brief The ValueFactorCalculator class header file. - * \author Josh Lurz + * \author Matthew Binsted, Matt Mowers */ #include @@ -53,14 +53,13 @@ class IInfo; /*! * \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 - * 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. - * \author Josh Lurz + * \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: diff --git a/cvs/objects/sectors/source/value_factor_calculator.cpp b/cvs/objects/sectors/source/value_factor_calculator.cpp index 70c46a6df6..5880522d47 100644 --- a/cvs/objects/sectors/source/value_factor_calculator.cpp +++ b/cvs/objects/sectors/source/value_factor_calculator.cpp @@ -35,7 +35,7 @@ * \file value_factor_calculator.cpp * \ingroup Objects * \brief ValueFactorCalculator class source file. - * \author Josh Lurz, Sonny Kim + * \author Matthew Binsted, Matt Mowers */ #include "util/base/include/definitions.h" @@ -86,7 +86,6 @@ const string& ValueFactorCalculator::getName() const { * 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& ValueFactorCalculator::getXMLNameStatic() { @@ -142,13 +141,14 @@ double ValueFactorCalculator::getAverageBackupCapacity(const string& aSector, } /*! - * \brief Compute value factor for intermittent technology. - * \details Compute value factor for intermittent technology, - * which will decrease as market share increases. - * This value factor will then be used to scale technology cost. - * \param aSector The name of the sector which requires backup capacity. - * \param aElectricSector The name of the electricity sector into which the - * sector having a backup amount calculated for will feed. + * \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). diff --git a/cvs/objects/technologies/include/intermittent_technology.h b/cvs/objects/technologies/include/intermittent_technology.h index cc8eb9fbb0..c1e47911e3 100644 --- a/cvs/objects/technologies/include/intermittent_technology.h +++ b/cvs/objects/technologies/include/intermittent_technology.h @@ -42,7 +42,7 @@ * \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 @@ -58,23 +58,8 @@ class IInfo; * resource. * \details An intermittent subsector 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 + * their value factor reduction as a function of market share. * XML specification for IntermittentTechnology * - XML name: \c intermittent-technology * - Contained by: Subsector @@ -84,7 +69,7 @@ class IInfo; * - \c wind-backup-calculator WindBackupCalculator * - \c capacity-limit-backup-calculator CapacityLimitBackupCalculator * - * \author Marshall Wise, Josh Lurz + * \author Marshall Wise, Josh Lurz, Matthew Binsted, Matt Mowers */ class IntermittentTechnology: public Technology { public: @@ -133,8 +118,7 @@ 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. @@ -151,25 +135,9 @@ 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 ), diff --git a/cvs/objects/technologies/source/intermittent_technology.cpp b/cvs/objects/technologies/source/intermittent_technology.cpp index 27bcb523a3..9fa009bb82 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" @@ -142,7 +142,7 @@ const string& IntermittentTechnology::getXMLNameStatic() { /*! \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 @@ -174,9 +174,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, @@ -192,15 +192,6 @@ void IntermittentTechnology::completeInit( const string& aRegionName, 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 intermittent technology to be for market. @@ -218,8 +209,7 @@ void IntermittentTechnology::completeInit( const string& aRegionName, mElectricSectorMarket = aRegionName; } - // Create trial market for intermettent technology if backup exists and needs to be - // calculated. + // Create trial market for intermittent technology if(mValueFactorCalculator){ SectorUtils::createTrialSupplyMarket( aRegionName, mTrialMarketName, mIntermittTechInfo.get(), mElectricSectorMarket ); MarketDependencyFinder* depFinder = scenario->getMarketplace()->getDependencyFinder(); @@ -233,7 +223,7 @@ void IntermittentTechnology::completeInit( const string& aRegionName, } } - // Warn if a backup calculator was not read-in. + // Warn if a value factor calculator was not read-in. if( !mValueFactorCalculator){ ILogger& mainLog = ILogger::getLogger( "main_log" ); mainLog.setLevel( ILogger::NOTICE ); @@ -307,7 +297,7 @@ 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 ); } @@ -325,12 +315,12 @@ double IntermittentTechnology::getResourceToEnergyRatio(const string& aRegionNam 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. */ @@ -357,11 +347,10 @@ void IntermittentTechnology::calcCost( const string& aRegionName, } /*! - * \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. @@ -398,7 +387,7 @@ void IntermittentTechnology::initializeInputLocations( const string& aRegionName } } - // Check that both the resource and backup input were set. + // Check that the resource input was set. if( mResourceInput == mInputs.end() ){ // There already was a resource input. ILogger& mainLog = ILogger::getLogger( "main_log" ); diff --git a/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv b/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv index 97e2b31372..351807389a 100644 --- a/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv +++ b/input/gcamdata/inst/extdata/energy/A23.globalinttech.csv @@ -1,7 +1,7 @@ # File: A23.globalinttech.csv # Title: Electricity sector intermittent technology information # Units: unitless for value factor intercept and slope -# Description: parameters used to calculate a value factor for variable techs (bounds = (0;1)) +# 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,intermittent.technology,electric.sector.name,trial.market.name,value.factor.intercept,value.factor.slope From 5d47ed44dd03107ea79a3189386e8c8db93381d8 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Fri, 22 Mar 2024 15:41:12 -0400 Subject: [PATCH 12/16] Bugfix for gcam-usa related to PLCOE setup. --- input/gcamdata/R/zgcamusa_L2234.elec_segments.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/input/gcamdata/R/zgcamusa_L2234.elec_segments.R b/input/gcamdata/R/zgcamusa_L2234.elec_segments.R index 21a2fdf11e..02c3115353 100644 --- a/input/gcamdata/R/zgcamusa_L2234.elec_segments.R +++ b/input/gcamdata/R/zgcamusa_L2234.elec_segments.R @@ -533,9 +533,11 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { year, minicam.energy.input, market.name) -> L2234.StubTechMarket_elecS_USA # Backup markets - L223.StubTechMarket_elec_USA %>% - distinct(region, supplysector, subsector, stub.technology, year) %>% - semi_join(L223.GlobalIntTechValueFactor_elec, by= c("subsector" = "subsector.name", "stub.technology" = "intermittent.technology")) %>% + L2234.StubTechMarket_elecS_USA %>% + # filter for intermittent technologies + semi_join(L2234.GlobalIntTechShrwt_elecS, by = c("supplysector" = "sector.name", + "subsector" = "subsector.name", + "stub.technology" = "intermittent.technology")) %>% left_join_error_no_match(states_subregions, by = c("region" = "state")) %>% select(region, supplysector, subsector, stub.technology, year, electric.sector.market = grid_region) -> L2234.StubTechElecMarket_backup_elecS_USA From 7ffc87def4ee8331e1620e5aa8fc47a12257b633 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Fri, 29 Mar 2024 18:24:48 -0400 Subject: [PATCH 13/16] Change subsector shareweight interpolation rules for wind and solar. --- input/gcamdata/inst/extdata/energy/A23.subsector_interp.csv | 6 +++--- input/gcamdata/inst/extdata/energy/A23.subsector_shrwt.csv | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 From d13a2e4888f799ff4e488270efa80705e388937a Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Tue, 11 Jun 2024 00:25:27 -0400 Subject: [PATCH 14/16] Minor C++ code cleanup. --- .../sectors/include/value_factor_calculator.h | 9 ----- .../source/value_factor_calculator.cpp | 38 +------------------ .../include/intermittent_technology.h | 7 ---- .../source/intermittent_technology.cpp | 6 --- 4 files changed, 2 insertions(+), 58 deletions(-) diff --git a/cvs/objects/sectors/include/value_factor_calculator.h b/cvs/objects/sectors/include/value_factor_calculator.h index a4b084a1e8..e6d02ed436 100644 --- a/cvs/objects/sectors/include/value_factor_calculator.h +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -96,15 +96,6 @@ class ValueFactorCalculator : public IBackupCalculator { const int aPeriod) const; protected: - - double calcIntermittentShare(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; // Define data such that introspection utilities can process the data from this // subclass together with the data members of the parent classes. diff --git a/cvs/objects/sectors/source/value_factor_calculator.cpp b/cvs/objects/sectors/source/value_factor_calculator.cpp index 5880522d47..feb1c832b9 100644 --- a/cvs/objects/sectors/source/value_factor_calculator.cpp +++ b/cvs/objects/sectors/source/value_factor_calculator.cpp @@ -56,8 +56,8 @@ using namespace std; */ ValueFactorCalculator::ValueFactorCalculator() { - mValueFactorIntercept = 0.945; - mValueFactorSlope = -1.326; + mValueFactorIntercept = 1.0; + mValueFactorSlope = 0.0; } // Documentation is inherited. @@ -171,37 +171,3 @@ double ValueFactorCalculator::getValueFactor( const string& aSector, return valueFactor; } - -/*! - * \brief Calculate the capacity share of the intermittent resource within the - * electricity sector. - * \details Calculates the share of capacity of the intermittent resource within - * the electricity sector. This is determined using trial values for - * the intermittent sector and electricity sector production. The - * production is converted to capacity using constant capacity factors. - * \param aSector The name of the sector which requires backup capacity. - * \param aElectricSector The name of the electricity sector into which the - * sector having a backup amount calculated for will feed. - * \param aResource The name of the resource the sector consumes. - * \param aRegion Name of the containing region. - * \param aReserveMargin Reserve margin for the electricity sector. - * \param aAverageGridCapacityFactor The average electricity grid capacity - * factor. - * \param aPeriod Model period. - * \return Share of the intermittent resource within within the electricity - * sector. - */ -double ValueFactorCalculator::calcIntermittentShare( 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 -{ - - double capacityShare = std::min( std::max( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 0.0 ), 1.0 ) * - aAverageGridCapacityFactor / aTechCapacityFactor; - return capacityShare; -} diff --git a/cvs/objects/technologies/include/intermittent_technology.h b/cvs/objects/technologies/include/intermittent_technology.h index c1e47911e3..27704bb100 100644 --- a/cvs/objects/technologies/include/intermittent_technology.h +++ b/cvs/objects/technologies/include/intermittent_technology.h @@ -138,13 +138,6 @@ class IntermittentTechnology: public Technology { //! Cached input containing the technology costs. DEFINE_VARIABLE( SIMPLE | NOT_PARSABLE, "tech-cost-input-pointer", mTechCostInput, InputIterator ), - //! 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 ratio DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "tech-output-ratio", mIntermitOutTechRatio, Value ) ) diff --git a/cvs/objects/technologies/source/intermittent_technology.cpp b/cvs/objects/technologies/source/intermittent_technology.cpp index 9fa009bb82..c34a8a9c18 100644 --- a/cvs/objects/technologies/source/intermittent_technology.cpp +++ b/cvs/objects/technologies/source/intermittent_technology.cpp @@ -71,7 +71,6 @@ IntermittentTechnology::IntermittentTechnology( const string& aName, const int a :Technology( aName, aYear ) { mElectricSectorName = "electricity"; - mElecReserveMargin = 0.15; mValueFactorCalculator = 0; @@ -81,7 +80,6 @@ IntermittentTechnology::IntermittentTechnology( const string& aName, const int a IntermittentTechnology::IntermittentTechnology() { mElectricSectorName = "electricity"; - mElecReserveMargin = 0.15; mValueFactorCalculator = 0; @@ -187,10 +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 ); // Inititalize info object mIntermittTechInfo.reset( InfoFactory::constructInfo( 0, getName() ) ); From 21021d933258e4d2425418fdab4b2dd37c7a6456 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Wed, 9 Oct 2024 17:19:24 -0400 Subject: [PATCH 15/16] Re-incorporate option for using previous backup-capacity approach to VRE integration. Includes C++ code changes and gcamdata changes (using a switch in constants.R). --- cvs/objects/build/vc10/objects.vcxproj | 6 + .../build/vc10/objects.vcxproj.filters | 18 + .../functions/include/non_energy_input.h | 1 + .../sectors/include/CSP_backup_calculator.h | 128 ++++ .../capacity_limit_backup_calculator.h | 157 +++++ .../sectors/include/ibackup_calculator.h | 24 +- .../sectors/source/CSP_backup_calculator.cpp | 224 +++++++ .../capacity_limit_backup_calculator.cpp | 305 +++++++++ .../include/backup_intermittent_technology.h | 223 +++++++ .../include/intermittent_technology.h | 6 +- .../technologies/include/itechnology.h | 3 +- .../source/backup_intermittent_technology.cpp | 579 ++++++++++++++++++ .../source/technology_container.cpp | 2 + .../util/base/include/gcam_data_containers.h | 1 + input/gcamdata/R/constants.R | 5 + input/gcamdata/R/sysdata.rda | Bin 6211 -> 6188 bytes input/gcamdata/R/xml.R | 2 +- input/gcamdata/R/zenergy_L223.electricity.R | 40 +- .../gcamdata/R/zenergy_L226.en_distribution.R | 22 + input/gcamdata/R/zenergy_xml_electricity.R | 102 +-- input/gcamdata/R/zgcamusa_L223.electricity.R | 38 +- .../R/zgcamusa_L2232.electricity_FERC.R | 8 +- .../R/zgcamusa_L2233.elec_segments_water.R | 67 +- .../gcamdata/R/zgcamusa_L2234.elec_segments.R | 66 +- input/gcamdata/R/zgcamusa_xml_elec_segments.R | 29 +- .../R/zgcamusa_xml_elec_segments_water.R | 31 +- input/gcamdata/R/zgcamusa_xml_electricity.R | 11 + .../R/zwater_L2233.electricity_water.R | 12 +- .../gcamdata/R/zwater_xml_electricity_water.R | 22 +- .../gcamdata/data-raw/generate_package_data.R | 4 +- .../energy/A23.globalinttech_backup.csv | 15 + .../extdata/energy/A26.globaltech_cost.csv | 4 +- .../extdata/energy/A26.globaltech_eff.csv | 2 + .../extdata/energy/A26.globaltech_shrwt.csv | 2 + .../inst/extdata/energy/A26.sector.csv | 4 +- .../extdata/energy/A26.subsector_logit.csv | 2 + .../extdata/energy/A26.subsector_shrwt.csv | 2 + .../mi_headers/ModelInterface_headers.txt | 2 +- 38 files changed, 2055 insertions(+), 114 deletions(-) create mode 100644 cvs/objects/sectors/include/CSP_backup_calculator.h create mode 100644 cvs/objects/sectors/include/capacity_limit_backup_calculator.h create mode 100644 cvs/objects/sectors/source/CSP_backup_calculator.cpp create mode 100644 cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp create mode 100644 cvs/objects/technologies/include/backup_intermittent_technology.h create mode 100644 cvs/objects/technologies/source/backup_intermittent_technology.cpp create mode 100644 input/gcamdata/inst/extdata/energy/A23.globalinttech_backup.csv diff --git a/cvs/objects/build/vc10/objects.vcxproj b/cvs/objects/build/vc10/objects.vcxproj index 06e07d6935..eedbce5646 100644 --- a/cvs/objects/build/vc10/objects.vcxproj +++ b/cvs/objects/build/vc10/objects.vcxproj @@ -630,6 +630,8 @@ + + @@ -680,6 +682,7 @@ + @@ -909,6 +912,8 @@ + + @@ -967,6 +972,7 @@ + diff --git a/cvs/objects/build/vc10/objects.vcxproj.filters b/cvs/objects/build/vc10/objects.vcxproj.filters index 2465097c07..1c6f98096f 100644 --- a/cvs/objects/build/vc10/objects.vcxproj.filters +++ b/cvs/objects/build/vc10/objects.vcxproj.filters @@ -932,6 +932,15 @@ Source Files\sectors + + Source Files\sectors + + + Source Files\sectors + + + Source Files\technology + @@ -1891,5 +1900,14 @@ 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/CSP_backup_calculator.h b/cvs/objects/sectors/include/CSP_backup_calculator.h new file mode 100644 index 0000000000..d68a9bd8e1 --- /dev/null +++ b/cvs/objects/sectors/include/CSP_backup_calculator.h @@ -0,0 +1,128 @@ +/* +* 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 _CSP_BACKUP_CALCULATOR_H_ +#define _CSP_BACKUP_CALCULATOR_H_ +#if defined(_MSC_VER) +#pragma once +#endif + +/*! + * \file CSP_backup_calculator.h + * \ingroup Objects + * \brief The CSPBackupCalculator class header file. + * \author Marshall Wise + */ + +#include +#include "sectors/include/ibackup_calculator.h" +/*! + * \ingroup Objects + * \brief The backup calculator for the CSP (concentrated solar trough) technology. + * \details Calculates the amount of backup energy required per unit of output. This + * differs from the capacity_limit_backup_calculator in that the CSP + * backup retunrs energy reuqired rather than capacity.
+ * + * + * XML specification for CSPBackupCalculator + * - XML name: \c CSP-backup-calculator + * - Contained by: IntermittentSubsector + * - Parsing inherited from class: None + * - Attributes: None + * - Elements: None + * + * \author Marshall Wise + */ +class CSPBackupCalculator: public IBackupCalculator { +public: + CSPBackupCalculator(); + virtual CSPBackupCalculator* clone() const; + static const std::string& getXMLNameStatic(); + 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; +protected: + + double calcIntermittentShare( 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; + + // 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, + + // Parameters hard-coded in constructor for first step + //! Maximum Backup Fraction is the maximum backup fraction required. + DEFINE_VARIABLE( SIMPLE, "max-backup-fraction", mMaxBackupFraction, double ), + + //! Fraction of electric sector that is intermediate and peak + DEFINE_VARIABLE( SIMPLE, "max-sector-load-served", mMaxSectorLoadServed, double ), + + //! Backup function exponent parameter + DEFINE_VARIABLE( SIMPLE, "backup-exponent", mBackupExponent, double ), + + //! Fraction of year backup mode operates (during no-sun days) + DEFINE_VARIABLE( SIMPLE, "no-sun-days", mNoSunDayBackup, double ) + ) + + //! Backup fraction -- cached for reporting + mutable double mBackupFraction; +}; + +#endif // _CSP_BACKUP_CALCULATOR_H_ diff --git a/cvs/objects/sectors/include/capacity_limit_backup_calculator.h b/cvs/objects/sectors/include/capacity_limit_backup_calculator.h new file mode 100644 index 0000000000..3ca03d0b56 --- /dev/null +++ b/cvs/objects/sectors/include/capacity_limit_backup_calculator.h @@ -0,0 +1,157 @@ +/* +* 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 _CAPACITY_LIMIT_BACKUP_CALCULATOR_H_ +#define _CAPACITY_LIMIT_BACKUP_CALCULATOR_H_ +#if defined(_MSC_VER) +#pragma once +#endif + +/*! + * \file capacity_limit_backup_calculator.h + * \ingroup Objects + * \brief The CapacityLimitBackupCalculator class header file. + * \author Josh Lurz + */ + +#include +#include "sectors/include/ibackup_calculator.h" + +// Forward declaration +class IInfo; + +/*! + * \ingroup Objects + * \brief The backup calculator for a capacity limited resource. + * \details Calculates the amount of backup required per unit of output. The marginal + * backup requirement is computed as an exponential function with parameters that + * specify a maximum backup requirement, the point at which half of the maximum + * backup is required, and the steepness of the curve in reaching the maximum + * backup requirement
+ * + * functional form of marginal backup requirement is + * + * backupCapacity = mFmax / (1.0 + exp( mC * ( xmid - elecShare ) / mTau )) + * where mFmax is the maximum backup fraction (defaults to 1) + * mC and mTau are shape parameters + * (ratio of mC to mTau determined steepness to reach fMax) + * xmid is the value of the share at which backupCapacity = 0.5*fMax + * + * + * The integral of this function, which is used to compute total and average bakcup + * is given by + * + * totalBackup = mFmax * mTau / mC * ( log ( 1.0 + exp( c * ( xmid - elecShare ) / mTau)) + * - mC * ( xmid - elecShare ) / mTau) + * + * + * XML specification for CapacityLimitBackupCalculator + * - XML name: \c capacity-limit-backup-calculator + * - Contained by: Technology + * - Parsing inherited from class: None + * - Attributes: None + * - Elements: + * - \c capacity-limit CapacityLimitBackupCalculator::mCapacityLimit + * + * \author Josh Lurz, Marshall Wise + */ +class CapacityLimitBackupCalculator: public IBackupCalculator { +public: + CapacityLimitBackupCalculator(); + virtual CapacityLimitBackupCalculator* 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; +protected: + + double getMarginalBackupCapacityFraction( 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; + + double calcIntermittentShare( 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; + + // 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, + + //! Capacity limit which sets the fraction of total output at which the backup curve + //! returns a value of 50% of the upper limit for backup (i.e.,50 of mFmax) + DEFINE_VARIABLE( SIMPLE, "capacity-limit", mCapacityLimit, double ), + + //! Parameter for max rate of back up (e.g. specify 1 for 1-to-1 backup as max) + DEFINE_VARIABLE( SIMPLE, "fmax", mFmax, double ), + + //! Parameter for steepness of backup curve. Higher number means steeper ascent. + DEFINE_VARIABLE( SIMPLE, "c", mC, double ), + + //! Parameter for steepness of backup curve. Lower means steeper ascent. Ascent depends + //! on the ratio of c/tau + DEFINE_VARIABLE( SIMPLE, "tau", mTau, double ) + ) +}; + +#endif // _CAPACITY_LIMIT_BACKUP_CALCULATOR_H_ diff --git a/cvs/objects/sectors/include/ibackup_calculator.h b/cvs/objects/sectors/include/ibackup_calculator.h index 1fee0dde50..873ae2abf2 100644 --- a/cvs/objects/sectors/include/ibackup_calculator.h +++ b/cvs/objects/sectors/include/ibackup_calculator.h @@ -41,7 +41,7 @@ * \file ibackup_calculator.h * \ingroup Objects * \brief The IBackupCalculator interface header file. - * \author Marshall Wise, Josh Lurz, Matthew Binsted, Matt Mowers + * \author Marshall Wise, Josh Lurz */ #include @@ -54,17 +54,20 @@ class IInfo; class Tabs; // Need to forward declare the subclasses as well. -class ValueFactorCalculator; +class CapacityLimitBackupCalculator; +class CSPBackupCalculator; +class ValueFactorCalculator; /*! * \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 + * \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 + * technologies that produce electricity. + * \author Josh Lurz */ class IBackupCalculator : public INamed, private boost::noncopyable { public: @@ -149,7 +152,8 @@ class IBackupCalculator : public INamed, private boost::noncopyable { /* Declare all subclasses of Sector to allow automatic traversal of the * hierarchy under introspection. */ - DEFINE_SUBCLASS_FAMILY( IBackupCalculator, ValueFactorCalculator) + DEFINE_SUBCLASS_FAMILY( IBackupCalculator, CapacityLimitBackupCalculator, + CSPBackupCalculator, ValueFactorCalculator ) ) }; diff --git a/cvs/objects/sectors/source/CSP_backup_calculator.cpp b/cvs/objects/sectors/source/CSP_backup_calculator.cpp new file mode 100644 index 0000000000..ce980fe9de --- /dev/null +++ b/cvs/objects/sectors/source/CSP_backup_calculator.cpp @@ -0,0 +1,224 @@ +/* +* 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 CSP_backup_calculator.cpp + * \ingroup Objects + * \brief CSPBackupCalculator class source file. + * \author Josh Lurz + */ + +#include "util/base/include/definitions.h" +#include +#include + +#include "sectors/include/CSP_backup_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" +#include "containers/include/iinfo.h" + +using namespace std; + +/*! + * \brief Constructor. + */ +CSPBackupCalculator::CSPBackupCalculator() +{ + mMaxBackupFraction = 0.40; + mMaxSectorLoadServed = 0.15; + mBackupExponent = 4.0; +} + +// Documentation is inherited. +CSPBackupCalculator* CSPBackupCalculator::clone() const { + CSPBackupCalculator* clone = new CSPBackupCalculator(); + clone->mMaxBackupFraction = mMaxBackupFraction; + clone->mMaxSectorLoadServed = mMaxSectorLoadServed; + clone->mBackupExponent = mBackupExponent; + clone->mNoSunDayBackup = mNoSunDayBackup; + + return clone; +} + +// Documentation is inherited. +bool CSPBackupCalculator::isSameType( const std::string& aType ) const { + return aType == getXMLNameStatic(); +} + +// Documentation is inherited. +const string& CSPBackupCalculator::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. +* \author Josh Lurz, James Blackwood +* \return The constant XML_NAME as a static. +*/ +const string& CSPBackupCalculator::getXMLNameStatic() { + const static string XML_NAME = "CSP-backup-calculator"; + return XML_NAME; +} + +const string& CSPBackupCalculator::getXMLName() const { + return getXMLNameStatic(); +} + +// Documentation is inherited. +void CSPBackupCalculator::toDebugXML( const int aPeriod, ostream& aOut, Tabs* aTabs ) const { + XMLWriteOpeningTag( getXMLNameStatic(), aOut, aTabs ); + XMLWriteElement( mMaxBackupFraction, "max-backup-fraction", aOut, aTabs ); + XMLWriteElement( mNoSunDayBackup, "no-sun-days-backup", aOut, aTabs ); + XMLWriteElement( mBackupFraction, "backup-fraction", aOut, aTabs ); + XMLWriteElement( mBackupExponent, "backup-exponent", aOut, aTabs ); + XMLWriteClosingTag( getXMLNameStatic(), aOut, aTabs ); +} + +// Documentation is inherited. +void CSPBackupCalculator::initCalc( const IInfo* aTechInfo ) { + mMaxSectorLoadServed = aTechInfo->getDouble( "max-sector-load-served", true ); + double noSunDays = aTechInfo->getDouble( "no-sun-days", true ); + double randomMaintenanceFraction = aTechInfo->getDouble( "random-maintenance-fraction", true ); + double scheduledMaintenance = aTechInfo->getDouble( "scheduled-maintenance", true ); + + double justNoSunDayBackup = noSunDays / double( 365 ); + // The base level of backup needed is no-sun days minus time spent in scheduled maintenance that can occur on no-sun days + mNoSunDayBackup = justNoSunDayBackup + - min( scheduledMaintenance * ( 1 - randomMaintenanceFraction ), justNoSunDayBackup ); +} + +double CSPBackupCalculator::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 +{ + //! Marginal backup calculation is used for marginal cost of backup capacity + //! and used in the cost of backup for share equations. + //! This cost is not needed for CSP since the backup capacity comes as part + //! of the CSP technology and is contained in the CSP tech cost already. A zero is returned. + + return 0.0; +} +double CSPBackupCalculator::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 +{ + //! Average backup is needed for CSP since it is used to compute the amount + //! of energy used by the backup technology. + + // Preconditions + assert( !aSector.empty() ); + assert( !aElectricSector.empty() ); + assert( !aResource.empty() ); + assert( !aRegion.empty() ); + assert( aReserveMargin >= 0 ); + assert( aAverageGridCapacityFactor > 0 ); + + // Determine the intermittent share of output. + // Note that this method in CSP differs as it is based on energy share not capacity + double elecShare = calcIntermittentShare( aSector, aElectricSector, aResource, + aRegion, aTechCapacityFactor, aReserveMargin, aAverageGridCapacityFactor, + aPeriod ); + + // No backup required for zero share. + if( elecShare < util::getSmallNumber() ){ + return 0; + } + + // Calculate average backup energy not inclusing the no-sun days + // based on the approximation by Yabei Zhang + + mBackupFraction = mMaxBackupFraction * pow( elecShare, mBackupExponent ); + + // Convert to capacity. This needs to be done since Intermittent Subsector + // assumes it is getting a capacity number and converts back to energy. + // This will only work in energy units if we assign a capacity factor of 1 + // for the backup capacity factor and read in a one in the intermittent supply + // sector object for backup capacity factor + double backupCapacityFactor = 1.0; + + // Add no-sun days backup + mBackupFraction += mNoSunDayBackup; + + return SectorUtils::convertEnergyToCapacity( backupCapacityFactor, + mBackupFraction ); +} + +/*! + * \brief Calculate the share of the intermittent resource within the + * electricity sector. + * \details Calculates the share of energy of the intermittent resource within + * the electricity sector. This is determined using trial values for + * the intermittent sector and electricity sector production. + * \param aSector The name of the sector which requires backup capacity. + * \param aElectricSector The name of the electricity sector into which the + * sector having a backup amount calculated for will feed. + * \param aResource The name of the resource the sector consumes. + * \param aRegion Name of the containing region. + * \param aReserveMargin Reserve margin for the electricity sector. + * \param aAverageGridCapacityFactor The average electricity grid capacity + * factor. + * \param aPeriod Model period. + * \return Share of the intermittent resource within within the electricity + * sector. + */ +double CSPBackupCalculator::calcIntermittentShare( 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 +{ + //! Note that the CSP backup is based on share of energy, not capacity, + //! so capacity factor and conversions to capacity not used. + + return SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ) / mMaxSectorLoadServed; +} diff --git a/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp new file mode 100644 index 0000000000..ec29b679e1 --- /dev/null +++ b/cvs/objects/sectors/source/capacity_limit_backup_calculator.cpp @@ -0,0 +1,305 @@ +/* +* 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 capacity_limit_backup_calculator.cpp + * \ingroup Objects + * \brief CapacityLimitBackupCalculator class source file. + * \author Josh Lurz, Sonny Kim + */ + +#include "util/base/include/definitions.h" +#include +#include +#include + +#include "sectors/include/capacity_limit_backup_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. + */ +CapacityLimitBackupCalculator::CapacityLimitBackupCalculator() +{ + mCapacityLimit = 1.0; + mFmax = 1.0; + mC = 1.0; + mTau = 0.1; +} + +// Documentation is inherited. +CapacityLimitBackupCalculator* CapacityLimitBackupCalculator::clone() const { + CapacityLimitBackupCalculator* clone = new CapacityLimitBackupCalculator(); + clone->mCapacityLimit = mCapacityLimit; + clone->mFmax = mFmax; + clone->mC = mC; + clone->mTau = mTau; + + return clone; +} + +// Documentation is inherited. +bool CapacityLimitBackupCalculator::isSameType( const std::string& aType ) const { + return aType == getXMLNameStatic(); +} + +// Documentation is inherited. +const string& CapacityLimitBackupCalculator::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. +* \author Josh Lurz, James Blackwood +* \return The constant XML_NAME as a static. +*/ +const string& CapacityLimitBackupCalculator::getXMLNameStatic() { + const static string XML_NAME = "capacity-limit-backup-calculator"; + return XML_NAME; +} + +const string& CapacityLimitBackupCalculator::getXMLName() const { + return getXMLNameStatic(); +} + +// Documentation is inherited. +void CapacityLimitBackupCalculator::toDebugXML( const int aPeriod, ostream& aOut, Tabs* aTabs ) const { + XMLWriteOpeningTag( getXMLNameStatic(), aOut, aTabs ); + XMLWriteElement( mCapacityLimit, "capacity-limit", aOut, aTabs ); + XMLWriteElement( mFmax, "fmax", aOut, aTabs ); + XMLWriteElement( mC, "c", aOut, aTabs ); + XMLWriteElement( mTau, "tau", aOut, aTabs ); + XMLWriteClosingTag( getXMLNameStatic(), aOut, aTabs ); +} + +// Documentation is inherited. +void CapacityLimitBackupCalculator::initCalc( const IInfo* aTechInfo ) { + // No information needs to be passed in +} + +double CapacityLimitBackupCalculator::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 +{ + // Preconditions + assert( !aSector.empty() ); + assert( !aElectricSector.empty() ); + assert( !aResource.empty() ); + assert( !aRegion.empty() ); + assert( aReserveMargin >= 0 ); + assert( aAverageGridCapacityFactor > 0 ); + + double marginalBackup = getMarginalBackupCapacityFraction( aSector, + aElectricSector, + aResource, + aRegion, + aTechCapacityFactor, + aReserveMargin, + aAverageGridCapacityFactor, + aPeriod ); + + + // This is confusing but mathematically correct. The marginal backupCapacityFraction is in units of + // GW per GW. The denominator (intermittent sector capacity GW) needs to be converted to energy, + // therefore the quotient is divided by the conversion from capacity to energy, + // using the technology capacity factor, which is the same as multiplying by + // the conversion from energy to capacity as done here. Units returned here are GW/EJ. + + return SectorUtils::convertEnergyToCapacity( aTechCapacityFactor, marginalBackup ); +} + +double CapacityLimitBackupCalculator::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 +{ + // Preconditions + assert( !aElectricSector.empty() ); + assert( !aResource.empty() ); + assert( !aRegion.empty() ); + assert( aReserveMargin >= 0 ); + assert( aAverageGridCapacityFactor > 0 ); + + // This function has an odd feature that at small shares the curve reverses sharply + // ultimately looking as if massive amounts of backup should be required. Clearly + // this isn't the intention so we will cap the trial share at the share value near + // the minimum "average backup" value. + double renewElecShare = std::max( + std::min( + SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), + // share should never exceed 1 + 1.0 ), + // avoid the steeply rising inflection point near the + // bottom of the curve by capping the share + 0.01 / mCapacityLimit ); + + + // Compute total backup using the integral of the marginal backup function + double xmid = mCapacityLimit; + double capacityRatio = aAverageGridCapacityFactor / aTechCapacityFactor; + double capacityShare = renewElecShare * capacityRatio; + + double totalBackup = mFmax * mTau / mC * ( log ( 1.0 + exp( mC * ( xmid - capacityShare ) / mTau ) ) + - mC * ( xmid - capacityShare ) / mTau ); + + // MAW believes this calculation of average backup is correct, but future generations should + // feel free to re-visit it. The S-curve backup function is + // already the marginal fraction of backup required as a function of the intermittent sector + // market share.(E.G., at 10% market share, the next unit of share needs 50% backup.) + // So integrating from 0 to the share does give the cumulative fraction of backup + // at that share, and dividing that integral by the share gives the average backup fraction + // up to that market share. + // This average is what is applied to the total output of the sector to get the total + // backup energy used. + double averageBackup = totalBackup / capacityShare; + + // This is confusing but mathematically correct. The averagebackupFraction is in units of + // GW per GW. The denominator (intermittent sector capacity GW) needs to be converted to energy, + // therefore the quotient is divided by the conversion from capacity to energy, + // using the technology capacity factor, which is the same as multiplying by + // the conversion from energy to capacity as done here. Units returned here are GW/EJ. + + return SectorUtils::convertEnergyToCapacity( aTechCapacityFactor, averageBackup ); +} + +/*! + * \brief Compute backup required per resource energy output. + * \details Compute backup required per resource energy output (since energy + * output is what the modeled market is based on). Convert intermittent + * resource output back to energy using the resource capacity factor. + * This is the cost of operating reserve or backup capacity. + * \param aSector The name of the sector which requires backup capacity. + * \param aElectricSector The name of the electricity sector into which the + * sector having a backup amount calculated for will feed. + * \param aResource The name of the resource the sector consumes. + * \param aRegion Name of the containing region. + * \param aReserveMargin Reserve margin for the electricity sector. + * \param aAverageGridCapacityFactor The average electricity grid capacity + * factor. + * \param aPeriod Model period. + * \return Reserve capacity per intermittent electricity resource output + * (GW/EJ). + */ +double CapacityLimitBackupCalculator::getMarginalBackupCapacityFraction( 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 +{ + // Preconditions + assert( aAverageGridCapacityFactor >= 0 && aAverageGridCapacityFactor <= 1 ); + assert( !aSector.empty() ); + assert( !aElectricSector.empty() ); + assert( !aResource.empty() ); + assert( !aRegion.empty() ); + + double renewElecShare = std::min( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 1.0 ); + + // No backup required for zero share. + if( renewElecShare < util::getVerySmallNumber() ){ + return 0; + } + + // Capacity limit must be between 0 and 1 inclusive. + assert( mCapacityLimit >= 0 && mCapacityLimit <= 1 ); + + // Calculate the marginal backup requirement at this share of the total. + double backupCapacity; + double xmid = mCapacityLimit; + + double capacityRatio = aAverageGridCapacityFactor / aTechCapacityFactor; + double capacityShare = renewElecShare * capacityRatio; + + backupCapacity = mFmax / ( 1.0 + exp( mC * ( xmid - capacityShare ) / mTau ) ); + + // This returned value is in terms of fraction of backup capacity per capacity + // of intermittent sector capacity (e.g., GW/GW) + + return backupCapacity; +} + +/*! + * \brief Calculate the capacity share of the intermittent resource within the + * electricity sector. + * \details Calculates the share of capacity of the intermittent resource within + * the electricity sector. This is determined using trial values for + * the intermittent sector and electricity sector production. The + * production is converted to capacity using constant capacity factors. + * \param aSector The name of the sector which requires backup capacity. + * \param aElectricSector The name of the electricity sector into which the + * sector having a backup amount calculated for will feed. + * \param aResource The name of the resource the sector consumes. + * \param aRegion Name of the containing region. + * \param aReserveMargin Reserve margin for the electricity sector. + * \param aAverageGridCapacityFactor The average electricity grid capacity + * factor. + * \param aPeriod Model period. + * \return Share of the intermittent resource within within the electricity + * sector. + */ +double CapacityLimitBackupCalculator::calcIntermittentShare( 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 +{ + + double capacityShare = std::min( std::max( SectorUtils::getTrialSupply( aRegion, aSector, aPeriod ), 0.0 ), 1.0 ) * + aAverageGridCapacityFactor / aTechCapacityFactor; + return capacityShare; +} 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..d579a7c9fb --- /dev/null +++ b/cvs/objects/technologies/include/backup_intermittent_technology.h @@ -0,0 +1,223 @@ +#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 subsector 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. + * 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 27704bb100..b523ec6460 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 @@ -160,4 +160,4 @@ class IntermittentTechnology: public Technology { 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..80eb242771 --- /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 interm_subsector.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/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 bc7cec470a..0cfaff3f3f 100644 --- a/cvs/objects/util/base/include/gcam_data_containers.h +++ b/cvs/objects/util/base/include/gcam_data_containers.h @@ -166,6 +166,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 a900fe54c892d998421f2c59c2ece17001f6af40..ba97d9a14ce9de32caae632d13bf991d651c7bc6 100644 GIT binary patch literal 6188 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 Kg$WMGC6*BN`dmN& literal 6211 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 + 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[["GlobalIntTechBackup"]])] + # Set global technology retirement information for all electricity sector technologies # ------------------------------------------------------------------------------------ @@ -1348,7 +1361,7 @@ module_energy_L223.electricity <- function(command, ...) { L223.GlobalTechCapture_elec L223.GlobalIntTechValueFactor_elec %>% - add_title("Capital costs of backup technologies for intermittent techs") %>% + 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") %>% @@ -1356,6 +1369,15 @@ module_energy_L223.electricity <- function(command, ...) { add_precursors("energy/A23.globalinttech") -> L223.GlobalIntTechValueFactor_elec + L223.GlobalIntTechBackup_elec %>% + 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") %>% + add_legacy_name("L223.GlobalIntTechBackup_elec") %>% + add_precursors("energy/A23.globalinttech_backup") -> + L223.GlobalIntTechBackup_elec + L223.StubTechCapFactor_elec %>% add_title("Capacity factors of stub technologies including wind and solar") %>% add_units("unitless fraction") %>% @@ -1656,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.GlobalIntTechValueFactor_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 dc19d1bb8b..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.GlobalIntTechValueFactor_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) { @@ -91,6 +92,7 @@ module_energy_electricity_xml <- function(command, ...) { 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") L223.GlobalTechSCurve_elec <- get_data(all_data, "L223.GlobalTechSCurve_elec") @@ -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.GlobalIntTechValueFactor_elec, "GlobalIntTechValueFactor") %>% 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.GlobalIntTechValueFactor_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 e4bd305948..2a4d3f2556 100644 --- a/input/gcamdata/R/zgcamusa_L223.electricity.R +++ b/input/gcamdata/R/zgcamusa_L223.electricity.R @@ -20,7 +20,7 @@ #' \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.StubTechElecMarket_backup_USA}, +#' \code{L223.StubTechMarket_elec_USA}, \code{L223.StubTechMarket_backup_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). #' @details This chunk generates input files to create an annualized electricity generation sector for each state @@ -49,6 +49,7 @@ module_gcamusa_L223.electricity <- function(command, ...) { "L223.StubTech_elec", "L223.StubTechEff_elec", "L223.StubTechCapFactor_elec", + "L223.GlobalIntTechBackup_elec", "L1231.in_EJ_state_elec_F_tech", "L1231.out_EJ_state_elec_F_tech", "L1232.out_EJ_sR_elec", @@ -91,6 +92,7 @@ module_gcamusa_L223.electricity <- 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", @@ -126,6 +128,7 @@ module_gcamusa_L223.electricity <- function(command, ...) { L223.StubTech_elec <- get_data(all_data, "L223.StubTech_elec", strip_attributes = TRUE) L223.StubTechEff_elec <- get_data(all_data, "L223.StubTechEff_elec", strip_attributes = TRUE) L223.StubTechCapFactor_elec <- get_data(all_data, "L223.StubTechCapFactor_elec", strip_attributes = TRUE) + L223.GlobalIntTechBackup_elec <- get_data(all_data, "L223.GlobalIntTechBackup_elec", strip_attributes = TRUE) L1231.in_EJ_state_elec_F_tech <- get_data(all_data, "L1231.in_EJ_state_elec_F_tech", strip_attributes = TRUE) L1231.out_EJ_state_elec_F_tech <- get_data(all_data, "L1231.out_EJ_state_elec_F_tech", strip_attributes = TRUE) L1232.out_EJ_sR_elec <- get_data(all_data, "L1232.out_EJ_sR_elec", strip_attributes = TRUE) @@ -503,6 +506,20 @@ module_gcamusa_L223.electricity <- function(command, ...) { select(-grid_region) -> L223.StubTechMarket_elec_USA + # L223.StubTechMarket_backup_USA: market names of backup inputs to state electricity sectors + 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", 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. + anti_join(A10.renewable_resource_delete, + by = c("region", "subsector" = "resource_elec_subsector")) %>% + select(LEVEL2_DATA_NAMES[["StubTechMarket"]]) -> + L223.StubTechMarket_backup_USA + # L223.StubTechCapFactor_elec_wind_USA: capacity factors for wind electricity in the states # Just use the subsector for matching - technologies include storage technologies as well L114.CapacityFactor_wind_state %>% @@ -570,6 +587,12 @@ module_gcamusa_L223.electricity <- function(command, ...) { filter(stub.technology == "wind_offshore", region %in% offshore_wind_states)) -> L223.StubTechMarket_elec_USA + L223.StubTechMarket_backup_USA %>% + filter(stub.technology != "wind_offshore") %>% + bind_rows(L223.StubTechMarket_backup_USA %>% + filter(stub.technology == "wind_offshore", + region %in% offshore_wind_states)) -> L223.StubTechMarket_backup_USA + # Replacing with correct state-specific offshore wind capacity factors L223.StubTechCapFactor_elec_wind_USA %>% filter(stub.technology == "wind_offshore", @@ -896,6 +919,17 @@ module_gcamusa_L223.electricity <- function(command, ...) { "L119.CapFacScaler_CSP_state") -> L223.StubTechMarket_elec_USA + L223.StubTechMarket_backup_USA %>% + add_title("Market names of backup inputs to state electricity sectors") %>% + add_units("Unitless") %>% + add_comments("Set market as USA") %>% + add_legacy_name("L223.StubTechMarket_backup_USA") %>% + add_precursors("L223.GlobalIntTechBackup_elec", + "gcam-usa/states_subregions", + "gcam-usa/A10.renewable_resource_delete", + "L119.CapFacScaler_CSP_state") -> + L223.StubTechMarket_backup_USA + if(exists("L223.StubTechElecMarket_backup_USA")) { L223.StubTechElecMarket_backup_USA %>% add_title("Market name of electricity sector for backup calculations") %>% @@ -951,6 +985,7 @@ module_gcamusa_L223.electricity <- function(command, ...) { "L223.StubTech_elec", "L223.StubTechEff_elec", "L223.StubTechCapFactor_elec", + "L223.GlobalIntTechBackup_elec", "L1231.in_EJ_state_elec_F_tech", "L1231.out_EJ_state_elec_F_tech", "L1232.out_EJ_sR_elec", @@ -994,6 +1029,7 @@ module_gcamusa_L223.electricity <- 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, diff --git a/input/gcamdata/R/zgcamusa_L2232.electricity_FERC.R b/input/gcamdata/R/zgcamusa_L2232.electricity_FERC.R index e3b2b9a20e..c28a186e7c 100644 --- a/input/gcamdata/R/zgcamusa_L2232.electricity_FERC.R +++ b/input/gcamdata/R/zgcamusa_L2232.electricity_FERC.R @@ -31,7 +31,7 @@ module_gcamusa_L2232.electricity_FERC <- function(command, ...) { "L126.in_EJ_state_td_elec", "L132.out_EJ_state_indchp_F", "L1232.out_EJ_sR_elec", - "L2234.StubTechElecMarket_backup_elecS_USA")) + "L223.StubTechMarket_backup_USA")) } else if(command == driver.DECLARE_OUTPUTS) { return(c("L2232.DeleteSupplysector_USAelec", "L2232.Supplysector_USAelec", @@ -72,7 +72,7 @@ module_gcamusa_L2232.electricity_FERC <- function(command, ...) { L126.in_EJ_state_td_elec <- get_data(all_data, "L126.in_EJ_state_td_elec") L132.out_EJ_state_indchp_F <- get_data(all_data, "L132.out_EJ_state_indchp_F") L1232.out_EJ_sR_elec <- get_data(all_data, "L1232.out_EJ_sR_elec") - L2234.StubTechElecMarket_backup_elecS_USA <- get_data(all_data, "L2234.StubTechElecMarket_backup_elecS_USA", strip_attributes = TRUE) + L223.StubTechMarket_backup_USA <- get_data(all_data, "L223.StubTechMarket_backup_USA", strip_attributes = TRUE) # This chunk builds the electric sector model with demand resolved at the grid region level. @@ -341,7 +341,7 @@ module_gcamusa_L2232.electricity_FERC <- function(command, ...) { # PART 3: THE STATES # L2232.StubTechElecMarket_backup_USA_FERC: electric sector name for states # Reset the electric sector market to the grid regions (for backup calculations) - L2234.StubTechElecMarket_backup_elecS_USA %>% + L223.StubTechMarket_backup_USA %>% select(LEVEL2_DATA_NAMES[["StubTechYr"]]) %>% left_join_error_no_match(select(states_subregions, electric.sector.market = grid_region, state), by = c("region" = "state")) -> @@ -531,7 +531,7 @@ module_gcamusa_L2232.electricity_FERC <- function(command, ...) { add_units("Unitless") %>% add_comments("Reset the electric sector market to the grid regions (for backup calculations)") %>% add_legacy_name("L2232.StubTechElecMarket_backup_USA") %>% - add_precursors("L2234.StubTechElecMarket_backup_elecS_USA") -> + add_precursors("L223.StubTechMarket_backup_USA") -> L2232.StubTechElecMarket_backup_USA return_data(L2232.DeleteSupplysector_USAelec, L2232.Supplysector_USAelec, L2232.SubsectorShrwtFllt_USAelec, diff --git a/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R b/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R index 9bd0973fce..9a3753b023 100644 --- a/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R +++ b/input/gcamdata/R/zgcamusa_L2233.elec_segments_water.R @@ -11,13 +11,14 @@ #' 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.GlobalIntTechValueFactor_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}, #' \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.StubTechProfitShutdown_elecS_cool_USA}, \code{L2233.StubTechShrwt_elecS_cool_USA}, \code{L2233.StubTechInterp_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.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) @@ -45,6 +46,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechCoef_elec_cool", "L2234.AvgFossilEffKeyword_elecS_USA", + "L2234.GlobalIntTechBackup_elecS_USA", "L2234.GlobalIntTechValueFactor_elecS_USA", "L2234.GlobalIntTechCapital_elecS_USA", "L2234.GlobalIntTechEff_elecS_USA", @@ -70,6 +72,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "L2234.StubTechElecMarket_backup_elecS_USA", "L2234.StubTechFixOut_elecS_USA", "L2234.StubTechFixOut_hydro_elecS_USA", + "L2234.StubTechMarket_backup_elecS_USA", "L2234.StubTechMarket_elecS_USA", "L2234.StubTechProd_elecS_USA", "L2234.SubsectorLogit_elecS_USA", @@ -114,6 +117,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "L2233.GlobalTechCapture_elecS_cool_USA", "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", @@ -136,6 +140,7 @@ module_gcamusa_L2233.elec_segments_water <- 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.StubTechShrwt_elecS_cool_USA", "L2233.StubTechInterp_elecS_cool_USA", @@ -192,6 +197,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { L2233.GlobalIntTechEff_elec_cool <- get_data(all_data, "L2233.GlobalIntTechEff_elec_cool", strip_attributes = TRUE) 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) @@ -217,6 +223,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { L2234.StubTechElecMarket_backup_elecS_USA <- get_data(all_data,"L2234.StubTechElecMarket_backup_elecS_USA", strip_attributes = TRUE) L2234.StubTechFixOut_elecS_USA <- get_data(all_data,"L2234.StubTechFixOut_elecS_USA", strip_attributes = TRUE) L2234.StubTechFixOut_hydro_elecS_USA <- get_data(all_data,"L2234.StubTechFixOut_hydro_elecS_USA", strip_attributes = TRUE) + L2234.StubTechMarket_backup_elecS_USA <- get_data(all_data,"L2234.StubTechMarket_backup_elecS_USA", strip_attributes = TRUE) L2234.StubTechMarket_elecS_USA <- get_data(all_data,"L2234.StubTechMarket_elecS_USA", strip_attributes = TRUE) L2234.StubTechProd_elecS_USA <- get_data(all_data,"L2234.StubTechProd_elecS_USA", strip_attributes = TRUE) L2234.SubsectorLogit_elecS_USA <- get_data(all_data,"L2234.SubsectorLogit_elecS_USA", strip_attributes = TRUE) @@ -544,6 +551,26 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { 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 L2234.GlobalIntTechCapital_elecS_USA %>% @@ -658,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 %>% @@ -824,6 +849,11 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { add_cooling_techs() -> L2233.StubTechFixOut_hydro_elecS_USA + L2234.StubTechMarket_backup_elecS_USA %>% + add_cooling_techs() %>% + mutate(technology = if_else(subsector == "rooftop_pv" | grepl("wind_base", subsector), subsector, technology)) -> + L2233.StubTechMarket_backup_elecS_USA + L2234.StubTechCost_offshore_wind_elecS_USA %>% add_cooling_techs() -> L2233.StubTechCost_offshore_wind_elecS_USA @@ -1257,6 +1287,14 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "gcam-usa/A23.elecS_tech_mapping_cool") -> L2233.AvgFossilEffKeyword_elecS_cool_USA + L2233.GlobalIntTechBackup_elecS_USA %>% + add_title("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% + add_units("none") %>% + add_comments("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% + add_legacy_name("L2233.GlobalIntTechBackup_elec") %>% + 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); @@ -1487,6 +1525,15 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { "gcam-usa/A23.elecS_tech_mapping_cool") -> L2233.StubTechCost_offshore_wind_elecS_cool_USA + L2233.StubTechMarket_backup_elecS_USA %>% + add_title("Backup Energy Inputs for Electricity Load Segments Intermittent Technologies") %>% + add_units("none") %>% + add_comments("Backup Energy Inputs for Electricity Load Segments Intermittent Technologies") %>% + add_legacy_name("L2233.StubTechMarket_backup_elec") %>% + add_precursors("L2234.StubTechMarket_backup_elecS_USA", + "gcam-usa/A23.elecS_tech_mapping_cool") -> + L2233.StubTechMarket_backup_elecS_cool_USA + L2233.StubTechInterp_elecS_cool_USA %>% add_title("Electricity Load Segments Stub Tech Interpolation Rules") %>% add_units("none") %>% @@ -1575,6 +1622,7 @@ module_gcamusa_L2233.elec_segments_water <- function(command, ...) { L2233.GlobalTechCapture_elecS_cool_USA, 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, @@ -1597,6 +1645,7 @@ module_gcamusa_L2233.elec_segments_water <- 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.StubTechShrwt_elecS_cool_USA, L2233.StubTechInterp_elecS_cool_USA, diff --git a/input/gcamdata/R/zgcamusa_L2234.elec_segments.R b/input/gcamdata/R/zgcamusa_L2234.elec_segments.R index 02c3115353..bb1bba0bf2 100644 --- a/input/gcamdata/R/zgcamusa_L2234.elec_segments.R +++ b/input/gcamdata/R/zgcamusa_L2234.elec_segments.R @@ -19,7 +19,7 @@ #' \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.GlobalIntTechValueFactor_elecS_USA}, -#' \code{L2234.StubTechMarket_elecS_USA}, \code{L2234.StubTechElecMarket_backup_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", @@ -59,6 +59,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L223.StubTechProd_elec_USA", "L223.StubTechFixOut_elec_USA", "L223.StubTechFixOut_hydro_USA", + "L223.StubTechMarket_backup_USA", "L223.StubTechCapFactor_elec_wind_USA", "L223.StubTechCapFactor_elec_solar_USA", "L223.GlobalTechCapFac_elec", @@ -76,6 +77,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L223.GlobalTechSCurve_elec", "L223.GlobalTechProfitShutdown_elec", "L223.GlobalTechCapture_elec", + "L223.GlobalIntTechBackup_elec", "L223.GlobalIntTechValueFactor_elec", "L223.PrimaryRenewKeyword_elec", "L223.PrimaryRenewKeywordInt_elec", @@ -114,8 +116,10 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "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", "L2234.StubTechProd_elecS_USA", "L2234.StubTechFixOut_elecS_USA", @@ -175,6 +179,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L223.StubTechProd_elec_USA <- get_data(all_data, "L223.StubTechProd_elec_USA", strip_attributes = TRUE) L223.StubTechFixOut_elec_USA <- get_data(all_data, "L223.StubTechFixOut_elec_USA", strip_attributes = TRUE) L223.StubTechFixOut_hydro_USA <- get_data(all_data, "L223.StubTechFixOut_hydro_USA", strip_attributes = TRUE) + L223.StubTechMarket_backup_USA <- get_data(all_data, "L223.StubTechMarket_backup_USA", strip_attributes = TRUE) L223.StubTechCapFactor_elec_wind_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_wind_USA", strip_attributes = TRUE) L223.StubTechCapFactor_elec_solar_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_solar_USA", strip_attributes = TRUE) L223.GlobalTechCapFac_elec <- get_data(all_data, "L223.GlobalTechCapFac_elec", strip_attributes = TRUE) @@ -192,6 +197,7 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L223.GlobalTechSCurve_elec <- get_data(all_data, "L223.GlobalTechSCurve_elec", strip_attributes = TRUE) 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) @@ -274,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. @@ -301,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. @@ -310,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. @@ -518,6 +524,14 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { 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 A23.elecS_inttech_mapping %>% @@ -533,11 +547,16 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { year, minicam.energy.input, market.name) -> L2234.StubTechMarket_elecS_USA # Backup markets - L2234.StubTechMarket_elecS_USA %>% - # filter for intermittent technologies - semi_join(L2234.GlobalIntTechShrwt_elecS, by = c("supplysector" = "sector.name", - "subsector" = "subsector.name", - "stub.technology" = "intermittent.technology")) %>% + L223.StubTechMarket_backup_USA %>% + # join is intended to duplicate rows; left_join_error_no_match throws error, so left_join used + left_join(A23.elecS_inttech_mapping, + by = c("supplysector", "subsector", "stub.technology" = "intermittent.technology")) %>% + filter(!is.na(minicam.energy.input)) %>% + select(region, supplysector = Electric.sector, subsector, stub.technology = Electric.sector.intermittent.technology, + year, minicam.energy.input, market.name) -> L2234.StubTechMarket_backup_elecS_USA + + L2234.StubTechMarket_backup_elecS_USA %>% + select(-minicam.energy.input, -market.name) %>% left_join_error_no_match(states_subregions, by = c("region" = "state")) %>% select(region, supplysector, subsector, stub.technology, year, electric.sector.market = grid_region) -> L2234.StubTechElecMarket_backup_elecS_USA @@ -1427,6 +1446,16 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L223.GlobalTechCapture_elec") -> L2234.GlobalTechCapture_elecS_USA + L2234.GlobalIntTechBackup_elecS %>% + add_title("Electricity Load Segments Intermittent Technology Backup Characteristics") %>% + add_units("1975$/kW/yr (backup.capital.cost); unitless") %>% + add_comments("Backup characteristics for electricity load segments intermittent technologies") %>% + add_legacy_name("L2234.GlobalIntTechBackup_elecS") %>% + add_precursors("gcam-usa/A23.elecS_inttech_mapping", + "gcam-usa/A23.elecS_tech_availability", + "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); @@ -1448,6 +1477,16 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { "L223.StubTechMarket_elec_USA") -> L2234.StubTechMarket_elecS_USA + L2234.StubTechMarket_backup_elecS_USA %>% + add_title("Backup Energy Inputs for Electricity Load Segments Intermittent Technologies") %>% + add_units("NA") %>% + add_comments("Backup energy inputs for intermittent electricity load segments technologies") %>% + add_legacy_name("L2234.StubTechMarket_backup_elecS_USA") %>% + add_precursors("gcam-usa/A23.elecS_inttech_mapping", + "gcam-usa/A23.elecS_tech_availability", + "L223.StubTechMarket_backup_USA") -> + L2234.StubTechMarket_backup_elecS_USA + L2234.StubTechElecMarket_backup_elecS_USA %>% add_title("Electricity Load Segments Sector Name for Backup Markets") %>% add_units("NA") %>% @@ -1456,7 +1495,6 @@ 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.GlobalIntTechValueFactor_elec", "L223.StubTechMarket_elec_USA") -> L2234.StubTechElecMarket_backup_elecS_USA @@ -1569,8 +1607,10 @@ module_gcamusa_L2234.elec_segments <- function(command, ...) { L2234.GlobalTechProfitShutdown_elecS_USA, 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, L2234.StubTechProd_elecS_USA, L2234.StubTechFixOut_elecS_USA, diff --git a/input/gcamdata/R/zgcamusa_xml_elec_segments.R b/input/gcamdata/R/zgcamusa_xml_elec_segments.R index 845a2a4585..7c0af2808c 100644 --- a/input/gcamdata/R/zgcamusa_xml_elec_segments.R +++ b/input/gcamdata/R/zgcamusa_xml_elec_segments.R @@ -44,8 +44,10 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "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", "L2234.StubTechProd_elecS_USA", "L2234.StubTechFixOut_elecS_USA", @@ -125,8 +127,10 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { L2234.GlobalTechProfitShutdown_elecS_USA <- get_data(all_data, "L2234.GlobalTechProfitShutdown_elecS_USA") 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") L2234.StubTechProd_elecS_USA <- get_data(all_data, "L2234.StubTechProd_elecS_USA") L2234.StubTechFixOut_elecS_USA <- get_data(all_data, "L2234.StubTechFixOut_elecS_USA") @@ -197,8 +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) - L2234.GlobalIntTechValueFactor_elecS_USA <- L2234.GlobalIntTechValueFactor_elecS_USA %>% - fix_global_tech_names() + 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) @@ -212,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") %>% @@ -232,7 +253,6 @@ 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.GlobalIntTechValueFactor_elecS_USA, "GlobalIntTechValueFactor") %>% add_xml_data(L2234.StubTechMarket_elecS_USA, "StubTechMarket") %>% add_xml_data(L2234.StubTechElecMarket_backup_elecS_USA, "StubTechElecMarket") %>% add_xml_data(L2234.StubTechProd_elecS_USA, "StubTechProd") %>% @@ -311,7 +331,6 @@ module_gcamusa_elec_segments_xml <- function(command, ...) { "L2234.GlobalTechProfitShutdown_elecS_USA", "L2234.GlobalTechSCurve_elecS_USA", "L2234.GlobalTechCapture_elecS_USA", - "L2234.GlobalIntTechValueFactor_elecS_USA", "L2234.StubTechMarket_elecS_USA", "L2234.StubTechElecMarket_backup_elecS_USA", "L2234.StubTechProd_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 8c1b8991c7..ab416e8247 100644 --- a/input/gcamdata/R/zgcamusa_xml_elec_segments_water.R +++ b/input/gcamdata/R/zgcamusa_xml_elec_segments_water.R @@ -26,6 +26,7 @@ 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.GlobalIntTechValueFactor_elecS_cool_USA", "L2233.GlobalIntTechCapital_elecS_USA", "L2233.GlobalIntTechCapital_elecS_cool_USA", @@ -48,6 +49,7 @@ 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", @@ -123,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.GlobalIntTechValueFactor_elecS_cool_USA<- get_data(all_data,"L2233.GlobalIntTechValueFactor_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") @@ -146,6 +149,7 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { L2233.StubTechElecMarket_backup_elecS_cool_USA <- get_data(all_data,"L2233.StubTechElecMarket_backup_elecS_cool_USA") L2233.StubTechFixOut_elecS_cool_USA<- get_data(all_data,"L2233.StubTechFixOut_elecS_cool_USA") L2233.StubTechFixOut_hydro_elecS_cool_USA<- get_data(all_data,"L2233.StubTechFixOut_hydro_elecS_cool_USA") + L2233.StubTechMarket_backup_elecS_cool_USA <- get_data(all_data,"L2233.StubTechMarket_backup_elecS_cool_USA") L2233.StubTechShrwt_elecS_cool_USA <- get_data(all_data, "L2233.StubTechShrwt_elecS_cool_USA") L2233.StubTechInterp_elecS_cool_USA <- get_data(all_data, "L2233.StubTechInterp_elecS_cool_USA") L2233.StubTechCost_offshore_wind_elecS_cool_USA <- get_data(all_data,"L2233.StubTechCost_offshore_wind_elecS_cool_USA") @@ -211,7 +215,7 @@ 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.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) @@ -232,6 +236,7 @@ module_gcamusa_elec_segments_water_xml <- function(command, ...) { 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) + L2233.StubTechMarket_backup_elecS_cool_USA <- rename(L2233.StubTechMarket_backup_elecS_cool_USA, stub.technology = technology) L2233.StubTechElecMarket_backup_elecS_cool_USA <- rename(L2233.StubTechElecMarket_backup_elecS_cool_USA, stub.technology = technology) L2233.StubTechProd_elecS_cool_USA <- rename(L2233.StubTechProd_elecS_cool_USA, stub.technology = technology) L2233.StubTechCapFactor_elecS_wind_USA <- rename(L2233.StubTechCapFactor_elecS_wind_USA, stub.technology = technology) @@ -278,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") %>% @@ -296,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.GlobalIntTechValueFactor_elecS_cool_USA, "GlobalIntTechValueFactor") %>% 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, @@ -385,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.GlobalIntTechValueFactor_elecS_cool_USA", "L2233.GlobalIntTechCapital_elecS_USA", "L2233.GlobalIntTechCapital_elecS_cool_USA", "L2233.GlobalIntTechEff_elecS_USA", diff --git a/input/gcamdata/R/zgcamusa_xml_electricity.R b/input/gcamdata/R/zgcamusa_xml_electricity.R index f2e2d044a6..beaabefa2b 100644 --- a/input/gcamdata/R/zgcamusa_xml_electricity.R +++ b/input/gcamdata/R/zgcamusa_xml_electricity.R @@ -39,6 +39,7 @@ 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", @@ -99,6 +100,7 @@ module_gcamusa_electricity_xml <- function(command, ...) { L223.StubTechFixOut_hydro_USA <- get_data(all_data, "L223.StubTechFixOut_hydro_USA") L223.StubTechProd_elec_USA <- get_data(all_data, "L223.StubTechProd_elec_USA") L223.StubTechMarket_elec_USA <- get_data(all_data, "L223.StubTechMarket_elec_USA") + L223.StubTechMarket_backup_USA <- get_data(all_data, "L223.StubTechMarket_backup_USA") L223.StubTechElecMarket_backup_USA <- get_data(all_data, "L223.StubTechElecMarket_backup_USA") L223.StubTechCapFactor_elec_wind_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_wind_USA") L223.StubTechCapFactor_elec_solar_USA <- get_data(all_data, "L223.StubTechCapFactor_elec_solar_USA") @@ -235,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 318bb9499d..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", "GlobalIntTechValueFactor_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", @@ -100,6 +100,7 @@ module_water_L2233.electricity_water <- function(command, ...) { "L2233.GlobalIntTechCoef_elec_cool", "L2233.AvgFossilEffKeyword_elec_cool", "L2233.GlobalIntTechValueFactor_elec_cool", + "L2233.GlobalIntTechBackup_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", "L2233.GlobalIntTechShrwt_elec_cool", @@ -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] @@ -736,6 +738,13 @@ module_water_L2233.electricity_water <- function(command, ...) { 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("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 %>% add_title("Cooling efficiencies of intermittent electricity generating technologies") %>% add_units("Unitless") -> @@ -1138,6 +1147,7 @@ module_water_L2233.electricity_water <- function(command, ...) { L2233.GlobalIntTechCoef_elec_cool, L2233.AvgFossilEffKeyword_elec_cool, L2233.GlobalIntTechValueFactor_elec_cool, + L2233.GlobalIntTechBackup_elec_cool, L2233.GlobalIntTechEff_elec_cool, L2233.GlobalIntTechLifetime_elec_cool, L2233.GlobalIntTechShrwt_elec_cool, diff --git a/input/gcamdata/R/zwater_xml_electricity_water.R b/input/gcamdata/R/zwater_xml_electricity_water.R index 12b1a5e753..4fddc2227d 100644 --- a/input/gcamdata/R/zwater_xml_electricity_water.R +++ b/input/gcamdata/R/zwater_xml_electricity_water.R @@ -25,6 +25,7 @@ module_water_electricity_water_xml <- function(command, ...) { "L223.SubsectorShrwt_renew", "L2233.AvgFossilEffKeyword_elec_cool", "L2233.GlobalIntTechValueFactor_elec_cool", + "L2233.GlobalIntTechBackup_elec_cool", "L2233.GlobalIntTechCapFac_elec_cool", "L2233.GlobalIntTechEff_elec_cool", "L2233.GlobalIntTechLifetime_elec_cool", @@ -86,6 +87,7 @@ module_water_electricity_water_xml <- function(command, ...) { 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") L2233.GlobalIntTechLifetime_elec_cool <- get_data(all_data, "L2233.GlobalIntTechLifetime_elec_cool") @@ -141,6 +143,7 @@ module_water_electricity_water_xml <- function(command, ...) { 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.GlobalIntTechValueFactor_elec_cool, "GlobalIntTechValueFactor") %>% + 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.GlobalIntTechValueFactor_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 3e9236df75..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,7 @@ 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", + 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") 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/A26.globaltech_cost.csv b/input/gcamdata/inst/extdata/energy/A26.globaltech_cost.csv index c1861130ab..7112a62ddc 100644 --- a/input/gcamdata/inst/extdata/energy/A26.globaltech_cost.csv +++ b/input/gcamdata/inst/extdata/energy/A26.globaltech_cost.csv @@ -1,11 +1,13 @@ # File: A26.globaltech_cost.csv # Title: Final energy delivery cost adders # Units: 1975 USD/GJ -# Description: The added cost to producer prices to get final energy delivery prices. 0 values indicate the delivery cost is included elsewhere. +# Description: The added cost to producer prices to get final energy delivery prices. 0 values indicate the delivery cost is included elsewhere. Backup electricity costs represent the costs of a gas turbine to manage base load, but CSP backup is included in the primary tech cost. # Source: pre-2006 Minicam model inputs # Column types: ccccnnnn # ---------- supplysector,subsector,technology,minicam.non.energy.input,1971,1975,2005,2100 +backup_electricity,gas,gas (steam/CT),non-energy,1.84,1.84,1.84,1.69 +csp_backup,gas,CSP gas hybrid mode,non-energy,0,0,0,0 delivered biomass,delivered biomass,delivered biomass,non-energy,0.14,0.14,0.14,0.14 delivered coal,delivered coal,delivered coal,non-energy,0.14,0.14,0.14,0.14 electricity_net_ownuse,electricity_net_ownuse,electricity_net_ownuse,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv b/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv index abcd9de9f2..14042cafa2 100644 --- a/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv +++ b/input/gcamdata/inst/extdata/energy/A26.globaltech_eff.csv @@ -5,6 +5,8 @@ # Column types: ccccnnn # ---------- supplysector,subsector,technology,minicam.energy.input,1971,2005,2100 +backup_electricity,gas,gas (steam/CT),wholesale gas,0.377,0.377,0.428 +csp_backup,gas,CSP gas hybrid mode,wholesale gas,0.307,0.307,0.358 delivered biomass,delivered biomass,delivered biomass,regional biomass,1,1,1 delivered coal,delivered coal,delivered coal,regional coal,1,1,1 electricity_net_ownuse,electricity_net_ownuse,electricity_net_ownuse,electricity,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv b/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv index a2e736c431..375e62e1d8 100644 --- a/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv +++ b/input/gcamdata/inst/extdata/energy/A26.globaltech_shrwt.csv @@ -6,6 +6,8 @@ # Column types: cccii # ---------- supplysector,subsector,technology,1971,2100 +backup_electricity,gas,gas (steam/CT),1,1 +csp_backup,gas,CSP gas hybrid mode,1,1 delivered biomass,delivered biomass,delivered biomass,1,1 delivered coal,delivered coal,delivered coal,1,1 electricity_net_ownuse,electricity_net_ownuse,electricity_net_ownuse,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A26.sector.csv b/input/gcamdata/inst/extdata/energy/A26.sector.csv index df79830eac..5faaffbf1a 100644 --- a/input/gcamdata/inst/extdata/energy/A26.sector.csv +++ b/input/gcamdata/inst/extdata/energy/A26.sector.csv @@ -1,11 +1,13 @@ # File: A26.sector.csv -# Title: Final energy delivery sectors - supplysector characteristics +# Title: Final energy delivery and reliability (backup) sectors - supplysector characteristics # Units: NA # Description: Characteristics of supply sectors for final energy delivery and reliability, setting the Units for price and inputs as well as the logit exponent. # Source: NA # Column types: ccccic # ---------- supplysector,output.unit,input.unit,price.unit,logit.exponent,logit.type +backup_electricity,EJ,EJ,1975$/GJ,-3, +csp_backup,EJ,EJ,1975$/GJ,-3, delivered biomass,EJ,EJ,1975$/GJ,-3, delivered coal,EJ,EJ,1975$/GJ,-3, electricity_net_ownuse,EJ,EJ,1975$/GJ,-3, diff --git a/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv b/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv index ed8e2d6840..046da86ecb 100644 --- a/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv +++ b/input/gcamdata/inst/extdata/energy/A26.subsector_logit.csv @@ -6,6 +6,8 @@ # Column types: ccic # ---------- supplysector,subsector,logit.exponent,logit.type +backup_electricity,gas,-6, +csp_backup,gas,-6, delivered biomass,delivered biomass,-6, delivered coal,delivered coal,-6, electricity_net_ownuse,electricity_net_ownuse,-6, diff --git a/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv b/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv index 9ef107f939..a4ecbb5ca0 100644 --- a/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv +++ b/input/gcamdata/inst/extdata/energy/A26.subsector_shrwt.csv @@ -6,6 +6,8 @@ # Column types: cccci # ---------- supplysector,subsector,year.fillout,year,share.weight +backup_electricity,gas,start-year,,1 +csp_backup,gas,start-year,,1 delivered biomass,delivered biomass,start-year,,1 delivered coal,delivered coal,start-year,,1 electricity_net_ownuse,electricity_net_ownuse,start-year,,1 diff --git a/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt b/input/gcamdata/inst/extdata/mi_headers/ModelInterface_headers.txt index 3f5099cbba..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,7 @@ 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 From 6a6152f61a6d419f80d8a4651fa2879b21d17bc4 Mon Sep 17 00:00:00 2001 From: Matthew Binsted Date: Thu, 10 Oct 2024 17:15:30 -0400 Subject: [PATCH 16/16] Improve comments in C++ code based on pull request review comments. --- .../sectors/include/value_factor_calculator.h | 3 +- .../include/backup_intermittent_technology.h | 28 ++++++++----------- .../include/intermittent_technology.h | 7 ++--- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/cvs/objects/sectors/include/value_factor_calculator.h b/cvs/objects/sectors/include/value_factor_calculator.h index e6d02ed436..f1ce663435 100644 --- a/cvs/objects/sectors/include/value_factor_calculator.h +++ b/cvs/objects/sectors/include/value_factor_calculator.h @@ -102,9 +102,10 @@ class ValueFactorCalculator : public IBackupCalculator { DEFINE_DATA_WITH_PARENT( IBackupCalculator, - //! TODO: leave an explanatory comment + //! 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 ) ) diff --git a/cvs/objects/technologies/include/backup_intermittent_technology.h b/cvs/objects/technologies/include/backup_intermittent_technology.h index d579a7c9fb..5ae268a62c 100644 --- a/cvs/objects/technologies/include/backup_intermittent_technology.h +++ b/cvs/objects/technologies/include/backup_intermittent_technology.h @@ -57,25 +57,21 @@ 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 + * 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 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. + * 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 diff --git a/cvs/objects/technologies/include/intermittent_technology.h b/cvs/objects/technologies/include/intermittent_technology.h index b523ec6460..9a0eead26e 100644 --- a/cvs/objects/technologies/include/intermittent_technology.h +++ b/cvs/objects/technologies/include/intermittent_technology.h @@ -56,18 +56,17 @@ 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. These technologies will have adjusted costs to reflect - * their value factor reduction as a function of market share. + * 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, Matthew Binsted, Matt Mowers */