How to Use linearProgramming

Looking at a single constraint

The live graph above is designed to help students understand the constraint

5 x + 3 y <= 30.

It shows the x- and y-axes and the line 5 x + 3 y = 30. The student can look at the value of the function

f(x, y) = 5 x + 3 y

by dragging the reddish-brown sphere around the display. The value of the function at the polnt marked by the sphere is displayed numerically in the upper right hand corner and graphically by the bar at the right side. The bar is red when the function is positive and blue when it is negative.

The curriculum developer can specify what is shown by using the following parameters.

Maximizing a function subject to linear constraints

This same example is intended to help students understand maximizing (or minimizing) an objective function subject to linear constraints. As the user moves the reddish-brown sphere around the value of the objective function is shown numerically at the upprer right and graphically by the red bar on the right side. For this example, the value of the parameter sw5 is set to 0 so that the bar is red when the objective function is positive and blue when it is negative.

The html code for these two examples is shown below. Notice that the parameters must be entered twice in different forms. Each form is recognized by some but not all browsers. The relevant code is highlighted in red and in blue. Be careful to enter the parameters as shown. We recommend that you copy the code from one of the examples below and edit the appropriate entries.

HTML code for the first example

HTML code for the second example

To use this Shock Wave Lite Applet download linearProgramming.dcr and place it in the same directory (folder) as the html files in which it appears. Follow the procedure for downloading and saving a file from your browser. For example, with Internet Explorer and MacOS X hold down the option key while clicking the link.