Académique Documents
Professionnel Documents
Culture Documents
Optimizacin ICS1113
ProgramacinNoLineal
1 semestre2010 Profesor:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso1:ProblemaUnidimensional
P ) Min f ( x) s.a. a x b xR
Caso2:Problemaconrestriccionesdeigualdad
P) Min f ( x) s.a. hi ( x) = 0 i = 1,..., m x C
Caso3:Problemascondesigualdades
P) Min f ( x) s.a. gi ( x) 0 i = 1,..., m x C
2
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso1:ProblemaUnidimensional Consideremoselsiguienteproblema:
P ) Min f ( x) s.a. a x b x Rn
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
Caso1:ProblemaUnidimensional Teorema (CondicinNecesariade1er orden) i. ii. iii iii.
P ) Min f ( x) s.a. a x b x Rn
x [ a, b ] espuntomnimolocaldeP),entonces: Si
Si x = a f ' ( x ) 0 Si x = b f ' ( x ) 0 Si a < x < b f ' ( x ) = 0
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
Caso1:ProblemaUnidimensional Teorema (CondicinSuficientede1er orden)
P ) Min f ( x) s.a. a x b x Rn
i. ii.
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
Caso1:ProblemaUnidimensional Teorema (CondicinNecesariade2r orden)
P ) Min f ( x) s.a. a x b x Rn
Seaf(x) dosvecesdiferenciable,y x puntomnimolocaldeP), entonces: Si x = a ( f ' ( a ) 0 ) y ( f '' ( a ) 0 si f ' ( a ) = 0 ) Si x = b ( f ' ( b ) 0 ) y ( f '' ( b ) 0 si f ' ( b ) = 0 ) Si a < x < b f ' ( x ) = 0 y f '' ( x ) 0
i. ii. iii.
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
Caso1:ProblemaUnidimensional Ejemplo
Solucin
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
Caso1:ProblemaUnidimensional Ejemplo
Solucin
0,000 0,500 1,000 1,500 2,000 2,500 2 500
0,2
0,4
0,6
0,8
Series1 0,00 0,1 0,1 0,0 0,0 0,00 0,0 0,2 0,5 1,1 2,0
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad
P) Min f ( x) s.a. hi ( x) = 0 i = 1,..., 1 m xC
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad Veamosqupasasitenemos2variablesy1restriccin:
P) Mi Min s.a. f ( x1 , x2 ) h( x1 , x2 ) = a
m = ? m =1 n=? n=2
Larestriccinylacurvadenivelsontangentes.
ICS1113.Prof.:PamelalvarezM. 10
ProgramacinNoLineal
P) Min s.a.
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad
f ( x1 , x2 ) h( x1 , x2 ) = a
Six*essolucinptima,qupasarsinosmovemosentornoa x*? x
x2 = r ( x1 )
Elnuevoproblemaentoncesser:
P) Min
f ( x1 , r ( x1 ))
11
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
P) Min s.a.
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad Cmoesesteproblema? Irrestricto
f ( x1 , x2 ) h( x1 , x2 ) = a
P) Min F ( x1 )
Cmoresolvemoselproblema?pensemosenlascondiciones necesarias i d de1er orden. d
ICS1113.Prof.:PamelalvarezM.
12
ProgramacinNoLineal
P) Min s.a.
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad Derivandoeigualandoa0setiene:
f ( x1 , x2 ) h( x1 , x2 ) = a
F =0 x1
f f dr + =0 x1 x2 dx1
R Recordemos d nuestrarestriccin: i i
h( x1 , x2 ) = a h( x1 , r ( x1 )) = a
Debemosmantenernoseneldominio
h( x1 + x1 , x2 + x2 ) = a
ICS1113.Prof.:PamelalvarezM. 13
ProgramacinNoLineal
P) Min s.a.
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad RecurramosnuevamenteaTaylor(primerorden):
f ( x1 , x2 ) h( x1 , x2 ) = a
h h h( x1 + x1 , x2 + x2 ) h( x1 , x2 ) + x1 + x2 x1 x2
R Remplazando: l d
h h x1 + x2 =0 x1 x2
h h dx1 + dx2 = 0 x1 x2
ICS1113.Prof.:PamelalvarezM. 14
Expresinquecorrespondeadiferenciarlarestriccinoriginal:
ProgramacinNoLineal
P) Min s.a.
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad Despejando:
f ( x1 , x2 ) h( x1 , x2 ) = a
f f x2 h =0 h x1 x1 x2
Estaexpresin,juntoalarestriccinsonlascondiciones
ICS1113.Prof.: Pamela lvarez M. necesariasdeprimer orden para nuestro problema. 15
ProgramacinNoLineal
P) Min s.a.
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad Definamos:
f ( x1 , x2 ) h( x1 , x2 ) = a
f x = 2 h x2
E Entonces:
h ( x1 , x2 ) = a
f h =0 xi xi
Aspudimosexpresarlascondicionesdeprimerorden.
ICS1113.Prof.:PamelalvarezM. 16
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad
P) Min s.a.
Reescribamosnuestroproblemacomo::
f ( x1 , x2 ) h( x1 , x2 ) = a
P 1 ) Min L ( x1 , x2 , ) = f ( x1 , x2 ) + ( a h( x1 , x2 ) )
L f h = = 0 = 1, 2 xi xi xi L = a h ( x1 , x2 ) = 0
ICS1113.Prof.:PamelalvarezM. 17
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad Resolvamoselproblema:
Min ( x 2 ) + ( y 1)
2
s.a.
x + y =1
P 1 ) Min L ( x, y , ) = f ( x, y ) + ( a h( x, y ) )
ICS1113.Prof.:PamelalvarezM.
18
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad
2 2
Min ( x 2 ) + ( y 1)
2
s.a.
x + y =1
P 1 ) Min L ( x, y , ) = ( x 2 ) + ( y 1) + (1 x y )
Lascondicionesdeprimerordenparaelproblemason:
L f h = = 0 = 1, 2 xi xi xi L = a h ( x1 , x2 ) = 0
ICS1113.Prof.:PamelalvarezM.
19
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:Problemaconrestriccionesdeigualdad EstemtodoseconocecomoelMtododeLagrange, desarrolladoen1790app. app L eslafuncindeLagrangeoLagrangeano eselmultiplicadordeLagrange(queyaveremosqu representa)
ICS1113.Prof.:PamelalvarezM.
20
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Dadoelproblema:
P) Min f ( x) s.a. h j ( x) = a j
j = 1,..., 1 m
TeoremadeLagrange:
x sea Lacondicinnecesariaparaqueelpuntofactibleregular
f ( x ) j h j ( x ) = 0
j =1
ICS1113.Prof.:PamelalvarezM. 21
ProgramacinNoLineal
P) Min s.a. f ( x) h j ( x) = a j j = 1,..., m
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Qusignificaesto?:
m
f ( x ) j h j ( x ) = 0
j =1
Q el Que lgradiente di d del laf funcin i objetivo bj i evaluada l d enel lpunto,se puedeexpresarcomocombinacinlinealdelosgradientesdelas restriccionesdelproblema, problema evaluadasenelpunto. punto
ICS1113.Prof.:PamelalvarezM.
22
ProgramacinNoLineal
P) Min s.a. f ( x) h j ( x) = a j j = 1,..., m
OptimizacinconRestricciones
h j ( x) f ( x) m j =0 xi xi j =1
a j hj = 0
i = 1,..., n
j = 1,..., m
ICS1113.Prof.:PamelalvarezM.
23
ProgramacinNoLineal
P) Min s.a. f ( x) h j ( x) = a j j = 1,..., m
OptimizacinconRestricciones
Nuestroproblemaloreescribimoscomo
L = 0 i =1 1,..., n xi
L = 0 j = 1,..., 1 m j
24
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Peroelteoremahabladepuntoregular,ques? Definicin: sedicequeelpuntox cumplelascondicionesderegularidad (oqueesunpuntoregular)sielJacobianoJ(x) delas restriccionesesderangomximo,esdecirlasfilassonl.i.
h1 ( x) h ( x ) J ( x) = 2 # h ( x ) m
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Ejemplo:
P) Min s.a. x x3 + y 2 = 0 ( x, y ) R 2
F i l Funcin lagrangeana:
L ( x, y , ) = x + ( x 3 y 2 ) L = 1 + 3 x 2 = 0 x L = 2 y = 0 y L = x3 y 2 = 0
Condicionesde1er orden:
ICS1113.Prof.:PamelalvarezM.
26
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Elsistemanotienesolucin,peroculeslasolucinptima?
P) Min s.a. x x + y = 0 ( x, y ) R 2
3 2
( x , y ) = ( 0,0 )
* *
ICS1113.Prof.:PamelalvarezM.
27
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Condicionesde2orden: Paraque local debecumplirseque: x seaunptimolocal,
f x f x + x
()
Interesaminimizar L ( x, ) = f ( x) + ( a h( x) ) Entonces:
L x + x, L x, = f x + x f ( x) 0
) ( )
ICS1113.Prof.:PamelalvarezM.
28
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Condicionesde2orden: Si local,entoncesdebecumplirseque: x esunptimolocal
2 L x, x
2
( ) x
ProgramacinNoLineal
O ti i i conR ti i Optimizacin Restricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Peroyaquenopodemossalirnosdeldominio,lascondiciones quesedebencumplirson:
i =1
h j x xi
( ) x = 0
i
j = 1,..., m
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Ejemplo:
P)
2 2 Min x12 + x2 + x3 s.a. x1 + x2 + 3 x3 2 = 0 5 x1 + 2 x2 + x3 5 = 0
Funcinlagrangeana:
2 2 L ( x1 , x2 , x3 , 1 , 2 ) = x12 + x2 + x3 + 1 ( 2 x1 x2 3 x3 ) + 2 ( 5 5 x1 2 x2 x3 )
ICS1113.Prof.:PamelalvarezM.
31
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Funcinlagrangeana:
2 2 L ( x1 , x2 , x3 , 1 , 2 ) = x12 + x2 + x3 + 1 ( 2 x1 x2 3 x3 ) + 2 ( 5 5 x1 2 x2 x3 )
L = 2 x1 1 52 = 0 x1 2 x 2 x2 32 = 0 L = 2 x2 1 22 = 0 1 5 x1 14 x2 + 3x3 = 0 6 x 2 x 5 0 = x2 3 2 2 L = 2 x3 31 2 = 0 x3
13 3 x 14 x3 = 5 * 8 * 5 x1 + 2 x2 + x3 = 5 2 x = y x = 2 3 16 x 2 x = 5 23 46 2 3 5 x1 14 x2 + 3 x3 = 0
ICS1113.Prof.:PamelalvarezM.
x1 + x2 + 3x3 = 2
* x1 =
37 2 * 7 y 1* = ; 2 = 46 23 23
32
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad SuficienciadecondicionesdeLagrange: Sif funcin i objetivo bj i yrestricciones i i sonconvexas,el lpuntox* *es ptimoglobal.
ICS1113.Prof.:PamelalvarezM.
33
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad Ejemplo:
P)
2 Min x12 + x2
s.a.
( x1 1) + ( x2 2 )
2
= 45
F i l Funcin lagrangeana:
2 L ( x1 , x2 , x3 , 1 , 2 ) = x12 + x2 + 45 ( x1 1) ( x2 2 ) 2
ICS1113.Prof.:PamelalvarezM.
34
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad
2 L ( x1 , x2 , x3 , 1 , 2 ) = x12 + x2 + 45 ( x1 1) ( x2 2 ) 2
Condicionesde1er orden:
L = 2 x1 2 ( x1 1) = 0 x1 2 x1 = x2 L = 2 x2 2 ( x2 2 ) = 0 x2
( x1 1) + ( 2 x1 2 )
2
= 45
5 x12 10 x1 40 = 0
4 4 4,8, 8 3 2 2, 4, 3
ICS1113.Prof.:PamelalvarezM.
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad
P)
2 Min x12 + x2
s.a.
( x1 1) + ( x2 2 )
2
= 45
Jacobiano:
J x = 2 ( x1 1) 2 ( x2 2 )
El l nicopuntonoregular l es (1,2)
()
ICS1113.Prof.:PamelalvarezM.
36
ProgramacinNoLineal
OptimizacinconRestricciones
Caso2:ProblemaGeneralconrestriccionesdeigualdad
2 L ( x1 , x2 , x3 , 1 , 2 ) = x12 + x2 + 45 ( x1 1) ( x2 2 ) 2
Condicionesde2orden: Hessiano:
2 2 0 0 2 2
Solucin:( 2, 4 ) f ( x) = 20
37
ProgramacinNoLineal
OptimizacinconRestricciones
f ( x*) = j , j = 1,..., m a j
Esdecir,elmultiplicadordeLagrangecorrespondealatasa decambiodelvalorptimocuandocambiaelladoderecho d unarestriccin de t i i .....pero
ICS1113.Prof.:PamelalvarezM. 38
ProgramacinNoLineal
OptimizacinconRestricciones
Caso3:Problemascondesigualdades Cualquierproblemadevariablescontinuassepuedeescribiren elformatoanterior(restriccionesdeigualdad)mediante transformaciones Desigualdades Variablenopositivas Variablessinrestriccionesdenonegatividad
ICS1113.Prof.:PamelalvarezM.
39
ProgramacinNoLineal
OptimizacinconRestricciones
Caso3:Problemascondesigualdades Dadoelproblema:
P) Min s.a. f ( x) gi ( x) 0 i = 1,..., 1 m
Anlisisdeoptimalidad:
Lascondicionesdeoptimalidaddifierensisetratadeunpuntoenelbordedel dominio(restriccionesactivas)osisetratadeunpuntointerior(todaslas restriccionesinactivas). Siestamosenunbordepodramosidentificarlasrestriccionesactivasenel punto,expresarlascomoigualdades,eliminarlasrestriccionesinactivasy emplearelMtododeLagrangeyavisto. Problemadehaceresto?
ICS1113.Prof.:PamelalvarezM. 40
ProgramacinNoLineal
OptimizacinconRestricciones
Caso3:Problemascondesigualdades Dadoelproblema:
P) Min s.a. f ( x) gi ( x) 0 i = 1,..., 1 m
ElconjuntodesolucionesfactiblesdeP)es:
S = { x R n : gi ( x ) 0, , i = 1,..., , , m}
Asumimosquetodaslasfunciones(objetivoyrestricciones)soncontinuamente diferenciables. Veamosalgunasdefiniciones:
ICS1113.Prof.:PamelalvarezM.
41
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades
Definicin: Seax S,unvectord Rn esunadireccinfactibleenS respectoax siexiste >0,talque:
( x + d ) S , ( 0, ]
Definicin:ElconjuntoD(x)={d Rn ,d esdireccinfactibledeS con respectoax}, } eselconjuntodedireccionesfactiblesenx.
ICS1113.Prof.:PamelalvarezM.
42
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades
Primeracondicindeoptimalidad: Seax*unmnimolocaldelproblema P).Entonces:
T f ( x ) d 0, d D ( x )
Esteresultadonoesprctico,porqu?
ICS1113.Prof.:PamelalvarezM.
43
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades
Definicin:Seax S.Elconjuntodendicesactivoses:
I ( x) = {i {1,..., m}: gi ( x) = 0}
LasrestriccionesconndicesenI(x) sedicequesonrestriccionesactivas en el lpuntox. Definicin:Seax S.SellamaconotangenteaS enelpuntox alconjunto:
T ( x) = {d R n : gi ( x)T d 0, i I ( x)}
As lasdireccionesfactiblesestnenelconotangenteT(x). As,
ICS1113.Prof.:PamelalvarezM. 44
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades
Supongamosquex*esmnimolocaldelproblema,yd esunadireccinde descenso,entoncespodemosverquetienequecumplirse:
f ( x*) )=
iI ( x *)
) g ( x*)
i i
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades g1
dTf(x*)>0
d, di d direccin i factible
f ( x*) =
iI ( x *)
g ( x*)
i i
ICS1113.Prof.:PamelalvarezM.
i 0, i I ( x*) )
g2
46
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades Notemosquesidefinimos
i = 0, i I ( x*)
Podemosescribirlacondicinencontradacomo:
f ( x*) = i gi ( x*)
i =1
ProgramacinNoLineal
P)
OptimizacinconRestricciones
Caso3:Problemascondesigualdades
i ( gi ( x*)) = 0, i = 1,..., m
ICS1113.Prof.:PamelalvarezM.