-
Notifications
You must be signed in to change notification settings - Fork 0
/
pruebacachem.gms
50 lines (33 loc) · 882 Bytes
/
pruebacachem.gms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$OFFSYMXREF
$OFFSYMLIST
option limrow=0;
option limcol=0;
option solprint=on;
option sysout=off;
option LP=CPLEX;
option MIP=CPLEX;
option NLP=CONOPT;
option MINLP=DICOPT;
option OPTCR=0;
$TITLE PRUEBA
$ONTEXT
Se trata de resolver la siguiente ecuación lineal sujeta a una serie de restricciones
Min F(x) = 3*x1 + 2*x2 + x3 + 2*x4 + 3*x5
s.a:
2*x1 + 5*x2 + x4 + x5 >= 6
4*x2 - 2*x3 + 2*x4 + 3*x5 >=5
x1 - 6*x2 + 3*x3 + 7*x4 + 5*x5 >= 7
x1, x2, x3, x4, x5, no negativas
$OFFTEXT
VARIABLES
x1, x2, x3, x4, x5, F;
POSITIVE VARIABLES
x1, x2, x3, x4, x5;
EQUATIONS
funobj, eq1, eq2, eq3 ;
funobj.. F =E= 3*x1 + 2*x2 + x3 + 2*x4 +3*x5;
eq1.. 2*x1 + 5*x2 + x4 + x5 =G= 6;
eq2.. 4*x2 - 2*x3 + 2*x4 + 3*x5 =G= 5;
eq3.. x1 - 6*x2 + 3*x3 + 7*x4 + 5*x5 =G= 7;
MODEL problema1 /funobj, eq1, eq2, eq3/;
SOLVE problema1 using LP minimazing F ;