- Mini-ISO
Mini-ISO is an interactive electricity market simulator for classroom use.
It provides three browser-based apps:
Several datasets are shipped with this repository
| Name | #Nodes | #Generators | Description | |
|---|---|---|---|---|
| 1. | mini_iso/datasets/one-zone |
1 | 3 | A simple illustration of marginal pricing |
| 2. | mini_iso/datasets/zones-zones |
3 | 2 | To illustrate congestion and price separation |
| 3. | mini_iso/datasets/mini-new-england-simple |
8 | 13 | Mini New England network with one offer tranche per generator |
| 4. | mini_iso/datasets/mini-new-england-nonuniform |
8 | 13 | Mini New England network with three offer tranches per generator |
To create a new dataset, follow the format of the files in the sample directory.
You'll need a three .csv files and a .json file that names them.
Classroom scenarios:
- Use the System Overview to illustrate offer stacks, marginal prices, locational marginal prices, and network congestion.
- Add a fun element of competition!
- Assign a group of class members to each generator in the network.
- Ask them to submit bids in the
Offersapp. - Every few minutes, clear the market via the
Auctionapp and ask students to record their change in revenue.
⚠️ In a realistic environment, market participants would never see each others' offers, so ask class members not to peek!
On macOS:
# Option 1 (recommended): Homebrew
brew install git python@3.12
# Option 2: Official installers
# - Git: https://git-scm.com/download/mac
# - Python: https://www.python.org/downloads/macos/On Windows:
winget install -e --id Git.Git
winget install -e --id Python.Python.3.12On Linux (Ubuntu/Debian):
sudo apt update
sudo apt install -y git python3 python3-venv python3-pipVerify that both Git and Python are available on your PATH:
git --version
python3 --versiongit clone https://github.com/ne-pearl/mini-iso.git
cd mini-isoOn macOS:
# Option 1: Homebrew
brew install pipx
# Option 2: Conda
conda install -c conda-forge pipx
pipx ensurepath
pipx install poetryOn Windows:
py -m ensurepip --upgrade
py -m pip install --user pipx
pipx ensurepath
pipx install poetryOn Linux (Ubuntu/Debian):
python3 -m pip install --user pipx
pipx ensurepath
pipx install poetrypoetry env use 3.12
poetry installOn macOS / Linux:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOn Windows:
py -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt| Path | Description |
|---|---|
| mini_iso/auction.py | Panel definition for Auction app |
| mini_iso/bidders.py | Panel definition for Offers app |
| mini_iso/clearance.py | Economic dispatch model in gurobipy |
| mini_iso/dashboard.py | Panel definition for System Overview app |
| mini_iso/typing_.py | Shared type definitions |
cd your/path/to/mini-iso
poetry env activate
poetry run python mini_iso/apps.py ./mini_iso/datasets/mini-new-england-multiIf you encounter a message like Cannot start Bokeh server, port 5006 is already in use, try the following commands.
In MacOS & Linux:
# Copy process id, e.g., 12345
lsof -i :5006
# Kill process
kill -9 12345In Windows:
In cmd:
# Copy process id, e.g., 12345
netstat -ano | findstr :5006
# Kill process
taskkill /PID 12345 /F# Copy process id, e.g., 12345
Get-Process -Id (Get-NetTCPConnection -LocalPort 5006).OwningProcess | Stop-Process -Force
# Kill process
taskkill /PID 12345 /FThe steps explain the use of PyInstaller to bundle Mini-ISO and its dependencies into a single (platform-dependent) executable file.
⚠️ This shouldn't be necessary (as all dependencies should already have been specified inpyproject.toml), I seem to have run into problems.
poetry add \
altair dask[dataframe] gurobipy hypothesis ipython matplotlib \
networkx pandas pandera panel pydantic pyinstaller pytest scipy
poetry updateOn Linux:
poetry env activate
poetry env use 3.12
# Required for python shared object files
sudo apt-get install python3.12-dev # or python3.11-dev etc.
# Local copy of gurobi.lic from PyPI
cp echo $(which python)/site-packages/gurobipy/.libs/gurobi.lic .
# Create redistributable (only for your platform)
cd your/path/to/mini-iso
pyinstaller \
mini_iso/app.py \
--hiddenimport pydantic.deprecated.decorator \
--add-data ./gurobi.lic:gurobipy/.libs/
# To run
./dist/app/app \
$(realpath mini_iso/datasets/mini_new_england/mini_new_england.json)On Windows:
For now, please see my notes in
windows.md.
- Update this document for Windows.
⚠️ When running the Mini-ISO bundle, you may encounter an error about an expired GUROBI license. This might indicate that you have an expiredgurobi.licfile in your home directory (which GUROBI checks first, before the copy in the Mini-ISO folders). To resolve, please remove/rename the expired file.



