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 profiles for smart charging #287

Merged

Conversation

isond
Copy link
Contributor

@isond isond commented Apr 8, 2022

Pull Request doc

Purpose

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

What the code is doing

How is the purpose executed?
This calculates the smart charging profiles for either LDVs or LDTs by iterating through the NHTS data. For each vehicle, all of its trips will help determine the optimized charging by considering various factors such as dwelling activity and charging costs.

Testing

How did you test this change (unit/functional testing, manual testing, etc.)?
This has not been tested yet but once it's been optimized to run faster, we can compare the output 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 is located here: "PreREISE/prereise/gather/demanddata/transportation_electrification/".

  • What files are most important?
    There are two new files. smart_charging.py is the main file with the algorithm. dwelling.py contains helper functions to calculate the charging power during a vehicle's dwelling period.

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 could about a few days for the reviewers to understand this code change.

@danielolsen
Copy link
Contributor

There are a couple of functions within dwelling.py that look similar to functions that we re-factored out of the immediate charging code in #266 (get_location, consider_trip_number, and get_charging_power). It seems like we could move the code from lines 156-171 into its own function which take trips as input and returns a boolean column which represents if charging is allowed or not, and then use this function both within the existing immediate_charging and the new smart_charging functions. What do you think?

@rouille
Copy link
Collaborator

rouille commented Apr 13, 2022

It would be helpful to assess the validity of the input parameters, e.g., LDT vs ldt, etc. Raising some ValueError would be helpful to guide the user.

@dmuldrew dmuldrew merged commit e66790f into Breakthrough-Energy:transportation_electrification Jul 19, 2022
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.

4 participants