Fuel Price

FuelPrice(;file, fp_scalar=1e3) <: Modification

FuelPrice is a Modification allowing users to specify fuel prices for different fuels by region. If multiple steps and quantities are given, the fuel price for a given region will be computed endogenously.

To adjust price by hour or year, see AdjustHourly or AdjustYearly.


  • file - file path to the table of fuel steps. See [summarize_table(::Val{:fuel_price})]@(ref)
  • fp_scalar = 1e3 - a Float64 for how much to scale the fuel price variables by. This helps with numerical instability, given that some fuel steps can be very large and could bloat the RHS and bounds range of the model. The default value of 1e3, for example, means that the quantity variables will all be in terms of thousands of MMBtu rather than MMBtu.
modify_raw_data!(mod::FuelPrice, config, data)

Read table from mod.file into data[:fuel_price]

modify_setup_data!(mod::FuelPrice, config, data)

Zero out the fuel_price column of the gen table, as it will get overwritten later by this Modification. This is to avoid double-counting the fuel cost.

modify_model!(mod::FuelPrice, config, data, model)
  • Make data[:fuel_markets] to keep track of each of the fuel markets
  • Add variable fuel_sold[fuel_price_idx, yr_idx, hr_idx]: total fuel sold at each price step for each time interval
  • Add expression fuel_used[fuel_market_idx, yr_idx, hr_idx]: total fuel used by generators for each market region for each time interval
  • Add expression fuel_price_obj[fuel_market_idx, yr_idx, hr_idx]: total cost of the fuel, added to the objective.
  • Add constraint cons_fuel_sold[fuel_price_idx, yr_idx]: constrain the total fuel_sold in each year to be ≤ yearly quantity
  • Add constraint cons_fuel_bal[fuel_market_idx, yr_idx, hr_idx]: constrain the amount of fuel sold in each market region to equal the amount of fuel used in each market region.

fuel_sold and fuel_used will be scaled down using the fp_scalar to reduce the difference in size between the variables used together in these constraints. This prevents issues with shadow prices which can sometimes be rounded to 0 when the objective scalar is high.

modify_results!(mod::FuelPrice, config, data)
  • Calculate the clearing price for each market region for each fuel type.
    • Equal to the shadow price of cons_fuel_sold for the cheapest fuel price step in the region plus the cheapest fuel price
    • Add it to fuel_markets.clearing_price column
    • Update gen.fuel_price column to use the clearing price (multiplied by the heat_rate column)
genfuelStringE4ST.NAtrueThe type of fuel that the price applies for. i.e. ng or coal
areaStringE4ST.NAtrueThe area that the price applies for i.e. nation. Leave blank if grid-wide
subareaStringE4ST.NAtrueThe subarea that the price applies for i.e. narnia. Leave blank if grid-wide
filter_StringE4ST.NAfalseI.e. filter1, filter2, etc. Other filter conditions that the price applies for, see parse_comparison for ideas
priceFloat64E4ST.DollarsPerMMBtutrueThe price of 1 MMBtu of fuel
quantityFloat64E4ST.MMBtutrueThe number of MMBtu of the fuel available at the price in each year. Set to Inf for unlimited.