Introduction
Why you need Mosel
`Mosel' is not an acronym. It is pronounced like the German river, mo-zul. It is an advanced modeling and solving language and environment, where optimization problems can be specified and solved with the utmost precision and clarity.
Here are some of the features of Mosel
- Mosel's easy syntax is regular and described formally in the reference manual.
- Mosel supports dynamic objects, which do not require pre-sizing. For instance, you do not have to specify the maximum sizes of the indices of a variable x.
- Mosel models are pre-compiled. Mosel compiles a model into a binary file which can be run on any computer platform, and which hides the intellectual property in the model if so required.
- Mosel is embeddable. There is a runtime library which can be called from your favorite programming language if required. You can access any of the model's objects from your programming language.
- Mosel is easily extended through the concept of modules. It is possible to write a set of functions, which together stand alone as a module. Several modules are supplied by Dash, including the Xpress-MP Optimizer.
- Support for user-written functions and procedures is provided.
- The use of sets of objects is supported.
- Constraints and variables etc. can be added incrementally. For instance, column generation can depend on the results of previous optimizations, so subproblems are supported.
The modeling component of Mosel provides you with an easy to use yet powerful language for describing your problem. It enables you to gather the problem data from text files and a range of popular spreadsheets and databases, and gives you access to a variety of solvers, which can find optimal or near-optimal solutions to your model.
What you need to know before using Mosel
Before using Mosel you should be comfortable with the use of symbols such as x or y to represent unknown quantities, and the use of this sort of variable in simple linear equations and inequalities, for example:
x+y6
Experience of a basic course in Mathematical or Linear Programming is worthwhile, but is not essential. Similarly some familiarity with the use of computers would be helpful.
For all but the simplest models you should also be familiar with the idea of summing over a range of variables. For example, if producej is used to represent the number of cars produced on production line j then the total number of cars produced on all N production lines can be written as:
producej
N j=1 This says `sum the output from each production line producej over all production lines j from j=1 to j=N'.
If our target is to produce at least 1000 cars in total then we would write the inequality:
producej
N j=1 1000
We often also use a set notation for the sums. Assuming that LINES is the set of production lines {1,..,N}, we may write equivalently:
producej
j LINES
1000
This may be read `sum the output from each production line producej over all production lines j in the set LINES'.
Other common mathematical symbols that are used in the text are
(the set of non-negative integer numbers {0,1,2,...}),
and
(intersection and union of sets),
and
(logical `and' and `or'), the all-quantifier
(read `for all'), and
(read `exists').
Mosel closely mimics the mathematical notation an analyst uses to describe a problem. So provided you are happy using the above mathematical notation the step to using a modeling language will be straightforward.
Symbols and conventions
We have used the following conventions within this guide:
- Mathematical objects are presented in italics.
- Examples of commands, models and their output are printed in a Courier font. Filenames are given in lower case Courier.
- Decision variables have lower case names; in the most example problems these are verbs (such as use, take).
- Constraint names start with an upper case letter, followed by mostly lower case (e.g. Profit, TotalCost).
- Data (arrays, sets, lists) and constants are written entirely with upper case (e.g. DEMAND, COST, ITEMS).
- The vertical bar symbol | is found on many keyboards as a vertical line with a small gap in the middle, but often confusingly displays on-screen without the small gap. In the UNIX world it is referred to as the pipe symbol. (Note that this symbol is not the same as the character sometimes used to draw boxes on a PC screen.) In ASCII, the | symbol is 7C in hexadecimal, 124 in decimal.
The structure of this guide
This user guide is structured into these main parts
- Part I describes the use of Mosel for people who want to build and solve Mathematical Programming (MP) problems. These will typically be Linear Programming (LP), Mixed Integer Programming (MIP), or Quadratic Programming (QP) problems. The part has been designed to show the modeling aspects of Mosel, omitting most of the more advanced programming constructs.
- Part II is designed to help those users who want to use the powerful programming language facilities of Mosel, using Mosel as a modeling, solving and programming environment. Items covered include looping (with examples), more about using sets, producing nicely formatted output, functions and procedures. We also give some advanced MP examples, including Branch-and-Cut, column generation, Goal Programming and Successive Linear Programming.
- Part III shows how Mosel models can be embedded into large applications using programming languages like C, Java, or Visual Basic.
- Part IV gives examples of some of the advanced features of Mosel, including the use of the Mosel Debugger and Profiler for the development and analysis of large-scale Mosel models, an introduction to the notion of packages, and an overview of the functionality of the modules in the Mosel distribution.
This user guide is deliberately informal and is not complete. It must be read in conjunction with the Mosel reference manual, where features are described precisely and completely.
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.