You can override the value of any variable in the model on a node-by-node basis. To perform a node-level override, use the aliases in the following table as additional columns in your spreadsheet or fields in your shapefile. Both long and short aliases are recognized.
Dependencies
Derivatives
class DiscountedCashFlowFactor(V):
section = 'finance'
option = 'discounted cash flow factor'
aliases = ['dccf']
dependencies = [
TimeHorizon,
InterestRatePerYear,
]
def compute(self):
interestExponents = [-x for x in xrange(1, self.get(TimeHorizon) + 1)]
return sum(numpy.array(1 + self.get(InterestRatePerYear)) ** interestExponents)
Derivatives
class EconomicGrowthRatePerYear(V):
section = 'finance'
option = 'economic growth rate per year'
aliases = ['economic_g']
default = 0.06
units = 'fraction per year'
Derivatives
class ElasticityOfElectricityDemand(V):
section = 'finance'
option = 'elasticity of electricity demand'
aliases = ['elasticity']
default = 1.5
Dependencies
Derivatives
class ElectricityDemandGrowthRatePerYear(V):
section = 'finance'
option = 'electricity demand growth rate per year'
aliases = ['dem_g']
dependencies = [
ElasticityOfElectricityDemand,
EconomicGrowthRatePerYear,
]
units = 'fraction per year'
def compute(self):
return abs(self.get(ElasticityOfElectricityDemand)) * self.get(EconomicGrowthRatePerYear)
Dependencies
Derivatives
class ElectricityDemandMultiplier(V):
section = 'finance'
option = 'electricity demand multiplier'
aliases = ['demf']
dependencies = [
ElectricityDemandGrowthRatePerYear,
TimeHorizon,
]
def compute(self):
return (1 + self.get(ElectricityDemandGrowthRatePerYear)) ** self.get(TimeHorizon)
Derivatives
class InterestRatePerYear(V):
section = 'finance'
option = 'interest rate per year'
aliases = ['interest_g']
default = 0.1
units = 'fraction per year'
Derivatives
class TimeHorizon(V):
section = 'finance'
option = 'time horizon'
aliases = ['time']
c = dict(parse=store.parseCeilInteger)
default = 10
units = 'years'
Dependencies
Derivatives
class IsRural(V):
section = 'demographics'
option = 'is rural'
aliases = ['rural']
c = dict(parse=int)
dependencies = [
ProjectedPopulationCount,
UrbanPopulationThreshold,
]
units = 'binary'
def compute(self):
return 1 if self.get(ProjectedPopulationCount) < self.get(UrbanPopulationThreshold) else 0
Dependencies
Derivatives
class MeanHouseholdSize(V):
section = 'demographics'
option = 'mean household size'
aliases = ['ho_size']
c = dict(check=store.assertPositive)
dependencies = [
RuralMeanHouseholdSize,
IsRural,
UrbanMeanHouseholdSize,
]
units = 'person count'
def compute(self):
return self.get(RuralMeanHouseholdSize) if self.get(IsRural) else self.get(UrbanMeanHouseholdSize)
Derivatives
class MeanInterhouseholdDistance(V):
section = 'demographics'
option = 'mean interhousehold distance'
aliases = ['mid']
default = 25
units = 'meters'
Derivatives
class PopulationCount(V):
section = 'demographics'
option = 'population count'
aliases = ['pop', 'population']
c = dict(parse=store.parseCeilInteger)
default = 0
units = 'person count'
Dependencies
Derivatives
class ProjectedHouseholdCount(V):
section = 'demographics'
option = 'projected household count'
aliases = ['p_ho']
c = dict(check=store.assertNonNegative)
dependencies = [
ProjectedPopulationCount,
MeanHouseholdSize,
]
units = 'household count'
def compute(self):
return math.ceil(self.get(ProjectedPopulationCount) / float(self.get(MeanHouseholdSize)))
Dependencies
Derivatives
class ProjectedPopulationCount(V):
section = 'demographics'
option = 'projected population count'
aliases = ['p_pop']
c = dict(parse=store.parseCeilInteger)
dependencies = [
ProjectedPopulationCounts,
]
units = 'person count'
def compute(self):
return self.get(ProjectedPopulationCounts)[-1]
Dependencies
Derivatives
class ProjectedPopulationCounts(V):
section = 'demographics'
option = 'projected population counts'
aliases = ['p_pops']
c = dict(parse=store.unstringifyIntegerList, format=store.flattenList, validate='validateNumberList')
dependencies = [
PopulationCount,
RuralPopulationGrowthRatePerYear,
UrbanPopulationGrowthRatePerYear,
UrbanPopulationThreshold,
finance.TimeHorizon,
]
units = 'person count list'
def compute(self):
# Initialize
populationCounts = [self.get(PopulationCount)]
urbanThreshold = self.get(UrbanPopulationThreshold)
ruralGrowthRate = self.get(RuralPopulationGrowthRatePerYear)
urbanGrowthRate = self.get(UrbanPopulationGrowthRatePerYear)
# For each year of the time horizon,
for year in xrange(self.get(finance.TimeHorizon)):
# Get population count
populationCount = populationCounts[-1]
# Get appropriate growth rate
populationGrowthRate = ruralGrowthRate if populationCount < urbanThreshold else urbanGrowthRate
# Append projected population count
populationCounts.append(int(math.ceil(populationCount * (1 + populationGrowthRate))))
# Return
return populationCounts
Derivatives
class RuralMeanHouseholdSize(V):
section = 'demographics'
option = 'mean household size (rural)'
aliases = ['ho_size_r']
default = 9.6
units = 'person count'
Derivatives
class RuralPopulationGrowthRatePerYear(V):
section = 'demographics'
option = 'population growth rate per year (rural)'
aliases = ['pop_g_r']
default = 0.015
units = 'fraction per year'
Derivatives
class UrbanMeanHouseholdSize(V):
section = 'demographics'
option = 'mean household size (urban)'
aliases = ['ho_size_u']
default = 7.5
units = 'person count'
Derivatives
class UrbanPopulationGrowthRatePerYear(V):
section = 'demographics'
option = 'population growth rate per year (urban)'
aliases = ['pop_g_u']
default = 0.036
units = 'fraction per year'
Derivatives
class UrbanPopulationThreshold(V):
section = 'demographics'
option = 'urban population threshold'
aliases = ['u_pop_thre']
c = dict(parse=store.parseCeilInteger)
default = 5000
units = 'person count'
Dependencies
Derivatives
class ProjectedNodalDemandPerYear(V):
section = 'demand'
option = 'projected nodal demand per year'
aliases = ['p_dem']
dependencies = [
ProjectedHouseholdDemandPerYear,
ProjectedProductiveDemandPerYear,
ProjectedHealthFacilityDemandPerYear,
ProjectedEducationFacilityDemandPerYear,
ProjectedCommercialFacilityDemandPerYear,
ProjectedPublicLightingFacilityDemandPerYear,
]
units = 'kilowatt-hours per year'
def compute(self):
return sum([
self.get(ProjectedHouseholdDemandPerYear),
self.get(ProjectedProductiveDemandPerYear),
self.get(ProjectedHealthFacilityDemandPerYear),
self.get(ProjectedEducationFacilityDemandPerYear),
self.get(ProjectedCommercialFacilityDemandPerYear),
self.get(ProjectedPublicLightingFacilityDemandPerYear),
])
Dependencies
Derivatives
class ProjectedNodalDiscountedDemand(V):
"""
Note that we are overestimating nodal demand aggregated over the time horizon
since we are using the projected demand at the end of the time horizon as the
recurring demand per year, which in real-life should scale year by year.
"""
section = 'demand'
option = 'projected nodal discounted demand'
aliases = ['p_dem_d']
dependencies = [
ProjectedNodalDemandPerYear,
finance.DiscountedCashFlowFactor,
]
units = 'kilowatt-hours'
def compute(self):
return self.get(ProjectedNodalDemandPerYear) * self.get(finance.DiscountedCashFlowFactor)
Dependencies
Derivatives
class DemandToPeakDemandConversionFactor(V):
section = 'demand (peak)'
option = 'demand to peak demand conversion factor'
aliases = ['dem_pkdemf']
dependencies = [
PeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours,
PeakElectricalHoursOfOperationPerYear,
]
def compute(self):
return self.get(PeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours) / float(self.get(PeakElectricalHoursOfOperationPerYear))
Dependencies
Derivatives
class PeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours(V):
section = 'demand (peak)'
option = 'peak demand as fraction of nodal demand occurring during peak hours'
aliases = ['pkdemf']
dependencies = [
RuralPeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours,
demographics.IsRural,
UrbanPeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours,
]
def compute(self):
return self.get(RuralPeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours) if self.get(demographics.IsRural) else self.get(UrbanPeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours)
Derivatives
class PeakElectricalHoursOfOperationPerYear(V):
section = 'demand (peak)'
option = 'peak electrical hours of operation per year'
aliases = ['pkel_hr']
c = dict(check=store.assertPositive)
default = 1460
units = 'hours per year'
Dependencies
Derivatives
class ProjectedPeakCommercialFacilityDemand(V):
section = 'demand (peak)'
option = 'projected peak commercial facility demand'
aliases = ['p_pkdem_co']
dependencies = [
ProjectedCommercialFacilityDemandPerYear,
DemandToPeakDemandConversionFactor,
]
units = 'kilowatts'
def compute(self):
return self.get(ProjectedCommercialFacilityDemandPerYear) * self.get(DemandToPeakDemandConversionFactor)
Dependencies
Derivatives
class ProjectedPeakNodalDemand(V):
section = 'demand (peak)'
option = 'projected peak nodal demand'
aliases = ['p_pkdem']
dependencies = [
ProjectedNodalDemandPerYear,
DemandToPeakDemandConversionFactor,
]
units = 'kilowatts'
def compute(self):
return self.get(ProjectedNodalDemandPerYear) * self.get(DemandToPeakDemandConversionFactor)
Dependencies
Derivatives
class ProjectedPeakProductiveDemand(V):
section = 'demand (peak)'
option = 'projected peak productive demand'
aliases = ['p_pkdem_pr']
dependencies = [
ProjectedProductiveDemandPerYear,
DemandToPeakDemandConversionFactor,
]
units = 'kilowatts'
def compute(self):
return self.get(ProjectedProductiveDemandPerYear) * self.get(DemandToPeakDemandConversionFactor)
Derivatives
class RuralPeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours(V):
section = 'demand (peak)'
option = 'peak demand as fraction of nodal demand occurring during peak hours (rural)'
aliases = ['pkdemf_r']
default = 0.4
Derivatives
class UrbanPeakDemandAsFractionOfNodalDemandOccurringDuringPeakHours(V):
section = 'demand (peak)'
option = 'peak demand as fraction of nodal demand occurring during peak hours (urban)'
aliases = ['pkdemf_u']
default = 0.4
Dependencies
Derivatives
class HouseholdDemandCurve(V):
section = 'demand (household)'
option = 'demand curve'
aliases = ['ho_dc']
c = dict(parse=curve.parse, format=curve.format)
dependencies = [
HouseholdDemandCurveType,
HouseholdDemandCurvePoints,
]
def compute(self):
curveType = self.get(HouseholdDemandCurveType)
curvePoints = self.get(HouseholdDemandCurvePoints)
return curve.fit(curveType, curvePoints)
Derivatives
class HouseholdDemandCurvePoints(V):
section = 'demand (household)'
option = 'demand curve points (population and multiplier)'
aliases = ['ho_dc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '500 1; 1000 1.56; 5000 6.16; 10000 11.5'
units = 'population and multiplier list'
Derivatives
class HouseholdDemandCurveType(V):
section = 'demand (household)'
option = 'demand curve type'
aliases = ['ho_dc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class HouseholdUnitDemandPerHouseholdPerYear(V):
section = 'demand (household)'
option = 'household unit demand per household per year'
aliases = ['ho_dc_unit']
default = 0 # 100
units = 'kilowatt-hours per year'
Dependencies
Derivatives
class ProjectedHouseholdDemandPerYear(V):
section = 'demand (household)'
option = 'projected household demand per year'
aliases = ['p_dem_ho']
dependencies = [
finance.ElectricityDemandMultiplier,
HouseholdDemandCurve,
HouseholdUnitDemandPerHouseholdPerYear,
demographics.ProjectedPopulationCount,
TargetHouseholdCount,
]
units = 'kilowatt-hours per year'
def compute(self):
return self.get(finance.ElectricityDemandMultiplier) * self.get(HouseholdDemandCurve).interpolate(self.get(demographics.ProjectedPopulationCount)) * self.get(HouseholdUnitDemandPerHouseholdPerYear) * self.get(TargetHouseholdCount)
Dependencies
Derivatives
class TargetHouseholdCount(V):
section = 'demand (household)'
option = 'target household count'
aliases = ['ct_hh_t']
c = dict(parse=store.parseCeilInteger)
dependencies = [
TargetHouseholdPenetrationRate,
demographics.ProjectedHouseholdCount,
]
units = 'households'
def compute(self):
return math.ceil(self.get(TargetHouseholdPenetrationRate) * self.get(demographics.ProjectedHouseholdCount))
Derivatives
class TargetHouseholdPenetrationRate(V):
section = 'demand (household)'
option = 'target household penetration rate'
default = 1
Dependencies
Derivatives
class ProductiveDemandCurve(V):
section = 'demand (productive)'
option = 'demand curve'
aliases = ['pr_dc']
c = dict(parse=curve.parse, format=curve.format)
dependencies = [
ProductiveDemandCurveType,
ProductiveDemandCurvePoints,
]
def compute(self):
curveType = self.get(ProductiveDemandCurveType)
curvePoints = self.get(ProductiveDemandCurvePoints)
return curve.fit(curveType, curvePoints)
Derivatives
class ProductiveDemandCurvePoints(V):
section = 'demand (productive)'
option = 'demand curve points (population and multiplier)'
aliases = ['pr_dc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '500 1; 1000 3.06; 5000 3.57; 10000 5.10'
units = 'population and multiplier list'
Derivatives
class ProductiveDemandCurveType(V):
section = 'demand (productive)'
option = 'demand curve type'
aliases = ['pr_dc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class ProductiveUnitDemandPerHouseholdPerYear(V):
section = 'demand (productive)'
option = 'productive unit demand per household per year'
aliases = ['pr_dc_unit']
default = 0 # 19.5
units = 'kilowatt-hours per year'
Dependencies
Derivatives
class ProjectedProductiveDemandPerYear(V):
"""
Productive demand is power for community resources such as water pumps
and grinding mills. By estimating productive demand on a per household
basis, we do not have to estimate the number of water pumps or
grinding mills that are shared by a village. The number of water pumps
or grinding mills is generally smaller than the number of households.
"""
section = 'demand (productive)'
option = 'projected productive demand'
aliases = ['p_dem_pr']
dependencies = [
finance.ElectricityDemandMultiplier,
ProductiveDemandCurve,
ProductiveUnitDemandPerHouseholdPerYear,
demographics.ProjectedPopulationCount,
TargetHouseholdCount,
]
units = 'kilowatt-hours per year'
def compute(self):
return self.get(finance.ElectricityDemandMultiplier) * self.get(ProductiveDemandCurve).interpolate(self.get(demographics.ProjectedPopulationCount)) * self.get(ProductiveUnitDemandPerHouseholdPerYear) * self.get(TargetHouseholdCount)
Dependencies
Derivatives
class CommercialFacilityCountCurve(V):
section = 'demand (social infrastructure)'
option = 'commercial facility count curve'
aliases = ['co_cc']
c = dict(parse=curve.parse, format=curve.format)
dependencies = [
CommercialFacilityCountCurveType,
CommercialFacilityCountCurvePoints,
]
def compute(self):
curveType = self.get(CommercialFacilityCountCurveType)
curvePoints = self.get(CommercialFacilityCountCurvePoints)
return curve.fit(curveType, curvePoints)
Derivatives
class CommercialFacilityCountCurvePoints(V):
section = 'demand (social infrastructure)'
option = 'commercial facility count curve points (population and facility count)'
aliases = ['co_cc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '50 0.12; 500 1.2; 5000 25; 10000 125'
units = 'population and facility count list'
Derivatives
class CommercialFacilityCountCurveType(V):
section = 'demand (social infrastructure)'
option = 'commercial facility count curve type'
aliases = ['co_cc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class CommercialFacilityUnitDemandPerCommercialFacilityPerYear(V):
section = 'demand (social infrastructure)'
option = 'commercial facility unit demand per commercial facility per year'
aliases = ['co_dc_unit']
default = 0 # 250
units = 'kilowatt-hours per year'
Dependencies
Derivatives
class EducationFacilityCountCurve(V):
section = 'demand (social infrastructure)'
option = 'education facility count curve'
aliases = ['ed_cc']
c = dict(parse=curve.parse, format=curve.format)
dependencies = [
EducationFacilityCountCurveType,
EducationFacilityCountCurvePoints,
]
def compute(self):
curveType = self.get(EducationFacilityCountCurveType)
curvePoints = self.get(EducationFacilityCountCurvePoints)
return curve.fit(curveType, curvePoints)
Derivatives
class EducationFacilityCountCurvePoints(V):
section = 'demand (social infrastructure)'
option = 'education facility count curve points (population and facility count)'
aliases = ['ed_cc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '50 0.1; 500 1; 5000 3; 10000 15'
units = 'population and facility count list'
Derivatives
class EducationFacilityCountCurveType(V):
section = 'demand (social infrastructure)'
option = 'education facility count curve type'
aliases = ['ed_cc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class EducationFacilityUnitDemandPerEducationFacilityPerYear(V):
section = 'demand (social infrastructure)'
option = 'education facility unit demand per education facility per year'
aliases = ['ed_dc_unit']
default = 0 # 1200
units = 'kilowatt-hours per year'
Dependencies
Derivatives
class HealthFacilityCountCurve(V):
section = 'demand (social infrastructure)'
option = 'health facility count curve'
aliases = ['he_cc']
c = dict(parse=curve.parse, format=curve.format)
dependencies = [
HealthFacilityCountCurveType,
HealthFacilityCountCurvePoints,
]
def compute(self):
curveType = self.get(HealthFacilityCountCurveType)
curvePoints = self.get(HealthFacilityCountCurvePoints)
return curve.fit(curveType, curvePoints)
Derivatives
class HealthFacilityCountCurvePoints(V):
section = 'demand (social infrastructure)'
option = 'health facility count curve points (population and facility count)'
aliases = ['he_cc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '50 0.16; 500 1.6; 5000 5; 10000 20'
units = 'population and facility count list'
Derivatives
class HealthFacilityCountCurveType(V):
section = 'demand (social infrastructure)'
option = 'health facility count curve type'
aliases = ['he_cc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class HealthFacilityUnitDemandPerHealthFacilityPerYear(V):
section = 'demand (social infrastructure)'
option = 'health facility unit demand per health facility per year'
aliases = ['he_dc_unit']
default = 0 # 1000
units = 'kilowatt-hours per year'
Dependencies
Derivatives
class ProjectedCommercialFacilityCount(V):
section = 'demand (social infrastructure)'
option = 'projected commercial facility count'
aliases = ['p_co']
dependencies = [
CommercialFacilityCountCurve,
demographics.ProjectedPopulationCount,
]
units = 'commercial facility count'
def compute(self):
return self.get(CommercialFacilityCountCurve).interpolate(self.get(demographics.ProjectedPopulationCount))
Dependencies
Derivatives
class ProjectedCommercialFacilityDemandPerYear(V):
section = 'demand (social infrastructure)'
option = 'projected commercial facility demand per year'
aliases = ['p_dem_co']
dependencies = [
finance.ElectricityDemandMultiplier,
SocialInfrastructureDemandCurve,
CommercialFacilityUnitDemandPerCommercialFacilityPerYear,
demographics.ProjectedPopulationCount,
ProjectedCommercialFacilityCount,
]
units = 'kilowatt-hours per year'
def compute(self):
return self.get(finance.ElectricityDemandMultiplier) * self.get(SocialInfrastructureDemandCurve).interpolate(self.get(demographics.ProjectedPopulationCount)) * self.get(CommercialFacilityUnitDemandPerCommercialFacilityPerYear) * self.get(ProjectedCommercialFacilityCount)
Dependencies
Derivatives
class ProjectedEducationFacilityCount(V):
section = 'demand (social infrastructure)'
option = 'projected education facility count'
aliases = ['p_ed']
dependencies = [
EducationFacilityCountCurve,
demographics.ProjectedPopulationCount,
]
units = 'education facility count'
def compute(self):
return self.get(EducationFacilityCountCurve).interpolate(self.get(demographics.ProjectedPopulationCount))
Dependencies
Derivatives
class ProjectedEducationFacilityDemandPerYear(V):
section = 'demand (social infrastructure)'
option = 'projected education facility demand per year'
aliases = ['p_dem_ed']
dependencies = [
finance.ElectricityDemandMultiplier,
SocialInfrastructureDemandCurve,
EducationFacilityUnitDemandPerEducationFacilityPerYear,
demographics.ProjectedPopulationCount,
ProjectedEducationFacilityCount,
]
units = 'kilowatt-hours per year'
def compute(self):
return self.get(finance.ElectricityDemandMultiplier) * self.get(SocialInfrastructureDemandCurve).interpolate(self.get(demographics.ProjectedPopulationCount)) * self.get(EducationFacilityUnitDemandPerEducationFacilityPerYear) * self.get(ProjectedEducationFacilityCount)
Dependencies
Derivatives
class ProjectedHealthFacilityCount(V):
section = 'demand (social infrastructure)'
option = 'projected health facility count'
aliases = ['p_he']
dependencies = [
HealthFacilityCountCurve,
demographics.ProjectedPopulationCount,
]
units = 'health facility count'
def compute(self):
return self.get(HealthFacilityCountCurve).interpolate(self.get(demographics.ProjectedPopulationCount))
Dependencies
Derivatives
class ProjectedHealthFacilityDemandPerYear(V):
section = 'demand (social infrastructure)'
option = 'projected health facility demand per year'
aliases = ['p_dem_he']
dependencies = [
finance.ElectricityDemandMultiplier,
SocialInfrastructureDemandCurve,
HealthFacilityUnitDemandPerHealthFacilityPerYear,
demographics.ProjectedPopulationCount,
ProjectedHealthFacilityCount,
]
units = 'kilowatt-hours per year'
def compute(self):
return self.get(finance.ElectricityDemandMultiplier) * self.get(SocialInfrastructureDemandCurve).interpolate(self.get(demographics.ProjectedPopulationCount)) * self.get(HealthFacilityUnitDemandPerHealthFacilityPerYear) * self.get(ProjectedHealthFacilityCount)
Dependencies
Derivatives
class ProjectedPublicLightingFacilityCount(V):
section = 'demand (social infrastructure)'
option = 'projected public lighting facility count'
aliases = ['p_li']
dependencies = [
PublicLightingFacilityCountCurve,
demographics.ProjectedPopulationCount,
]
units = 'public lighting facility count'
def compute(self):
return self.get(PublicLightingFacilityCountCurve).interpolate(self.get(demographics.ProjectedPopulationCount))
Dependencies
Derivatives
class ProjectedPublicLightingFacilityDemandPerYear(V):
section = 'demand (social infrastructure)'
option = 'projected public lighting facility demand per year'
aliases = ['p_dem_li']
dependencies = [
finance.ElectricityDemandMultiplier,
SocialInfrastructureDemandCurve,
PublicLightingFacilityUnitDemandPerPublicLightingFacilityPerYear,
demographics.ProjectedPopulationCount,
ProjectedPublicLightingFacilityCount,
]
units = 'kilowatt-hours per year'
def compute(self):
return self.get(finance.ElectricityDemandMultiplier) * self.get(SocialInfrastructureDemandCurve).interpolate(self.get(demographics.ProjectedPopulationCount)) * self.get(PublicLightingFacilityUnitDemandPerPublicLightingFacilityPerYear) * self.get(ProjectedPublicLightingFacilityCount)
Dependencies
Derivatives
class PublicLightingFacilityCountCurve(V):
section = 'demand (social infrastructure)'
option = 'public lighting facility count curve'
aliases = ['li_cc']
c = dict(parse=curve.parse, format=curve.format)
dependencies = [
PublicLightingFacilityCountCurveType,
PublicLightingFacilityCountCurvePoints,
]
def compute(self):
curveType = self.get(PublicLightingFacilityCountCurveType)
curvePoints = self.get(PublicLightingFacilityCountCurvePoints)
return curve.fit(curveType, curvePoints)
Derivatives
class PublicLightingFacilityCountCurvePoints(V):
section = 'demand (social infrastructure)'
option = 'public lighting facility count curve points (population and facility count)'
aliases = ['li_cc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '50 0.1; 500 1; 5000 7; 10000 25'
units = 'population and facility count list'
Derivatives
class PublicLightingFacilityCountCurveType(V):
section = 'demand (social infrastructure)'
option = 'public lighting facility count curve type'
aliases = ['li_cc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class PublicLightingFacilityUnitDemandPerPublicLightingFacilityPerYear(V):
section = 'demand (social infrastructure)'
option = 'public lighting facility unit demand per public lighting facility per year'
aliases = ['li_dc_unit']
default = 0 # 102
units = 'kilowatt-hours per year'
Derivatives
class SocialInfrastructureDemandCurvePoints(V):
section = 'demand (social infrastructure)'
option = 'demand curve points (population and multiplier)'
aliases = ['so_dc_pts']
c = dict(parse=store.unstringifyCoordinatesList, format=store.flattenCoordinatesList, validate='validateCoordinatesList')
default = '500 1; 1000 1.5; 5000 2.25; 10000 3.375'
units = 'population and multiplier list'
Derivatives
class SocialInfrastructureDemandCurveType(V):
section = 'demand (social infrastructure)'
option = 'demand curve type'
aliases = ['so_dc_t']
c = dict(parse=str, input=curve.inputCurveType)
default = 'ZeroLogisticLinear'
Derivatives
class LowVoltageLineCostPerMeter(V):
section = 'distribution'
option = 'low voltage line cost per meter'
aliases = ['di_ll_cm']
default = 10
units = 'dollars per meter'
Derivatives
class LowVoltageLineEquipmentCostPerConnection(V):
section = 'distribution'
option = 'low voltage line equipment cost per connection'
aliases = ['di_le_cc']
default = 200
units = 'dollars per connection'
Derivatives
class LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYearAsFractionOfEquipmentCost(V):
section = 'distribution'
option = 'low voltage line equipment operations and maintenance cost as fraction of equipment cost'
aliases = ['di_le_omf']
default = 0.01
Dependencies
Derivatives
class LowVoltageLineInitialCost(V):
section = 'distribution'
option = 'low voltage line initial cost'
aliases = ['di_ll_ini']
dependencies = [
LowVoltageLineLength,
LowVoltageLineCostPerMeter,
]
units = 'dollars'
def compute(self):
return self.get(LowVoltageLineCostPerMeter) * self.get(LowVoltageLineLength)
Dependencies
Derivatives
class LowVoltageLineLength(V):
section = 'distribution'
option = 'low voltage line length'
aliases = ['di_ll_len']
dependencies = [
demographics.MeanInterhouseholdDistance,
demand.TargetHouseholdCount,
]
units = 'meters'
def compute(self):
# Load
meanInterhouseholdDistance = self.get(demographics.MeanInterhouseholdDistance)
targetHouseholdCount = self.get(demand.TargetHouseholdCount)
# Return
return meanInterhouseholdDistance * (targetHouseholdCount - 1) if targetHouseholdCount > 1 else 0
Derivatives
class LowVoltageLineLifetime(V):
section = 'distribution'
option = 'low voltage line lifetime'
aliases = ['di_ll_life']
c = dict(check=store.assertPositive)
default = 10
units = 'years'
Dependencies
Derivatives
class LowVoltageLineOperationsAndMaintenanceCostPerYear(V):
section = 'distribution'
option = 'low voltage line operations and maintenance cost per year'
aliases = ['di_ll_om']
dependencies = [
LowVoltageLineOperationsAndMaintenanceCostPerYearAsFractionOfLineCost,
LowVoltageLineCostPerMeter,
LowVoltageLineLength,
]
units = 'dollars per year'
def compute(self):
return self.get(LowVoltageLineOperationsAndMaintenanceCostPerYearAsFractionOfLineCost) * self.get(LowVoltageLineCostPerMeter) * self.get(LowVoltageLineLength)
Derivatives
class LowVoltageLineOperationsAndMaintenanceCostPerYearAsFractionOfLineCost(V):
section = 'distribution'
option = 'low voltage line operations and maintenance cost per year as fraction of line cost'
aliases = ['di_ll_omf']
default = 0.01
Dependencies
Derivatives
class LowVoltageLineRecurringCostPerYear(V):
section = 'distribution'
option = 'low voltage line recurring cost per year'
aliases = ['di_ll_rec']
dependencies = [
LowVoltageLineOperationsAndMaintenanceCostPerYear,
LowVoltageLineReplacementCostPerYear,
]
units = 'dollars per year'
def compute(self):
return sum([
self.get(LowVoltageLineOperationsAndMaintenanceCostPerYear),
self.get(LowVoltageLineReplacementCostPerYear),
])
Dependencies
Derivatives
class LowVoltageLineReplacementCostPerYear(V):
section = 'distribution'
option = 'low voltage line replacement cost per year'
aliases = ['di_ll_rep']
dependencies = [
LowVoltageLineInitialCost,
LowVoltageLineLifetime,
]
units = 'dollars per year'
def compute(self):
return self.get(LowVoltageLineInitialCost) / float(self.get(LowVoltageLineLifetime))
Dependencies
Derivatives
class DieselComponentInitialCost(costMiniGrid.MiniGridSystemInitialCost):
section = 'system (off-grid)'
option = 'diesel component initial cost'
aliases = ['og_d_ini']
dependencies = [
DieselGeneratorCost,
DieselGeneratorInstallationCost,
]
def compute(self):
return sum([
self.get(DieselGeneratorCost),
self.get(DieselGeneratorInstallationCost),
])
Dependencies
Derivatives
class DieselComponentRecurringCostPerYear(costMiniGrid.MiniGridSystemRecurringCostPerYear):
section = 'system (off-grid)'
option = 'diesel component recurring cost per year'
aliases = ['og_d_rec']
dependencies = [
DieselGeneratorOperationsAndMaintenanceCostPerYear,
DieselGeneratorReplacementCostPerYear,
DieselFuelCostPerYear,
]
def compute(self):
return sum([
self.get(DieselGeneratorOperationsAndMaintenanceCostPerYear),
self.get(DieselGeneratorReplacementCostPerYear),
self.get(DieselFuelCostPerYear),
])
Dependencies
Derivatives
class DieselFuelCostPerYear(costMiniGrid.DieselFuelCostPerYear):
section = 'system (off-grid)'
aliases = ['og_fl']
dependencies = [
costMiniGrid.DieselFuelCostPerLiter,
costMiniGrid.DieselFuelLitersConsumedPerKilowattHour,
DieselGeneratorActualSystemCapacity,
DieselGeneratorEffectiveHoursOfOperationPerYear,
]
def compute(self):
return self.get(costMiniGrid.DieselFuelCostPerLiter) * self.get(costMiniGrid.DieselFuelLitersConsumedPerKilowattHour) * self.get(DieselGeneratorActualSystemCapacity) * self.get(DieselGeneratorEffectiveHoursOfOperationPerYear)
Dependencies
Derivatives
class DieselGeneratorActualSystemCapacity(costMiniGrid.DieselGeneratorActualSystemCapacity):
section = 'system (off-grid)'
aliases = ['og_dg_acp']
dependencies = [
DieselGeneratorAvailableSystemCapacities,
DieselGeneratorActualSystemCapacityCounts,
]
def compute(self):
return numpy.dot(
self.get(DieselGeneratorAvailableSystemCapacities),
self.get(DieselGeneratorActualSystemCapacityCounts))
Dependencies
Derivatives
class DieselGeneratorActualSystemCapacityCounts(costMiniGrid.DieselGeneratorActualSystemCapacityCounts):
section = 'system (off-grid)'
aliases = ['og_dg_acps']
dependencies = [
DieselGeneratorDesiredSystemCapacity,
DieselGeneratorAvailableSystemCapacities,
]
def compute(self):
return metric.computeSystemCounts(
self.get(DieselGeneratorDesiredSystemCapacity),
self.get(DieselGeneratorAvailableSystemCapacities))
Derivatives
class DieselGeneratorAvailableSystemCapacities(costMiniGrid.DieselGeneratorAvailableSystemCapacities):
section = 'system (off-grid)'
default = '1000 750 500 400 200 150 100 70 32 19 12 10 8 6'
aliases = ['og_dg_cps']
Dependencies
Derivatives
class DieselGeneratorCost(costMiniGrid.DieselGeneratorCost):
section = 'system (off-grid)'
aliases = ['og_dg_ini']
dependencies = [
costMiniGrid.DieselGeneratorCostPerDieselSystemKilowatt,
DieselGeneratorActualSystemCapacity,
]
def compute(self):
return self.get(costMiniGrid.DieselGeneratorCostPerDieselSystemKilowatt) * self.get(DieselGeneratorActualSystemCapacity)
Dependencies
Derivatives
class DieselGeneratorDesiredSystemCapacity(costMiniGrid.DieselGeneratorDesiredSystemCapacity):
section = 'system (off-grid)'
aliases = ['og_dg_dcp']
dependencies = [
demand.ProjectedPeakCommercialFacilityDemand,
demand.ProjectedPeakProductiveDemand,
]
def compute(self):
return sum([
self.get(demand.ProjectedPeakCommercialFacilityDemand),
self.get(demand.ProjectedPeakProductiveDemand),
])
Dependencies
Derivatives
class DieselGeneratorEffectiveHoursOfOperationPerYear(V):
section = 'system (off-grid)'
option = 'diesel generator hours of operation per year (effective)'
aliases = ['og_dg_efhr']
dependencies = [
demand.ProjectedCommercialFacilityDemandPerYear,
demand.ProjectedProductiveDemandPerYear,
DieselGeneratorMinimumHoursOfOperationPerYear,
DieselGeneratorActualSystemCapacity,
]
units = 'hours per year'
def compute(self):
# Initialize
dieselGeneratorActualSystemCapacity = self.get(DieselGeneratorActualSystemCapacity)
# If the capacity of the diesel generator is zero,
if dieselGeneratorActualSystemCapacity == 0:
# Return zero hours of operation
return 0
# Compute effectiveDemandPerYear and assume an off-grid diesel generator does NOT have distribution loss
effectiveDemandPerYear = self.get(demand.ProjectedCommercialFacilityDemandPerYear) + self.get(demand.ProjectedProductiveDemandPerYear)
# Return
return max(self.get(DieselGeneratorMinimumHoursOfOperationPerYear), effectiveDemandPerYear / float(dieselGeneratorActualSystemCapacity))
Dependencies
Derivatives
class DieselGeneratorInstallationCost(costMiniGrid.DieselGeneratorInstallationCost):
section = 'system (off-grid)'
aliases = ['og_dg_i']
dependencies = [
costMiniGrid.DieselGeneratorInstallationCostAsFractionOfGeneratorCost,
DieselGeneratorCost,
]
def compute(self):
return self.get(costMiniGrid.DieselGeneratorInstallationCostAsFractionOfGeneratorCost) * self.get(DieselGeneratorCost)
Derivatives
class DieselGeneratorMinimumHoursOfOperationPerYear(V):
section = 'system (off-grid)'
option = 'diesel generator hours of operation per year (minimum)'
aliases = ['og_dg_mnhr']
default = 1460
units = 'hours per year'
Dependencies
Derivatives
class DieselGeneratorOperationsAndMaintenanceCostPerYear(costMiniGrid.DieselGeneratorOperationsAndMaintenanceCostPerYear):
section = 'system (off-grid)'
aliases = ['og_dg_om']
dependencies = [
costMiniGrid.DieselGeneratorOperationsAndMaintenanceCostPerYearAsFractionOfGeneratorCost,
DieselGeneratorCost,
]
def compute(self):
return self.get(costMiniGrid.DieselGeneratorOperationsAndMaintenanceCostPerYearAsFractionOfGeneratorCost) * self.get(DieselGeneratorCost)
Dependencies
Derivatives
class DieselGeneratorReplacementCostPerYear(costMiniGrid.DieselGeneratorReplacementCostPerYear):
section = 'system (off-grid)'
aliases = ['og_dg_rep']
dependencies = [
DieselGeneratorCost,
costMiniGrid.DieselGeneratorLifetime,
]
def compute(self):
return self.get(DieselGeneratorCost) / float(self.get(costMiniGrid.DieselGeneratorLifetime))
Dependencies
Derivatives
class OffGridSystemInitialCost(V):
section = 'system (off-grid)'
option = 'system initial cost'
aliases = ['og_ini']
dependencies = [
PhotovoltaicComponentInitialCost,
DieselComponentInitialCost,
]
units = 'dollars'
def compute(self):
return self.get(PhotovoltaicComponentInitialCost) + self.get(DieselComponentInitialCost)
Dependencies
Derivatives
class OffGridSystemNodalDiscountedCost(V):
section = 'system (off-grid)'
option = 'system nodal discounted cost'
aliases = ['og_nod_d']
dependencies = [
demand.ProjectedNodalDemandPerYear,
OffGridSystemInitialCost,
OffGridSystemRecurringCostPerYear,
finance.DiscountedCashFlowFactor,
]
units = 'dollars'
def compute(self):
if self.get(demand.ProjectedNodalDemandPerYear) == 0:
return 0
return self.get(OffGridSystemInitialCost) + self.get(OffGridSystemRecurringCostPerYear) * self.get(finance.DiscountedCashFlowFactor)
Dependencies
Derivatives
class OffGridSystemNodalLevelizedCost(V):
section = 'system (off-grid)'
option = 'system nodal levelized cost'
aliases = ['og_nod_lev']
dependencies = [
demand.ProjectedNodalDiscountedDemand,
OffGridSystemNodalDiscountedCost,
]
units = 'dollars per kilowatt-hour'
def compute(self):
if self.get(demand.ProjectedNodalDiscountedDemand) == 0:
return 0
return self.get(OffGridSystemNodalDiscountedCost) / float(self.get(demand.ProjectedNodalDiscountedDemand))
Dependencies
Derivatives
class OffGridSystemRecurringCostPerYear(V):
section = 'system (off-grid)'
option = 'system recurring cost per year'
aliases = ['og_rec']
dependencies = [
PhotovoltaicComponentRecurringCostPerYear,
DieselComponentRecurringCostPerYear,
]
units = 'dollars per year'
def compute(self):
return self.get(PhotovoltaicComponentRecurringCostPerYear) + self.get(DieselComponentRecurringCostPerYear)
Derivatives
class OffGridSystemTotalDiscountedCost(V):
section = 'system (off-grid)'
option = 'system total discounted cost'
aliases = ['og_tot_d']
default = 0
units = 'dollars'
def aggregate(self, childVS):
# If the system is off-grid,
if childVS.get(System)[0] == 'o':
# Update
self.value += childVS.get(costOffGrid.OffGridSystemNodalDiscountedCost)
Derivatives
class OffGridSystemTotalDiscountedDemand(V):
section = 'system (off-grid)'
option = 'system total discounted demand'
aliases = ['og_dem_d']
default = 0
units = 'kilowatt-hours'
def aggregate(self, childVS):
# If the system is off-grid,
if childVS.get(System)[0] == 'o':
# Update
self.value += childVS.get(demand.ProjectedNodalDiscountedDemand)
Dependencies
class OffGridSystemTotalLevelizedCost(V):
section = 'system (off-grid)'
option = 'system total levelized cost'
aliases = ['og_tot_lev']
dependencies = [
OffGridSystemTotalDiscountedDemand,
OffGridSystemTotalDiscountedCost,
]
units = 'dollars per kilowatt-hour'
def compute(self):
if self.get(OffGridSystemTotalDiscountedDemand) == 0:
return 0
return self.get(OffGridSystemTotalDiscountedCost) / float(self.get(OffGridSystemTotalDiscountedDemand))
Derivatives
class PeakSunHoursPerYear(V):
"""
Peak sun hours is the number of hours per year during which sunlight
is considered brightest for a given location.
"""
section = 'system (off-grid)'
option = 'peak sun hours per year'
aliases = ['pksu_hr']
c = dict(check=store.assertPositive)
default = 1320
units = 'hours per year'
Dependencies
Derivatives
class PhotovoltaicBalanceCost(V):
"""
The balance consists of the parts of the photovoltaic system besides
the panels and the batteries.
"""
section = 'system (off-grid)'
option = 'photovoltaic balance cost'
aliases = ['og_px_ini']
dependencies = [
PhotovoltaicBalanceCostAsFractionOfPanelCost,
PhotovoltaicPanelCost,
]
units = 'dollars'
def compute(self):
return self.get(PhotovoltaicBalanceCostAsFractionOfPanelCost) * self.get(PhotovoltaicPanelCost)
Derivatives
class PhotovoltaicBalanceCostAsFractionOfPanelCost(V):
section = 'system (off-grid)'
option = 'photovoltaic balance cost as fraction of panel cost'
aliases = ['og_px_cf']
default = 0.5
Derivatives
class PhotovoltaicBalanceLifetime(V):
section = 'system (off-grid)'
option = 'photovoltaic balance lifetime'
aliases = ['og_px_life']
c = dict(check=store.assertPositive)
default = 10
units = 'years'
Dependencies
Derivatives
class PhotovoltaicBalanceReplacementCostPerYear(V):
section = 'system (off-grid)'
option = 'photovoltaic balance replacement cost per year'
aliases = ['og_px_rep']
dependencies = [
PhotovoltaicBalanceCost,
PhotovoltaicBalanceLifetime,
]
units = 'dollars per year'
def compute(self):
return self.get(PhotovoltaicBalanceCost) / float(self.get(PhotovoltaicBalanceLifetime))
Dependencies
Derivatives
class PhotovoltaicBatteryCost(V):
section = 'system (off-grid)'
option = 'photovoltaic battery cost'
aliases = ['og_pb_ini']
dependencies = [
PhotovoltaicBatteryCostPerKilowattHour,
PhotovoltaicBatteryKilowattHoursPerPhotovoltaicComponentKilowatt,
PhotovoltaicPanelActualSystemCapacity,
]
units = 'dollars'
def compute(self):
return self.get(PhotovoltaicBatteryCostPerKilowattHour) * self.get(PhotovoltaicBatteryKilowattHoursPerPhotovoltaicComponentKilowatt) * self.get(PhotovoltaicPanelActualSystemCapacity)
Derivatives
class PhotovoltaicBatteryCostPerKilowattHour(V):
section = 'system (off-grid)'
option = 'photovoltaic battery cost per kilowatt-hour'
aliases = ['og_pb_ckwh']
default = 400
units = 'dollars per kilowatt-hour'
Derivatives
class PhotovoltaicBatteryKilowattHoursPerPhotovoltaicComponentKilowatt(V):
section = 'system (off-grid)'
option = 'photovoltaic battery kilowatt-hours per photovoltaic component kilowatt'
aliases = ['og_pb_hkw']
default = 5
units = 'kilowatt-hours per kilowatt'
Derivatives
class PhotovoltaicBatteryLifetime(V):
section = 'system (off-grid)'
option = 'photovoltaic battery lifetime'
aliases = ['og_pb_life']
c = dict(check=store.assertPositive)
default = 3
units = 'years'
Dependencies
Derivatives
class PhotovoltaicBatteryReplacementCostPerYear(V):
section = 'system (off-grid)'
option = 'photovoltaic battery replacement cost per year'
aliases = ['og_pb_rep']
dependencies = [
PhotovoltaicBatteryCost,
PhotovoltaicBatteryLifetime,
]
units = 'dollars per year'
def compute(self):
return self.get(PhotovoltaicBatteryCost) / float(self.get(PhotovoltaicBatteryLifetime))
Derivatives
class PhotovoltaicComponentEfficiencyLoss(V):
section = 'system (off-grid)'
option = 'photovoltaic component efficiency loss'
aliases = ['og_p_loss']
c = dict(check=store.assertLessThanOne)
default = 0.1
units = 'fraction'
Dependencies
Derivatives
class PhotovoltaicComponentInitialCost(V):
section = 'system (off-grid)'
option = 'photovoltaic component initial cost'
aliases = ['og_p_ini']
dependencies = [
PhotovoltaicPanelCost,
PhotovoltaicBatteryCost,
PhotovoltaicBalanceCost,
]
units = 'dollars'
def compute(self):
return self.get(PhotovoltaicPanelCost) + self.get(PhotovoltaicBatteryCost) + self.get(PhotovoltaicBalanceCost)
Dependencies
Derivatives
class PhotovoltaicComponentOperationsAndMaintenanceCostPerYear(V):
section = 'system (off-grid)'
option = 'photovoltaic component operations and maintenance cost per year'
aliases = ['og_p_om']
dependencies = [
PhotovoltaicComponentOperationsAndMaintenanceCostPerYearAsFractionOfComponentCost,
PhotovoltaicComponentInitialCost,
]
units = 'dollars per year'
def compute(self):
return self.get(PhotovoltaicComponentOperationsAndMaintenanceCostPerYearAsFractionOfComponentCost) * self.get(PhotovoltaicComponentInitialCost)
Derivatives
class PhotovoltaicComponentOperationsAndMaintenanceCostPerYearAsFractionOfComponentCost(V):
section = 'system (off-grid)'
option = 'photovoltaic component operations and maintenance cost per year as fraction of component cost'
aliases = ['og_p_omf']
default = 0.05
Dependencies
Derivatives
class PhotovoltaicComponentRecurringCostPerYear(V):
section = 'system (off-grid)'
option = 'photovoltaic component recurring cost per year'
aliases = ['og_p_rec']
dependencies = [
PhotovoltaicPanelReplacementCostPerYear,
PhotovoltaicBatteryReplacementCostPerYear,
PhotovoltaicBalanceReplacementCostPerYear,
PhotovoltaicComponentOperationsAndMaintenanceCostPerYear,
]
units = 'dollars per year'
def compute(self):
return self.get(PhotovoltaicPanelReplacementCostPerYear) + self.get(PhotovoltaicBatteryReplacementCostPerYear) + self.get(PhotovoltaicBalanceReplacementCostPerYear) + self.get(PhotovoltaicComponentOperationsAndMaintenanceCostPerYear)
Dependencies
Derivatives
class PhotovoltaicPanelActualSystemCapacity(V):
section = 'system (off-grid)'
option = 'photovoltaic panel actual capacity'
aliases = ['og_pp_acp']
dependencies = [
PhotovoltaicPanelAvailableSystemCapacities,
PhotovoltaicPanelActualSystemCapacityCounts,
]
units = 'kilowatts'
def compute(self):
return numpy.dot(
self.get(PhotovoltaicPanelAvailableSystemCapacities),
self.get(PhotovoltaicPanelActualSystemCapacityCounts))
Dependencies
Derivatives
class PhotovoltaicPanelActualSystemCapacityCounts(V):
section = 'system (off-grid)'
option = 'photovoltaic panel actual capacity counts'
aliases = ['og_pp_acps']
c = dict(parse=store.unstringifyIntegerList, format=store.flattenList, validate='validateNumberList')
dependencies = [
PhotovoltaicPanelDesiredSystemCapacity,
PhotovoltaicPanelAvailableSystemCapacities,
]
units = 'capacity count list'
def compute(self):
return metric.computeSystemCounts(
self.get(PhotovoltaicPanelDesiredSystemCapacity),
self.get(PhotovoltaicPanelAvailableSystemCapacities))
Derivatives
class PhotovoltaicPanelAvailableSystemCapacities(V):
section = 'system (off-grid)'
option = 'available system capacities (photovoltaic panel)'
aliases = ['og_pp_cps']
c = dict(parse=store.unstringifyDescendingFloatList, format=store.flattenList, validate='validateNumberList')
default = '1.5 1.0 0.4 0.15 0.075 0.05'
units = 'kilowatts list'
Dependencies
Derivatives
class PhotovoltaicPanelCost(V):
section = 'system (off-grid)'
option = 'photovoltaic panel cost'
aliases = ['og_pp_ini']
dependencies = [
PhotovoltaicPanelCostPerPhotovoltaicComponentKilowatt,
PhotovoltaicPanelActualSystemCapacity,
]
units = 'dollars'
def compute(self):
return self.get(PhotovoltaicPanelCostPerPhotovoltaicComponentKilowatt) * self.get(PhotovoltaicPanelActualSystemCapacity)
Derivatives
class PhotovoltaicPanelCostPerPhotovoltaicComponentKilowatt(V):
section = 'system (off-grid)'
option = 'photovoltaic panel cost per photovoltaic component kilowatt'
aliases = ['og_pp_ckw']
default = 6000
units = 'dollars per kilowatt'
Dependencies
Derivatives
class PhotovoltaicPanelDesiredSystemCapacity(V):
section = 'system (off-grid)'
option = 'photovoltaic panel desired capacity'
aliases = ['og_pp_dcp']
dependencies = [
demand.ProjectedHouseholdDemandPerYear,
demand.ProjectedHealthFacilityDemandPerYear,
demand.ProjectedEducationFacilityDemandPerYear,
demand.ProjectedPublicLightingFacilityDemandPerYear,
PhotovoltaicComponentEfficiencyLoss,
PeakSunHoursPerYear,
]
units = 'kilowatts'
def compute(self):
# Computed effectiveDemandPerYear scaled by photovoltaic component loss
effectiveDemandPerYear = sum([
self.get(demand.ProjectedHouseholdDemandPerYear),
self.get(demand.ProjectedHealthFacilityDemandPerYear),
self.get(demand.ProjectedEducationFacilityDemandPerYear),
self.get(demand.ProjectedPublicLightingFacilityDemandPerYear),
]) / float(1 - self.get(PhotovoltaicComponentEfficiencyLoss))
# Return
return effectiveDemandPerYear / float(self.get(PeakSunHoursPerYear))
Derivatives
class PhotovoltaicPanelLifetime(V):
section = 'system (off-grid)'
option = 'photovoltaic panel lifetime'
aliases = ['og_pp_life']
c = dict(check=store.assertPositive)
default = 30
units = 'years'
Dependencies
Derivatives
class PhotovoltaicPanelReplacementCostPerYear(V):
section = 'system (off-grid)'
option = 'photovoltaic panel replacement cost per year'
aliases = ['og_pp_rep']
dependencies = [
PhotovoltaicPanelCost,
PhotovoltaicPanelLifetime,
]
units = 'dollars per year'
def compute(self):
return self.get(PhotovoltaicPanelCost) / float(self.get(PhotovoltaicPanelLifetime))
Derivatives
class DieselFuelCostPerLiter(V):
section = 'system (mini-grid)'
option = 'diesel fuel cost per liter'
aliases = ['mg_fl_cl']
default = 1.08
units = 'dollars per liter'
Dependencies
Derivatives
class DieselFuelCostPerYear(V):
section = 'system (mini-grid)'
option = 'diesel fuel cost per year'
aliases = ['mg_fl']
dependencies = [
DieselFuelCostPerLiter,
DieselFuelLitersConsumedPerKilowattHour,
DieselGeneratorActualSystemCapacity,
DieselGeneratorEffectiveHoursOfOperationPerYear,
]
units = 'dollars per year'
def compute(self):
return self.get(DieselFuelCostPerLiter) * self.get(DieselFuelLitersConsumedPerKilowattHour) * self.get(DieselGeneratorActualSystemCapacity) * self.get(DieselGeneratorEffectiveHoursOfOperationPerYear)
Derivatives
class DieselFuelLitersConsumedPerKilowattHour(V):
section = 'system (mini-grid)'
option = 'diesel fuel liters consumed per kilowatt-hour'
aliases = ['mg_fl_lkwh']
default = 0.5
units = 'liters per kilowatt-hour'
Dependencies
Derivatives
class DieselGeneratorActualSystemCapacity(V):
section = 'system (mini-grid)'
option = 'diesel generator actual system capacity'
aliases = ['mg_dg_acp']
dependencies = [
DieselGeneratorAvailableSystemCapacities,
DieselGeneratorActualSystemCapacityCounts,
]
units = 'kilowatts'
def compute(self):
return numpy.dot(
self.get(DieselGeneratorAvailableSystemCapacities),
self.get(DieselGeneratorActualSystemCapacityCounts))
Dependencies
Derivatives
class DieselGeneratorActualSystemCapacityCounts(V):
section = 'system (mini-grid)'
option = 'diesel generator actual system capacity counts'
aliases = ['mg_dg_acps']
c = dict(parse=store.unstringifyIntegerList, format=store.flattenList, validate='validateNumberList')
dependencies = [
DieselGeneratorDesiredSystemCapacity,
DieselGeneratorAvailableSystemCapacities,
]
units = 'capacity count list'
def compute(self):
return metric.computeSystemCounts(
self.get(DieselGeneratorDesiredSystemCapacity),
self.get(DieselGeneratorAvailableSystemCapacities))
Derivatives
class DieselGeneratorAvailableSystemCapacities(V):
section = 'system (mini-grid)'
option = 'available system capacities (diesel generator)'
aliases = ['mg_dg_cps']
c = dict(parse=store.unstringifyDescendingFloatList, format=store.flattenList, validate='validateNumberList')
default = '1000 750 500 400 200 150 100 70 32 19 12 6'
units = 'kilowatts list'
Dependencies
Derivatives
class DieselGeneratorCost(V):
section = 'system (mini-grid)'
option = 'diesel generator cost'
aliases = ['mg_dg_ini']
dependencies = [
DieselGeneratorCostPerDieselSystemKilowatt,
DieselGeneratorActualSystemCapacity,
]
units = 'dollars'
def compute(self):
return self.get(DieselGeneratorCostPerDieselSystemKilowatt) * self.get(DieselGeneratorActualSystemCapacity)
Derivatives
class DieselGeneratorCostPerDieselSystemKilowatt(V):
section = 'system (mini-grid)'
option = 'diesel generator cost per diesel system kilowatt'
aliases = ['mg_dg_ck']
default = 150
units = 'dollars per kilowatt'
Dependencies
Derivatives
class DieselGeneratorDesiredSystemCapacity(V):
section = 'system (mini-grid)'
option = 'diesel generator desired system capacity'
aliases = ['mg_dg_dcp']
dependencies = [
demand.ProjectedPeakNodalDemand,
DistributionLoss,
]
units = 'kilowatts'
def compute(self):
return self.get(demand.ProjectedPeakNodalDemand) / float(1 - self.get(DistributionLoss))
Dependencies
Derivatives
class DieselGeneratorEffectiveHoursOfOperationPerYear(V):
section = 'system (mini-grid)'
option = 'diesel generator hours of operation per year (effective)'
aliases = ['mg_dg_efhr']
dependencies = [
demand.ProjectedNodalDemandPerYear,
DistributionLoss,
DieselGeneratorMinimumHoursOfOperationPerYear,
DieselGeneratorActualSystemCapacity,
]
units = 'hours per year'
def compute(self):
# Initialize
dieselGeneratorActualSystemCapacity = self.get(DieselGeneratorActualSystemCapacity)
# If the capacity of the diesel generator is zero,
if dieselGeneratorActualSystemCapacity == 0:
# Return zero hours of operation
return 0
# Compute effectiveDemandPerYear and assume a mini-grid diesel generator has distribution loss
effectiveDemandPerYear = self.get(demand.ProjectedNodalDemandPerYear) / float(1 - self.get(DistributionLoss))
# Return
return max(self.get(DieselGeneratorMinimumHoursOfOperationPerYear), effectiveDemandPerYear / float(dieselGeneratorActualSystemCapacity))
Dependencies
Derivatives
class DieselGeneratorInstallationCost(V):
section = 'system (mini-grid)'
option = 'diesel generator installation cost'
aliases = ['mg_dg_i']
dependencies = [
DieselGeneratorInstallationCostAsFractionOfGeneratorCost,
DieselGeneratorCost,
]
units = 'dollars'
def compute(self):
return self.get(DieselGeneratorInstallationCostAsFractionOfGeneratorCost) * self.get(DieselGeneratorCost)
Derivatives
class DieselGeneratorInstallationCostAsFractionOfGeneratorCost(V):
section = 'system (mini-grid)'
aliases = ['mg_dg_if']
option = 'diesel generator installation cost as fraction of generator cost'
default = 0.25
Derivatives
class DieselGeneratorLifetime(V):
section = 'system (mini-grid)'
option = 'diesel generator lifetime'
aliases = ['mg_dg_life']
c = dict(check=store.assertPositive)
default = 5
units = 'years'
Derivatives
class DieselGeneratorMinimumHoursOfOperationPerYear(V):
section = 'system (mini-grid)'
option = 'diesel generator hours of operation per year (minimum)'
aliases = ['mg_dg_mnhr']
default = 1460
units = 'hours per year'
Dependencies
Derivatives
class DieselGeneratorOperationsAndMaintenanceCostPerYear(V):
section = 'system (mini-grid)'
option = 'diesel generator operations and maintenance cost per year'
aliases = ['mg_dg_om']
dependencies = [
DieselGeneratorOperationsAndMaintenanceCostPerYearAsFractionOfGeneratorCost,
DieselGeneratorCost,
]
units = 'dollars per year'
def compute(self):
return self.get(DieselGeneratorOperationsAndMaintenanceCostPerYearAsFractionOfGeneratorCost) * self.get(DieselGeneratorCost)
Derivatives
class DieselGeneratorOperationsAndMaintenanceCostPerYearAsFractionOfGeneratorCost(V):
section = 'system (mini-grid)'
option = 'diesel generator operations and maintenance cost per year as fraction of generator cost'
aliases = ['mg_dg_omf']
default = 0.01
Dependencies
Derivatives
class DieselGeneratorReplacementCostPerYear(V):
section = 'system (mini-grid)'
option = 'diesel generator replacement cost per year'
aliases = ['mg_dg_rep']
dependencies = [
DieselGeneratorCost,
DieselGeneratorLifetime,
]
units = 'dollars per year'
def compute(self):
return self.get(DieselGeneratorCost) / float(self.get(DieselGeneratorLifetime))
Derivatives
class DistributionLoss(V):
section = 'system (mini-grid)'
option = 'distribution loss'
aliases = ['mg_loss']
c = dict(check=store.assertLessThanOne)
default = 0.10
units = 'fraction'
Dependencies
Derivatives
class LowVoltageLineEquipmentCost(V):
section = 'system (mini-grid)'
option = 'low voltage line equipment cost'
aliases = ['mg_le']
dependencies = [
costDistribution.LowVoltageLineEquipmentCostPerConnection,
demand.TargetHouseholdCount,
]
units = 'dollars'
def compute(self):
return self.get(costDistribution.LowVoltageLineEquipmentCostPerConnection) * self.get(demand.TargetHouseholdCount)
Dependencies
Derivatives
class LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYear(V):
section = 'system (mini-grid)'
option = 'low voltage line equipment operations and maintenance cost per year'
aliases = ['mg_le_om']
dependencies = [
costDistribution.LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYearAsFractionOfEquipmentCost,
LowVoltageLineEquipmentCost,
]
units = 'dollars per year'
def compute(self):
return self.get(costDistribution.LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYearAsFractionOfEquipmentCost) * self.get(LowVoltageLineEquipmentCost)
Dependencies
Derivatives
class MiniGridSystemInitialCost(V):
section = 'system (mini-grid)'
option = 'system initial cost'
aliases = ['mg_ini']
dependencies = [
DieselGeneratorCost,
DieselGeneratorInstallationCost,
LowVoltageLineEquipmentCost,
costDistribution.LowVoltageLineInitialCost,
]
units = 'dollars'
def compute(self):
return sum([
self.get(DieselGeneratorCost),
self.get(DieselGeneratorInstallationCost),
self.get(LowVoltageLineEquipmentCost),
self.get(costDistribution.LowVoltageLineInitialCost),
])
Dependencies
Derivatives
class MiniGridSystemNodalDiscountedCost(V):
section = 'system (mini-grid)'
option = 'system nodal discounted cost'
aliases = ['mg_nod_d']
dependencies = [
demand.ProjectedNodalDemandPerYear,
MiniGridSystemInitialCost,
MiniGridSystemRecurringCostPerYear,
finance.DiscountedCashFlowFactor,
]
units = 'dollars'
def compute(self):
if self.get(demand.ProjectedNodalDemandPerYear) == 0:
return 0
return self.get(MiniGridSystemInitialCost) + self.get(MiniGridSystemRecurringCostPerYear) * self.get(finance.DiscountedCashFlowFactor)
Dependencies
Derivatives
class MiniGridSystemNodalLevelizedCost(V):
section = 'system (mini-grid)'
option = 'system nodal levelized cost'
aliases = ['mg_nod_lev']
dependencies = [
demand.ProjectedNodalDiscountedDemand,
MiniGridSystemNodalDiscountedCost,
]
units = 'dollars per kilowatt-hour'
def compute(self):
if self.get(demand.ProjectedNodalDiscountedDemand) == 0:
return 0
return self.get(MiniGridSystemNodalDiscountedCost) / float(self.get(demand.ProjectedNodalDiscountedDemand))
Dependencies
Derivatives
class MiniGridSystemRecurringCostPerYear(V):
section = 'system (mini-grid)'
option = 'system recurring cost per year'
aliases = ['mg_rec']
dependencies = [
DieselGeneratorOperationsAndMaintenanceCostPerYear,
DieselGeneratorReplacementCostPerYear,
DieselFuelCostPerYear,
LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYear,
costDistribution.LowVoltageLineRecurringCostPerYear,
]
units = 'dollars per year'
def compute(self):
return sum([
self.get(DieselGeneratorOperationsAndMaintenanceCostPerYear),
self.get(DieselGeneratorReplacementCostPerYear),
self.get(DieselFuelCostPerYear),
self.get(LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYear),
self.get(costDistribution.LowVoltageLineRecurringCostPerYear),
])
Derivatives
class MiniGridSystemTotalDiscountedCost(V):
section = 'system (mini-grid)'
option = 'system total discounted cost'
aliases = ['mg_tot_d']
default = 0
units = 'dollars'
def aggregate(self, childVS):
# If the system is mini-grid,
if childVS.get(System)[0] == 'm':
# Update
self.value += childVS.get(costMiniGrid.MiniGridSystemNodalDiscountedCost)
Derivatives
class MiniGridSystemTotalDiscountedDemand(V):
section = 'system (mini-grid)'
option = 'system total discounted demand'
aliases = ['mg_dem_d']
default = 0
units = 'kilowatt-hours'
def aggregate(self, childVS):
# If the system is mini-grid,
if childVS.get(System)[0] == 'm':
# Update
self.value += childVS.get(demand.ProjectedNodalDiscountedDemand)
Dependencies
class MiniGridSystemTotalLevelizedCost(V):
section = 'system (mini-grid)'
option = 'system total levelized cost'
aliases = ['mg_tot_lev']
dependencies = [
MiniGridSystemTotalDiscountedDemand,
MiniGridSystemTotalDiscountedCost,
]
units = 'dollars per kilowatt-hour'
def compute(self):
if self.get(MiniGridSystemTotalDiscountedDemand) == 0:
return 0
return self.get(MiniGridSystemTotalDiscountedCost) / float(self.get(MiniGridSystemTotalDiscountedDemand))
Derivatives
class DistributionLoss(V):
section = 'system (grid)'
option = 'distribution loss'
aliases = ['gr_loss']
c = dict(check=store.assertLessThanOne)
default = 0.15
units = 'fraction'
Derivatives
class GridElectricityCostPerKilowattHour(V):
section = 'system (grid)'
option = 'electricity cost per kilowatt-hour'
aliases = ['gr_el_ckwh']
default = 0.17
units = 'dollars per kilowatt-hour'
Dependencies
Derivatives
class GridElectricityCostPerYear(V):
section = 'system (grid)'
option = 'electricity cost per year'
aliases = ['gr_el']
dependencies = [
GridElectricityCostPerKilowattHour,
demand.ProjectedNodalDemandPerYear,
DistributionLoss,
]
units = 'dollars per year'
def compute(self):
return self.get(GridElectricityCostPerKilowattHour) * self.get(demand.ProjectedNodalDemandPerYear) / float(1 - self.get(DistributionLoss))
Dependencies
Derivatives
class GridExternalSystemInitialCostPerMeter(V):
section = 'system (grid)'
option = 'external system initial cost per meter'
aliases = ['ge_inim']
dependencies = [
GridMediumVoltageLineCostPerMeter,
]
units = 'dollars per meter'
def compute(self):
return self.get(GridMediumVoltageLineCostPerMeter)
Dependencies
Derivatives
class GridExternalSystemNodalDiscountedCostPerMeter(V):
section = 'system (grid)'
option = 'external nodal discounted cost per meter'
aliases = ['ge_nodm_d']
c = dict(check=store.assertPositive)
dependencies = [
GridExternalSystemInitialCostPerMeter,
GridExternalSystemRecurringCostPerMeterPerYear,
finance.DiscountedCashFlowFactor,
]
units = 'dollars per meter'
def compute(self):
return self.get(GridExternalSystemInitialCostPerMeter) + self.get(GridExternalSystemRecurringCostPerMeterPerYear) * self.get(finance.DiscountedCashFlowFactor)
Dependencies
Derivatives
class GridExternalSystemRecurringCostPerMeterPerYear(V):
section = 'system (grid)'
option = 'external system recurring cost per meter per year'
aliases = ['ge_recm']
dependencies = [
GridMediumVoltageLineOperationsAndMaintenanceCostPerMeterPerYear,
GridMediumVoltageLineReplacementCostPerMeterPerYear,
]
units = 'dollars per meter per year'
def compute(self):
return self.get(GridMediumVoltageLineOperationsAndMaintenanceCostPerMeterPerYear) + self.get(GridMediumVoltageLineReplacementCostPerMeterPerYear)
Dependencies
Derivatives
class GridInstallationCost(V):
section = 'system (grid)'
option = 'installation cost'
aliases = ['gr_i']
dependencies = [
GridInstallationCostPerConnection,
GridInternalConnectionCount,
]
units = 'dollars'
def compute(self):
return self.get(GridInstallationCostPerConnection) * self.get(GridInternalConnectionCount)
Derivatives
class GridInstallationCostPerConnection(V):
section = 'system (grid)'
option = 'installation cost per connection'
aliases = ['gr_i_cc']
default = 130
units = 'dollars per connection'
Dependencies
Derivatives
class GridInternalConnectionCount(V):
section = 'system (grid)'
option = 'internal connection count'
aliases = ['gr_ic']
dependencies = [
demand.TargetHouseholdCount,
GridSocialInfrastructureCount,
]
units = 'connection count'
def compute(self):
return self.get(demand.TargetHouseholdCount) + self.get(GridSocialInfrastructureCount)
Dependencies
Derivatives
class GridInternalSystemInitialCost(V):
section = 'system (grid)'
option = 'internal system initial cost'
aliases = ['gi_ini']
dependencies = [
GridInstallationCost,
GridTransformerCost,
LowVoltageLineEquipmentCost,
costDistribution.LowVoltageLineInitialCost,
]
units = 'dollars'
def compute(self):
return sum([
self.get(GridInstallationCost),
self.get(GridTransformerCost),
self.get(LowVoltageLineEquipmentCost),
self.get(costDistribution.LowVoltageLineInitialCost),
])
Dependencies
Derivatives
class GridInternalSystemNodalDiscountedCost(V):
section = 'system (grid)'
option = 'internal system nodal discounted cost'
aliases = ['gi_nod_d']
dependencies = [
demand.ProjectedNodalDemandPerYear,
GridInternalSystemInitialCost,
GridInternalSystemRecurringCostPerYear,
finance.DiscountedCashFlowFactor,
]
units = 'dollars'
def compute(self):
if self.get(demand.ProjectedNodalDemandPerYear) == 0:
return 0
return self.get(GridInternalSystemInitialCost) + self.get(GridInternalSystemRecurringCostPerYear) * self.get(finance.DiscountedCashFlowFactor)
Dependencies
Derivatives
class GridInternalSystemNodalLevelizedCost(V):
section = 'system (grid)'
option = 'internal system nodal levelized cost'
aliases = ['gi_nod_lev']
dependencies = [
demand.ProjectedNodalDiscountedDemand,
GridInternalSystemNodalDiscountedCost,
]
units = 'dollars per kilowatt-hour'
def compute(self):
if self.get(demand.ProjectedNodalDiscountedDemand) == 0:
return 0
return self.get(GridInternalSystemNodalDiscountedCost) / float(self.get(demand.ProjectedNodalDiscountedDemand))
Dependencies
Derivatives
class GridInternalSystemRecurringCostPerYear(V):
section = 'system (grid)'
option = 'internal system recurring cost per year'
aliases = ['gi_rec']
dependencies = [
GridTransformerOperationsAndMaintenanceCostPerYear,
GridTransformerReplacementCostPerYear,
GridElectricityCostPerYear,
LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYear,
costDistribution.LowVoltageLineRecurringCostPerYear,
]
units = 'dollars per year'
def compute(self):
return sum([
self.get(GridTransformerOperationsAndMaintenanceCostPerYear),
self.get(GridTransformerReplacementCostPerYear),
self.get(GridElectricityCostPerYear),
self.get(LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYear),
self.get(costDistribution.LowVoltageLineRecurringCostPerYear),
])
Derivatives
class GridMediumVoltageLineCostPerMeter(V):
section = 'system (grid)'
option = 'medium voltage line cost per meter'
aliases = ['gr_ml_cm']
default = 20
units = 'dollars per meter'
Derivatives
class GridMediumVoltageLineLifetime(V):
section = 'system (grid)'
option = 'medium voltage line lifetime'
aliases = ['gr_ml_life']
c = dict(check=store.assertPositive)
default = 30
units = 'years'
Dependencies
Derivatives
class GridMediumVoltageLineOperationsAndMaintenanceCostPerMeterPerYear(V):
section = 'system (grid)'
option = 'medium voltage line operations and maintenace cost per meter per year'
aliases = ['gr_ml_omm']
dependencies = [
GridMediumVoltageLineOperationsAndMaintenanceCostPerYearAsFractionOfLineCost,
GridMediumVoltageLineCostPerMeter,
]
units = 'dollars per meter per year'
def compute(self):
return self.get(GridMediumVoltageLineOperationsAndMaintenanceCostPerYearAsFractionOfLineCost) * self.get(GridMediumVoltageLineCostPerMeter)
Derivatives
class GridMediumVoltageLineOperationsAndMaintenanceCostPerYearAsFractionOfLineCost(V):
section = 'system (grid)'
option = 'medium voltage line operations and maintenance cost per year as fraction of line cost'
aliases = ['gr_ml_omf']
default = 0.01
Dependencies
Derivatives
class GridMediumVoltageLineReplacementCostPerMeterPerYear(V):
section = 'system (grid)'
option = 'medium voltage line replacement cost per meter per year'
aliases = ['gr_ml_repm']
dependencies = [
GridMediumVoltageLineCostPerMeter,
GridMediumVoltageLineLifetime,
]
units = 'dollars per meter per year'
def compute(self):
return self.get(GridMediumVoltageLineCostPerMeter) / float(self.get(GridMediumVoltageLineLifetime))
Dependencies
Derivatives
class GridSocialInfrastructureCount(V):
section = 'system (grid)'
option = 'social infrastructure count'
aliases = ['gr_so']
dependencies = [
demand.ProjectedHealthFacilityCount,
demand.ProjectedEducationFacilityCount,
demand.ProjectedPublicLightingFacilityCount,
demand.ProjectedCommercialFacilityCount,
]
units = 'facility count'
def compute(self):
return self.get(demand.ProjectedHealthFacilityCount) + self.get(demand.ProjectedEducationFacilityCount) + self.get(demand.ProjectedPublicLightingFacilityCount) + self.get(demand.ProjectedCommercialFacilityCount)
Derivatives
class GridSystemTotalDiscountedCost(V):
section = 'system (grid)'
option = 'system total discounted cost'
aliases = ['gr_tot_d']
default = 0
units = 'dollars'
def aggregate(self, childVS):
# Get
childDataset = childVS.state[0]
childNode = childVS.state[1]
# If the system is grid and we are connecting a node that was not in the existing grid,
if childVS.get(System)[0] == 'g' and not childDataset.wasNodeAlreadyConnected(childNode):
# Get internal cost
internalCost = childVS.get(costGrid.GridInternalSystemNodalDiscountedCost)
# Get half the length of all new connections to the node
newConnections = childDataset.cycleConnections(childNode, is_existing=False)
newConnectionLengthHalved = sum(x.weight for x in newConnections) / 2.
# Get external cost
externalCostPerMeter = childVS.get(costGrid.GridExternalSystemNodalDiscountedCostPerMeter)
externalCost = externalCostPerMeter * newConnectionLengthHalved
# Add internal and external cost
self.value += internalCost + externalCost
Derivatives
class GridSystemTotalDiscountedDemand(V):
section = 'system (grid)'
option = 'system total discounted demand'
aliases = ['gr_dem_d']
default = 0
units = 'kilowatt-hours'
def aggregate(self, childVS):
# Get
childDataset = childVS.state[0]
childNode = childVS.state[1]
# If the system is grid and we are connecting a node that was not in the existing grid,
if childVS.get(System)[0] == 'g' and not childDataset.wasNodeAlreadyConnected(childNode):
# Update
self.value += childVS.get(demand.ProjectedNodalDiscountedDemand)
Dependencies
class GridSystemTotalLevelizedCost(V):
section = 'system (grid)'
option = 'system total levelized cost'
aliases = ['gr_tot_lev']
dependencies = [
GridSystemTotalDiscountedDemand,
GridSystemTotalDiscountedCost,
]
units = 'dollars per kilowatt-hour'
def compute(self):
if self.get(GridSystemTotalDiscountedDemand) == 0:
return 0
return self.get(GridSystemTotalDiscountedCost) / float(self.get(GridSystemTotalDiscountedDemand))
Dependencies
Derivatives
class GridTransformerActualSystemCapacity(V):
section = 'system (grid)'
option = 'grid transformer actual system capacity'
aliases = ['gr_tr_acp']
dependencies = [
GridTransformerAvailableSystemCapacities,
GridTransformerActualSystemCapacityCounts,
]
units = 'kilowatts'
def compute(self):
return numpy.dot(
self.get(GridTransformerAvailableSystemCapacities),
self.get(GridTransformerActualSystemCapacityCounts))
Dependencies
Derivatives
class GridTransformerActualSystemCapacityCounts(V):
section = 'system (grid)'
option = 'grid transformer actual system capacity counts'
aliases = ['gr_tr_acps']
c = dict(parse=store.unstringifyIntegerList, format=store.flattenList, validate='validateNumberList')
dependencies = [
GridTransformerDesiredSystemCapacity,
GridTransformerAvailableSystemCapacities,
]
units = 'capacity count list'
def compute(self):
return metric.computeSystemCounts(
self.get(GridTransformerDesiredSystemCapacity),
self.get(GridTransformerAvailableSystemCapacities))
Derivatives
class GridTransformerAvailableSystemCapacities(V):
section = 'system (grid)'
option = 'available system capacities (transformer)'
aliases = ['gr_tr_cps']
c = dict(parse=store.unstringifyDescendingFloatList, format=store.flattenList, validate='validateNumberList')
default = '1000 900 800 700 600 500 400 300 200 100 90 80 70 60 50 40 30 20 15 5'
units = 'kilowatts list'
Dependencies
Derivatives
class GridTransformerCost(V):
section = 'system (grid)'
option = 'transformer cost'
aliases = ['gr_tr']
dependencies = [
GridTransformerCostPerGridSystemKilowatt,
GridTransformerActualSystemCapacity,
]
units = 'dollars'
def compute(self):
return self.get(GridTransformerCostPerGridSystemKilowatt) * self.get(GridTransformerActualSystemCapacity)
Derivatives
class GridTransformerCostPerGridSystemKilowatt(V):
section = 'system (grid)'
option = 'transformer cost per grid system kilowatt'
aliases = ['gr_tr_ckw']
default = 1000
units = 'dollars per kilowatt'
Dependencies
Derivatives
class GridTransformerDesiredSystemCapacity(V):
section = 'system (grid)'
option = 'grid transformer desired system capacity'
aliases = ['gr_tr_dcp']
dependencies = [
demand.ProjectedPeakNodalDemand,
DistributionLoss,
]
units = 'kilowatts'
def compute(self):
return self.get(demand.ProjectedPeakNodalDemand) / float(1 - self.get(DistributionLoss))
Derivatives
class GridTransformerLifetime(V):
section = 'system (grid)'
option = 'transformer lifetime'
aliases = ['gr_tr_life']
c = dict(check=store.assertPositive)
default = 10
units = 'years'
Dependencies
Derivatives
class GridTransformerOperationsAndMaintenanceCostPerYear(V):
section = 'system (grid)'
option = 'transformer operations and maintenance cost per year'
aliases = ['gr_tr_om']
dependencies = [
GridTransformerOperationsAndMaintenanceCostPerYearAsFractionOfTransformerCost,
GridTransformerCost,
]
units = 'dollars per year'
def compute(self):
return self.get(GridTransformerOperationsAndMaintenanceCostPerYearAsFractionOfTransformerCost) * self.get(GridTransformerCost)
Derivatives
class GridTransformerOperationsAndMaintenanceCostPerYearAsFractionOfTransformerCost(V):
section = 'system (grid)'
option = 'transformer operations and maintenance cost per year as fraction of transformer cost'
aliases = ['gr_tr_omf']
default = 0.03
Dependencies
Derivatives
class GridTransformerReplacementCostPerYear(V):
section = 'system (grid)'
option = 'transformer replacement cost per year'
aliases = ['gr_tr_rep']
dependencies = [
GridTransformerCost,
GridTransformerLifetime,
]
units = 'dollars per year'
def compute(self):
return self.get(GridTransformerCost) / float(self.get(GridTransformerLifetime))
Dependencies
Derivatives
class LowVoltageLineEquipmentCost(V):
section = 'system (grid)'
option = 'low voltage line equipment cost'
aliases = ['gr_le']
dependencies = [
costDistribution.LowVoltageLineEquipmentCostPerConnection,
GridInternalConnectionCount,
]
units = 'dollars'
def compute(self):
return self.get(costDistribution.LowVoltageLineEquipmentCostPerConnection) * self.get(GridInternalConnectionCount)
Dependencies
Derivatives
class LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYear(V):
section = 'system (grid)'
option = 'low voltage line equipment operations and maintenance cost per year'
aliases = ['gr_le_om']
dependencies = [
costDistribution.LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYearAsFractionOfEquipmentCost,
LowVoltageLineEquipmentCost,
]
units = 'dollars per year'
def compute(self):
return self.get(costDistribution.LowVoltageLineEquipmentOperationsAndMaintenanceCostPerYearAsFractionOfEquipmentCost) * self.get(LowVoltageLineEquipmentCost)
Dependencies
class Metric(V):
'Maximum length of medium voltage line for which grid extension is cheaper than standalone options'
section = 'metric'
option = 'maximum length of medium voltage line extension'
aliases = ['mvmax']
dependencies = [
costOffGrid.OffGridSystemNodalDiscountedCost,
costOffGrid.OffGridSystemNodalLevelizedCost,
costMiniGrid.MiniGridSystemNodalDiscountedCost,
costMiniGrid.MiniGridSystemNodalLevelizedCost,
costGrid.GridInternalSystemNodalDiscountedCost,
costGrid.GridInternalSystemNodalLevelizedCost,
costGrid.GridExternalSystemNodalDiscountedCostPerMeter,
]
units = 'meters'
def compute(self):
# Compute levelized costs
self.get(costOffGrid.OffGridSystemNodalLevelizedCost)
self.get(costMiniGrid.MiniGridSystemNodalLevelizedCost)
self.get(costGrid.GridInternalSystemNodalLevelizedCost)
# Compute the cost of the cheapest standalone option for the node
standaloneCost = min(
self.get(costOffGrid.OffGridSystemNodalDiscountedCost),
self.get(costMiniGrid.MiniGridSystemNodalDiscountedCost))
# Compute the (non-negative) amount of money we have left to spend on grid extension
gridExternalBudget = max(0, standaloneCost - self.get(costGrid.GridInternalSystemNodalDiscountedCost))
# Compute the length of line we are allowed for grid extension
return gridExternalBudget / float(self.get(costGrid.GridExternalSystemNodalDiscountedCostPerMeter))
Dependencies
class System(V):
section = 'metric'
option = 'system'
aliases = ['system']
c = dict(parse=str)
dependencies = [
demand.ProjectedNodalDemandPerYear,
costMiniGrid.MiniGridSystemNodalDiscountedCost,
costOffGrid.OffGridSystemNodalDiscountedCost,
]
def compute(self):
# If the demand is positive,
if self.get(demand.ProjectedNodalDemandPerYear) == 0:
return 'unelectrified'
# If grid is chosen,
elif self.state[0].isNodeConnected(self.state[1]):
return 'grid'
# If mini-grid is chosen,
elif self.get(costMiniGrid.MiniGridSystemNodalDiscountedCost) < self.get(costOffGrid.OffGridSystemNodalDiscountedCost):
return 'mini-grid'
# If off-grid is chosen,
else:
return 'off-grid'
Social infrastructure demand curve¶
Dependencies
Derivatives