home *** CD-ROM | disk | FTP | other *** search
- !This file is a demonstration of the graphical prosentation of
- !the following linear programming problem
- !Load it using command ld demo.drw
- !The exclamation marks (!) can be used for commenting
-
- !Max 600x1 + 200x2
- !subject to
- ! x1 < 6
- ! x2 < 10
- ! 10x1 + 20x2 < 160
- ! 300x1 + 200x2 < 2400
- ! x1, x2 > 0
-
- nw !New, clear and reset
-
- ik r !Ink, red
- li 600,200, 0 !Line, Objective function slope
- li 600,200, 800
- li 600,200,4200 !Line, Optimal value
-
- ik y !Ink, yellow;
- li 1, 0, 6 !Line, First constraint
- li 0, 1, 10 !Line, Second constraint
- li 10, 20, 160 !Line, Third constraint
- li 300,200,2400 !Line, Fourth constraint
-
- ax !Redraw axes (must be pacthed lest fill leaks)
- fi 1,1 !Fill the area around 1,1 bordered by yellow
- po 6,3 !Point at the optimal solution
-
- lb 9, 4, 10x1+20x2<160 !Labels
- lb 6.2, 6, x1<6
- lb 2, 10.7, x2<10
- lb 3, 8, 300x1+200x2<2400
-
- !LPDEMO.DRW ready
-