Session 1: Running MPL On A Sample Model

In this session, you will go through a series of steps to learn how to run MPL on a sample model. By the end of the session, you will be able to start MPL, load and solve the model, and view the solution. At that point, you will learn how you can change option settings for MPL through dialog boxes. A brief outline of the MPL Help System is also covered at the end of this session. You will now go through each step in detail using the formulation of a sample model.

Your First MPL Session

There are four simple steps you need to be familiar with in order to solve models in MPL:

Step 1: Start the MPL Application

Starting MPL is simple in Windows. When you installed MPL, the installation program created an entry in the Start menu under Programs for MPL for Windows. If MPL has not been installed, please refer to Chapter 2 for information on how to install the software. To start MPL, click the Start button from the task bar that appears along the bottom of the screen and select Programs/MPL for Windows.

Step 1: Start the MPL Application

MPL for Windows in the Start Menu

Step 2: Load the Model File into MPL

After starting MPL, the next step is to load a model file in the model editor. The MPL application comes with several sample models that are installed in the Mplwin4 directory. MPL models are stored as standard text files and typically have the file extension '.mpl'. The model we are using in this session is called Model1.mpl and is stored along with other models for this tutorial in a separate folder called Tutorial.

  1. Choose Open from the File menu to display the Open dialog box.
  2. Double click on the Tutorial folder name to go down to the folder where the model file 'Model1.mpl' is stored as shown below.
  3. The Open File Dialog Box

  4. The Open dialog now lists all the MPL model files in the Tutorial folder. Click on the filename 'Model1.mpl' to select the model file and then press Open to open the file. Alternatively, you can open the file directly by double clicking on it in the list of files.

This will open a new model editor window containing the formulation for the model.

Model Editor Window with the Model1.mpl model file

Step 3: Solve the Model

In this tutorial you will be using the CPLEX solver, but if you have another solver installed that is supported by MPL, you can use that one instead.

When you run MPL for the first time after installing it, MPL will automatically try to locate any solvers that you have available. You can see which solvers have been set up for MPL by going to the Run menu. Each solver found will be listed in the menu with the word Solve in front of it.

If you do not have any solvers available you will see the item No Solvers in the Run menu. In this case refer to Chapter 2.3: Setting up Solvers for MPL for information on how to add solvers to MPL. The rest of this tutorial will assume that you have successfully installed CPLEX or some other solver and it has been set up correctly.

The next step is to solve the model that you have loaded into the model editor. To solve the model follow these steps:

  1. Choose Solve CPLEX from the Run menu to solve the 'Model1' model.
  2. While solving the model, the Status Window is displyed and provides you with information about the solution progress.

The Status Window for the Model1 Model

The Status Window provides you with information such as the number of lines read, the number of variables and constraints encountered, and how much memory has been used. While the optimizer is solving the model, the number of iterations and the current value of the objective function are also shown. The figure above shows the Status Window after the problem has been solved.

Step 4: View the Solution

MPL sends the solution to a file with same name as the model file, but with the file extension '.sol'. Use the following steps to view the solution file Model1.sol that was generated for the model you just solved:

  1. Press the View button at the bottom of the Status Window, which appeared on the screen during the solving process. This will open a View Window containing the solution file as shown below.

View Window with the Solution File 'Model1.sol'

  1. You can quickly browse through the solution using the scroll bars on the right. Note that the details of the solution are provided including the optimal solution value for the objective function, values for the decision variables and for the constraints.
  2. When you are finished browsing through the solution press the (X) button in the upper right hand corner to close the View Window.
Step 5: Using the Model Definitions Tree Window

MPL also allows you to view all of the defined items from the model formulation in a hierarchical tree window called the Model Definitions window . Each branch corresponds to a section in the model.

If the tree window is not open, you can open it by choosing Model Definitions from the View menu. While working in MPL it is normally good idea to leave the window open at all times. MPL will then automatically update its contents every time you solve your model.

The tree window provides easy access to different areas of the model and allows you to quickly view selected parts of the solution from the model. To use the tree window do the following:

  1. Make sure the tree window is open by choosing Model Definitions from the View menu.

The Model Definitions Tree Window

  1. Under the header VARIABLES in the tree window, you will see three variable names listed: Produce, Inventory, Sales; which are the variables for the model. In front of each section header, there is a small box containing either a plus or a minus sign. This box allows you to quickly to expand and collapse each branch of the tree.
  2. Now select the variable Produce and press the View button at the bottom of the window. This will open a new View Window with the solution values for the Produce variable.

View Window with the Solution Values for the Produce Variable

Using the Help System in MPL

MPL offers the user an extensive help system containing useful information on how to use the software.

Accessing the Available Help Topics for MPL

To open the main help system window for MPL, go to the Help menu and choose Topics. This will display the help window, shown below, where you can select the help topic you wish to read.

The Help Contents Window for MPL

The MPL Help Topics dialog box contains three tabs; the Contents tab, the Index tab, and the Find tab, giving you different ways of accessing the help.

The Contents tab, shows all the available topics in the help system in a hierarchical tree structure.

The Index tab, enables the user to access a list of all the keywords in the help file or to perform a search for a specific keyword.

The Find tab, enables the user to find a help topic by searching for specific words or phrases in the text. The Find database is built the first time you select the Find tab through the Find Setup Wizard.

Looking Up Context Sensitive Help for Dialog Boxes

One of the beneficial features in Windows is the addition of context sensitive help for dialog boxes. This feature enables you to quickly get specific help information about the dialog box item you are interested in. To learn how to use the context sensitive help in MPL follow these steps:

  1. To open a dialog box choose MPL Language from the Options menu. This will display the MPL Language Options dialog box.
  2. Click on the question mark button in the upper right corner of the dialog and then release the mouse button. The cursor will change to a (?) which you can use to point to an item you are interested in.
  3. Move the mouse across the dialog and click on the Max subscript length item. A small window will pop up with a short explanation of the item you selected as shown here below.

Context Sensitive Help for Dialog Box

You can also display the context sensitive help by pressing the right mouse button on the item in the dialog box and then select What's This? from the pop up menu.

Back To Top | Maximal Home Page | Overview | Previous Page | Next Page