APEM is a framework for electricity-market clearing, pricing, and analysis. It brings together optimization-based market models, pricing methods, network-aware post-processing, and supporting evaluation tools in a single codebase.
- APEM Core: market-clearing workflows for unit-based and order-book-based models. Uses config.json, runs allocation/pricing/redispatch pipelines, and writes results under
results/.... - APEM Node Ranking: structural and market-based node-ranking tools, including network scores, market scores, PTDF indicators, and DC economic-dispatch baselines.
- APEM PF Relaxations: DCOPF and ACOPF relaxation experiments on ARPA-derived subscenarios, including
DCOPF,Shor SDP,Chordal SDP,Jabr SOCP, andQCvariants.
- Python 3.10, 3.11, or 3.12. Python 3.11 is recommended.
- Gurobi + valid license for APEM Core optimization workflows
- MOSEK + valid license for APEM PF Relaxations
APEM has been tested on Windows and macOS. Linux is expected to work with the same Python and solver setup.
Gurobi must be installed and licensed before running APEM Core workflows. For a
local named-user license, place gurobi.lic in your home directory. For WLS
licenses, configure the license credentials according to the Gurobi license
manager.
MOSEK licenses can be placed at ~/.mosek/mosek.lic or configured with MOSEKLM_LICENSE_FILE.
Clone the repository:
git clone https://github.com/TUM-DSS/APEM.git
cd APEMpython -m venv .venv
# macOS / Linux
source .venv/bin/activate
# Windows PowerShell
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
pip install -e .For PF relaxation experiments, also install:
pip install -r power_flow_relaxations/requirements.txtEdit config.json, then run:
python main.pyCore outputs are written under:
results/unit_based_model/...results/order_book_based_model/...
Configuration details: Online Configuration Guide
After installing MOSEK requirements and configuring a license:
PYTHONPATH=. MPLCONFIGDIR=/tmp/mplcache ./.venv/bin/python -m power_flow_relaxations.run_relaxationsResults are written under relaxation_results/....
PF relaxation details: Online PF Relaxations Guide
Online documentation: https://tum-dss.github.io/APEM/
Build the Sphinx docs locally:
python -m pip install -r docs/requirements.txt
cd docs
make htmlOpen docs/_build/html/index.html.
If apem cannot be imported, run from the repository root and reinstall in editable mode:
pip install -e .If optimization fails, first check the relevant solver package and license: gurobipy for APEM Core, mosek for APEM PF Relaxations.
