Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate charging profiles for smart charging HDV #301

Conversation

isond
Copy link
Contributor

@isond isond commented Aug 25, 2022

Pull Request doc

Purpose

What is the larger goal of this change?
To add the Python translation of the smart charging HDV code

What the code is doing

How is the purpose executed?
Similar to the smart charging code for LDVs and LDTs, this code iterates through the HDV vehicle data to determine the optimized charging while taking into consideration dwelling activity and charging costs.

Testing

How did you test this change (unit/functional testing, manual testing, etc.)?
Output from this code was compared against the MATLAB output.

Where to look

  • It's helpful to clarify where your new code lives if you moved files around or there could be confusion/
    The new code can be found in the transportation_electrification folder, "PreREISE/prereise/gather/demanddata/transportation_electrification/".

  • What files are most important?
    smart_charging_HDV.py which contains the main algorithm
    dwelling.py which has additional helper functions specific to the HDV code
    fdata_v10st.mat which is a new dataset with HDV vehicles

Usage Example/Visuals

How the code can be used and/or images of any graphs, tables or other visuals (not always applicable).

Time estimate

How long will it take for reviewers and observers to understand this code change?
It can take a few days to go over the code change.

hdv_daily_mat = loadmat(filepath)
hdv_daily_vmt = hdv_daily_mat["hdv_daily_vmt"]

return hdv_daily_vmt[hdv_year-1, hdv_cat-1]
Copy link
Collaborator

@dmuldrew dmuldrew Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to check that input year is in the list mentioned in the doc strings

"""

range_vmt = data["Trip Distance"].copy()
range_vmt[data["Total Vehicle Miles"] > veh_range] = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that veh_range values are as expected

@dmuldrew dmuldrew force-pushed the transportation_electrification branch from 8bdd583 to a8cc651 Compare September 6, 2022 23:47
@dmuldrew dmuldrew self-assigned this Sep 7, 2022
Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it generates profiles as expected, we decided to merge it first and refactor in follow up PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants