minimize_lp(11*x1+8*x2,[ 2*x1+x2>=12, x1+2*x2>=12, x1+x2>=10, 3*x1+4*x2<=60 ]), nonegative_lp=true;";[br][br][b](10)[/b] set X to Variables[br][b](11)[/b] set Tablo Constraints and Ojective=0 as equations[br][b](19)[/b] copy Tab to StdTab and [br]set Objectiv (-1) Z (make Z coefficient negative)[br]set in >= constraints rows (-1) slack variable, a constraints equation set slack variable = 0[br][b](29)[/b] refer A[sub]11[/sub] [br]Absolute largest coefficient in Z' (before last row) defines the pivot column[br]Calculate b/(pivot column) Qb2(Tableau, pivot column) -> Smallest value defines the pivot row[br]....[br]stop if all columns of additional variables in Z' (before last row) = -1 -> EndPhase1 matrix[br][b](36)[/b] set EndPhase1 matrix to A[sub]ij[/sub] phase1 ending (A[sub]14[/sub])[br][b](39)[/b] refer A[sub]1[/sub] [br]go ahead with standard simplex algorithm -> all coefficients of Z are negativ -> stop[br]
(15)[br]\text\small\blue{LP minimization \mathbb{LP_{min}} works analogously to LP maximization, but\\[br]in the opposite direction of the gradient. This results in the following changes:\\[br]\underline{Optimality test}: All coefficients of the objective function \mathbb{Z}_{min} ≤ 0\\[br]\underline{Pivot column}: largest entry in \mathbb{Z_{min}} }[br][br](18)[br]\text\small\blue{As in Max-LP, set the slack variable to -1 for NB equal to or greater than.\\[br]For equations, remove the slack variable \to 0\\[br]Phase 1:\\Search for a feasible basic solution using the simplex algorithm and an auxiliary objective function.\\ [br]Block entry after slack variables and before b variables }[br][br](21)[br]\text\small\blue{Setting up the initial simplex table. In each row where we subtract a slack variable, we additionally add an auxiliary variable.}[br][br](23)[br]\text\small\blue{Replacing the objective function Z with the column sum of all auxiliary variables \to Z'}[br][br](25)[br]\text\small\blue{By adding all rows containing an auxiliary variable to the objective function row\\[br]we set all entries of the auxiliary variables in the objective function row to zero:\\[br]Z'=Load(Start)+Z'\times Start \to penultimate row of A_{11}\\[br]\to last row original Z to notation of the basis change\\ [br]Pivot selection is done manually after the quotient Qb2 \to b/pivot column[br][br](35)[br]\text\small\blue{The initial problem now has a basic solution.\\[br]Remove the data from the auxiliary variables.\\[br]In the second phase, the optimal target value is determined using the simplex table.}[br][br](38)[br]\text\small\blue{Protocol for basis change\{row pivot, column pivot\}\\[br]The pivot \{z,s\} describes a basis change \\[br]\to Column s enters the basis, column z leaves the basis. \\[br]\to Transform Z, Z is expressed by basis variables x1 and x2\\[br]\to A_1 receives the new Z from the last row of the matrix EndPhase1:[br][br]("\text\small\blue{https://statmath.wu.ac.at/~leydold/MOK/HTML/node164.html}")[br][br][br][size=150]Matrix Functions[/size][br][table][tr][td]Die Ausstattung zur Matrizen-Behandlung ist sehr [br]schwach ausgeprägt. Es gibt keine Spalten-Werkzeuge. Um Spalten zu bearbeiten muss die Matrix transponiert werden:[br]Element()[br]Take()[br]First()[br]Last()[br]können dann Zeilen barbeiten die mit[br]Join()[br]Append()[br]wieder zusammen gebaut werden. Die bearbeiteten Zeilen werden nach einer Rück-Transponierung wieder zu Spalten"[/td][td]The features for matrix processing are very limited. There are no column tools. To edit columns, the matrix must be transposed:[br]Element()[br]Take()[br]First()[br]Last()[br]can then edit rows that are reassembled with[br]Join()[br]Append().[br]After transposing back, the edited rows become columns again.[br][br][br][/td][/tr][/table]
https://www.mikrocontroller.net/attachment/156858/SimplexMeFile_2012-10-08_19-55.pdf[math]\nearrow[/math][br][br]minimize_lp([br]39*x1+21*x2+82*x3+55*x4,[[br]2*x1+50*x2+6*x3+74*x4<=60,[br]2*x1+50*x2+6*x3+74*x4>=54,[br]1*x1+75*x2+13*x3+96*x4<=80,[br]1*x1+75*x2+13*x3+96*x4>=39,[br]5*x1+83*x2+5*x3+105*x4<=90,[br]5*x1+83*x2+5*x3+105*x4>=24,[br]x1+x2+x3+x4=1[br]]),numer;[br] [br][table] [tr][br][td][math]\textcolor{blue}{\large\mathcal{Maxima-Link}\nearrow[/math] [br]https://sagecell.sagemath.org/?q=ohjkyg[/td][br] [td][math]\textcolor{blue}{\large\mathcal{SageMath-Link}\nearrow[/math] [br]https://sagecell.sagemath.org/?q=bxgkkw[/td][br][/tr][br][/table][br][i]Tablo:={ 2*x1+50*x2+6*x3+74*x4=60, [u]2*x1+50*x2+6*x3+74*x4=54[/u], 1*x1+75*x2+13*x3+96*x4=80, [u]1*x1+75*x2+13*x3+96*x4=39[/u], 5*x1+83*x2+5*x3+105*x4=90, [u]5*x1+83*x2+5*x3+105*x4=24[/u], x1+x2+x3+x4=1,39*x1+21*x2+82*x3+55*x4=0}[br][br][math]\small A_{11} \, := \, \left(\begin{array}{rrrrrrrrrrrrrrrr}2&50&6&74&1&0&0&0&0&0&0&0&0&0&0&60\\2&50&6&74&0&-1&0&0&0&0&0&1&0&0&0&54\\1&75&13&96&0&0&1&0&0&0&0&0&0&0&0&80\\1&75&13&96&0&0&0&-1&0&0&0&0&1&0&0&39\\5&83&5&105&0&0&0&0&1&0&0&0&0&0&0&90\\5&83&5&105&0&0&0&0&0&-1&0&0&0&1&0&24\\1&1&1&1&0&0&0&0&0&0&0&0&0&0&1&1\\9&209&25&276&0&-1&0&-1&0&-1&0&0&0&0&0&118\\-39&-21&-82&-55&0&0&0&0&0&0&0&0&0&0&0&0\\\end{array}\right)[/math][br][br]Phase1: A_{11}...A_{18}[br]BasisPhase1:={5, 12, 7, 13, 9, 14, 15}[br]BasisPhase2:=[i]{{5, 12, 7, 13, 9, 14, 1}{7,1}[sub]1[/sub],{5, 12, 7, 13, 9, 2, 1}{6,2}[sub]2[/sub],{5, 12, 7, 13, 9, 2, 3}{7,3}[sub]3[/sub],{5, 12, 7, 13, 9, 4, 3}{6,4}[sub]4[/sub],{5, 12, 7, 10, 9, 4, 3}{4,10}[sub]5[/sub],{5, 12, 7, 10, 9, 4, 0}{7,1}[sub]6[/sub],[b]{5, 8, 7, 10, 9, 4, 0}{[/b]2,8}[sub]7[/sub]}[br][/i][math]\longrightarrow[/math][b] {Basiswechsel}{Pivot}[/b]-Folge [br][br]\text\small\blue{Protokoll der Basiswechsel \[b]{Basisspalten\},\{ZeilenPivot,Spaltenpivot\[/b]}\\[br]Der Pivot \{z,s\} beschreibt einen Basiwechsel \to Spalte s geht in die Basis, Spalte z verlässt die Basis. \\[br]Der zweite Basiswechsel \{7,1\} löscht den Basiseintrag \{5, 12, 7, 10, 9, 4, 0\} für Spalte 1\\[br][/i][br]Phase2: A_1 {7,2} ... A_2[br]IL:={{0}, {0.8333333333336}, {0}, {0.1666666666662}}[br]----[br][br]minimize_lp([br]2*x1-5*x2+x3,[br][2*x1+x2<=100,[br]-x1+2*x2+2*x3<=90,[br]x1+x2-x3>=60,[br]x1+4*x3=44[br]]), nonegative_lp=true, numer;[br][br]Tablo:={2*x1+x2=100, -x1+2*x2+2*x3=90, [u]x1+x2-x3=60,[/u] [u]x1+4*x3=44[/u],2*x1-5*x2+x3=0}[br][br][math]\small A_{11} \, := \, \left(\begin{array}{rrrrrrrrrr}2&1&0&1&0&0&0&0&0&100\\-1&2&2&0&1&0&0&0&0&90\\1&1&-1&0&0&-1&0&1&0&60\\1&0&4&0&0&0&0&0&1&44\\2&1&3&0&0&-1&0&0&0&104\\-2&5&-1&0&0&0&0&0&0&0\\\end{array}\right)[/math][br][br][i]Phase1: A_{11}...A_{15}[br][/i]BasisPhase1:={4, 5, 8, 9}[br]BasisPhase2:={ {4, 5, 8, 3},{4, 3}[sub]1[/sub],{4, 5, 8, 1},{4, 1}[sub]2[/sub],{2, 5, 8, 1},{1, 2}[sub]3[/sub],[b]{2, 5, 3, 1}[/b],{3, 3}[sub]4[/sub] }[br]Phase2: A_1 {2,6} ... A_2[br]IL:={{24}, {52}, {5}}