A Python package for simulating electrodialysis experiments to assist electrodialysis process design, control, and optimization.
If you use IDAES-managed solver binaries (recommended for this project), do this in a fresh conda environment:
conda create -n edexp python=3.11 -y
conda activate edexp
pip install -e .
idaes get-extensionsFor development and tests, use:
pip install -e ".[dev]"For this package, use the WaterTAP IPOPT wrapper for process initialization and NLP solves:
from idaes.core.solvers import get_solver
solver = get_solver("ipopt-watertap")This is the package default expectation for initialization and NLP solves.
Verify IPOPT + MA27 from Python:
python - <<'PY'
import watertap_solvers
from idaes.core.solvers import get_solver
from pyomo.environ import ConcreteModel, Var, Objective, Constraint, minimize
s = get_solver("ipopt-watertap")
print("IPOPT available:", s.available(exception_flag=False))
m = ConcreteModel()
m.x = Var(initialize=1.0)
m.obj = Objective(expr=(m.x - 2.0)**2, sense=minimize)
m.c = Constraint(expr=m.x >= 0)
s.options["linear_solver"] = "ma27"
res = s.solve(m, tee=False)
print("Termination:", res.solver.termination_condition)
PYNotes:
- If you use
idaes get-extensions, you generally do not need a separateconda install ipopt.
- Python:
3.9-3.11(seepyproject.toml) - IPOPT available on PATH (preferred linear solver:
ma27) - Fast tests:
pytest -m "not slow" - Full tests:
pytest
All current demo files in scripts/demos/:
scripts/demos/model_training_walkthrough.ipynbscripts/demos/demo_ossp_proc.pyscripts/demos/demo_kssp_proc_k2.py
Project documentation lives in docs/.
- Main entry:
docs/index.rst - Workflow overview:
docs/simulation-workflows.md - Docs map:
docs/README.md
ELECTRODIALYSIS_EXPERIMENT/
├─ src/electrodialysis_experiment/ # Core package code
├─ scripts/ # Runner scripts
├─ docs/ # Project documentation
├─ tests/ # Unit tests
├─ pyproject.toml # Build and dependency info
└─ README.md # Project description
Electrodialysis_Experiment is part of the WaterTAP software platform and shares
the same license and copyright as WaterTAP.
See LICENSE.md and COPYRIGHT.md in the repository root.
Main contact: Xiangyu Bi (xbi@lbl.gov)