-- We want to maximize the Function y = - 1/2x,
-- with the two conditions y ≤ 6 - 3/4x and y ≥ 1 - x and the bounds 0 ≤ x ≤ 6 and 1/3 ≤ y ≤ 4.
-- We prename the input of GLPK.LPSolve-function.
Use S::=QQ[x,y];
OF := 1/2x + y;
LE := [3/4x + y - 6];
GE := [x + y - 1];
Bounds:=[[0,6], [1/3,4]];
-- Then we compute the solution with
GLPK.LPSolve(OF, [], LE, GE, Bounds, "Simplex", "Max");
-- And we achieve:
-------------------------------------
Solution Status: OPTIMAL
Value of objective function: 5333333333/1000000000
[x - 266667/100000, y - 4]
|