-----------------
SIMPLEX ALGORITHM for TI-89, TI-92[+]
----------------- v.1.2.2

With STEPWISE option.


CONTENTS
--------
- Compatibility
- Using the program
- Examples
- Known Bugs
- History
- Credits

COMPATIBILITY
-------------
This program was created on a TI-89 HW1, AMS 2.03, also probed on AMS 1.00.
It's fully compatible with TI-92 and TI-92 Plus (All ROMs).


USING THE PROGRAM
-----------------
Please run all the programs once before archiving it.

There are 3 subprograms NOT ALL are necessary.

* simplex()

With this program you don't need to know the syntax of each subprogram.


* simplxss(mat,numvart)

Applies simplex step by step over mat.
numvart indicates the number of artificial variables.

The program shows the pivot element and the row operations applied.
z and w letters are not shown.


* simplxfs(mat,numvart)

Shows the final solution for mat (if solution exists).
numvart indicates the number of artificial variables.


* tsimplex()

Use it to easily create the simplex tableaux, you don't have to put slack
or artificial variables.

z : [x1,x2,...,xn,-z]
Restrictions: [x1,x2,...,xn,bm]

Restrictions xi >= 0 aren't necessary to be included.


EXAMPLES
--------
Note:
 < means <= (less than or equal to) and
 > means >= (greater than or equal to)


Example 1.

Min z = y - x + 1, subject to:

      -2x + y < 2
        x -2y < 2
        x + y < 5
         x, y > 0

If you create the tableaux with tsimplex:

Num of restrictions : 3
Objective function  : [-1,1,-1]
Problem             : Min

Restrictions
1: [-2,1,2]   <
2: [1,-2,2]   <
3: [1,1,5]    <

mat will be:

           -2  1  1  0  0  2
            1 -2  0  1  0  2
            1  1  0  0  1  5
           -1  1  0  0  0 -1

and numvart=0

the final solution is [4,1,9,0,0]

You can obtain z evaluating this solution:
   z = -(4)+(1)+1 = -2


Example 2. (Artificial variables)

Max z = -2x + y + 1, subject to:

         2x + y > 4
         -x + y < 4
        -3x + y >-15
         x      < 7
           x, y > 0


Num of restrictions : 4
Objective function  : [-2,1,-1]
Problem             : Max

Restrictions
1: [2,1,4]    >
2: [-1,1,4]   <
3: [-3,1,-15] >
4: [1,0,7]    <


mat will be:
       2  1 -1  0  0  0  1   4
      -1  1  0  1  0  0  0   4
       3 -1  0  0  1  0  0  15
       1  0  0  0  0  1  0   7
       2 -1  0  0  0  0  0   1
      -2 -1  1  0  0  0  0  -4

and numvart=1

the final solution is [0,4,0,0,19,7]

   z= -2(0)+4(1)+1 = 5


KNOWN BUGS
----------
> If you have AMS 2.0x (TI-89 only) it's necessary to deactivate the
  alpha-lock on each tsimplex dialog box.
> If the matrix is too big you will not see it completely at the PgrmIO
  when using simplxss.


HISTORY
-------
> (v.2.0)
> v.1.2.2
  Spelling errors corrected.
  TI-92 incompatibility fixed (Thanks to Juan Carlos Carvajal)
  Algorithm bugs fixed.
> v.1.2.1
  A few little changes.
> v.1.2
  New interface, help text updated.
> v.1.1
  simplex() fixed, now compatible with TI-92 Plus.
> v.1.0
  First version, incompatible with TI-92, TI-92 Plus.


CREDITS
-------
Programmed by:

Esteban Richmond Salazar
ersiq@costarricense.com
richmond@terraba.fing.ucr.ac.cr

Send your comments, questions and errors that you find related with this
program.