Dies beantwortet nicht direkt Ihre Frage. Sie können GNU GLPK und Gusek Editor herunterladen und versuchen, Ihre Anforderungen zu modellieren.
Wenn MATLAB auch mathematische Programmiersprachen wie MathProg, GAMS unterstützt, dann könnten Sie Ihre linearen Gleichungen modellieren und ohne objektive Funktion lösen (wie @sascha kommentiert).
/* MathProg Example : With trivial inequalities */
param m, integer, > 0, default 242;
param n, integer, > 0, default 9;
set INEQUALITIES := 1..m;
set VARS := 1..n;
var x{j in VARS}, >= 0, <= 30;
s.t. phi{i in INEQUALITIES}: i - sum{j in VARS} x[j] <= 20;
solve;
for{j in VARS} {
printf"x[%2d] = %2d\n", j, x[j];
}
end;
erstellte Gleichungen aussehen würde:
Minimize
obj: 0 x(1)
Subject To
phi(1): - x(1) - x(2) - x(3) - x(4) - x(5) - x(6) - x(7) - x(8) - x(9)
<= 19
phi(2): - x(1) - x(2) - x(3) - x(4) - x(5) - x(6) - x(7) - x(8) - x(9)
<= 18
phi(3): - x(1) - x(2) - x(3) - x(4) - x(5) - x(6) - x(7) - x(8) - x(9)
phi(242): - x(1) - x(2) - x(3) - x(4) - x(5) - x(6) - x(7) - x(8)
- x(9) <= -222
Bounds
0 <= x(1) <= 30
0 <= x(2) <= 30
0 <= x(3) <= 30
0 <= x(4) <= 30
0 <= x(5) <= 30
0 <= x(6) <= 30
0 <= x(7) <= 30
0 <= x(8) <= 30
0 <= x(9) <= 30
End
auf die Lösung des Modells Lösung aussehen würde:
>C:\gusek\glpsol.exe --cover --clique --gomory --mir -m "vijay.mod"
GLPSOL: GLPK LP/MIP Solver, v4.64
Parameter(s) specified in the command line:
--cover --clique --gomory --mir -m vijay.mod
Reading model section from vijay.mod...
vijay.mod:17: warning: final NL missing before end of file
17 lines were read
Generating phi...
Model has been successfully generated
GLPK Simplex Optimizer, v4.64
242 rows, 9 columns, 2178 non-zeros
Preprocessing...
222 rows, 9 columns, 1998 non-zeros
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 1.000e+00 ratio = 1.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 222
0: obj = 0.000000000e+00 inf = 2.475e+04 (222)
222: obj = 0.000000000e+00 inf = 0.000e+00 (0) 2
OPTIMAL LP SOLUTION FOUND
Time used: 0.0 secs
Memory used: 0.5 Mb (538071 bytes)
x[ 1] = 30
x[ 2] = 30
x[ 3] = 30
x[ 4] = 30
x[ 5] = 30
x[ 6] = 30
x[ 7] = 30
x[ 8] = 12
x[ 9] = 0
Model has been successfully processed
>Exit code: 0 Time: 0.212
[linprog] (https://de.mathworks.com /help/optim/ug/linprog.html) – sascha
@sascha Ich lese über linprog, aber von dem, was ich vom Ausdruck des Problems sehe, gibt es keine Notwendigkeit für eine objektive Funktion, also wie überspringe ich die f? –
Verwenden Sie einen Nullvektor oder einen anderen Vektor (da Sie nicht angegeben haben, welche möglichen Lösungen Sie suchen). – sascha