Overview#
In Getting Started you installed linopy, built a first scalar model, and saw N-D variables on coordinates. The User Guide reopens each of those pieces in depth and adds the rest of the modelling surface.
Each page is a runnable Jupyter notebook — read it top to bottom, or use it as a reference once you know what you’re looking for.
Core building blocks#
The four notebooks below cover the model object you’ll interact with most. Read them in order the first time; come back to them whenever you’re unsure what a particular operator or argument does.
Creating Variables — declaring decision variables, with bounds and coordinates. Continuous, integer, binary, and semi-continuous.
Creating Expressions — combining variables into linear (and quadratic) expressions; arithmetic, broadcasting,
sum,groupby,rolling,where.Creating Constraints — turning expressions into
≤/≥/==constraints, and theCSRConstraintmemory-efficient alternative.Coordinate Alignment — how linopy lines up operands that live on different coordinates, and how to control it with
join.
After these four you can build any LP/MIP/QP linopy supports.
Working with an existing model#
Once you’ve built a model, you’ll often want to inspect it, change a bound, swap a constraint, or copy it for what-if analysis.
Modifying Models — modifying or removing variables and constraints in place;
Model.copy();fix/relaxfor variables.
Where to go next#
Examples — end-to-end problem walkthroughs: The Transport Problem, Migrating from Pyomo.
Advanced features — Special Ordered Sets (SOS) Constraints, Piecewise Linear Constraints, and the Testing with Linopy for asserting structural properties of a model.
Solving — Remote Solving with SSH (SSH), Solve on OETC (OET Cloud) (OET Cloud), GPU-Accelerated Solving (cuPDLPx).
Troubleshooting — Trouble shooting - Infeasible Model (diagnosing infeasible problems), Double logging in gurobi (and other solver quirks).
Reference — the full API reference listing.