-
Notifications
You must be signed in to change notification settings - Fork 9
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
backup control to dos #146
Draft
kendallbaertlein
wants to merge
11
commits into
NREL:dev
Choose a base branch
from
kendallbaertlein:backup-control
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a225cde
added to do items
kendallbaertlein 3aad9bf
added some stuff
kendallbaertlein f74c68d
worked on some to do items and added new input files for running run_…
kendallbaertlein c383979
added/worked on some backup functions
kendallbaertlein a91abfe
worked on er backup functions and added file to plot results.
kendallbaertlein 2cc401f
worked on staged backup and lockout after setpoint change
kendallbaertlein 1a4998d
worked on temp offset and lockout after setpoint change
kendallbaertlein 5bb12f5
Updated ER control code
kendallbaertlein 4a130ca
test
kendallbaertlein a85155d
Final updates to code, etc
kendallbaertlein 900e659
Updated ER to heat above the setpoint
kendallbaertlein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import datetime as dt | ||
import pandas as pd | ||
import os | ||
|
||
df = pd.read_csv("case 8 annual/OCHRE_hourly.csv") | ||
df["Time"] = pd.to_datetime(df["Time"]) | ||
|
||
cost = [] | ||
unmet_load = [] | ||
|
||
df.dropna(inplace=True) | ||
|
||
for n in range(len(df)): | ||
date = df["Time"].iloc[n] | ||
TOU = True | ||
|
||
winter = False | ||
summer = False | ||
|
||
winter_1_start = dt.datetime(2018, 1, 1, 0, 0) #.timestamp() # year, month, day, hour, minute | ||
winter_1_end = dt.datetime(2018, 6, 1, 0, 0) #.timestamp() # year, month, day, hour, minute | ||
|
||
winter_2_start = dt.datetime(2018, 10, 1, 0, 0)#.timestamp() # year, month, day, hour, minute | ||
winter_2_end = dt.datetime(2019, 1, 1, 0, 0)#.timestamp() # year, month, day, hour, minute | ||
|
||
summer_start = dt.datetime(2018, 6, 1, 0, 0)#.timestamp() # year, month, day, hour, minute | ||
summer_end = dt.datetime(2018, 10, 1, 0, 0)#.timestamp() # year, month, day, hour, minute | ||
|
||
# figure out whether it is summer or winter rates | ||
if date >= winter_1_start and date < winter_1_end: | ||
winter = True | ||
elif date >= summer_start and date < summer_end: | ||
summer = True | ||
elif date >= winter_2_start and date < winter_2_end: | ||
winter = True | ||
else: | ||
raise Exception("invalid date input", date) | ||
|
||
off_peak_start_1 = dt.time(19, 0, 0) | ||
off_peak_end_1 = dt.time(23, 59, 59) | ||
off_peak_start_2 = dt.time(0, 0, 0) | ||
off_peak_end_2 = dt.time(13, 0, 0) | ||
|
||
mid_peak_start = dt.time(13, 0, 0) | ||
mid_peak_end = dt.time(15, 0, 0) | ||
|
||
on_peak_start = dt.time(15, 0, 0) | ||
on_peak_end = dt.time(19, 0, 0) | ||
|
||
# figure out prices based on time of day, season, and rate | ||
if TOU == True: # prices based on https://co.my.xcelenergy.com/s/billing-payment/residential-rates/time-of-use-pricing | ||
if date.time() >= off_peak_start_1 and date.time() <= off_peak_end_1: | ||
if winter == True: | ||
rate = 0.12 | ||
elif summer == True: | ||
rate = 0.12 | ||
else: | ||
raise Exception("invalid date input", date) | ||
elif date.time() >= off_peak_start_2 and date.time() < off_peak_end_2: | ||
if winter == True: | ||
rate = 0.12 | ||
elif summer == True: | ||
rate = 0.12 | ||
else: | ||
raise Exception("invalid date input", date) | ||
elif date.time() >= mid_peak_start and date.time() < mid_peak_end: | ||
if winter == True: | ||
rate = 0.16 | ||
elif summer == True: | ||
coratest = 0.22 | ||
else: | ||
raise Exception("invalid date input", date) | ||
elif date.time() >= on_peak_start and date.time() < on_peak_end: | ||
if winter == True: | ||
rate = 0.21 | ||
elif summer == True: | ||
rate = 0.33 | ||
else: | ||
raise Exception("invalid date input", date) | ||
else: | ||
raise Exception("invalid date input", date) | ||
else: | ||
if winter == True: | ||
rate = 0.13 | ||
elif summer == True: | ||
rate = 0.16 | ||
else: | ||
raise Exception("invalid input") | ||
|
||
cost += [rate*df['Total Electric Energy (kWh)'].iloc[n]] | ||
unmet_load += [abs(df['Unmet HVAC Load (C)'].iloc[n])] | ||
|
||
df["Electricity Cost [$]"] = cost | ||
print("Total Electricity Cost ($): ", sum(cost)) | ||
print("HVAC Energy Consumption (kWh)", sum(df['HVAC Heating Main Power (kW)'])) | ||
print("Backup Energy Consumption (kWh)", sum(df['HVAC Heating ER Power (kW)'])) | ||
print("Combined HVAC and Backup Energy Consumption (kWh)", sum(df['HVAC Heating Main Power (kW)'])) | ||
print("Unmet Load (hr*C)", sum(unmet_load)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@kendallbaertlein: We'll want to revert these changes, they were just for testing on your local branch. I don't think we actually want anything in run_dwelling.py to change here.