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 the CSRConstraint memory-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 / relax for variables.

Where to go next#