-
Notifications
You must be signed in to change notification settings - Fork 28
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
refactor: maximum LDV dwell period to 72 hours, finish charging efficiency implementation #314
refactor: maximum LDV dwell period to 72 hours, finish charging efficiency implementation #314
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Changing the maximum dwell period for LDV to 72 hours to make it compatible with HDV makes sense, which I believe won't change the behavior of LDV because no LDV trips in the dataset has dwell period greater than 48 hours. Not sure whether it's worth the effort to make the dwell period a variable (maybe still a multiple of 24) so that if there are more HDV data coming in, corner cases will be handled automatically. Maybe that's overkill though.
prereise/gather/demanddata/transportation_electrification/immediate.py
Outdated
Show resolved
Hide resolved
if power > 19.2: | ||
charging_efficiency = 0.95 | ||
else: | ||
charging_efficiency = 0.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether we should factor this out given it is used in both immediate charging and smart charging, also it would be great if references of these numbers (from assumptions or from existing studies?) can be added somewhere with the module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I’d leave it as is, as I’ve been using the diffs between the LDV and HDV immediate/smart charging files. There will be another PR that will just be moving code blocks around…
prereise/gather/demanddata/transportation_electrification/smart_charging.py
Outdated
Show resolved
Hide resolved
model_year_profile[24:48] += ( | ||
outputelectricload[48:72] | ||
/ (daily_vmt_total[day_iter] * 1000) | ||
* emfacvmt | ||
) | ||
|
||
else: | ||
elif day_iter == len(input_day) - 2: | ||
# MW | ||
model_year_profile[day_iter * 24 : day_iter * 24 + 48] += ( | ||
outputelectricload[:48] / (daily_vmt_total[day_iter] * 1000) * emfacvmt | ||
) | ||
model_year_profile[:24] += ( | ||
outputelectricload[48:72] | ||
/ (daily_vmt_total[day_iter] * 1000) | ||
* emfacvmt | ||
) | ||
|
||
else: | ||
# MW | ||
model_year_profile[day_iter * 24 : day_iter * 24 + 72] += ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether we can simplify the logic in a similar way above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I’ve been thinking about what a generalized function for an arbitrary dwell window would look like, though it would likely be later…maybe also some type of detection of how big the dwell window should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we decided to save some potential refactors into future PRs, this is good to go.
Pull Request doc
Purpose
Reconcile LDV and HDV implementations into one.
What the code is doing
why_to
todwell_location
LDV: add charging_efficiency condition #308
Testing
Automated tests
Time estimate
~20 min