Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMP: Multiple consumers for floorspace and reisdential energy demand #262

Open
wants to merge 161 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
c04cbcc
Add offlline information for the flsp-Gompertz function: pop density and
jonsampedro Jun 7, 2021
747e65d
Add reference to new function
jonsampedro Jun 7, 2021
1861be6
Changes to write parameters of the Gompetrz flsp function (including
jonsampedro Jun 7, 2021
ba62d27
delete GCAM_DATA_MAP.Rd
jonsampedro Jun 7, 2021
5d7f87a
Additional changes to write the gompertz parameters in th xml
jonsampedro Jun 9, 2021
c476a10
bugfix k parameter
jonsampedro Jun 9, 2021
6297bf2
Changes to write population density into XMLs
jonsampedro Jun 10, 2021
b85116b
Add new function to GCAM-USA
jonsampedro Jun 10, 2021
6036c2e
Build new structure for xml (allow gompetrz and satiation demand
jonsampedro Jun 30, 2021
9282c80
Input files for final DS structure
jonsampedro Jul 15, 2021
156fa10
Initial commit for cpp files for the flsp function
jonsampedro Jul 15, 2021
fcd860b
Temp commit, new structure (2 cppfiles + BasepcFlsp read from DS)
jonsampedro Jul 19, 2021
7bc8139
Temp changes to correct errors compiling the cpp files
jonsampedro Jul 20, 2021
9fb1e21
Temp commit: Solves some errors in the cpp files
jonsampedro Jul 21, 2021
d2ab343
temp commit: solves most of cpp errors (only 2 left)
jonsampedro Jul 22, 2021
d1da6e0
tem commit: Additional reduction of cpp errors
jonsampedro Jul 22, 2021
f946a7a
Temp commit: more changes for gompertz function
jonsampedro Jul 26, 2021
9b3c5ef
Solve the cpp errors and build the executable
jonsampedro Jul 27, 2021
93af1a4
BugFix MI headrers
jonsampedro Jul 27, 2021
e103081
Roll back commits on satiation impedance (to be addressed in a future
jonsampedro Jul 27, 2021
b0052b4
Merge tag 'tags/gcam-v5.4' into JS/feature/new-flsp-demand
jonsampedro Jul 27, 2021
16be1b1
Changes for flsp demand
jonsampedro Jul 27, 2021
83a5a83
Solver error with model solvin
jonsampedro Jul 28, 2021
e2ce01c
BugFix non-USA regions popDens effect
jonsampedro Jul 29, 2021
9618858
Include the gompertz function code files (.h and .cpp) to the compiler
jonsampedro Jul 29, 2021
cac05cd
BugFix writeToDebug SubregionalIncome
jonsampedro Jul 29, 2021
fa28e97
Minor changes on script comments
jonsampedro Aug 2, 2021
326cd50
Delete unused extdata files
jonsampedro Aug 2, 2021
bd078f7
Roll back energy price exponent in the satiation demand function
jonsampedro Aug 4, 2021
16a76b3
Update parameters and source
jonsampedro Aug 9, 2021
6c73def
Not include the effect of base floorspace to be consistent with the
jonsampedro Aug 9, 2021
9c483b5
Calculate habitable land within the DS (instead of reading it
jonsampedro Aug 11, 2021
9e942eb
Allocate the created cpp files in the corresponding folders
jonsampedro Aug 11, 2021
6d26dcd
Floorspace includes income groups
jonsampedro Aug 18, 2021
59a328e
Zero the PriceElasticity of floorspace. Required for the new structure
jonsampedro Aug 18, 2021
3051643
"Finished" flsp: Writes satiation impedance and the new adder (as
jonsampedro Aug 18, 2021
fbac55a
Changes GCAM "world" Floorspace DS
jonsampedro Aug 23, 2021
6789c52
Flsp price elasticity to zero
jonsampedro Aug 23, 2021
e247373
Changes flsp GCAM "world"
jonsampedro Aug 23, 2021
3c8419e
minor change doc
jonsampedro Aug 23, 2021
b605684
Write the impedance and adder parameters for flsp and energy in GCAM and
jonsampedro Aug 25, 2021
dfb3c7f
Add price files
jonsampedro Aug 26, 2021
f155f8f
Add sysdata with new level2DataNames and mi Headers
jonsampedro Aug 26, 2021
9c4fcd6
Write satiation impedance and adder (bias) for non-thermal energy
jonsampedro Aug 26, 2021
8e59bd6
Add impedance and adder for thermal services (+some corrections in
jonsampedro Aug 27, 2021
070611d
Add CalPrices
jonsampedro Aug 27, 2021
128076b
Temp commit: Changes in cpp files that build the executable but still
jonsampedro Aug 30, 2021
5b436c2
temp commit: simplifies structure for the cpp changes to adjust
jonsampedro Aug 31, 2021
76b606a
Builds executable (error coeffcient k=Inf)
jonsampedro Sep 1, 2021
c46f3fe
Adjust satiation impedance
jonsampedro Sep 1, 2021
a06b307
Minor change satiation level
jonsampedro Sep 1, 2021
851f004
Delete duplicates in thermal services
jonsampedro Sep 1, 2021
73534c9
BugFix satiation demand unction -> corrects the inf coefficient
jonsampedro Sep 2, 2021
5d62fc7
Take comment out
jonsampedro Sep 3, 2021
3c495ac
Modify saiation impedance and adder in the DS and add some queries fo…
jonsampedro Sep 10, 2021
fee00f9
Temp commit: some changes related to adjSat
jonsampedro Sep 14, 2021
4d924da
Roll back zero prelast for flsp demand
jonsampedro Sep 15, 2021
bd41f5f
Modifications to write the coefficient in the DS (woks correctly)
jonsampedro Sep 15, 2021
1db4a7a
Merge branch 'JS/feature/adjSatfunction' into JS/feature/building_mul…
jonsampedro Sep 15, 2021
38a68c4
Adjust coefficient calculation
jonsampedro Sep 22, 2021
fe3db03
Correct MI headers for bias-adder and add a new query: Servive Output
jonsampedro Sep 22, 2021
0c3ccc9
Correct solution with no adder
jonsampedro Sep 23, 2021
c7deccc
Adjust thermal building input for "GetBiassAdder"
jonsampedro Sep 24, 2021
ffadba3
Solves dividing the BiasAdder equally across groups
jonsampedro Sep 24, 2021
c9894bc
Add income distribution projections (Task 1.3)
jonsampedro Sep 28, 2021
562f437
Add calibarted prices
jonsampedro Sep 30, 2021
d3c1140
update to xcode project file (include gompertz function code files)
pkyle Oct 14, 2021
06e29f0
Write coefficient and multiple consumer groups in the transportation
jonsampedro Oct 18, 2021
1d70efd
Rename Gompertz function parameters for consistency
jonsampedro Oct 25, 2021
c0a036c
Delete the (now) unused satiation parameters from the resid
jonsampedro Oct 26, 2021
911c54e
Merge branch 'JS/feature/new-flsp-demand' of https://stash.pnnl.gov/s…
jonsampedro Oct 26, 2021
c108513
BugFix: Write output DB
jonsampedro Oct 26, 2021
0d596a0
Add new asumption for floorspace in historical years (2005:2015):
jonsampedro Oct 29, 2021
b2231ba
Adjust historical flsp in USA based on AEO assumptions
jonsampedro Nov 1, 2021
e84d8ea
BugFix, header comma
jonsampedro Nov 1, 2021
4dc88f8
Add precursors as inputs to avoid warning message
jonsampedro Nov 1, 2021
8743c64
Update rda data files
jonsampedro Nov 9, 2021
c0d2105
Adjust USA flsp calibration based on AEO projections
jonsampedro Nov 9, 2021
29c9c53
update gcamdata documentation
pkyle Nov 10, 2021
b483c86
Add prop shares for supplysectors and building inputs (temp)
jonsampedro Nov 13, 2021
9270e48
Revert "Write coefficient and multiple consumer groups in the transpo…
jonsampedro Nov 15, 2021
0a712a8
Add consumer groups to HDDCDD
jonsampedro Nov 15, 2021
3665058
Add estimation of parameters into the DS
jonsampedro Nov 22, 2021
0ab3dd5
Round parameters and add documentation file
jonsampedro Nov 23, 2021
1127508
Round L102.ceds_GFED_nonco2_tg_R_S_F to the 12th digit to eliminate
jonsampedro Nov 23, 2021
0bfe97f
Add strip_attributes to L144.hab_land_flsp_fin
jonsampedro Nov 23, 2021
3dc1c53
More strip_attributes
jonsampedro Nov 23, 2021
cf3c642
Delete data files (temp)
jonsampedro Nov 29, 2021
030c5ee
Add new data files
jonsampedro Nov 29, 2021
02b54f8
Small fixes including:
pralitp Nov 29, 2021
e30e5f5
Merge remote-tracking branch 'origin/master' into JS/feature/new-flsp…
pralitp Nov 29, 2021
0ddabf0
Add data files from PIC
jonsampedro Nov 29, 2021
2a448d0
Merge branch 'JS/feature/new-flsp-demand' of https://stash.pnnl.gov/s…
jonsampedro Nov 29, 2021
a1ca700
Local data files
jonsampedro Nov 29, 2021
049bf6d
Add new data files from PIC
jonsampedro Nov 30, 2021
c5a02b8
Merge branch 'JS/feature/new-flsp-demand' into JS/feature/building_mu…
jonsampedro Dec 1, 2021
6f4684d
Changes in the DS to distinguish between modern and traditional fuels
jonsampedro Dec 15, 2021
b46bcde
Add input coefficients to the cpp files
jonsampedro Dec 15, 2021
fca64d9
Add conditional service densities
jonsampedro Dec 15, 2021
bb434a8
Structure that works with multiple consumers (still calibration errors)
jonsampedro Dec 17, 2021
689ec6a
Adjust function to report services per consumer group
jonsampedro Jan 17, 2022
11f8c08
Correct calibration of thermal load
jonsampedro Jan 18, 2022
36675c1
Correct satiation impedance (sector price)
jonsampedro Jan 19, 2022
77d6fac
Adjust shares for Africa
jonsampedro Jan 21, 2022
4b47932
Update data map file
jonsampedro Jan 21, 2022
ba634fe
Minor change cpp file
jonsampedro Jan 27, 2022
ca8c092
Add non-CO2 emissions to multiple consumer representaton
jonsampedro Jan 27, 2022
9bc8d1d
Adjust HFC emissions
jonsampedro Jan 28, 2022
58a07fa
Adjustment to flsp per capita to avoid the 2015-2020 decrease associated
jonsampedro Feb 2, 2022
18a0f9f
Add subnational socioeconomic queries
jonsampedro Feb 2, 2022
56805e7
Adjust gompertz coeffcients for USA: re-estimated based on AEO
jonsampedro Feb 2, 2022
33c5300
Correct satiation adders for the residential energy demands
jonsampedro Feb 2, 2022
378b6ca
Major revisions for residential energy demand:
jonsampedro Feb 14, 2022
cd85bf5
Adjust floorspace and traditional fuels
jonsampedro Feb 18, 2022
dfa5b3e
Rewrite adder for floorspace (no shares) and add TradBio to all regions
jonsampedro Feb 18, 2022
a5809a0
Major revisions: new income decile projections, new service allocation,
jonsampedro Mar 1, 2022
3a17cd8
Adjust bias adder (converge in 2030) and bugfixes (Africa electric
jonsampedro Mar 1, 2022
fccc3f0
Correct cpp files to have time-varying BiasAdder
jonsampedro Mar 2, 2022
4fc6db0
Delete unused TRadBio sectors to avoid dependency-finder warning
jonsampedro Mar 4, 2022
2addc55
Adjustments for running SSPs with no errors nor warnings
jonsampedro Mar 7, 2022
bc8bba1
Adjust commercial satiation adder per SSP
jonsampedro Mar 7, 2022
8182663
Correct future shell efficiency trajectories
jonsampedro Mar 10, 2022
77bdd65
BugFix shell conductance
jonsampedro Mar 14, 2022
b8a38ae
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro Mar 15, 2022
c20e6f2
Correct satiation impedance parsing
jonsampedro Mar 15, 2022
a9786e5
Parse thermal coefficient
jonsampedro Mar 15, 2022
e374982
Move from hab-land to popDens
jonsampedro Mar 22, 2022
ea12b34
Clean code
jonsampedro Mar 25, 2022
63a7284
add new queries
jonsampedro Mar 30, 2022
a7747b2
Allocate residential coal to heating and others to keep consistency with
jonsampedro Mar 30, 2022
9e12c7d
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro Mar 30, 2022
5e38bed
temp commit: delete correct sectors in GCAM-USA bulding file (solving
jonsampedro Apr 4, 2022
ed4d929
Edit queries
jonsampedro Apr 4, 2022
d577fe1
BugFix: add max model base years
jonsampedro Apr 8, 2022
d16c987
Adjustments to GCAM-USA to be consistent with the new building sector in
jonsampedro Apr 8, 2022
161ebd7
Roll back re-mapping to TradBio
jonsampedro Apr 8, 2022
83e5fd0
Delete query: service output per gcam consumer
jonsampedro Apr 8, 2022
487c752
Delete TradBio in USA region to avoid warning severe error
jonsampedro Apr 13, 2022
95c3ac5
BugFix: data for the estimation of parameters
jonsampedro Apr 19, 2022
e0339f8
Add correct precursors
jonsampedro Apr 19, 2022
10a0180
Adjust calibration prices
jonsampedro Apr 21, 2022
50c01d1
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro Apr 22, 2022
4b37728
Add a price-corrector coefficient to capture the difference between
jonsampedro Apr 25, 2022
a04e670
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro Apr 27, 2022
be189a5
BugFix GCAM_data_map
jonsampedro Apr 27, 2022
01c88b1
BugFix join df
jonsampedro Apr 27, 2022
a4799e8
Adjust HFC MACC curves for cooling with multiple consumers
jonsampedro Apr 28, 2022
fb381e5
Add SSP-specific subregional income distribution pathways for future
jonsampedro Apr 29, 2022
e365390
Add base service density for bugFix
jonsampedro May 2, 2022
a74ea39
BugFix: Change the approach to adjust "negative values" and eliminate…
jonsampedro May 12, 2022
3fca83f
In the adjustment, set the adder to final calibration period
jonsampedro May 12, 2022
0647288
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro May 26, 2022
c23792a
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro May 31, 2022
398aa63
Adjust electric heating in China
jonsampedro Jun 10, 2022
8d6985f
Update income shares based on latets pridr release
jonsampedro Jun 14, 2022
fc12098
Merge branch 'master' into JS/feature/building_mult_cons
jonsampedro Jun 14, 2022
dda9b1e
Update prebuilt data
jonsampedro Jun 16, 2022
f94705c
Expand elec heating sw to further regions (beyond China)
jonsampedro Jun 16, 2022
dc59271
Update income distribution paths from pridr
jonsampedro Jun 17, 2022
44df533
correct satiation impedance for SSP scenarios
Dec 4, 2023
dfae0f3
add decreasing EFs for resid TradBio following SSP2-trends from Rao e…
Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cvs/objects/build/xcode3/objects.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2179,6 +2179,7 @@
CD488754122873C200F5A88A /* co2_emissions.cpp in Sources */,
CD488756122873C200F5A88A /* emissions_summer.cpp in Sources */,
CDAACD88216C546D00D13FD6 /* supply_demand_curve_saver.cpp in Sources */,
CD488758122873C200F5A88A /* ghg_factory.cpp in Sources */,
4BC45CF32717DF19001B7DF6 /* building_gompertz_function.cpp in Sources */,
CD693FA01AEFE0CE00805384 /* relative_cost_logit.cpp in Sources */,
CD48875B122873C200F5A88A /* input_driver.cpp in Sources */,
Expand Down
4 changes: 4 additions & 0 deletions cvs/objects/functions/include/building_node_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class SatiationDemandFunction;
class BuildingNodeInput : public INestedInput
{
friend class GompertzDemandFunction;
friend class XMLDBOutputter;
public:
BuildingNodeInput();
~BuildingNodeInput();
Expand Down Expand Up @@ -422,6 +423,9 @@ friend class GompertzDemandFunction;
//! The base floorspace parameter to use during calcDemand. Parsed from XML
DEFINE_VARIABLE(SIMPLE, "b-param", mbParam, Value),

//! The base floorspace parameter to use during calcDemand. Parsed from XML
DEFINE_VARIABLE(SIMPLE, "tot-dens", mTotDens, Value),

//! The income parameter to use during calcDemand. Parsed from XML
DEFINE_VARIABLE(SIMPLE, "income-param", mIncomeParam, Value),

Expand Down
16 changes: 16 additions & 0 deletions cvs/objects/functions/include/building_service_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "functions/include/aproduction_function.h"

class IInput;
class BuildingNodeInput;
class BuildingServiceInput;

/*!
Expand Down Expand Up @@ -80,9 +81,11 @@ class BuildingServiceFunction : public AProductionFunction {
double capitalStock = 0, const IInput* aParentInput = 0 ) const;



double calcLevelizedCost( const InputSet& aInputs, const std::string& aRegionName,
const std::string& aSectorName, int aPeriod, double aAlphaZero, double aSigma,
const IInput* aParentInput = 0 ) const;


// AProductionFunction methods not implemented
double changeElasticity( InputSet& input, const std::string& aRegionName, double priceReceived,
Expand Down Expand Up @@ -139,8 +142,21 @@ class BuildingServiceFunction : public AProductionFunction {

double calcServiceDensity( BuildingServiceInput* aBuildingServiceInput,
const double aIncome,
const double aBasePrice,
const std::string& aRegionName,
const int aPeriod ) const;

double calcServiceCoal(BuildingServiceInput* aBuildingServiceInput,
const double aIncome,
const double aBasePrice,
const std::string& aRegionName,
const int aPeriod) const;

double calcServiceTradBio(BuildingServiceInput* aBuildingServiceInput,
const double aIncome,
const double aBasePrice,
const std::string& aRegionName,
const int aPeriod) const;
};

#endif // _BUILDING_SERVICE_FUNCTION_H_
70 changes: 60 additions & 10 deletions cvs/objects/functions/include/building_service_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ class BuildingServiceInput : public INestedInput

// Building service specific methods
void setServiceDensity( const double aServiceDensity, const int aPeriod );
SatiationDemandFunction* getSatiationDemandFunction() const;

SatiationDemandFunction* getSatiationDemandFunction() const;

virtual double calcThermalLoad( const BuildingNodeInput* aBuildingInput,
const double aInternalGainsPerSqMeter,
const int aPeriod ) const;

virtual double getBiasAdder(const int aPeriod) const;

// INestedInput methods
// define them to do nothing since a BuildingServiceInput is a leaf in the nesting structure
// this should be the end point for recursion
Expand Down Expand Up @@ -188,7 +190,25 @@ class BuildingServiceInput : public INestedInput
virtual void setPricePaid( const double aPricePaid,
const int aPeriod );

virtual double getCoefficient( const int aPeriod ) const;
virtual double getCoefficient(const int aPeriod) const;

virtual double getCoef() const;

virtual double getCoalA() const;

virtual double getCoalK() const;

virtual double getCoalBase() const;

virtual double getTradBioX() const;

virtual double getTradBioY() const;

virtual double getTradBioBase() const;

virtual double getServPriceBase() const;

virtual double getServBaseDens() const;

virtual void setCoefficient( const double aCoefficient,
const int aPeriod );
Expand Down Expand Up @@ -298,17 +318,47 @@ class BuildingServiceInput : public INestedInput

// 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(
INestedInput,
DEFINE_DATA_WITH_PARENT(
INestedInput,

//! The name of this input.
DEFINE_VARIABLE( SIMPLE, "name", mName, std::string ),
//! The name of this input.
DEFINE_VARIABLE(SIMPLE, "name", mName, std::string),

//! Building service demand by period.
DEFINE_VARIABLE( ARRAY | STATE, "base-service", mServiceDemand, objects::PeriodVector<Value> ),
//! Building service demand by period.
DEFINE_VARIABLE(ARRAY | STATE, "base-service", mServiceDemand, objects::PeriodVector<Value>),

//! Energy service density for reporting.
DEFINE_VARIABLE( ARRAY | STATE | NOT_PARSABLE, "service-density", mServiceDensity, objects::PeriodVector<Value> ),
DEFINE_VARIABLE(ARRAY | STATE | NOT_PARSABLE, "service-density", mServiceDensity, objects::PeriodVector<Value>),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "coef", mCoef, Value),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(ARRAY | STATE, "bias-adder", mBiasAdderEn, objects::PeriodVector<Value>),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "A-coal", mCoalA, Value),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "k-coal", mCoalK, Value),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "base-coal", mCoalBase, Value),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "x-TradBio", mTradBioX, Value),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "y-TradBio", mTradBioY, Value),

//! Demand function coefficients to capture base year characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "base-TradBio", mTradBioBase, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "price", mServPriceBase, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "base-density", mServBaseDens, Value),

//! Satiation demand function.
DEFINE_VARIABLE( CONTAINER, "satiation-demand-function", mSatiationDemandFunction, SatiationDemandFunction* )
Expand Down
17 changes: 10 additions & 7 deletions cvs/objects/functions/include/satiation_demand_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ class SatiationDemandFunction : public INamed, private boost::noncopyable {

double calcDemand( const double aDemandDriver ) const;

void calibrateSatiationImpedance( const double aDemand, const double aDemandDriver, const int aPeriod );

static const std::string& getXMLNameStatic();

// INamed methods
Expand All @@ -125,22 +123,27 @@ class SatiationDemandFunction : public INamed, private boost::noncopyable {
//! The satiation level which may have been parsed directly by the user.
DEFINE_VARIABLE( SIMPLE, "satiation-level", mParsedSatiationLevel, Value ),

//! Satiation impedance. This is the parsed value and will not change.
DEFINE_VARIABLE(SIMPLE, "satiation-impedance", mParsedSatiationImpedance, Value),

//! Satiation adder, determines subsistence level. This is the parsed value
//! and will not change.
DEFINE_VARIABLE(SIMPLE, "satiation-adder", mParsedSatiationAdder, Value),

//! The satiation level to use during calcDemand. This could have been read
//! in directly by the user or set as a percentage increase from the base year
//! demand.
DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "real-satiation-level", mSatiationLevel, Value ),

//! Satiation impedance or midpoint demand driver. Note that this value is
//! calibrated via calibrateSatiationImpedance.
DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "satiation-impedance", mSatiationImpedance, Value ),

//! Satiation adder, determines subsistence level. This is the parsed value
//! and will not change.
DEFINE_VARIABLE( SIMPLE, "satiation-adder", mParsedSatiationAdder, Value ),
DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "real-satiation-impedance", mSatiationImpedance, Value ),


//! Satiation adder, determines subsistence level. This value may be adjusted
//! from the parsed value during some calibration periods.
DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "real-satiation-adder", mSatiationAdder, Value )

)

void copy( const SatiationDemandFunction& aOther );
Expand Down
37 changes: 34 additions & 3 deletions cvs/objects/functions/include/thermal_building_service_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class ThermalBuildingServiceInput : public BuildingServiceInput
const std::string& aTechName,
const IInfo* aTechInfo );

virtual double getCoefficient( const int aPeriod ) const;
virtual double getCoefficient(const int aPeriod) const;

virtual void setCoefficient( const double aCoefficient,
const int aPeriod );

Expand All @@ -125,9 +125,40 @@ class ThermalBuildingServiceInput : public BuildingServiceInput

//! Degree days by period.
DEFINE_VARIABLE( ARRAY, "degree-days", mDegreeDays, objects::PeriodVector<Value> ),


//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE( SIMPLE | STATE, "coef", mCoef, Value ),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "A-coal", mCoalA, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "k-coal", mCoalK, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "base-coal", mCoalBase, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "x-TradBio", mTradBioX, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "y-TradBio", mTradBioY, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "base-TradBio", mTradBioBase, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "price", mServPriceBase, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(SIMPLE | STATE, "base-density", mServBaseDens, Value),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE(ARRAY | STATE, "bias-adder", mBiasAdderEn, objects::PeriodVector<Value>),

//! Demand function coefficients to capture base year thermal characteristics.
DEFINE_VARIABLE( SIMPLE | STATE | NOT_PARSABLE, "coefficient", mCoefficient, Value )

)

void copy( const ThermalBuildingServiceInput& aInput );
Expand Down
1 change: 0 additions & 1 deletion cvs/objects/functions/source/building_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ double BuildingFunction::calcCoefficient( InputSet& input, double consumption, c
/ buildingNodeInput->getSubregionalPopulation();
// first calibrate the satiation impedance
SatiationDemandFunction* demandFunction = buildingNodeInput->getSatiationDemandFunction();
demandFunction->calibrateSatiationImpedance( perCapitaBaseFloorspace, buildingNodeInput->getSubregionalIncome(), period );
}
return 1;
}
Expand Down
15 changes: 12 additions & 3 deletions cvs/objects/functions/source/building_gompertz_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,34 @@ double GompertzDemandFunction::calcDemand(InputSet& input, double income, const
double unadjustSatiation = bldInput->mUnadjustSatiation;
double landDensityParam = bldInput->mLandDensityParam;
double subregionalPopulation = bldInput->mCurrentSubregionalPopulation;
double habitableLand = bldInput->mHabitableLand;
double TotDens = bldInput->mTotDens;
double bParam = bldInput->mbParam;
double incomeParam = bldInput->mIncomeParam;
double subregionalIncome = bldInput->mCurrentSubregionalIncome;
double biasAdjustParam = bldInput->mBiasAdjustParam;

double pcfloorspace = (unadjustSatiation + (-landDensityParam) * log(subregionalPopulation / habitableLand))
double pcfloorspace = (unadjustSatiation + (-landDensityParam) * log(TotDens))
* exp((-bParam)
* exp((-incomeParam) * log(subregionalIncome)))
+ biasAdjustParam;


// unit conversions to convert from from billion m^2 to m^2
const double CONV_M2_BM2 = 1e-9;
// unit conversions to convert from thous ppl to ppl
const double CONV_POP_THOUS = 1e3;
double floorspace = pcfloorspace * CONV_M2_BM2 * subregionalPopulation * CONV_POP_THOUS;


// May need to make an adjustment

double Basefloorspace = bldInput->mBasepcFlsp * CONV_M2_BM2 * subregionalPopulation * CONV_POP_THOUS;

if (floorspace < Basefloorspace) {
floorspace = Basefloorspace;
}

bldInput->setPhysicalDemand(floorspace, regionName, period);

return floorspace;
}

3 changes: 2 additions & 1 deletion cvs/objects/functions/source/building_node_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ BuildingNodeInput::~BuildingNodeInput() {
delete mSatiationDemandFunction;
}


void BuildingNodeInput::completeInit( const string& aRegionName, const string& aSectorName,
const string& aSubsectorName, const string& aTechName,
const IInfo* aTechInfo)
Expand Down Expand Up @@ -216,10 +217,10 @@ void BuildingNodeInput::toDebugXML( const int aPeriod, ostream& aOut, Tabs* aTab
XMLWriteElement( mFloorToSurfaceRatio[ aPeriod ], "floor-to-surface-ratio", aOut, aTabs );
XMLWriteElement( mPrice[ aPeriod ], "price", aOut, aTabs );
XMLWriteElement(mUnadjustSatiation, "unadjust-satiation", aOut, aTabs);
XMLWriteElement(mHabitableLand, "habitable-land", aOut, aTabs);
XMLWriteElement(mBasepcFlsp, "base-pcFlsp", aOut, aTabs);
XMLWriteElement(mLandDensityParam, "land-density-param", aOut, aTabs);
XMLWriteElement(mbParam, "b-param", aOut, aTabs);
XMLWriteElement(mTotDens, "tot-dens", aOut, aTabs);
XMLWriteElement(mIncomeParam, "income-param", aOut, aTabs);
XMLWriteElement(mBiasAdjustParam, "bias-adjust-param", aOut, aTabs);
XMLWriteElement(mCurrentSubregionalPopulation, "subregional-population", aOut, aTabs);
Expand Down
Loading