A controls-oriented engineering electrolyzer model.
Project description
Electrolyzer
Electrolyzer is a controls-oriented engineering model for hydrogen production systems. It simulates multi-stack electrolyzer operation, supports PEM and alkaline cell models, tracks degradation, and includes levelized cost of hydrogen (LCOH) analysis utilities.
What this repo provides
- Time-series simulation of one or more stacks with supervisory control logic.
- PEM and alkaline electrochemical cell models with polarization curve fitting.
- Degradation tracking (steady, fatigue, and on/off cycling) with optional penalty modes.
- Cost and LCOH analysis tools tied to simulation outputs.
- YAML-based modeling configuration with a JSON schema for validation and defaults.
Project structure
- Core simulation: electrolyzer/simulation
- Cell models: electrolyzer/simulation/cell_models
- Validation/schema: electrolyzer/tools/validation.py, electrolyzer/tools/modeling_schema.yaml
- LCOH analysis: electrolyzer/tools/analysis
- Examples: examples
- Documentation: docs
Installation
Python 3.11+ is required.
pip install .
Optional extras:
pip install ".[examples]" # notebooks + example dependencies
pip install -e ".[develop]" # dev + docs tooling
pip install -e ".[all]" # everything
More detail is in docs/installing.md.
Quick start
Run a simulation from a YAML configuration and a power signal:
import numpy as np
from electrolyzer.simulation.bert import run_electrolyzer
power_signal = np.ones(3600) * 1e6 # 1 MW for 1 hour, in Watts
elec_sys, results = run_electrolyzer("examples/example_02_electrolyzer/modeling_options.yaml", power_signal)
print(results.head())
Compute LCOH using the same signal:
import numpy as np
from electrolyzer.tools.analysis.run_lcoh import run_lcoh
power_signal = np.ones(3600) * 1e6
lcoe = 0.04418 # $/kWh
lcoh_breakdown, lcoh_value = run_lcoh(
"examples/example_04_lcoh/cost_modeling_options.yaml",
power_signal,
lcoe,
)
print(lcoh_value)
Modeling configuration
Models are configured with YAML files validated against a JSON schema. The schema defines defaults and accepted ranges for parameters like stack rating, cell geometry, degradation rates, and control policy settings.
- Schema: electrolyzer/tools/modeling_schema.yaml
- Example PEM configuration: examples/example_02_electrolyzer/modeling_options.yaml
- Example alkaline configuration: examples/example_06_alkaline/default_alkaline.yaml
Key configuration blocks:
electrolyzer.supervisor: system rating and number of stacks.electrolyzer.controller: control strategy and decision policy flags.electrolyzer.stack: stack sizing, cell type, and operational settings.electrolyzer.degradation: degradation rates and end-of-life parameters.electrolyzer.cell_params: PEM or alkaline cell model parameters.electrolyzer.costs: LCOH input data for capex, opex, feedstock, and finance.
Control strategies
The supervisor supports multiple control modes for stack scheduling and power distribution:
PowerSharingRotation,SequentialRotationEvenSplitEagerDeg,EvenSplitHesitantDegSequentialEvenWearDeg,SequentialSingleWearDegBaselineDegDecisionControl(composed from policy flags in the YAML)
See electrolyzer/simulation/supervisor.py for logic.
Degradation modeling
Each stack tracks voltage degradation from steady operation, fatigue, and on/off cycling. You can choose whether degradation penalizes hydrogen production or increases power draw. The end-of-life voltage delta drives replacement calculations in the LCOH workflow.
Outputs
run_electrolyzer returns a supervisor object and a pandas.DataFrame of time-series results.
The frame includes overall power and curtailment plus per-stack columns for degradation, cycles,
uptime, hydrogen production rate, and current density.
Examples
- Basic simulation: examples/example_02_electrolyzer/example_run.py
- Polarization curve fitting: examples/example_01_polarization/example_run.py
- Controller behavior: examples/example_05_controller/example_05_controller_options.py
- Alkaline configuration: examples/example_06_alkaline/alkaline_example_run.py
- LCOH calculation: examples/example_04_lcoh/cost_example_run.py
Documentation
Docs are in docs. The landing page is docs/intro.md. If you build the Jupyter Book locally, the generated site lands in docs/_build/html.
Testing
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file electrolyzer-0.2.1.tar.gz.
File metadata
- Download URL: electrolyzer-0.2.1.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aebbf847301622d18409c269240c0499d5468878622271d8101e761abb908e8
|
|
| MD5 |
510651f19a29faa8b6d076dfec118558
|
|
| BLAKE2b-256 |
d37846352350edfdcb0d8cb02878a8a2c1416311ac558b075f18ac4998573bdc
|
Provenance
The following attestation bundles were made for electrolyzer-0.2.1.tar.gz:
Publisher:
publish_to_pypi.yml on NatLabRockies/electrolyzer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
electrolyzer-0.2.1.tar.gz -
Subject digest:
7aebbf847301622d18409c269240c0499d5468878622271d8101e761abb908e8 - Sigstore transparency entry: 1004365979
- Sigstore integration time:
-
Permalink:
NatLabRockies/electrolyzer@e91e9198215ac3ee75cd9997159491d55073a17d -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/NatLabRockies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@e91e9198215ac3ee75cd9997159491d55073a17d -
Trigger Event:
release
-
Statement type:
File details
Details for the file electrolyzer-0.2.1-py3-none-any.whl.
File metadata
- Download URL: electrolyzer-0.2.1-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbeb261970b7ebc6bb168d6397ccc28a4ed9f8475bc9f0ea547ef1a2f0f9174f
|
|
| MD5 |
52ff51a918eedf09b7dd1572d390b80c
|
|
| BLAKE2b-256 |
cd0d137ca37dd15e10617813db1bea379d6c9c58482cd78c38ae3ca0d12b9687
|
Provenance
The following attestation bundles were made for electrolyzer-0.2.1-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on NatLabRockies/electrolyzer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
electrolyzer-0.2.1-py3-none-any.whl -
Subject digest:
bbeb261970b7ebc6bb168d6397ccc28a4ed9f8475bc9f0ea547ef1a2f0f9174f - Sigstore transparency entry: 1004365983
- Sigstore integration time:
-
Permalink:
NatLabRockies/electrolyzer@e91e9198215ac3ee75cd9997159491d55073a17d -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/NatLabRockies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@e91e9198215ac3ee75cd9997159491d55073a17d -
Trigger Event:
release
-
Statement type: