RouteE-Powertrain is a tool for predicting energy usage over a set of road links.
Project description
Overview
RouteE-Powertrain is a Python package that allows users to work with a set of pre-trained mesoscopic vehicle energy prediction models for a varity of vehicle types. Additionally, users can train their own models if "ground truth" energy consumption and driving data are available. RouteE-Powertrain models predict vehicle energy consumption over links in a road network, so the features considered for prediction often include traffic speeds, road grade, turns, etc.
The typical user will utilize RouteE's catalog of pre-trained models. Currently, the catalog consists of light-duty vehicle models, including conventional gasoline, diesel, hybrid electric (HEV), plugin hybrid electric (PHEV) and battery electric (BEV). These models can be applied to link-level driving data (in the form of pandas dataframes) to output energy consumption predictions.
Users that wish to train new RouteE models can do so. The model training function of RouteE enables users to use their own drive-cycle data, powertrain modeling system, and road network data to train custom models.
Quickstart
RouteE Powertrain is available on PyPI and can be installed with pip
:
pip install pip --upgrade
pip install nrel.routee.powertrain
(For more detailed instructions, see here)
Then, you can import the package and use a pre-trained model from the RouteE model catalog:
import pandas as pd
import nrel.routee.powertrain as pt
# Print the available pre-trained models
print(pt.list_available_models(local=True, external=True))
# [
# '2016_TOYOTA_Camry_4cyl_2WD',
# '2017_CHEVROLET_Bolt',
# '2012_Ford_Focus',
# ...
# ]
# Load a pre-trained model
model = pt.load_model("2016_TOYOTA_Camry_4cyl_2WD")
# Inspect the model to see what it expects for input
print(model)
# ========================================
# Model Summary
# --------------------
# Vehicle description: 2016_TOYOTA_Camry_4cyl_2WD
# Powertrain type: ICE
# Number of estimators: 2
# ========================================
# Estimator Summary
# --------------------
# Feature: speed_mph (mph)
# Distance: miles (miles)
# Target: gge (gallons_gasoline)
# Raw Predicted Consumption: 29.856 (miles/gallons_gasoline)
# Real World Predicted Consumption: 25.606 (miles/gallons_gasoline)
# ========================================
# Estimator Summary
# --------------------
# Feature: speed_mph (mph)
# Feature: grade_dec (decimal)
# Distance: miles (miles)
# Target: gge (gallons_gasoline)
# Raw Predicted Consumption: 29.845 (miles/gallons_gasoline)
# Real World Predicted Consumption: 25.596 (miles/gallons_gasoline)
# ========================================
# Predict energy consumption for a set of road links
links_df = pd.DataFrame(
{
"miles": [0.1, 0.2, 0.3], # miles
"speed_mph": [30, 40, 50], # mph
"grade_dec": [-0.05, 0, 0.05], # decimal
}
)
energy_result = model.predict(links_df)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nrel_routee_powertrain-1.1.1.tar.gz
.
File metadata
- Download URL: nrel_routee_powertrain-1.1.1.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1822e990882b82797441e241dede0abd56bb6f70ee803774885e4b9084dc5b11 |
|
MD5 | af6a84e93744d6ab56a2fcc00ab0ba07 |
|
BLAKE2b-256 | 801393994e5b9cb99b0c264b7ca10dae106f7cbac9fbeef717179406e5fe8738 |
File details
Details for the file nrel.routee.powertrain-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: nrel.routee.powertrain-1.1.1-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c88973800f4afe0882a39c26d6d4056dafd01d080d64c213b7a37232a52529 |
|
MD5 | 46b082ea3e2ec62e892d542a7a00d8ab |
|
BLAKE2b-256 | 749e265bab330de0a8fe3a346ce3bee8cdd45b1f705bd569686a1236de1b36d3 |