TP en
TP en
TP en
Page 1 Le mod�le :
Page 3 & 4 : exemple de minimisation d'un probl�me lin�aire.
------------------------------------------------------------------------
[x,fval,exitflag,output,lambda] = linprog(f,A,b,[],[],lb)
-------------------------------------------------------------------------
Remarque:
lb = zeros(3,1) est �quivalent � lb = [0; 0;0]
-----------------------------------------------------------------------------------
[x,fval,exitflag,output,lambda] = linprog(f,A,b,[],[],lb)
----------------------------------------------------------------------------------
f = [ -1 ; -2 ; -3; -4; -5 ; -6 ]
A = [5 3 2 4 5 1
0 -1 2 1 4 5
2 4 4 5 1 5
6 5 4 3 2 1 ];
b = [2; 2; 3 ; 4 ];
lb = [-2; -3; -4 ; -5;-6 ;-7 ];
ub = [2; 3; 4 ; 5;6 ;7 ];
[x,fval,exitflag,output,lambda] = linprog(f,[],[],A ,b,lb,ub)
-----------------------------------------------------------------------------------
-------
(0 <= x1 <=2);
(0 <= x2 <=2);
(0 <= x3 <=3);
(0 <= x4 <=3);
(0 <=x5 <= 4);
solution
-----------------------------------------------------------------------------------
----
f = [ 1 ; 3 ; 5; 1; 4 ]
A = [1 1 -1 1 0
2 0 4 2 1
1 6 1 0 2 ];
b = [1 ; 7; 19 ];
lb = [ 0 ; 0 ; 0 ; 0 ; 0 ];
ub = [2; 2; 3 ; 3;4 ];
X1 >=0; X2 >=0;
solution
-----------------------------------------------------------------------------------
----
f = [ 2; 1]
A = [-2 1
1 1
0 1 ];
b = [1; 3; 2];
lb = zeros(2,1);
-----------------------------------------------------------------------------------
----
solution
-------------------------------------------------------------------------------
f = [ 2; 1;0;0;0]
A = [-2 1 1 0 0
1 1 0 1 0
0 1 0 0 1];
b = [1; 3; 2];
lb = zeros(5,1);
--------------------------------------------------------------------------------