How to solve a LPP when the A of linprog does not form a square matrix? I have 5 variables and 2 constraints.

4 visualizaciones (últimos 30 días)
Max Z = 0.1*X1 + 0.15*X2 + 0.2*X3 + 0.5*X4 + 1.2*X5
Subject to:
2*X1 + 2*X2 + 2*X3 + 0.6*X4 + 0.3*X5 <= 750
0.04*X2 + 0.08*X3 + 0.09*X4 + 0.135*X5 <= 30.75
All variable >= zero.

Respuestas (1)

Stephan
Stephan el 17 de Sept. de 2020
Editada: Stephan el 17 de Sept. de 2020
% define all constraints
A = [2, 2, 2, 0.6, 0.3;
0 0.04, 0.08, 0.09, 0.135;
-eye(5)]
b = [750, 30.75, zeros(1,5)]
% define obective function
Z = [0.1, 0.15, 0.2, 0.5, 1.2]
% call linprog with negative Z, due to maximization
sol = linprog(-Z,A,b)
  2 comentarios
BISWAJIT KAR
BISWAJIT KAR el 17 de Sept. de 2020
This is not giving an answer. The maximization problem gives -ve vakue for objective function
Stephan
Stephan el 18 de Sept. de 2020
for me it results in - using R2020a:
A =
2.0000 2.0000 2.0000 0.6000 0.3000
0 0.0400 0.0800 0.0900 0.1350
-1.0000 0 0 0 0
0 -1.0000 0 0 0
0 0 -1.0000 0 0
0 0 0 -1.0000 0
0 0 0 0 -1.0000
b =
750.0000 30.7500 0 0 0 0 0
Z =
0.1000 0.1500 0.2000 0.5000 1.2000
Optimal solution found.
sol =
340.8333
0
0
0
227.7778

Iniciar sesión para comentar.

Categorías

Más información sobre Linear Programming and Mixed-Integer Linear Programming en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by