31
Resoluci ´ on gr ´ afica Resoluci ´ on gr ´ afica de problemas de optimizaci ´ on

Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Embed Size (px)

Citation preview

Page 1: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Resolucion grafica de problemas deoptimizacion

Page 2: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

Page 3: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

(0, 4)

(0,−4)

(4, 0)

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

Nos fijamos en la primerarestriccion x2 + y2 = 16. Esuna circunferencia de centro en(0, 0). Creamos una pequenatabla de valores:

x y0 ±4±4 0

Page 4: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

Sabiendo que es una circunfe-rencia, con esos pocos puntosbasta para dibujarla.Representamos unicamente laparte que cumple x ≥ 0 porla condicion de signo del pro-blema. La otra parte de la cir-cunferencia no sera factible.

Page 5: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

(0, 0)

(1, 1)

(2, 4)

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

La segunda restriccion es unaparabola y = x2. Creamos otratabla de valores:

x y0 01 12 4

Page 6: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

Sabiendo que es una parabola,es facil unirlos “con forma deparabola”.

Page 7: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

(0,−2)(2, 0)

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

La tercera restriccion es unarecta y = x − 2, luego nos bastauna tabla con dos puntos:

x y0 −22 0

Page 8: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

Para resolver graficamente unproblema de optimizacion comoeste empezamos representandosus restricciones con igualdad.

Conviene escribir cada ecuacional lado de la curva correspon-diente.

Page 9: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

(0, 0)

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Empezamos con la circunferen-cia. Para ello tomamos cualqu-ier punto que no este sobre lacurva. Por ejemplo el (0, 0), yobservamos que no cumple larestriccion:

02 + 02 ≥ 16.

Page 10: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

(0, 0)

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Por lo tanto, los puntos quecumplen la primera restriccionson los que estan en la parte li-mitada por la circunferencia enla que no esta el punto (0, 0) quehemos tomado de ejemplo.

Page 11: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

(1, 0)

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Para la parabola no podemostomar el punto (0, 0) porque laparabola pasa por el, luego nonos determina ninguna de lasdos partes en que esta divide alplano. Tomamos en su lugar el(1, 0) y observamos que

0 ≤ 12.

Page 12: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Por lo tanto, los puntos quecumplen la segunda restriccionson los que estan en la parte de(1, 0), es decir, los que estan de-bajo de la parabola.La zona mas oscura es la delos puntos que cumplen a la vezlas dos primeras restricciones,es decir, los que estan fuera dela circunferencia y debajo de laparabola.

Page 13: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

(0, 0)

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Para la recta podemos tomar denuevo el punto (0, 0), porque larecta no pasa por el, y observa-mos que se cumple

0 ≥ 0− 2

Page 14: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Por lo tanto, la tercera restriccionla cumplen los puntos que estanen la parte del (0, 0), es de-cir, los de arriba de la recta.De nuevo, la zona mas oscuraesta formada por los puntos quecumplen las tres restricciones.

Page 15: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2

Ahora hay que determinar aque parte de cada curva estanlos puntos que satisfacen surestriccion.

Como tambien cumplen la con-dicion de signo, x ≥ 0, conclui-mos que las soluciones factiblesdel problema son las que apare-cen mas sombreadas en la fi-gura.De entre todas ellas, hemos deencontrar las que hacen que lafuncion objetivo tome su valormaximo y su valor mınimo.

Page 16: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

Para ello calculamos el gra-diente de la funcion objetivo:

∇F = (1, 3)

y lo representamos, por ejemplo,a partir del punto (0, 0): traza-mos una flecha que parta de(0, 0) y que avance un lugar a laderecha y tres hacia arriba.

Page 17: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Opt. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

El gradiente indica la direccionhacia donde crece la funcion ob-jetivo.Dibujamos la recta perpendicu-lar al gradiente, que contiene alos puntos donde la funcion ob-jetivo vale 0.

Page 18: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0F = 3

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 19: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 6

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 20: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 9

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 21: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 12

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 22: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 15

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 23: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 18

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 24: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 21

A medida que desplazamos di-cha recta en la direccion del gra-diente obtenemos puntos conmayor valor de la funcion obje-tivo.

Page 25: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Max. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 24

Como vemos que podemossubir indefinidamente por el con-junto de oportunidades, resultaque cualquier solucion factiblepuede ser mejorada por otra, yconcluimos que

el problema de maximizar esNO ACOTADO.

Page 26: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Min. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 21

Para resolver el problema de mi-nimizar debemos movernos endireccion opuesta al gradiente.

Page 27: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Min. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 18

Para resolver el problema de mi-nimizar debemos movernos endireccion opuesta al gradiente.

Page 28: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Min. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 15

Para resolver el problema de mi-nimizar debemos movernos endireccion opuesta al gradiente.

Page 29: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Min. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

F = 12

Para resolver el problema de mi-nimizar debemos movernos endireccion opuesta al gradiente.

Page 30: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Min. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

Mınimo global��

El ultimo punto que podemosencontrar dentro del conjunto deoportunidades al desplazarnosen la direccion contraria al gra-diente es la solucion optima.

Todo lo que se ve en la figura de-berıa estar dibujado en una res-puesta de examen: las restric-ciones, el gradiente, la perpen-dicular al gradiente F = 0 yla paralela desplazada para quepase por la solucion optima.

Page 31: Resolucion gr´ afica de problemas de´ optimizacion´ · Resolucion´ grafica´ Un problema de optimizacion´ Opt. x +3y s.a x2 +y2 16 y x2 y x 2 x 0 x = 0 x2 +y2 = 16 Para resolver

Resoluciongrafica

Un problema de optimizacion

Min. x + 3ys.a x2 + y2 ≥ 16

y ≤ x2

y ≥ x − 2x ≥ 0

x = 0

x2 + y2 = 16

y = x2

y = x − 2∇F

F = 0

Para calcular analıticamente lasolucion optima observamosque se encuentra sobre la cir-cunferencia y la recta (pero nosobre la parabola), por lo que elpunto (x , y) que buscamos debesatisfacer las dos ecuaciones:

x2 + y2 = 15, y = x − 2.

Al resolver el sistema de ecua-ciones obtenemos

(x , y) = (3.65, 1.65).