Professional Documents
Culture Documents
formulas that define the limits on the values of the 1/60*Drop + 3/60*Deco <=16;
variables
1
LINGO Solver Status Window LINGO Solution Report Window
If no errors are found, the LINGO Solver Close the Solver Status window to see the
Status window appears Solution Report window
LINGO allows you to group many SETS section must be defined before any
instances of the same variable into sets of the set members are used in the
Example: If a model involved 27 delivery model’s constraints
trucks, then these 27 trucks could be Primitive set example:
described more simply as a single set
SETS:
Sets may also include attributes for each
Trucks/TR1..TR27/:Capacity;
member, such as the hauling capacity for
each delivery truck ENDSETS
2
Using Sets (cont.) Set Looping Statement Examples
All variables in a LINGO model are @GIN – any positive integer value
considered to be non-
non-negative and @BIN – a binary value (ie
(ie,, 0 or 1)
continuous unless otherwise specified @FREE – any positive or negative real
LINGO’s four variable domain functions value
can be used to override the default @BND – any value within the specified
domain for given variables bounds
3
LINGO Operators and Functions Mathematical Functions
There are three types of operators that @ABS(X) – returns the absolute value of X
LINGO uses @SIGN(X) – returns -1 if X is negative and +1 if
X is positive
Arithmetic
@EXP(X) – calculates eX
Logical
@LOG(X) – calculates the natural log of X
Relational @SIN(X) – returns the sine of X, where X is the
angle in radians
@COS(X) – returns the cosine of X
@TAN(X) – returns the tangent of X
Knapsack (cont.)
DATA:
WEIGHT, RATING =
1, 2
3, 9
4, 3
3, 8
3, 10
1, 6
5, 4
10, 10;
KNAPSACK_CAPACITY = 15;
ENDDATA
4
Questions?