Title: | Prepare EDGE Transport Data for the REMIND model |
---|---|
Description: | EDGE-T is a fork of the GCAM transport module https://jgcri.github.io/gcam-doc/energy.html#transportation with a high level of detail in its representation of technological and modal options. It is a partial equilibrium model with a nested multinomial logit structure and relies on the modified logit formulation. Most of the sources are not publicly available. PIK-internal users can find the sources in the distributed file system in the folder `/p/projects/rd3mod/inputdata/sources/EDGE-Transport-Standalone`. |
Authors: | Johanna Hoppe [aut, cre] , Alois Dirnaichner [aut], Marianna Rottoli [aut], Jarusch Muessel [aut] |
Maintainer: | Johanna Hoppe <[email protected]> |
License: | GPL-3 |
Version: | 2.12.3 |
Built: | 2024-12-20 09:25:00 UTC |
Source: | https://github.com/pik-piam/edgeTransport |
calcEdgeTransportSA()
is a wrapper for toolEdgeTransportSA()
to make use of
madrat caching.
calcEdgeTransportSA( SSPscen, transportPolScen, isICEban = FALSE, demScen = "default", gdxPath = NULL, outputFolder = NULL, isStored = FALSE, isTransportReported = TRUE, isTransportExtendedReported = FALSE, isREMINDinputReported = FALSE, isAnalyticsReported = FALSE )
calcEdgeTransportSA( SSPscen, transportPolScen, isICEban = FALSE, demScen = "default", gdxPath = NULL, outputFolder = NULL, isStored = FALSE, isTransportReported = TRUE, isTransportExtendedReported = FALSE, isREMINDinputReported = FALSE, isAnalyticsReported = FALSE )
SSPscen |
SSP or SDP scenario |
transportPolScen |
EDGE-T transport policy scenario |
isICEban |
optional enabling of ICE ban |
demScen |
Demand scenario, used to apply reduction factors on total demands from the regression |
gdxPath |
Path to a GDX file to load price signals from a REMIND run |
outputFolder |
Path to folder for storing output data |
isStored |
Optional saving of intermediate RDS files |
isTransportReported |
Optional transport reporting in MIF format |
isTransportExtendedReported |
Optional extension of transport reporting providing more detailed variables |
isREMINDinputReported |
Optional reporting of REMIND input data |
isAnalyticsReported |
Optional reporting of analytics data (e.g. variables over iterations) |
Transport input data for REMIND
Jarusch Muessel, Johanna Hoppe
Check a data.table for NAs and duplicates and throw an error if needed
checkForNAsDups(dt, varname, codePosition)
checkForNAsDups(dt, varname, codePosition)
dt |
data.table to be checked |
varname |
name of the variable |
codePosition |
position in the code to find the bug |
Johanna Hoppe
Creates RDS files for iterative REMIND-EDGE runs from csv input files. Existing files are overwritten silently. Does not return anything.
csv2RDS(filename, inputPath, SSPscenario, demScenario, transportPolScenario)
csv2RDS(filename, inputPath, SSPscenario, demScenario, transportPolScenario)
filename |
name of the file |
inputPath |
the path to the folder containing the input (csv-) files |
SSPscenario |
SSP scenario |
demScenario |
demand scenario |
transportPolScenario |
Transport policy scenario |
List associated univocalNames for any entry of the decision tree
getFilterEntriesUnivocalName(categories, decisionTree)
getFilterEntriesUnivocalName(categories, decisionTree)
categories |
vector of categories to filter |
decisionTree |
decision tree that contains the univocalNames associated to the category |
list of categories and their associated univocalNames e.g. trn_pass as list entry containing a vector c("Compact Car", "HSR", ..)
Johanna Hoppe
Run in the REMIND output folder in between iterations
iterativeEdgeTransport()
iterativeEdgeTransport()
Johanna Hoppe
Apply ICE ban on vehicle types that feature preference factors
toolApplyICEbanOnPreferences(preferenceTab, helpers)
toolApplyICEbanOnPreferences(preferenceTab, helpers)
preferenceTab |
data.table including preferences for all levels of the decision tree |
helpers |
list of helpers |
Preferences in accordance to the ICE ban policy
Johanna Hoppe
Applies two different temporal resolutions on a data.table object in the edgeTransport data structure and do a linear approximination for the highRes data that is not available
toolApplyMixedTimeRes(data, helpers, idcols = NULL)
toolApplyMixedTimeRes(data, helpers, idcols = NULL)
data |
data.table containing data in in the edgeTransport data structure (at least featuring univocalName, period, value) |
helpers |
list containing several helpers used throughout the model. It includes dtTimeRes, a data.table containing the temporal resolution for different univocalNames |
idcols |
optional supply of idcols for using approx_dt |
data.table
Johanna Hoppe
Apply scenario specific adjustments to the preference trends
toolApplyScenPrefTrends( baselinePrefTrends, scenParPrefTrends, GDPpcMER, policyStartYear, GDPcutoff, helpers, isICEban )
toolApplyScenPrefTrends( baselinePrefTrends, scenParPrefTrends, GDPpcMER, policyStartYear, GDPcutoff, helpers, isICEban )
baselinePrefTrends |
Baseline preference trends |
scenParPrefTrends |
Scenario parameters to be applied on the preference trends |
GDPpcMER |
Per capita GDP based on market exchange rate |
policyStartYear |
Year from which the scenario parameters are applied on the baseline preference trends |
GDPcutoff |
Threshold used to categorize countries into different mitigation groups based on their GDP |
helpers |
List containing several helpers used throughout the model |
isICEban |
Switch to turn on ICE phase out policies |
Scenario specific preference trends
Johanna Hoppe
Apply demand scenario specific adjustments to the energy intensity
toolApplyScenSpecEnInt(enInt, scenParEnergyIntensity, policyStartYear, helpers)
toolApplyScenSpecEnInt(enInt, scenParEnergyIntensity, policyStartYear, helpers)
enInt |
Energy intensity input data supplied by mrtransport |
scenParEnergyIntensity |
Transport policy scenario specific energy intensity improvement factors |
policyStartYear |
Year from which scenario specific transport policies are applied |
helpers |
List with helpers |
data.table with scenario specific energy intensity input data
Johanna Hoppe
Apply demand scenario specific adjustments to the load Factor
toolApplyScenSpecLoadFactor( loadFactor, scenParLoadFactor, policyStartYear, helpers )
toolApplyScenSpecLoadFactor( loadFactor, scenParLoadFactor, policyStartYear, helpers )
loadFactor |
load factor input data supplied by mrtransport |
scenParLoadFactor |
Scenario specific parameters to be applied don the baseline load factor |
policyStartYear |
Year when scenario differentiation sets in |
helpers |
List with helpers |
Scenario specific load factor
Johanna Hoppe
Calculate annuity for different vehicle types
toolCalculateAnnuity(annuityCalc, helpers)
toolCalculateAnnuity(annuityCalc, helpers)
annuityCalc |
input data for interest rate and service Life from edgeTransport |
helpers |
list with helpers |
Johanna Hoppe
This function calculates the fleet composition based on the energy service demand, the composition of new sales each year and the service life of vehicles. With the help of the annual mileage, the absolute numbers of vehicles is calculated. If the remaining stock is sufficient to meet the energy service demand, 10
toolCalculateFleetComposition( ESdemandFVsalesLevel, vehDepreciationFactors, vehSalesAndModeShares, annualMileage, loadFactor, helpers )
toolCalculateFleetComposition( ESdemandFVsalesLevel, vehDepreciationFactors, vehSalesAndModeShares, annualMileage, loadFactor, helpers )
ESdemandFVsalesLevel |
Energy service demand on fuel vehicle level for new sales |
vehDepreciationFactors |
Factors for the depreciation of vehicles in each year of the maximum service Life |
vehSalesAndModeShares |
Vehicle sales and mode shares for the decision tree |
annualMileage |
Annual kilometers driven by a vehicle |
loadFactor |
Persons or tons loaded on each vehicle |
helpers |
List of helpers |
list of fleet composition data
Johanna Hoppe
Calculate eneryg service demand on fuel vehicle level
toolCalculateFVdemand( sectorESdemand, salesAndModeShares, helpers, histESdemand = NULL, baseYear = NULL )
toolCalculateFVdemand( sectorESdemand, salesAndModeShares, helpers, histESdemand = NULL, baseYear = NULL )
sectorESdemand |
energy service demand on CES node level |
salesAndModeShares |
vehicle sales and mode shares |
helpers |
List with helpers |
histESdemand |
historcial energy service demand for iterative EDGE-T |
baseYear |
ned year of historical energy service demand |
data.table
Johanna Hoppe
Apply regional differences for inconvenience cost start values based on ICE cost differences
toolCalculateInitialIncoCost( combinedCost, incoCostStartVal, annuity, loadFactor, annualMileage, helpers )
toolCalculateInitialIncoCost( combinedCost, incoCostStartVal, annuity, loadFactor, annualMileage, helpers )
combinedCost |
total cost of ownership |
incoCostStartVal |
start values for inconvenience costs |
annuity |
calculated annuity for different vehicle types |
loadFactor |
load factor data |
annualMileage |
annual mileage data |
helpers |
list with helpers |
data.table including initial inconvenience costs from 1990-2020 for LDV 4W US$/(p|t)km
Johanna Hoppe
Calculate vehicle depreciation factors for fleet tracking
toolCalculateVehicleDepreciationFactors(annuityCalc, helpers)
toolCalculateVehicleDepreciationFactors(annuityCalc, helpers)
annuityCalc |
parameters for annualization |
helpers |
list with helpers |
data.table including vehicle depreciation factors over service life#'
Johanna Hoppe
Calibrate the logit share weights to historical data.
toolCalibrateHistPrefs( combinedCosts, histESdemand, timeValueCost, lambdas, helpers )
toolCalibrateHistPrefs( combinedCosts, histESdemand, timeValueCost, lambdas, helpers )
combinedCosts |
Annualized total cost of ownership |
histESdemand |
Historical energy service demand data |
timeValueCost |
Time value cost for passenger transport modes |
lambdas |
Exponents for discrete choice function |
helpers |
list with helpers |
data.table with calibrated historical preferences
Checks whether data is complete for all levels of decision tree
toolCheckAllLevelsComplete(data, decisionTree, name)
toolCheckAllLevelsComplete(data, decisionTree, name)
data |
data.table containing data in all levels format that should be checked |
decisionTree |
data.table containing full edgeTransport decision Tree |
name |
name of variable to be checked |
data.table
Johanna Hoppe
Function that converts CAPEX and OPEX into US$/(p|t)km and provides them combined in a structured format
toolCombineCAPEXandOPEX( CAPEXtrackedFleet, nonFuelOPEXtrackedFleet, CAPEXother, nonFuelOPEXother, fuelCosts, subsidies, energyIntensity, loadFactor, annualMileage, annuity, helpers )
toolCombineCAPEXandOPEX( CAPEXtrackedFleet, nonFuelOPEXtrackedFleet, CAPEXother, nonFuelOPEXother, fuelCosts, subsidies, energyIntensity, loadFactor, annualMileage, annuity, helpers )
CAPEXtrackedFleet |
CAPEX data for vehicle types that feature fleet tracking: Cars, trucks, busses |
nonFuelOPEXtrackedFleet |
non-fuel OPEX data for vehicle types that feature fleet tracking: Cars, trucks, busses |
CAPEXother |
CAPEX data for other vehicle types |
nonFuelOPEXother |
non-fuel OPEX data for other vehicle types |
fuelCosts |
fuel cost data |
subsidies |
purchase price subsidy data |
energyIntensity |
energy intensity data |
loadFactor |
load factor data |
annualMileage |
annual mileage data |
annuity |
calculated annuity for different vehicle types |
helpers |
list with helpers |
data.table including total costs of ownership in US$/(p|t)km
Energy service demand projection
toolDemandRegression( historicalESdemand, GDPperCapitaPPP, POP, genParDemRegression, scenParDemRegression, scenParRegionalDemRegression, scenParDemandFactors, baseYear, policyStartYear, helpers )
toolDemandRegression( historicalESdemand, GDPperCapitaPPP, POP, genParDemRegression, scenParDemRegression, scenParRegionalDemRegression, scenParDemandFactors, baseYear, policyStartYear, helpers )
historicalESdemand |
Historical energy service demand |
GDPperCapitaPPP |
GDP per capita based on purchase power parity |
POP |
Population data |
genParDemRegression |
General regression factors |
scenParDemRegression |
Scenario specific general regression factors |
scenParRegionalDemRegression |
Scenario specific regionally differentiated regression factors |
scenParDemandFactors |
Demand scenario factors |
baseYear |
End year of historical energy service demand data |
policyStartYear |
Start year of scenario differentiation |
helpers |
list with helpers |
Scenario specific energy service demand for all model years on CES level
Johanna Hoppe
Function that traverses each level of the decision tree and calculates the shares according to the discrete choice approach
toolDiscreteChoice(input, generalModelPar, updatedEndoCosts, helpers)
toolDiscreteChoice(input, generalModelPar, updatedEndoCosts, helpers)
input |
dataset for discrete choice module |
generalModelPar |
general model parameter |
updatedEndoCosts |
updated endogenous costs |
helpers |
list of helpers |
calculated shares
Johanna Hoppe
The Edge Transport Model includes the transport specific input data preparation, a choice model to determine transport mode and technology shares, a demand regression and a fleet tracking for cars, busses and trucks
toolEdgeTransportSA( SSPscen, transportPolScen, isICEban = FALSE, demScen = "default", gdxPath = NULL, outputFolder = NULL, isStored = TRUE, isTransportReported = TRUE, isTransportExtendedReported = FALSE, isREMINDinputReported = FALSE, isAnalyticsReported = FALSE )
toolEdgeTransportSA( SSPscen, transportPolScen, isICEban = FALSE, demScen = "default", gdxPath = NULL, outputFolder = NULL, isStored = TRUE, isTransportReported = TRUE, isTransportExtendedReported = FALSE, isREMINDinputReported = FALSE, isAnalyticsReported = FALSE )
SSPscen |
SSP or SDP scenario |
transportPolScen |
EDGE-T transport policy scenario |
isICEban |
optional enabling of ICE ban |
demScen |
Demand scenario, used to apply reduction factors on total demands from the regression |
gdxPath |
Path to a GDX file to load price signals from a REMIND run |
outputFolder |
Path to folder for storing output data |
isStored |
Optional saving of intermediate RDS files |
isTransportReported |
Optional transport reporting in MIF format |
isTransportExtendedReported |
Optional extension of transport reporting providing more detailed variables |
isREMINDinputReported |
Optional reporting of REMIND input data |
isAnalyticsReported |
Optional reporting of analytics data (e.g. variables over iterations) |
Transport input data for REMIND
Johanna Hoppe, Jarusch Müßel, Alois Dirnaichner, Marianna Rottoli
Read and build the complete structure of the edgeTransport decision tree
toolLoadDecisionTree(regionAggregation = "iso")
toolLoadDecisionTree(regionAggregation = "iso")
regionAggregation |
choose one of the different options for regional aggregation (iso|regionCode21|regionCode12) |
data.table of full spatially extended edgeTransport decision tree
Johanna Hoppe
Load all inputs that are required to run the model
toolLoadInputs(SSPscen, transportPolScen, demScen, gdxPath, hybridElecShare)
toolLoadInputs(SSPscen, transportPolScen, demScen, gdxPath, hybridElecShare)
SSPscen |
SSP or SDP scenario |
transportPolScen |
EDGE-T transport policy scenario |
demScen |
Demand scenario, used to apply reduction factors on total demands from the regression |
gdxPath |
Path to a GDX file to load price signals from a REMIND run |
hybridElecShare |
Share of electricity in Hybrid electric vehicles |
list with different input data sets
Johanna Hoppe
Load iterative inputs
toolLoadIterativeInputs( edgeTransportFolder, inputFolder, inputFiles, numberOfRegions, SSPscenario, transportPolScenario, demScenario )
toolLoadIterativeInputs( edgeTransportFolder, inputFolder, inputFiles, numberOfRegions, SSPscenario, transportPolScenario, demScenario )
edgeTransportFolder |
transport folder |
inputFolder |
the path to the folder containing the input (csv-) files |
inputFiles |
names of the input files |
numberOfRegions |
regional resolution |
SSPscenario |
SSP scenario |
transportPolScenario |
Transport policy scenario |
demScenario |
demand scenario |
Load GDP and Population data from mrdrivers
toolLoadmrdriversData(SSPscen, helpers)
toolLoadmrdriversData(SSPscen, helpers)
SSPscen |
SSP scenario for which the mrdrivers input data shall be loaded |
helpers |
list containg several helpers used throughout the model. It includes dtTimeRes, a data.table containing the temporal resolution for different univocalNames |
list of data.tables containing mrdrivers input data
Load data from mrremind
toolLoadmrremindData(helpers)
toolLoadmrremindData(helpers)
helpers |
list containg several helpers used throughout the model. It includes dtTimeRes, a data.table containing the temporal resolution for different univocalNames |
list of data.tables containing mrremind input data
Load input data from the mrtransport package
toolLoadmrtransportData(SSPscen)
toolLoadmrtransportData(SSPscen)
SSPscen |
SSP scenario for which the mrtransport input data should be loaded |
list of data.tables with the mrtransport input data
Load input data from the edgeTransport package and choose data according to SSP and transport policy scenario
toolLoadPackageData(SSPscenario, transportPolScenario, demScenario = NULL)
toolLoadPackageData(SSPscenario, transportPolScenario, demScenario = NULL)
SSPscenario |
SSP scenario for which the package data should be loaded |
transportPolScenario |
transport policy scenario for which the package data should be loaded |
demScenario |
demand scenario for which the package input data should be loaded |
list of data.tables with the package input data
Load the energy service demand from a REMIND fulldata.gdx on sector level (CES level) in [bn (p|t)km/yr] and the requested temporal resolution
toolLoadREMINDesDemand(gdxPath, helpers)
toolLoadREMINDesDemand(gdxPath, helpers)
gdxPath |
path to REMIND fulldata.gdx |
helpers |
list of helpers |
Load fuel prices from a REMIND fulldata.gdx in [US$/MJ] and map them on to the edgeTransport decision tree. The output is provided in the same spatial resolution as the transferred gdx file and the temporal resolution is set according to the param yrs.
toolLoadREMINDfuelCosts(gdxPath, hybridElecShare, helpers)
toolLoadREMINDfuelCosts(gdxPath, hybridElecShare, helpers)
gdxPath |
path to REMIND fulldata.gdx |
hybridElecShare |
Share of electricity in Hybrid electric vehicles |
helpers |
list with helpers |
fuel costs on technology level
Normalize preferences so that the maximum in each branch of the decision tree equals 1
toolNormalizePreferences(preferenceTab)
toolNormalizePreferences(preferenceTab)
preferenceTab |
data.table including preferences for all levels of the decision tree |
Normalized preferences
Johanna Hoppe
sort data.table according to edgeTransport data structure and check for NAs If checkCompletness is activated it is further checked, if the full data set is provided. In case of fleetVars == TRUE the full data set is reduced to the vehicle types that feature fleet tracking
toolOrderandCheck( data, decisionTree, yrs = NULL, checkCompleteness = FALSE, fleetVars = FALSE )
toolOrderandCheck( data, decisionTree, yrs = NULL, checkCompleteness = FALSE, fleetVars = FALSE )
data |
data.table containing data in all levels format that should be checked |
decisionTree |
data.table containing full edgeTransport decision Tree |
yrs |
temporal resolution |
checkCompleteness |
if activated it is further checked, if the full data set is provided |
fleetVars |
if activated the full data set is reduced to vehicle types that feature fleet tracking |
data.table
Johanna Hoppe
Format all cost components
toolPrepareDataEndogenousCosts(inputData, lambdas, helpers)
toolPrepareDataEndogenousCosts(inputData, lambdas, helpers)
inputData |
List containing inputData |
lambdas |
exponents for discrete choice calculation |
helpers |
List with helpers |
data.table including all cost components
Johanna Hoppe
Apply transport scenario specific adjustments to input data
toolPrepareScenInputData( genModelPar, scenModelPar, inputDataRaw, policyStartYear, GDPcutoff, helpers, isICEban )
toolPrepareScenInputData( genModelPar, scenModelPar, inputDataRaw, policyStartYear, GDPcutoff, helpers, isICEban )
genModelPar |
General model parameters |
scenModelPar |
Transport scenario (SSPscen + demScen + polScen) specific model parameters |
inputDataRaw |
Raw input data |
policyStartYear |
Year when scenario differentiation sets in |
GDPcutoff |
GDP cutoff to differentiate between regions |
helpers |
List with helpers |
isICEban |
optional enabling of ICE ban |
List of data.tables with scenario specific input data
Johanna Hoppe
Function that aggregates the data for the next higher level of the decision tree
toolTraverseDecisionTree(data, upperLevel, decisionTree)
toolTraverseDecisionTree(data, upperLevel, decisionTree)
data |
data.table containing the data of the lower level |
upperLevel |
name of the upper level in the decision tree |
decisionTree |
full edgeTransport decision tree |
data.table
Johanna Hoppe
Provides updates for endogenous cost components e.g. inconvenience costs for cars
toolUpdateEndogenousCosts( dataEndoCosts, depreciationFactors, scenParIncoCost, policyStartYear, timeValue, preferences, lambdas, helpers, isICEban, vehiclesPerTech = NULL )
toolUpdateEndogenousCosts( dataEndoCosts, depreciationFactors, scenParIncoCost, policyStartYear, timeValue, preferences, lambdas, helpers, isICEban, vehiclesPerTech = NULL )
dataEndoCosts |
data.table containing all cost components for cars over the full range of policy years in a yearly resolution. Exogenous CAPEX and OPEX are provided over the full range. Endogenous cost components and FS3 shares are provided until policyStartYear. Rest is filled with NA. |
depreciationFactors |
data.table containing vehicle depreciation factor for each year of service Life |
scenParIncoCost |
data.table containing scenario specific parameters for inconvenience costs policy mask |
policyStartYear |
year from which scenario-specific differentiation begins |
timeValue |
data.table containing mode specific time value costs based on speed and gdp |
preferences |
preference factor trends |
lambdas |
data.table containing exponents for discrete choice calculation |
helpers |
list containing helpers like mappings, decisionTree etc. |
isICEban |
optional enabling of ICE ban |
vehiclesPerTech |
data.table containing total number of vehicles for all years and regions |
list containing data.table with endogenous cost components over the full time span and additional data.tables for model behavior analysis
Johanna Hoppe