Skip to content

Commit

Permalink
Update pysam (#17)
Browse files Browse the repository at this point in the history
* update to pysam v 2.2.4

* fix some battery inputs for pysam v2.2.4

* fix om_expense outputs

* fix warning with log_name

* remove construction financing and add depreciation and debt

* fix test results

* update .gitignore

* fix battery financials for new version

* add battery replacement output

* remove taxes from grid_dispatch.py

* fix test results

* fix test results

* Update ci.yml

* fix test results

* fix test results

* fix test results

* modify solar PTC, add location from paper

* weight hybrid financials by production or cost ratio or evenly; add tax incentives output

* update tests

* fix tests

* add pv_charging_only to dispatch options for ITC qualification

* fix battery financial simulation to not run if 0 battery

* fix test results

* use power_sources for system_capacity_kw property

* rename solar files in Docs to pv

* add battery.rst

* update requirements-dev.txt

* update to pysam 3.0.0

* pvwattsv8 & O&M for battery

* O&M costs for hybrid with tests

* more tests for battery O&M variable cost

* production tax credits test

* fix tests

* fix accidental commit

* update test results
  • Loading branch information
dguittet committed Jan 26, 2022
1 parent 7ffb8c5 commit 1bfe81c
Show file tree
Hide file tree
Showing 30 changed files with 9,367 additions and 209 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__/

log/
HOPP_examples/
HOPP-demos/
tests/analysis/results/

.idea/*
Expand Down
11 changes: 11 additions & 0 deletions docs/hybrid/battery_storage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _BatteryStorage:


Battery Storage
================================

Battery Storage class based on PySAM's BatteryStateful Model


.. autoclass:: hybrid.battery.Battery
:members:
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Welcome to HOPP's documentation!
hybrid/power_source.rst
hybrid/wind_source.rst
hybrid/pv_source.rst
hybrid/battery_storage.rst
hybrid/grid.rst
hybrid/hybrid_simulation.rst
hybrid/flicker.rst
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
from typing import Tuple

import PySAM.Pvwattsv7 as pvwatts
import PySAM.Pvwattsv8 as pvwatts
import PySAM.Windpower as windpower
import numpy as np
from shapely.geometry import (
Expand Down Expand Up @@ -179,7 +179,7 @@ def run_wind_model(windmodel: windpower.Windpower):
windmodel.execute(0)
return windmodel.Outputs.annual_energy

def run_pv_model(pvmodel: pvwatts.Pvwattsv7):
def run_pv_model(pvmodel: pvwatts.Pvwattsv8):
cap = pvmodel.SystemDesign.system_capacity
gcr = pvmodel.SystemDesign.gcr
est = cap * self._solar_size_aep_multiplier * self.solar_gcr_loss_multiplier(gcr)
Expand Down Expand Up @@ -238,7 +238,7 @@ def solar_gcr_loss_multiplier(self, gcr):
if gcr_str in self._solar_gcr_loss_multiplier.keys():
return self._solar_gcr_loss_multiplier[gcr_str]

solar_model: pvwatts.Pvwattsv7 = self._scenario['Solar'][0]
solar_model: pvwatts.Pvwattsv8 = self._scenario['Solar'][0]
old_cap, old_gcr = solar_model.SystemDesign.system_capacity, solar_model.SystemDesign.gcr
solar_model.SystemDesign.system_capacity = 1
solar_model.SystemDesign.gcr = gcr
Expand Down Expand Up @@ -306,7 +306,7 @@ def compute_objective(self,
avg_gcr = np.dot(np.array(net_solar_capacities) / total_solar_capacity,
np.array([area.gcr for area in conforming_candidate.solar_areas]))

solar_model: pvwatts.Pvwattsv7 = self._scenario['Solar'][0]
solar_model: pvwatts.Pvwattsv8 = self._scenario['Solar'][0]
solar_model.SystemDesign.gcr = avg_gcr
solar_model.SystemDesign.system_capacity = float(total_solar_capacity)
solar_score = self._scenario['Solar'][1](solar_model) / 1000
Expand Down
Loading

0 comments on commit 1bfe81c

Please sign in to comment.