Setup Fleet¶
-
setupGeneratorFleet
(currYear, genparam, reserveparam)¶ Imports fleet data
This is the main function to compile the existing power plant fleet that will be used in the simulation
Uses pre defined parameters of this analysis (states, year, & power system for analysis) to import data of generator fleet. Imports fleet, isolates fleet to given state and power system, removes retired units, and adds emissions rates and cooling information.
Constructs base generator fleet w/ cooling information, emissions rates, VOM, fuel price, and unit commitment parameters. Then the fleet is compressed.
DATA SOURCES: fleet - NEEDS; cooling information - EIA860; emissions rates - eGRID; VOM & UC parameters - PHORUM.
- Parameters
currYear – (int) year of fleet
genparam – object of class
Generalparameters
reserveparam – object of class
Reserveparameters
- Returns
(2d list) generator fleet data
-
addCoolingTechnologyAndSource
(baseGenFleet, statesForAnalysis, dataRoot)¶ ADD COOLING TECHNOLOGY AND SOURCE TO FLEET
Imports cooling map and data from EIA 860, then adds them generator fleet
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)statesForAnalysis – states for analysis (1d list)
dataRoot – (string) path to root of data folder
-
addCoolingInfoToFleet
(baseGenFleet, equipData, unitsToCoolingIDMap)¶ Adds cooling technology and source to fleet
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)equipData – (2d list) cooling equipment data (EIA 860)
unitsToCoolingIDMap – (dictionary) map of generator ID to cooling ID
-
getCoolingTechAndSource
(equipData, orisID, coolingID)¶ Gets cooling tech for given ORIS and cooling ID. Works for generators in NEEDS that have a corresponding unit in EIA860.
- Parameters
equipData – (2d list) cooling tech data
orisID – (str) oris ID
coolingID – (str) cooling ID
- Returns
tuple with cooling technology and source for input generator
-
getCoolingTechMap
()¶ Maps 2-letter codes to comprehensible cooling techs
- Returns
dictionary mapping cooling tech abbrev to full name (e.g. {‘DC’: ‘dry cooling’})
-
mapUnitsToCoolingID
(assocData, baseGenFleet, equipData)¶ Maps NEEDS generator IDs to EIA860 cooling IDs
- Parameters
assocData – (2d list) cooling association data from EIA860
baseGenFleet – (2d list) base generator fleet from NEEDS (see
importNEEDSFleet()
)equipData – (2d list) map of NEEDS generators to EIA860 cooling ID or ‘NoMatch’
- Returns
dictionary mapping NEEDS generator IDs to EIA860 cooling IDs
-
getRetirementStatusOfAssocRow
(assocRow, assocData, equipData)¶ Check if cooling tech associated with cooling ID for ORIS ID match is retired. Returns true if unit is retired.
- Parameters
assocRow –
assocData –
equipData –
- Returns
(boolean) True if unit is retired. False otherwise
-
get860Data
(statesForAnalysis, dataRoot)¶ Imports EIA860 cooling equipment and association data, and isolates equipment data to units in states of analysis
- Parameters
statesForAnalysis – (1d list) states for analysis
dataRoot – (string) path to directory with input data
- Returns
(2d list) EIA860 cooling IDs and technologies
-
import860data
(dataRoot)¶ Imports 860 equipment and association data
This function reads two csv files (6_1_EnviroAssoc_cooling.csv and 6_2_EnviroEquip_cooling.csv) created directly from the EIA860 excel files with similar names.
- Parameters
dataRoot – (string) path to directory with input data
- Returns
(2d list) EIA860 cooling association and equipment data
-
addEmissionsRates
(baseGenFleet, statesForAnalysis, dataRoot)¶ Add emission rates from EGrid to generator fleet
Adds a column with eGRID emissions rates to the 2d list with generator fleet. It modifies the 2d list baseGenFleet. This function does not return anything.
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)statesForAnalysis – (1d list) states for analysis
dataRoot – (string) path to directory with input data
-
fillMissingEmissionsRates
(baseGenFleet, emsHeadersToAdd)¶ Fills missing generator emission rates with average for gens that have the same fuel and plant type.
This function does not return anything.
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)emsHeadersToAdd – (1d list) emissions headers to add
-
getEmsRatesOfMatchingFuelAndPlantType
(baseGenFleet, plantType, fuelType, emsHeadersToAdd)¶ Gets emission rates of generators w/ given plant & fuel type
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)plantType – (string) name of plant type
fuelType – (string) name of fuel type
emsHeadersToAdd – (1d list) emissions headers to add
- Returns
(1d lists) lists with NOx, SO2 and CO2 emissions rates
-
getMatchingRowsFuelAndPlantType
(baseGenFleet, plantType, fuelType, noxCol)¶ Gets row indexes in generator fleet of generators that match given plant & fuel type, filtering out units w/ no emissions rate data.
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)plantType – (string) name of plant type
fuelType – (string) name of fuel type
noxCol – (int) index of column with NOx emission rate
- Returns
(1d list) indices of row with matching plant & fuel type
-
getMatchingRowsFuelType
(baseGenFleet, fuelType, noxCol)¶ Gets row indexes in generator fleet of gens with same fuel type, filtering out units with no emissions rate data.
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)fuelType – (string) name of fuel type
noxCol – (int) index of column with NOx emission rate
- Returns
(1d list) indices of row with matching fuel type
-
addEmissionsRatesValues
(baseFleet, egridBoiler, egridPlant)¶ Add eGRID emissions rates values to fleet
This function adds eGRID emissions rates values to fleet, either using boiler specific data for coal & o/g steam units or plant level average data. Adds emission rate in order of nox, so2, and co2, as set by ems headers in addEmissionsRates. This function does not return anything.
- Parameters
baseFleet – (2d list) generator fleet (see
importNEEDSFleet()
)egridBoiler – (2d list) eGRID boiler data
egridPlant – (2d list) eGRID plant data
-
getBlrEmRates
(baseFleet, idx, egridBoiler)¶ Get boiler emission rates
Look for boiler-level match of given gen in gen fleet to eGRID data, and return emissions rates if find match.
- Parameters
baseFleet – (2d list) generator fleet (see
importNEEDSFleet()
)idx – (int) index of row in baseFleet
egridBoiler – (2d list) eGRID boiler data
- Returns
(1d list) boiler-level nox, so2 & co2 ems rates
-
getPlantEmRates
(baseFleet, idx, egridPlant)¶ Get plant emission rates
Looks for plant-level match of given unit in gen fleet to eGRID plant data, and returns plant-level ems rate of matching plant if found.
- Parameters
baseFleet – (2d list) generator fleet (see
importNEEDSFleet()
)idx – (int) index of row in baseFleet
egridPlant – (2d list) eGRID plant data
- Returns
(1d list) plant-level nox, so2 & co2 ems rate
-
calculateEmissionsRatesBlr
(egridBoiler, egridBoilerRow)¶ Calculate boiler-level emissions rates.
- Parameters
egridBoiler – (2d list) eGRID boiler data
egridBoilerRow – (int) row in boiler data
- Returns
(1d list) boiler-level emission rates [lb/mmbtu]
-
calculateEmissionsRatesPlnt
(egridPlant, egridPlantRow)¶ Calculate plant-level emissions rates.
- Parameters
egridPlant – (2d list) eGRID plant data
egridPlantRow – (int) row in plant data
- Returns
(1d list) plant-level nox, so2 and co2 emission rates [lb/mmbtu]
-
addLatLong
(baseGenFleet, statesForAnalysis, dataRoot)¶ Add lat/long data to fleet
This function gets lat/long data from egrid and adds columsn with this data to the generator fleet. This function does not return anything
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)statesForAnalysis – (1-d list) list with states included in the analysis
dataRoot – (string) path of directory wit input data
-
addLatLongValues
(baseFleet, egridPlant)¶ Worker function to add lat/long data to fleet
This function adds lat/long values to base fleet using eGRID plant data. This function does not return anything
- Parameters
baseFleet – (2d list) generator fleet (see
importNEEDSFleet()
)egridPlant – (2d list) eGRID plant data
-
performFleetCompression
(genFleet, ipmZones, plantTypesCurtailed)¶ Compress fleet by combining small units
This function simplifies the generator fleet by combining small units (< 200 MW) of same type into a single plant. Units are combined according to plant type, subregion (ipm zone), age, among other factors. Thermal units that will have capacity deratings will not be combined (since capacity deratings are location-dependent).
- Parameters
genFleet – (2d list) generator fleet (see
importNEEDSFleet()
)ipmZones – (1-d list) list with names of ipm zones
plantTypesCurtailed – (1-d list) list with names of plant types that are included in capacity derating simulations
- Returns
(2-d list) updated compressed generator fleet with small units combined
-
compressFuelAndPlantType
(genFleet, fuel, plant, ipmZones, plantTypesCurtailed)¶ Compress fleet by combining small units of given plant type and fuel type
This function modifies the 2-d list genFleet passed as parameter. It does not return anything
- Parameters
genFleet – (2d list) generator fleet (see
importNEEDSFleet()
)fuel – (string) name of fuel type
plant – (string) name of plant type
ipmZones – (1-d list) list with names of ipm zones
plantTypesCurtailed – (1-d list) list with names of plant types that are included in capacity derating simulations
-
combineGenerators
(genFleet, idxsToRemoveAndCombine, fuel, plant, startFleetLength, ipmZones)¶ Combine generators based on when they came online
Small generators of same fuel/plant-type that came online in the same decade will be combined. This function modifies the 2-d list genFleet passed as paraemter. It does not return anything
- Parameters
genFleet – (2d list) generator fleet (see
importNEEDSFleet()
)idxsToRemoveAndCombine – (1-d list) list with indexes of rows of units that are going to be combined (and then removed from fleet)
fuel – (string) name of fuel type
plant – (string) name of plant type
startFleetLength – (int) length of original uncompressed fleet
ipmZones – (1-d list) list with names of ipm zones
-
combineGeneratorsInDecade
(genFleet, idxsInIntervalAndZone, medianYearInInterval, fuel, plant, startFleetLength, zone)¶ Combine generators in same decade
This function does the actual aggregation of generators in the same decade. It combines generators up to 500 MW of combined size. This function modifies the 2-d list genFleet passed as parameter. It does not return anything
- Parameters
genFleet – (2d list) generator fleet (see
importNEEDSFleet()
)idxsInIntervalAndZone – (1-d list) list with units in the time interval and ipm zone that can be combined
medianYearInInterval – (int) median online year of plants being combined
fuel – (string) name of fuel type
plant – (string) name of plant type
startFleetLength – (int) length of original uncompressed fleet
zone – (string) name of ipm zone
-
addCombinedIdxsToFleet
(genFleet, idxsToCombine, combinedCapac, fuel, plant, medianYearInInterval, zone)¶ Combine generators in given indexes
This function does the actual aggregation of generators at given rows in the fleet’s 2-d list. It also appends the row with the new generator to the fleet. This function modifies the 2-d list genFleet passed as parameter. It does not return anything
- Parameters
genFleet – (2d list) generator fleet (see
importNEEDSFleet()
)idxsToCombine – (1-d list) list with indexes of rows of generators to be combined
combinedCapac – (float) total capacity of combined power plant
fuel – (string) name of fuel type
plant – (string) name of plant type
medianYearInInterval – (int) median online year of plants being combined
zone – (string) name of ipm zone
-
addStateZoneOrisFuelOnlineYearAndPlantType
(genFleet, newRow, fuel, plant, zone, *onlineYear)¶ Add additional info to new combined generator
This function adds State, Zone, Oris, Fuel, OnlineYear, and PlantType to the new generator resulting from the combination of small units. This function modifies the 1-d list newrow passed as parameter. It does not return anything
- Parameters
genFleet – (2d list) generator fleet (see
importNEEDSFleet()
)newRow – (1-d list) list with data of new combined generator that will be added to the fleet
fuel – (string) name of fuel type
plant – (string) name of plant type
zone – (string) name of ipm zone
onlineYear – (int) online year of new combined generator that will be added to the fleet
-
addVOMandFOM
(baseGenFleet, vomAndFomData)¶ Add columns with variable and fixed O&M data to generator fleet
This function modifies the 2-d list baseGenFleet passed as parameter. It does not return anything
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)vomAndFomData – (2-d list) 2-d list with variable of fixed O&M data for each plant type
-
addVomAndFomValues
(baseGenFleet, vomAndFomData)¶ Add variable and fixed O&M data to generator fleet
This function modifies the 2-d list baseGenFleet passed as parameter. It does not return anything
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)vomAndFomData – (2-d list) 2-d list with variable of fixed O&M data for each plant type
-
importVomAndFomData
(dataRoot)¶ Import variable and fixed O&M data from input files
Variable and fixed O&M data are located in file VOMandFOMValuesExistingPlants.csv inside the directory [dataRoot]/NewPlantData/
- Parameters
dataRoot – (string) path of directory wit input data
- Returns
(2-d list) 2-d list with variable of fixed O&M data for each plant type
-
addUnitCommitmentParameters
(baseGenFleet, phorumData)¶ Add unit commitment parameters to generator fleet
unit commitment parameters are based on fuel and plant type (data from PHORUM). Columns with UC are added to the baseGenFleet 2-d list.
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)phorumData – (2d list) table with phorum parameters (see
importPhorumData()
)
-
addUCValues
(baseGenFleet, ucHeaders, phorumData)¶ Worker function to ddd unit commitment parameters to generator fleet
- Parameters
baseGenFleet – (2d list) generator fleet (see
importNEEDSFleet()
)ucHeaders – (1d list) list with names of UC parameters that will be added to header of generator fleet
phorumData – (2d list) table with phorum parameters (see
importPhorumData()
)
-
getMatchingPhorumValue
(phorumData, fuel, plantType, size, paramName)¶ Get value of UC parameter from Phorum database
- Parameters
phorumData – (2d list) table with phorum parameters (see
importPhorumData()
)fuel – (string) fuel name
plantType – (string) plant type name
size – (float) installed capacity of plant
paramName – (string) name of UC parameter
- Returns
(float) value of UC parameter for this plant type & fuel in the phorum database
-
mapFleetFuelToPhorumFuels
(fleetFuel)¶ Map name of fuel in fleet to Phorum data
- Parameters
fleetFuel – (string) name if fuel in fleet
- Returns
(string) name of fuel in Phorum
-
mapHeadersToPhorumParamNames
()¶ Get map name of UC parameter in fleet to Phorum
This function returns a dictionary mapping the names of UC parameters used in the fleet to the ones used in Phorum.
- Returns
dictionary {‘name in fleet’: ‘name in phorum’}
-
addFuelPrices
(baseGenFleet, currYear, fuelPriceTimeSeries)¶ Add column with fuel prices to fleet
This function adds a column of fuel prices to the 2-d list with fleet data
- Parameters
baseGenFleet – (2-d list) generator fleet (see
importNEEDSFleet()
)currYear – (int) current year
fuelPriceTimeSeries – (1-d list) list with time series of fuel prices
-
addFuelPriceValues
(baseGenFleet, fuelPriceTimeSeries, currYear)¶ Add fuel values to column of fuel prices
- Parameters
baseGenFleet – (2-d list) generator fleet (see
importNEEDSFleet()
)fuelPriceTimeSeries – (1-d list) list with time series of fuel prices
currYear – (int) current year
-
getFuelPrice
(fleetRow, fleetFuelCol, fuelPriceTimeSeries, currYear)¶ Get price of fuel of a specific plant in fleet for current year (adjusted for inflation)
- Parameters
fleetRow – (1-d list) row in generator fleet table with data for a specific plant
fleetFuelCol – (int) index of column with fuel prices in gen fleet
fuelPriceTimeSeries – (1-d list) list with time series of fuel prices
currYear – (int) current year
- Returns
value of price of fuel adjusted to inflation
-
getFuelPriceForFuelType
(fuel, fuelPriceTimeSeries, currYear)¶ Get price value of given fuel for current year (not adjusted for inflation)
- Parameters
fuel – (string) name of fuel
fuelPriceTimeSeries – (1-d list) list with time series of fuel prices
currYear – (int) current year
- Returns
value of price of fuel (not adjusted to inflation)
-
importNEEDSFleet
(dataRoot)¶ Import base generator fleet from NEEDS
Reads NEEDS fleet data from a CSV file. This CSV file must be located in the [dataRoot]/NEEDS folder
The CSV file needs_nocommas.csv is originated from the NEEDS excel file. Commas in the excel file must be converted to &
- Parameters
dataRoot – (string) path to directory with input data
- Returns
(2-d list) 2-d list with headers containing generator fleet data
-
importeGridData
(statesForAnalysis, dataRoot)¶ Import eGRID boiler and plant level data, then isolate plants and boilers in state
- Parameters
statesForAnalysis – (1d list) states for analysis
dataRoot – (string) path of directory wit input data
- Returns
(2d lists) eGRID boiler and plant data
-
importeGridBoilerData
(dirName)¶ Import eGRID boiler data and remove extra headers
The CSV file egrid_data_boiler.csv is originated from the eGrid excel file. Commas in the excel file must be converted to &
- Parameters
dirName – (string) directory with egrid data
- Returns
(2d list) boiler data
-
importeGridPlantData
(dirName)¶ Import eGRID plant data and remove extra headers
The CSV file egrid_data_plant.csv is originated from the eGrid excel file. Commas in the excel file must be converted to &
- Parameters
dirName – (string) directory with egrid data
- Returns
(2d list) plant data
-
elimExtraneousHeaderInfo
(egridFleet, valueInFirstValidRow)¶ Eliminates first several rows in egrid CSV that has no useful info
- Parameters
egridFleet – (2d list) eGRID fleet
valueInFirstValidRow – (string) value in col 0 in first row w/ valid data that want to save
- Returns
(2d list) eGRID fleet
-
removeRetiredUnits
(baseGenFleet, retirementYearScreen)¶ Removes retired units from fleet based on input year
- Parameters
baseGenFleet – (2d list) gen fleet (see
importNEEDSFleet()
)retirementYearScreen – (int) year below which retired units should be removed from fleet
-
isolateGensInStates
(baseGenFleet, statesForAnalysis, colName)¶ Isolates fleet to generators in states of interest
- Parameters
baseGenFleet – (2d list) gen fleet data (see
importNEEDSFleet()
)statesForAnalysis – (1d list) states for analysis
colName – (string) name of column name with state data
- Returns
(2d list) updated gen fleet data
-
isolateGensInPowerSystem
(baseGenFleet, ipmZones)¶ Isolates fleet to generators in in the ipm regions of interest
- Parameters
baseGenFleet – (2d list) gen fleet (see
importNEEDSFleet()
)ipmZones – (1d list) list with names of ipm zones included in analysis
- Returns
(2d list) updated gen fleet
-
importPhorumData
(dataRoot)¶ Import PHORUM data (VOM + UC parameters)
Phorum data is in a CSV file PHORUMUCParameters.csv.
- Parameters
dataRoot – (string) path to directory with input data
- Returns
(2d list) phorum data
-
addRandomOpCostAdder
(baseGenFleet, ocAdderMin, ocAdderMax)¶ Add random operation cost adder to fleet in new column
Add to all fuel types. Use value of 0.05 - makes up ~0.03% on average of fleet. Max addition to op cost of gen in fleet is 0.19%.
- Parameters
baseGenFleet – (2d list) gen fleet (see
importNEEDSFleet()
)ocAdderMin – (float) min value
ocAdderMax – (float) max value
-
addRegResOfferAndElig
(baseGenFleet, regupCostCoeffs)¶ Add regulated reserve offer costs and eligibility
(Based on params in Denholm 2013, Val of energy sto for grid apps)
- Parameters
baseGenFleet – (2d list) gen fleet (see
importNEEDSFleet()
)regupCostCoeffs –
-
aggregatePlantTypeToORIS
(genFleet, pt)¶ Aggregate hydro units to single plant according to ORIS code
- Parameters
genFleet – (2d list) gen fleet (see
importNEEDSFleet()
)pt – (string) name of plant type
-
isolateFirstFuelType
(fuel)¶ Helper function to split name of fuel
Some plants have multiple modeled fuels divided by
&
- Parameters
fuel – (string) original name of fuel
- Returns
(string) simplified name of fuel
-
getStateAbbrevs
(statesForAnalysis)¶ Get abbreviations (which eGRID uses but NEEDS does not)
- Parameters
statesForAnalysis – (1d list) states for analysis
- Returns
(dict) map of states names to state abbreviations
-
identifyRowsToRemove
(list2d, valuesToKeep, colName)¶ Returns a list of rows to remove for values in a given column that don’t equal any value in valuesToKeep.
- Parameters
list2d – any 2d list
valuesToKeep – (1d list) values in specified column to keep
colName – (string) col name
- Returns
(1d list) row indices to remove
-
removeRows
(baseGenFleet, rowsToRemove)¶ Remove rows of given indexes from 2d list
- Parameters
baseGenFleet – (2d list) data (see
importNEEDSFleet()
)rowsToRemove – (1d list) list with row indexes to remove
-
mapHeadersToCols
(fleet)¶ Returns a dictionary mapping headers to column numbers
- Parameters
fleet – (2d list) fleet data with header (see
importNEEDSFleet()
)- Returns
(dict) map of header name to header
-
addHeaders
(fleet, listOfHeaders)¶ - Parameters
fleet – (2d list) fleet data (see
importNEEDSFleet()
)listOfHeaders – (1d list) headers to add to first row of data
-
avgListVals
(listOfVals)¶ Returns average of values in input 1d list
- Parameters
listOfVals – (1-d list) list with numeric values
- Returns
(float) average value
-
removeTrailingDecimalFromEgridORIS
(egridORISIDs)¶ Removes ‘.0’ from end of ORIS IDs in eGRID
- Parameters
egridORISIDs – (1-d list) list with ORIS IDs
-
toNum
(s)¶ Converts a string w/ commas in it to a float
- Parameters
s – (string) a number in string format
- Returns
(float) numeric value
-
search2Lists
(list1, list2, data1, data2)¶ Return row indexes (or False) where list1=data1 and list2=data2
- Parameters
list1 – list
list2 – list
data1 – value
data2 – value
- Returns
False if not match. If there is a match, index of match
-
colTo1dList
(data, colNum)¶ Convert specified column in 2d list to a 1-d list
- Parameters
data – (2-d list) a generic 2-d list
colNum – (int) index of column
- Returns
(1-d list) list with data from column