1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
SIMPLEX
========
The simplex package implements the two-phase standard simplex method for
solving linear programming problems in maxima.
The simplex package contains two files: simplex.lisp and
minimize_sx.mac. The file simplex.lisp should be compiled for speed. You
must load simplex before minimize_sx.
FUNCTIONS
==========
- linear_program(A, b, c): finds the vector x which minimizes c'.x subject
to A.x=b. A is a n.m matrix, b a list of length n and c a list of length
m. The return value is [x, val] where x is the minimizing vector and
val=c'.x. This function is defined in the file simplex.lisp.
- minimize_lp(ex, const, pos): minimizes expression ex subject to
constraints in the list const. pos is an optional arguments which lists
non-negative variables. This function is defined in the file
minimize_sx.
- maximize_lp(ex, const, pos): maximizes expression ex subject to
constraints in the list const. pos is an optional arguments which lists
non-negative variables. This function is defined in the file
minimize_sx.
VARIABLES
==========
- epsilon_lp: epsilon for numerical computation (float)
- scale_lp: scale input (boolean)
- pivot_count_sx: the number of pivots in last computation (fixnum)
- pivot_max_sx: maximum number of pivots allowed (fixnum)
- nonnegative_lp: assume all variables to minimize_lp/maximize_lp are
non-negative (boolean)
DEMO
=====
(%i1) A : matrix([1,1,-1,0],[2,-3,0,-1], [4,-5,0,0])$
(%i2) b : [1,1,6]$
(%i3) c : [1,-2,0,0]$
(%i4) linear_program(A, b, c);
(%o4) [[13/2, 4, 19/2, 0], -3/2]
(%i1) minimize_lp(x+y, [3*x+y>4, x+4*y>4]), nonnegative_lp=true;
(%o1) [20/11, [x = 12/11, y = 8/11]]
TESTS
======
There are some tests in the Tests subdirectory.
AUTHOR
=======
This package was written by
Andrej Vodopivec <andrejv@users.sourceforge.net>
http://wxmaxima.sourceforge.net/maxima.html
It is licensed under the GPL licence.
|