Skip to content

Commit

Permalink
updating environ and utils to resolve MacOS numpy issues and missing …
Browse files Browse the repository at this point in the history
…seaborn package.
  • Loading branch information
ebalogun01 committed Dec 29, 2023
1 parent 8dc1e80 commit 492e063
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions charging_sim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,16 @@ def build_electricity_cost(controller, load, energy_prices_TOU, demand_charge=Fa
return cost_electricity


def build_cost_PGE_BEV2S(controller, load, energy_prices_TOU, penalize_max_power=True, max_power_pen=1000):
def build_cost_PGE_BEV2S(controller, load, energy_prices_TOU, penalize_max_power=True, max_power_pen=1000,
use_smoothness=False, smoothness_alpha=0.1):
# print(energy_prices_TOU, 'TOUU')
"""This will need to use a heuristic and take the average conservative estimate for gamma"""
net_grid_load = load + controller.battery_power - controller.solar.battery_power - controller.solar.ev_power
TOU_cost = cp.sum(cp.multiply(energy_prices_TOU, net_grid_load)) * controller.resolution/60 # ($)
smoothness_pen = np.mean(cp.abs(controller.battery_power[:-1] - controller.battery_power[1:]))
smoothness_alpha = 0
if use_smoothness:
smoothness_pen = cp.sum(cp.abs(controller.battery_power[:-1] - controller.battery_power[1:]))
else:
smoothness_pen = 0
price_per_block = 95.56 # ($/Block)
overage_fee = 3.82 # ($/kW)
charging_block = controller.pge_gamma * 50 # gamma is an integer variable that's at least 1
Expand Down
Binary file modified environment.yml
Binary file not shown.

0 comments on commit 492e063

Please sign in to comment.