-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from NREL/develop
Hercules v1.1
- Loading branch information
Showing
153 changed files
with
222,444 additions
and
1,741 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Check Examples APIs | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
examples-check: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] #, macos-latest, windows-latest] | ||
fail-fast: False | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e ".[develop]" | ||
pip install git+https://github.com/NREL/electrolyzer.git | ||
pip install https://github.com/NREL/SEAS/blob/main/SEAS.tar.gz?raw=true | ||
pip install git+https://github.com/NREL/floris.git@v4 | ||
- name: Run example 06_amr_wind_standin_and_battery | ||
# Run all examples and test that they finish successfully. Do not evaluate the results. | ||
# Copy the examples to a new directory outside of the repo to ensure that there is no | ||
# reliance on the repo directory structure. | ||
run: | | ||
#mkdir -p temp1/temp2/temp3 | ||
#cp -rv example_case_folders/06_amr_wind_standin_and_battery/ temp1/temp2/temp3/. | ||
# cd temp1/temp2/temp3/06_amr_wind_standin_and_battery/ | ||
cd example_case_folders/06_amr_wind_standin_and_battery/ | ||
error_found=0 # 0 is false | ||
error_results="Error in example:" | ||
# Try running the bash script | ||
if ! bash batch_script.sh; then | ||
error_results="${error_results}"$'\n'" - run_example.sh" | ||
error_found=1 | ||
fi | ||
if [[ ! $error_found ]]; then | ||
echo "${error_results}" | ||
fi | ||
exit $error_found |
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
fail-fast: False | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -27,7 +27,7 @@ jobs: | |
# - uses: pre-commit/[email protected] | ||
- name: Run ruff | ||
run: | | ||
ruff . | ||
ruff check . | ||
# ruff format | ||
- name: Run tests and collect coverage | ||
run: | | ||
|
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
# Battery | ||
|
||
There are two battery models currently implemented in Hercules: `SimpleBattery` and `LIB`. Both interact with Hercules through a simple wrapper class: `Battery`. | ||
|
||
### Parameters | ||
|
||
Battery parameters are defined in the hercules input yaml file used to initialize `emulator`. | ||
|
||
- `py_sim_type`: `"SimpleBattery"` or `"LIB"` | ||
- `energy_capacity`: [kWh] | ||
- `charge_rate`: [kW] | ||
- `max_SOC`: between 0 and 1 | ||
- `min_SOC`: between 0 and 1 | ||
- `initial_conditions` | ||
- `SOC`: between `min_SOC` and `max_SOC` | ||
|
||
|
||
Once initialized, the battery is only interacted with using the `step` method. | ||
|
||
### Inputs | ||
Inputs are passed to `step()` as a dict named `inputs`, which must have the following fields: | ||
|
||
``` | ||
{py_sims:{inputs:{battery_signal: ____, | ||
available_power: ____ | ||
}}} | ||
``` | ||
|
||
### Outputs | ||
Outputs are returned as a dict containing the following values | ||
- `power` The charging/discharging power of the battery | ||
- `reject` The amount of charging/discharging requested of the battery that it could not fulfill. Can be positive or negative. | ||
- `soc` The battery state of charge | ||
|
||
|
||
## `SimpleBattery` | ||
|
||
`SimpleBattery` is defined by $E_t = \sum_{k=0}^t P_k \Delta t$, where $E_t$ is the energy stored and $P_t$ is the charging/discharging power at time $t$. Both $E$ and $P$ are constrained by upper and lower limits. | ||
|
||
$\underline{E} \leq E \leq \overline{E}$ | ||
|
||
$\underline{P} \leq P \leq \overline{P}$ | ||
|
||
|
||
## `LIB` | ||
|
||
`LIB` models a lithium ion battery based on the lithium ion cell model presented in [1.]. The main difference between `LIB` and `SimpleBattery` is that `LIB` includes diffusion transients and losses both of which are modeled as an equivalent circuit model following the approach in [1.]. | ||
|
||
|
||
|
||
### References | ||
|
||
1. M.-K. Tran et al., “A comprehensive equivalent circuit model for lithium-ion batteries, incorporating the effects of state of health, state of charge, and temperature on model parameters,” Journal of Energy Storage, vol. 43, p. 103252, Nov. 2021, doi: 10.1016/j.est.2021.103252. |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
# Examples Overview | ||
|
||
Hercules includes several examples to demonstrate usage for a number of key configurations. | ||
|
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.