FlexCosting¶
- class flexops.costing.flex_costing.FlexCosting(*args, **kwds)¶
- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- time_block
The fo.TimeBlock instance whose time_index/dt/datetime_index this costing aggregates and bills against. Required.
- tariff_file
Path to an EECO tariff file, or several to merge: a list of paths, or a mapping of EECO utility (‘electric’/’gas’) to path to also assign each file to a utility. At most one of tariff_file or tariff; omit both to price every carrier from energy_prices.
- tariff
An already-loaded EECO tariff object (or a list/mapping of them to merge, as for tariff_file). At most one of tariff or tariff_file.
- energy_prices
Optional native prices, as a mapping of carrier or fuel name to its price. Keys are ‘electrical’ or a registered fuel name. A price is a single value (flat over the horizon), an array-like with one value per time point, or a Pyomo component indexed over the horizon (so the price may itself be a model Param or Var); anything with the wrong number of values raises. A price may carry Pyomo units (0.12 * currency_units(‘USD’) / pyunits.kWh) or be a bare number, which is read in the currency over the carrier’s metered quantity — kWh for a power carrier, m**3 for a fuel. A carrier priced here is billed natively and is NOT sent to EECO, so it needs no tariff.
- export_prices
Optional prices paid for exports, as a mapping of carrier or fuel name to its price, in the same forms and units as energy_prices. Each key needs a native energy_prices entry, and its export price must not exceed that import price at any time point. A carrier priced here has its net series split into non-negative import_<carrier> and export_<carrier>, billed at the import and export prices; the model stays an LP because exporting is never more profitable than importing is costly. A carrier left out credits exports at its import price (net metering).
- decomposition_type
Optional EECO decomposition of net electrical power and fuel usage into imports and exports on the tariff path, e.g. ‘linear’, so the tariff’s export charges apply to an exporting site. Passed straight to EECO, which owns the available types and whether they are linear. None skips the decomposition. Has no effect on native prices; use export_prices for those.
- currency
Currency basis to use when no tariff is given (a tariff’s own currency basis always wins). Registered as a Pyomo currency unit, so flat prices must be written in it.
- prorate_monthly_charges
Prorate a tariff’s monthly-assessed demand charge and fixed (customer) charge to the horizon length when the horizon is shorter than the calendar month it starts in. Set False to bill the full monthly charges regardless of horizon length.
- consumption_estimate
Estimated total consumption over the horizon, keyed by EECO utility (‘electric’/’gas’; kWh / m**3). EECO needs it to price any tier other than a flat top tier.
- dr_event_file
Optional path to an EECO demand-response program file. v0 loads it into a container only (no DR constraints built).
- fixed_operating_cost
Fixed operating cost in dollars over the horizon (non- tariff: maintenance, labor, chemicals). Distinct from the tariff’s own fixed charge, which EECO folds into electricity cost.
- lifetime_years
Plant lifetime in years (> 0), used with the effective rate to form the capital recovery factor that annualizes capital cost.
- discount_rate
Annual discount rate (fraction, e.g. 0.08 = 8%). Used alone as the effective rate when interest_rate is unset; otherwise it deflates interest_rate into a real effective rate. An effective rate of 0 falls back to straight-line 1/lifetime.
- interest_rate
Optional annual cost of capital (fraction, e.g. 0.06). When given, the capital recovery factor uses the effective rate (1 + interest_rate) / (1 + discount_rate) - 1. Leave unset to use discount_rate alone.
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(FlexCosting) New instance