How-to guides#
Each guide lists the steps toward one task, for a reader who already writes the specification of an optimisation model (a spec). To learn the language from the start, follow the tutorials first.
Set up and check#
- Install mathspec into a Python environment, and set up your editor to complete the keys of a spec file.
- Check a spec without data on your machine and in continuous integration (CI), and read a refusal or a remark that is not one (advice).
Write a spec#
- Choose between a dimension, a relation, a map and a parameter for a column of your data.
- State a rule that differs by case, such as committable and non-committable generators, in one spec.
- Fix a quantity that is data in one model and a decision in another with one spec file.
Print, compare and compose#
- Print a spec as math in LaTeX, Markdown or a typesetting system (Typst), with the symbols your field uses.
- Compare two specs so that a diff contains only what the specs state differently.
- Compose a spec from several files with
mergefor a component library, and withoverridefor the changes a project lays over a shared spec.
Work with piecewise curves and SOS#
- See what a piecewise curve or an SOS expands to as plain variables and constraints, for a special ordered set (an SOS).