From: Leandro Lucarella Date: Mon, 27 Mar 2006 00:50:45 +0000 (+0000) Subject: Modelos y Optimización I. X-Git-Tag: svn_import~1 X-Git-Url: https://git.llucax.com/z.facultad/71.14/ejercicios.git/commitdiff_plain/1c35e1e42e2fab787d14a121c7311e0b4d4c3e36 Modelos y Optimización I. --- 1c35e1e42e2fab787d14a121c7311e0b4d4c3e36 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9ae1001 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ + +mods = $(wildcard *.mod) + +results = $(patsubst %.mod,%.result,$(mods)) + +all: $(results) + +%.result: %.mod + @echo Resolviendo $^... + @glpsol --model $^ --bounds $^.bounds > $@ + @echo >> $@ + @echo ------------------------------------------------------------------------ >> $@ + @echo >> $@ + @cat $^.bounds >> $@ + @$(RM) $^.bounds + +clean: + @echo Limpiando... + @rm -fv *.result + +.PHONY: clean + diff --git a/ej_1.1.mod b/ej_1.1.mod new file mode 100644 index 0000000..c7d0d2b --- /dev/null +++ b/ej_1.1.mod @@ -0,0 +1,11 @@ + +var fertilizante_a, >= 0; +var fertilizante_b, >= 0; + +maximize + value: 1200 * fertilizante_a + 400 * fertilizante_b; + +subject to + alchool: 3 * fertilizante_a + 2/3 * fertilizante_b <= 80; + ciclohexano: fertilizante_a + 2 * fertilizante_b <= 8; +end; diff --git a/ej_1.2.mod b/ej_1.2.mod new file mode 100644 index 0000000..c259d2d --- /dev/null +++ b/ej_1.2.mod @@ -0,0 +1,12 @@ + +var producto1, >= 0; +var producto2, >= 0; + +maximize + value: 60 * producto1 + 50 * producto2; + +subject to + maquina1: 2 * producto1 + 4 * producto2 <= 80; + maquina2: 3 * producto1 + 2 * producto2 <= 60; + maquina3: 4 * producto1 + 2 * producto2 <= 100; +end; diff --git a/ej_1.3.mod b/ej_1.3.mod new file mode 100644 index 0000000..3ed50ab --- /dev/null +++ b/ej_1.3.mod @@ -0,0 +1,13 @@ + +var producto1, >= 0; +var producto2, >= 0; + +maximize + value: 12 * producto1 + 8 * producto2; + +subject to + maquina1: 1 * producto1 + 2/5 * producto2 <= 200; + maquina2: 1/2 * producto1 + 1 * producto2 <= 200; + demanda1: 1 * producto1 >= 50; + demanda2: 4 * producto1 <= producto2; +end; diff --git a/ej_1.5.mod b/ej_1.5.mod new file mode 100644 index 0000000..a2a905e --- /dev/null +++ b/ej_1.5.mod @@ -0,0 +1,13 @@ + +var alimento_m, >= 0; +var alimento_n, >= 0; + +minimize + value: 10 * alimento_m + 4 * alimento_n; + +subject to + nutriente_a: 0.1 * alimento_m >= 0.4; + nutriente_b: 0.1 * alimento_n >= 0.6; + nutriente_c: 0.1 * alimento_m >= 2; + nutriente_d: 0.2 * alimento_n >= 1.7; +end;