Professional Documents
Culture Documents
Programming
Abdelmoutalib Metrane
EMSI
Marrakech Maroc
December 3, 2017
Introduction
1 Minos 5.5
2 Cplex
3 Lpsolve
4 Ipopt
5 xpress
1 Impossible de couper/coller
2 Impossible de déler les output
Solution
Édition de chiers
Le chier .mod
−x1 + 2x2 ≤ 12
3x1 + 5x2 ≤ 52
x1 + x2 ≤ 14
x1 ≤ 12
x1 , x2 ≥ 0.
Fichier Exemple1.mod
*******************************
var X1 >= 0 ;
var X2 >= 0 ;
maximize Prot: 4 * X1 + 5 * X2;
subject to cont1: -X1 + 2 * X2 <=12;
subject to cont2: 3*X1 + 5* X2 <= 52;
subject to cont3: X1 + X2 <=14;
subject to cont4: X1 <= 12;
*******************************
*******************************
sw: ampl
ampl: model Exemple1.mod;
ampl: solve;
MINOS 5.5: optimal solution found.
3 iterations, objective 61
ampl: display X1, X2;
X1 = 9
X2 = 5
*******************************
*******************************
sw: ampl
ampl: model Res-graph1.mod;
ampl: option solver cplex;
ampl: solve;
CPLEX 11.0.1: optimal solution; objective 61
2 dual simplex iterations (1 in phase I)
ampl: display X1, X2;
X1 = 9
X2 = 5
*******************************
*******************************
sw: ampl entrer à AMPL
ampl: model nom-de-chier.mod; ouvrir un chier modèl
ampl: option solver nom-de-solveur; choisir le solveur
ampl: solve; résoudre
ampl: display nom-de-variable ; sortir les résultats
*******************************
var X1 >=0 ;
var X2 >=0;
maximize Prot: 22410 * X1 + 33230 * X2;
subject to Atelier1: 3.5 * X1 + 4 * X2 <=1500;
subject to Ateleir2: 2 * X1 + 3 * X2 <=1500;
subject to MINeconomique: 120 <= X1;
set A;
param T:=2;
param cost {1..T};
param a {j in 1..T };
param b {j in 1..T };
param d {i in A};
var X {j in 1..T} ;
maximize Prot: sum {j in 1..T} cost[j] * X[j];
subject to Atelier {i in A}: sum {j in 1..T} a[j] * X[j]<= d[i];
subject to MINeconomique {j in 1..1}: 120 <= X[j];
*******************************
sw: ampl
ampl: include Usine-auto2.run;
*******************************
*******************************
sw: ampl
ampl: model 'C:\ Users\ DELL \ Desktop\ Bureau2017\
AMPL2017\ transp.mod';
ampl:data 'C:\ Users\ DELL\Desktop\ Bureau 2017\
AMPL2017\ transp.dat';
ampl: solve;
MINOS 5.5: optimal solution found.
13 iterations, objective 196200
ampl: display Trans;
Trans [*,*] (tr)