9.1 Coefficients for Variables

Every variable has a coefficient in each constraint, which you can specify. If the variable is not mentioned in the constraint the coefficient value is zero. If there is a variable, but no coefficient is given, the default value is one. The coefficient can either be placed in front of the variable or trailing it.

You can enter coefficients as simple numbers or as any combination of products, fractions, percentages, and arithmetic functions. Parentheses containing constant expressions can also be used in the denominators of the coefficients.

MPL evaluates those expressions when it reads the model file, and puts the results in the input file. This capability enables you, for example, to enter fractions with complete accuracy. Named data constants declared in the DATA section can be used as any other numbers.

Examples of coefficients:

    4                     {  = 4.0             }
    1/3                   {  = 0.33333333333   }
    1/(3+5)               {  = 0.125           }
    2 * InvtCost          {  = 2 * 8.8 = 17.6  }
    1.32 / 24.5% * 53     {  = 285.55102041    }

In the fourth line it is assumed that the InvtCost is a named data constant which has been defined as 8.8.


Back To Top | Maximal Home Page | Table of Contents | Previous Page | Next Page