How this book works¶
Foundation
Three products, one knowledge base¶
flowchart TB
K[Energy Operations Research] --> B[Book<br/>MkDocs]
K --> L[Labs<br/>Google Colab]
K --> Y[Library<br/>energy_or]
B --> V[Visualisation<br/>Manim + in-browser models]
L --> V
Y --> V
V --> P[Production system]
- The book (this site) teaches the intuition and the mathematics.
- The labs are Jupyter notebooks that open in Google Colab. They install the library with one line and let you change parameters and break things.
- The library,
energy_or, holds the reusable, tested model code. Notebooks call it; they do not copy it. - The visualisations are generated from solver output. Manim never decides anything; it draws what the optimiser decided.
The chapter template¶
Every modelling chapter follows the same fifteen steps, so you always know where you are:
- Real-world problem — the operational situation in plain language
- Physical system — what is physically happening
- Decision — what are we actually deciding?
- Variables — the decision variables, with units
- Objective — what we maximise or minimise
- Constraints — what we are not allowed to do
- Formulation — the optimisation problem, written out
- Visualisation — what the mathematics looks like
- Implementation — Python, using
energy_or - Solve — with an open-source solver
- Interpret — back into MW, MWh, $, availability, risk
- Backtest — against history, where it makes sense
- Add realism — progressively harder constraints
- Challenge — exercises
- Production perspective — how this would run continuously
Chapter 1 is the reference implementation of this template.
Four views of every model¶
Where it is meaningful, each optimisation problem is shown four ways:
| View | Shows |
|---|---|
| Physical | What is happening to the asset or system |
| Mathematical | Variables, objective, constraints, feasible region |
| Optimiser | How the solution is reached, what binds |
| Operational / economic | MW, MWh, $, SOC, availability, downtime, risk |
Three tracks¶
The book has three tracks that advance together. You learn a modelling technique, then immediately operationalise it.
| After this modelling chapter… | …this engineering lab |
|---|---|
| Linear programming | Package and test the model |
| BESS dispatch | Expose it through an API |
| Price forecasting | Track experiments, register the model |
| Rolling-horizon BESS | Containerise and schedule it |
| Fleet optimisation | Profile it and cut solve latency |
| Forecast + optimise | Instrument the whole pipeline (observability) |
| — | Incident labs: break it deliberately, then recover |
The engineering track includes OptOps: the optimisation-layer counterpart of MLOps (solver status, solve time, optimality gap, infeasibility diagnosis, binding-constraint monitoring), and latency budgets for decisions that must be made every five minutes.
Difficulty markers¶
Foundation no prior optimisation needed · Intermediate builds on earlier chapters · Advanced heavier mathematics · Production running systems
You can skip derivations marked Advanced on a first read and come back later.
Exercises¶
Each major chapter ends with five kinds of exercise:
- Guided — change one parameter and predict the result before running it
- Engineering — add a physical constraint
- Market — add an economic condition
- Challenge — extend the formulation
- Production — think about running the model continuously
Running the labs¶
Click the Open in Colab badge on any chapter. The first cell installs the library:
To work locally instead: