Académique Documents
Professionnel Documents
Culture Documents
TP : Optimization
Master 1 FMP + CM
Pr. F. BOUMEDIENE
Mr .WALID LAROUI
Mr . SAMIR HARITI
Emails:
fboumediene@usthb.dz
faiza.boumediene@usthb.edu.dz
walid.laroui@usthb.edu.dz
1
TP°N 2 : Linear programming
Introduction
La programmation linéaire est une méthode d'optimisation mathématique visant à
atteindre le résultat optimal dans un modèle donné, tout en respectant des contraintes
linéairement définie.
Linprog
Linprog est une fonction MATLAB utilisée pour résoudre des problèmes de programmation linéaire.
Son rôle est de trouver une solution optimale qui minimise ou maximise une fonction linéaire tout en
La borne supérieure de x
La borne inférieure de x
Example: Find the solution of the following linear programming problem, using the simplex
method (linprog function of Matlab):
Min f = −x1 − 2x2 − x3
Subject to 2x1 + x2 − x3 ≤ 2
2x1 − x2 + 5x3 ≤ 6
4x1 + x2 + x3 ≤ 6
xi ≥ 0; i = 1, 2, 3
clc
clear all
C=[-1;-2;-1]; % Linear objective function vector f
A=[2 1 -1; % Matrix for linear inequality constraints
2 -1 5;
4 1 1];
b=[2;6;6]; % Vector for linear inequality constraints
lb=zeros(3,1); % lb Vector of lower bounds
Aeq=[]; % Matrix for linear equality constraints
beq=[]; % beq Vector for linear equality constraints
[x,fval] = linprog(C,A,b,Aeq,beq,lb)
Applications: Solve graphically, and using the “linprog” function, the following linear programming problems:
11
SOLUTION :
10x + 5y ≤ 2500
4x + 10y ≤ 2000
x + 1.5y ≤ 450
Since the variables x and y cannot take negative values, we have
x≥0
The total profit is given by f (x, y) = 50x + 100y y≥0
D a symmetric
positive-definite
matrix
Resolution using Matlab : Find the solution of the following quadratic programming
problem using MATLAB:
22