Examples#
Each example page contains the specification of one optimisation model
(a spec) twice. The page has the YAML file,
and the math that the typesetter prints from the file.
Every spec is a file under examples/ in the repository, and the test suite
loads each one. Open a page to see whether the language can state a problem
like yours, and what each line of the file means.
- Least-cost dispatch is the smallest spec with a balance, a bound and a cost to minimise.
- Unit commitment states
previous_statusin three cases, so one inequality covers a running unit and a starting unit. - Units with ports is a spec with one
relation for the ports of each unit,
maps for the bus and the role of
each port, and a parameter whose
where:keeps only the output ports. - One construct per spec contains the smallest file for
each form of the four operators and
dual, each file beside its typeset equation. - A curve by convex combination is the smallest
piecewiseentry, with one weight per breakpoint. The three pages after it state the same dispatch with another method. - A curve that is not convex holds the weights on one segment with a binary per segment, under the default method.
- A curve as a special ordered set leaves the same restriction to the solver, in place of the binaries and their rows.
- A curve as segment lines states the curve as inequalities, and its expansion declares no variable.
- A curve filled segment by segment fills each segment only once the one before it is full. Its curves have different lengths, and a status switches the curve only of a committable generator.
- A component library is several files that
mergecomposes into one spec, each written against one shared fragment (the surface).
An open-source power system modelling framework
(PyPSA) has its own pages in the Development section,
which start at PyPSA in one file. They state the model that PyPSA
builds, as a proof that the language can state it.
PyPSA in 25 files states the same spec in fragments
that merge composes.
See also
- Typeset output, for the formats the typesetter prints and their options
- The language reference, for every key a file accepts