Power.ftt_p_costc module#

ftt_p_costc.py#

Power cost-supply curves module.

Cost-supply curves give the cost of a resource as a function of its quantity, and hence provide the marginal cost of each resource. For example, if a fossil fuel resource is running out, the fuel cost increases. For e.g. hydropower, if there are less accessible places to build, then the investment cost goes up. For variable renewables, the load factor (the number of hours it delivers to the grid, divide by the number of hours in a year).

Functions included:
  • marginal_costs_nonrenewables

    Calculates marginal cost of production of non renewable resources

  • cost_curves

    Calculates cost-supply curves for the power sector

Power.ftt_p_costc.cost_curves(BCET, BCSC, MEWD, MEWG, MEWL, MEPD, MERC, MRCL, RERY, MPTR, MRED, MRES, num_regions, num_techs, num_resources, year, dt, tech_to_resource, resource_to_fuel_map, cf_multipliers, gen_tech_indices)#

FTT: Power cost-supply curves routine. This calculates the cost of resources given the available supply.

Power.ftt_p_costc.get_cf_multipliers(titles)#

Read T2TI_CF_multiplier.csv and return a dict of tech_idx -> (source_tech_idx, multiplier).

Technologies absent from the CSV are not included (treat as multiplier=1). Used to derive a technology’s capacity factor from another technology’s freshly-computed capacity factor (e.g. CSP = 2x Solar PV’s CF). The target is always set from the source’s value, never from its own prior value, so repeated calls within the same year stay idempotent rather than compounding.

Power.ftt_p_costc.get_gen_tech_indices(titles)#

Return T2TI and ERTI index pairs used in the generation-based primary energy demand block.

Each entry maps a resource name to (t2ti_index_or_list, erti_index). The schema (22-tech or 12-tech) is detected automatically from titles[‘T2TI’].

22-tech: separate entries for Biomass/Biomass+CCS, Waste/Waste+CCS, Marine,

Geothermal, Onshore, Offshore, Solar PV, CSP, Large Hydro, Pumped Hydro.

12-tech: Bioenergy and Bioenergy+CCS replace Biomass+Waste; biogas gets an empty

list (zero demand). Marine and Geothermal are merged into Other Renewable; Onshore and Offshore both map to Wind (approximation — both ERTI slots receive the full aggregate Wind generation). CSP is merged into Solar.

Power.ftt_p_costc.get_resource_to_fuel_map(titles)#

Read ERTI_JTI_map.csv and return a dict of erti_idx -> [jti_idx, …].

Used to sum non-power fuel demand (MEWD) into resource demand (MEPD) for fossil-fuel ERTI entries without hardcoding JTI integer indices.

Power.ftt_p_costc.get_tech_to_resource(titles)#

Read converters.csv and return the tech-to-resource index mapping.

Returns a list where entry j is the 0-based index into titles[‘ERTI’] of the resource used by technology j in titles[‘T2TI’]. Adding or removing rows in converters.csv automatically updates the mapping.

Power.ftt_p_costc.marginal_costs_nonrenewables(MEPD, RERY, MPTR, BCSC, HistC, MRCL, MERC, dt, num_regions, num_resources)#

Marginal cost of production of non-renewable resources.

Parameters:
  • MPTR (NumPy array) – Values of nu by region (Production to reserve ratio) See paper Mercure & Salas arXiv:1209.0708 for data

  • HistC (NumPy array) – Cost axis C

  • MRCL (NumPy array) – Previous marginal cost value

  • MEPD (NumPy array) – Total resource demand

  • MERC (NumPy array) – Current (new) marginal cost value

  • MRED (NumPy array) – Resources left

  • MRES (NumPy array) – reserves

  • RERY (NumPy array) – supply in GJ of fossil fuel resource (only I = 2 to 4 used)

  • BCSC (NumPy array) – Dataset for natural resources

  • num_regions (int) – Number of regions and resources

  • num_resources (int) – Number of regions and resources

Returns:

  • RERY

  • BCSC

  • MERC

  • MRED

  • MRES

Notes

Takes about 16s to compile, so probably not worth it unless running a lot of scenarios.

Scipy.fsolve might be a better strategy for speed ups..

Power.ftt_p_costc.update_capacity_factors(BCET, BCSC, MEWL, MERC, MEPD, tech_to_resource, loadfactor_type_mask, cf_multipliers)#

New capacity factor method. Much less strict that the previous version based on work by Rishi Sahastrabuddhe.

Power.ftt_p_costc.update_capacity_factors_original(BCET, MEWG, MEWL, BCSC, CSC_Q, MEPD, MERC, tech_to_resource, num_regions, num_techs, cf_multipliers)#
Power.ftt_p_costc.update_fuel_costs(BCET, MERC, MRCL, tech_to_resource, fuel_type_mask)#

For nuclear, oil, coal and gas, update fuel costs based on changes to MERC compared to the previous time step

Power.ftt_p_costc.update_investment_cost(BCET, BCSC, CSC_Q, MEPD, MERC, tech_to_resource, investment_type_mask)#

Increasing investment term type of limit, for technologies such as hydropower and geothermal. Unrealistically strict, so turned off