80 likes | 92 Views
כלים חישוביים – תכנון לינארי. Matlab (optimization toolbox) Maple (with simplex) Solver (by excel). Matlab. x = linprog(f,A,b) x = linprog(f,A,b) solves min f'*x such that A*x <= b. Maple. > cnsts := {3*x+4*y-3*z <= 23, 5*x-4*y-3*z <= 10, 7*x+4*y+11*z <= 30}: obj := -x + y + 2*z:
E N D
כלים חישוביים – תכנון לינארי • Matlab (optimization toolbox) • Maple (with simplex) • Solver (by excel)
Matlab • x = linprog(f,A,b) x = linprog(f,A,b) solves min f'*x such that A*x <= b
Maple > cnsts := {3*x+4*y-3*z <= 23, 5*x-4*y-3*z <= 10, 7*x+4*y+11*z <= 30}: obj := -x + y + 2*z: maximize(obj,cnsts union {x>=0,y>=0,z>=0}); > maximize(obj,cnsts,NONNEGATIVE); > maximize( x+y, {4*x+3*y <= 5, 3*x+4*y <= 4 } ); > minimize(-obj,cnsts,NONNEGATIVE); > feasible({4*x+3*y <= 5, 3*x+4*y = 4}, NONNEGATIVE); > feasible({4*x-3*y <= 5, 3*x-4*y = 4, x>=0, y>=0 }); > display( { x + 3*y + z <= 0, w - 2*y - z <= 2 } ); > dual( x+y, {3*x+4*y <= 4, 4*x+3*y <= 5}, z );