Documentos de Académico
Documentos de Profesional
Documentos de Cultura
6
PROGRAMACIN NO LINEAL
5.6.1. INTRODUCCIN
5.6.3. MTODO
O O DE N
NEWTON
W ON S
SIN
N RESTRICCIONES
S CC ON S
INTRODUCCIN
ESTADSTICA Y OPTIMIZACIN 2
TEMA 5.6. PROGRAMACIN NO LINEAL
Ejemplo:
x1 4
ESTADSTICA Y OPTIMIZACIN 3
TEMA 5.6. PROGRAMACIN NO LINEAL
0
4
ESTADSTICA Y OPTIMIZACIN 4
TEMA 5.6. PROGRAMACIN NO LINEAL
2
max 54 x1 9 x12 78 x2 13x22
6
s.a x1 4 0
6
2 x 2 12
3 x1 2 x2 18 Z=189
x 1 , x 2 0 Z*=265
3
x* 4
3 3
Z=117
Z=162
0
4
ESTADSTICA Y OPTIMIZACIN 5
TEMA 5.6. PROGRAMACIN NO LINEAL
Con estos tres ltimos ejemplos queremos mostrar es que el ptimo puede estar en
cualquier sitio de la regin factible.
Mx locales en x=0,2,4
1 5
ESTADSTICA Y OPTIMIZACIN 6
TEMA 5.6. PROGRAMACIN NO LINEAL
1
1. La funcin
L f i objetivo
bj i ded mximo
i y cncava,
o ell logaritmo
l i d la
de l
funcin objetivo cncava, con restricciones lineales.
ESTADSTICA Y OPTIMIZACIN 7
TEMA 5.6. PROGRAMACIN NO LINEAL
2 f
0 ( 0) x
x 2
f(x)
f(x)
( )
ESTADSTICA Y OPTIMIZACIN 8
TEMA 5.6. PROGRAMACIN NO LINEAL
CONCEPTOS BSICOS
min f ( x1 ,..., xn )
min f ( x) s.a g1 ( x1 ,..., xn ) 0
...................
( PNL) s.a : xF
x Rn
( PNL) g m ( x1 ,..., xn ) 0
h1 ( x1 ,..., xn ) 0
F definido
d fi id a partir
ti de
d un .................
hl ( x1 ,..., xn ) 0
conjunto de restricciones
2 Algoritmos
2. Al i que utilizan
ili derivadas
d i d
ESTADSTICA Y OPTIMIZACIN 9
TEMA 5.6. PROGRAMACIN NO LINEAL
Cuando las funciones del problema son funciones diferenciables, podemos aplicar
algoritmos de solucin basados en las derivadas de la/s funcin/es. Dos conceptos
bsicos asociados con las funciones diferenciables son el gradiente y el hessiano
(para el clculo de este ltimo se necesita q
(p que la funcin sea dos veces
diferenciable)
f x , x ,..., x .
t
f x1 ,..., xn f x1 ,..., xn f x1 ,..., xn
1 2 n
x1 , x2 ,..., xn
Una condicin necesaria para que un punto sea un mximo o mnimo (local) de
una funcin es que su gradiente sea cero en dicho punto, es decir que sea un punto
estacionario.
ESTADSTICA Y OPTIMIZACIN 10
TEMA 5.6. PROGRAMACIN NO LINEAL
f x1 ,...,xn
2 f x1 ,...,xn
2
ESTADSTICA Y OPTIMIZACIN 11
TEMA 5.6. PROGRAMACIN NO LINEAL
CARACTERSTICAS:
min x4 x2 2x
epsiln = 0,0001
Iteracin x1 x2 Abs(f'(x1)) Abs(x2 - x1)
1 -3,0000
3,0000 -2,0189
2,0189 104,0000 0,9811
2 -2,0189 -1,3607 30,8765 0,6582
4 xn31 2 xn 1 2 3 -1,3607 -0,8979 9,3552 0,4627
xn xn1 4 ,
-0,8979 -0,4940
, 3,1000
, 0,4039
,
12 xn21 2
5 -0,4940 1,1151 1,4942 1,6091
6 1,1151 1,0132 1,3158 0,1018
7 1,0132 1,0002 0,1345 0,0130
8 1,0002 1,0000 0,0021 0,0002
9 1,0000 1,0000 0,0000 0,0000
ESTADSTICA Y OPTIMIZACIN 13
TEMA 5.6. PROGRAMACIN NO LINEAL
Celda objetivo
j ((Mnimo))
Celda Nombre Valor original Valor final
$B$20 FUNC.OBJ. Iteracin 78 -2
Celdas cambiantes
Celda
Ce da Nombre
o be Valor
a o original
o g a Valor
a o final
a
$C$18 X -3 0,999999863
Restricciones
NINGUNA
ESTADSTICA Y OPTIMIZACIN 14
TEMA 5.6. PROGRAMACIN NO LINEAL
300
250
200 1
150 0,8
100 0,6
50 0,4
0 0,2
-5 -4 -3 -2 -1 0 1 2 3 0
-50
-1 -0,8 -0,6 -0,4 -0,2
-0,2 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
-0,4
-0,6
-0,8
-1
-1,2
-1,4
14
-1,6
-1,8
-2
ESTADSTICA Y OPTIMIZACIN 15
TEMA 5.6. PROGRAMACIN NO LINEAL
min x x 1x 2 x 3 x 4 x 5
6
5
4
3
2
1
0
-0,5 -1 0 0,5 1 1,5 2 2,5 3 3,5 4 4,5 5 5,5 6 xn5 75 xn4 340 xn3 675 xn2 548 xn 120
xn 1 xn
-2
30 xn4 300 xn3 1020 xn2 1350 xn 548
-3
-4
-5
-6
-7
-8
-9
-10
-11
11
-12
-13
-14
-15
-16
-17
-18
ESTADSTICA Y OPTIMIZACIN 16
TEMA 5.6. PROGRAMACIN NO LINEAL
Microsoft Excel 10.0 Informe de respuestas Microsoft Excel 10.0 Informe de respuestas
Hoja de clculo: [Programacin ni lineal.xls]Hoja6 Hoja de clculo: [Programacin ni lineal.xls]Hoja6
Restricciones Restricciones
NINGUNA NINGUNA
Microsoft Excel 10.0 Informe de respuestas Microsoft Excel 10.0 Informe de respuestas
Hoja de clculo: [Programacin ni lineal.xls]Hoja6 Hoja de clculo: [Programacin ni lineal.xls]Hoja6
Celdas
C ld cambiantes
bi t Celdas cambiantes
Celda Nombre Valor original Valor final Celda Nombre Valor original Valor final
$B$4 x 1,75 2,499999302 $B$4 x 3,75 4,663446522
Restricciones Restricciones
NINGUNA NINGUNA
ESTADSTICA Y OPTIMIZACIN 17
TEMA 5.6. PROGRAMACIN NO LINEAL
Paso 0: Elegir > 0 para precisin mnima. Elegir x1 como semilla de inicio.
CARACTERSTICAS:
1. Se utiliza p
para funciones dos veces diferenciables.
2. Se basa en la aproximacin cuadrtica de una funcin.
3. Sirve para buscar puntos que anulan el gradiente de una funcin.
4
4. Debe existir la inversa del hessiano en cada punto.
punto
ESTADSTICA Y OPTIMIZACIN 18
TEMA 5.6. PROGRAMACIN NO LINEAL
max x 2 y 2 xy y 2 3 y
f f2
f
2
x ( x , y ) 2 xy 2 y ( x , y ) ( x , y ) 2y 2 x 2
x 2
x y
f ( x , y ) f
2 H ( f ( x , y )) 2 x 2
( x , y ) x 2 x 2 y 3 2
f 2
f 2
( x , y) ( x , y)
y yx y 2
x2 = x1 Hf(x1)1f(x1)
1
1 0 1 12 0 1
iter1 f Hf
1
1 2 1 0 2 2
1 0
iter 2 f STOP OJO: si estuvisemos minimizando ocurrira lo
2 0 mismo, por lo que Hf(x1)1f(x1) no sera una
verdadera
d d direccin
di i ded descenso.
d
ESTADSTICA Y OPTIMIZACIN
TEMA 5.6. PROGRAMACIN NO LINEAL
0
-2,5 -2 -1,5 -1 -0,5 0
-0 5
-0,5
-1
-1,5
-2
-2,5
-3
-3,5
-4
ESTADSTICA Y OPTIMIZACIN 20
TEMA 5.6. PROGRAMACIN NO LINEAL
ESTADSTICA Y OPTIMIZACIN 21
TEMA 5.6. PROGRAMACIN NO LINEAL
Paso 0: Elegir > 0 para precisin mnima. Elegir x1 como semilla de inicio.
Paso 1: Calcular f(x1). Resolver el problema de una variable min f(x1 mf(x1)),
m 0. IR al Paso 2. (Si maximizamos, max f(x1+mf(x1)), m 0.)
ESTADSTICA Y OPTIMIZACIN 22
TEMA 5.6. PROGRAMACIN NO LINEAL
x y
max 3 x 2 y 2 xy
2 xy
2
3 x
3 x 2 y 2 xy 2
f x , y 3 y 2 2 xy
3 x 2 y 2 xy
2 0,4
0,35
0,3
0,25
0 13 13 m
iter1 f max m3
0,2
2m
1 1 m 9 m 2 0,15
0 3 3 0,1
0 05
0,05
1 0
iter 2 f STOP
0
0 1 2 3 4 5 6
1 0
ESTADSTICA Y OPTIMIZACIN 23
TEMA 5.6. PROGRAMACIN NO LINEAL
Seleccin
S l i deld l punto
t inicial
i i i l
ESTADSTICA Y OPTIMIZACIN 24
TEMA 5.6. PROGRAMACIN NO LINEAL
FUNCIONES DE PENALIZACIN:
Se utilizan para penalizar puntos que sean infactibles y no hacerlo para aquellos que son
factibles. De este modo se intenta transformar problemas no lineales con restricciones en
problemas no lineales sin restricciones y poder aplicar los mtodos anteriores.
anteriores Dependiendo
del tipo de restriccin las funciones de penalizacin sern de una forma u otra.
h( x ) 0 h( x )
r
m l
p ( x) max{0, g i ( x)} hi ( x)
r r
i 1 i 1
25
TEMA 5.6. PROGRAMACIN NO LINEAL
Paso 0:
P El i > 0 para criterio
0 Elegir it i de
d terminacin.
t El i x1 como semilla
i i Elegir ill de
d
inicio, 1 escalar de penalizacin y un escalar > 1.
ESTADSTICA Y OPTIMIZACIN 26
TEMA 5.6. PROGRAMACIN NO LINEAL
min ( x1 2) 4 ( x1 2 x2 ) 2 k ( x12 x2 ) 2
iteracin k - sima
ESTADSTICA Y OPTIMIZACIN 27
TEMA 5.6. PROGRAMACIN NO LINEAL
3 10 (1 1687 0.7406)
(1.1687, 0 7406) (0 9906 0.8425)
(0.9906, 0 8425) 1 5203
1.5203 0 1926
0.1926
ESTADSTICA Y OPTIMIZACIN 28
TEMA 5.6. PROGRAMACIN NO LINEAL
Celdas cambiantes
Celda Nombre Valor original Valor final
$C$2 X1 2 0,945504203
$D$2 X2 1 0,893977559
Restricciones
Celda Nombre Valor de la celda frmula Estado Divergencia
$B$6 R1 6 39723E 07 $B$6
6,39723E-07 $B$6=$D$6
$D$6 O i
Opcional
l 0
ESTADSTICA Y OPTIMIZACIN 29
TEMA 5.6. PROGRAMACIN NO LINEAL
Existencia de mltiples
p mnimos locales
ESTADSTICA Y OPTIMIZACIN 30