def levelize_costs(self): if hasattr(self, 'is_levelized') and ( self.definition == 'absolute' or (self.definition == 'relative' and self.reference_tech_operation == 'add')): inflation = cfg.getParamAsFloat('inflation_rate') rate = self.cost_of_capital - inflation if self.is_levelized == 0: self.values_level = -np.pmt(rate, self.book_life, 1, 0, 'end') * self.values util.convert_age(self, attr_from='values_level', attr_to='values_level', reverse=False, vintages=self.vintages, years=self.years) else: self.values_level = self.values.copy() util.convert_age(self, attr_from='values_level', attr_to='value_level', reverse=False, vintages=self.vintages, years=self.years) self.values = np.pv(rate, self.book_life, -1, 0, 'end') * self.values else: util.convert_age(self, attr_from='values', attr_to='values_level', reverse=False, vintages=self.vintages, years=self.years)
def levelize_costs(self): if self.is_levelized == 1: inflation = cfg.getParamAsFloat('inflation_rate') rate = self.cost_of_capital - inflation if self.is_levelized == 0: self.values_level = -np.pmt(rate, self.book_life, 1, 0, 'end') * self.values util.convert_age(self, attr_from='values_level', attr_to='values_level', reverse=False, vintages=self.vintages, years=self.years) else: self.values_level = self.values.copy() util.convert_age(self, attr_from='values_level', attr_to='values_level', reverse=False, vintages=self.vintages, years=self.years) self.values = np.pv(rate, self.book_life, -1, 0, 'end') * self.values else: util.convert_age(self, reverse=False, vintages=self.vintages, years=self.years)
def levelize_costs(self): if hasattr(self, 'is_levelized'): inflation = cfg.getParamAsFloat('inflation_rate') try: rate = self.cost_of_capital - inflation except: pdb.set_trace() if self.is_levelized == 0: self.values_level = - np.pmt(rate, self.book_life, 1, 0, 'end') * self.values util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False) elif self.is_levelized==1: self.values_level = self.values.copy() util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False) self.values = np.pv(rate, self.book_life, -1, 0, 'end') * self.values elif self.definition == 'relative': self.values_level = self.values.copy() util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False) else: raise ValueError("no specification of whether the technology cost is levelized") else: raise ValueError('Supply Technology id %s needs to indicate whether costs are levelized ' %self.name)
def set_max_min_flex_loads(self, flex_pmin, flex_pmax): self.flex_load_penalty_short = UnitConverter.unit_convert(cfg.getParamAsFloat('flex_load_penalty_short', 'opt'), unit_from_den='megawatt_hour', unit_to_den=cfg.calculation_energy_unit) self.flex_load_penalty_long = UnitConverter.unit_convert(cfg.getParamAsFloat('flex_load_penalty_long', 'opt'), unit_from_den='megawatt_hour', unit_to_den=cfg.calculation_energy_unit) if self.has_flexible_load: self.max_flex_load = flex_pmax.squeeze().to_dict() self.min_flex_load = flex_pmin.squeeze().to_dict()
def levelize_costs(self): inflation = cfg.getParamAsFloat('inflation_rate') rate = self.cost_of_capital - inflation self.values_level = -np.pmt(rate, self.lifetime, 1, 0, 'end') * self.values