Vous êtes sur la page 1sur 208

T0 c

oex
ist
enc
eo fpeaceandharmonybetweenth
edi
ffe
ren
t
MA
n.ABi
sar
egi
sle
redl
rad
ema
rko
f l
eMalhWorksI
nc
. melodieso
fpeopleeverywhere
T
hisb
ooki
sp l
edo
nnc
id paper.@

C
opy
rig
hl2 2b
@
yJo
hnW
ile
y& S
onsNewY
ork
.AI
Iri
ghl
s e
d.

P
ubl
ish
eds
imu
lta
neo
usl
yinC
nna
dn.

Nop n
rto fIh
ispub
licll
lio
nmayber e p
rodu dst
oredina tr
iev
s ystemor1nsmi
ttedinnnyf o
rmo r
byanym n s
ele
clron
icmec
hanicaJpholoc
opyingc o
rdin
gscan
ningoro t
herw
iseex
ceptas
per
m i
ttcdu nd
erSectio
ns1 0
7or1 08ofthe1 976UnitedSt
alc
sCopyri
ghlA crw
irhou
leithe
rtheprior
wri
t t
cnpr m
issi
ono fIh
ePubli
sherorouth
ori7
.3l
ionthroug
hp aym
enloft h
ea p
prop
riul
epe r
-copyfcc10
Ih
eC opy
r igh
lC l
earanceCen
ler222Ro W dD r
iveD n
nver
MA0 1923(97
8)7508400f
nx( 9
78)
75047
44.R equ I
S10IhePubli
she
rf orpermi
ssionshouldbenddre
ssed10thePeml
issio
nsD ep
artmenl
JohnWil cy& SonsIn
c.60
5 i r
dA venueNewY orkNY1 01
5
8- 1 2(212
)8 50-
11 ( 212)
850
-6 008E-Ma
il:PERMREQ@WILEY.COM.

spub
lic
ali
onisdes
igned1
0prov
ideacc
ulenndau
tho
ril
ali
veinfo
mta
l i
onin E 1
0esubj
ecl
mat
terc
ove .I
d tis80l
dwithth
eunde
rslu
ndi
ngIha
lthepu
blis
heri
snolengag
e dinren
dng
pr
ofe
ssi
ona
lser
vice
s.Ifpr
ofe
ssi
onn
lndvi
ceorot
hcrex
per
ta s
sis
lan
ceis q
uir
edes er
vic
esofa
co
mpele
ntpro
fes
sion
alp

e n asho
uldbesou
ghl
.

U
bra
ryo
fCo
ngr
essC
ata
log
;lg
I ;
nP"
bl;
cat
iot
lDat
a:

V
enk
oluro
mnP.

App
liedopli
miZlll
ionwithMATLAB~ P rogramm
ingIP
.Ven
kala
rml
ln.
p
.c om.
AWiley
-Inte
rsc i
enccpubl
icn
lion
."
ISBN0-471 9 58
.5(1o
c th:al
k.pnp
er )
1.Mn
lhema
l i
caJo pt
imiz
ation
--D
olllproc i
ng2
.MATLAB.J.T
it
le
.

Q
A402
.5.V
422
001
51
9.3
-dc
21 2
001
026
938
P
rin
ledi
nIh
eUn
ile
dSl
ale
sofA
mer
icn
.
10987654321


6
~.4r;r :T

--

CONTENTS

PREFACE x
ii
i

1 I
ntr
odu
ctl
on 1
1
.1 O
pt i
miz
ationFundamen
talsI2
1
.1.1 Elemen
tso fProble
mFormu
lat
ionI4
1
.1.2 Mathe
maticalModeligI1
n 0
1
.1.3 Natur
eo fSol
utionI1 6
1
.1.4 Cha
ract
eris
ticsoftheSe
arc
hProc
edu
reI20
1
.2 I
ntrod
uct
iontoMA1 1
.As I2
. 5
.2
1 .
1 WhyMATLAB?I25
.2
1 .
2 MATLABI n
sta
llat
ionIssue
sI26
.2.
1 3 UsingMATLABt heFi
rstTimeI27
1
.2.4 Usin
gt heEdi
tor/3 3
1
.2.
5 CreatingaCodeS nipp
e t/37
.2
1 .
6C r
eatingaProgramI40
P
rob
lesI44
m

2 GraphlcalOptlmizatlon 45
2
.1 b lemDefin
iti
onI45
2
.1.1 E xample2.
1 I46
2
.1.2 F ormatfo
rlh
eGra
phi
calD
isp
layI47
2
.2 G
raphi
calS
olut
ionI48
2
.2.
1 MATLABHigh-Leve
lGrap
hicsFun
cti
onsI48
2
.2.
2 Example2.I
- Gra
phic
alS o
lut
ionI50
2
.2.
3Disp
layin
gt h
eG r
aphisI5
c 3
2
.2.
4 C
ustom
izingtheFig
ureI54
2
.3 A
ddi
tio
nalExamplesI56
v
l
l
v
l
ll CONTENTS CONTENTS I
x

2.
3.
1 Example2 .
2I56 4
.1.
1 P
roble
mFormulation-Example4.
1 /1
55
2.
3. 3I64
2 Example2. 4
.1.
2Disc
ussio
nofConsain
ts/1 57
2.3 Example2.
3. 4I73 4
.2 Ma
thematicalC on
cepts/1 59
2.
4A dd
iti
ona
lMA 11.
.ABGra
phicsI79 4
.2.
1 S ymbo l
i cComp
utationUs
ingMATLAB/1
59
2.
4.1 Hand
leG raph
icsI80 4
.2.2 Ba~ic Mathe
matic
alConce
ptsI1 62
2.
4.2 Gr
aphic
alU serInt
erf
aceI81 4
.2.
3 T aylor'sTheore
m/Se
ries/169
2.
4.3 GUICodeI84 3 G
4. rap
hica
1Solut
ions/1 71
R
efe
ren
cesI9
1 4.
3.1 Un
constrai
nedProblem/1 71
P
rob
lesI9
m 2 4.
3.2E q
ualit
yC on
strain
edProbl
em/1 7
2
4.
3.3 In
equa
lityCons
traine
dProblem/1 73
3 LlnearProgrammlng 93 4.3
.4 Equa
lit
ya ndIne
qual
ityC
onstr
ain
ts/1 74

3
.1 P
roblemDefi
niti
onI94 4.
4 An
alyt
ica
1C o
ndition
s/1 75
4.
4.
1 U n
constrai
nedProblem/1 7
6
3
.1.
1 S t
andardFor
mat/94
4.
4.2 Equa
lit
yCons in
edP r
oblemI1 79
3
.1.
2 M ode
lingIssu
es/98
4.
4.3 In
equa
lityConst
rainedOpt
imiza
tio
nI18
6
3
.2 G
raphi
calSol
utio
n/1 07
4.
4.4G en
eralOptimiz
ationProblem/191
3
.2.
1 Example3.1 /110
3
.2.
2 C h
ara
cte
ris
ticsoftheS
olu
tio
n/I I
1 4
.5 Exnpl
es/1 9
4
3
. 3 D
2. i
ffe
rentSo
luti
onTypesI1 14 4
.5.1 Example4.2/ 1
94
4.
5. 3/1
2 Example4. 9
6
3
.3 Nume
ric
alSolutio
n-theSimp l
exMethodI1 1
5
3.
3.1 Fe
atu
resofth
eSimplexMethod/1 15 R
efe
ren
ces/200
3.
3. 2 Ap
plic
ati
onofSimplexMethod/1 17 P
rob
lem
s/2
01
3.
3. 3 So
lut
ionUsingMA11
..B/1
A 20
33.
. 4 So
lut
ionUsingMAT
LA B'SOp
timiz
ati
onTool
boxI123 5 NumericalTechnlques- e
TheOn-DlmenslonalProblem 203
3
.4 Ad
diti
onalExampl
es/1 24 5
.1 P
roblemDef
init
ionI204
3.
4.
1 Example3 .2-
Tra
nsporta
tionPro
blem/1 2
4 .1
5 .
1 C o
nstra
inedOne-D
ime
nsi
onlP
a r
oblem/204
3.
4.2 Example3.3-Equa
lit
yCons
tra
intsandU
nresct
ed
5
.2 S
oluti
ontoth
eP rob
le m/2 05
Vari
able
s/1 30
5
.2.
1 G r
aphic
alSolutio
n/2 05
3.
4.3 Example3.
4- AFour-Va
ria
bleProb
lem/1 34
5
.2.
2 Newton-RaphsonT e
chniq
ue/206
3.
5 A
dditi
onalTopic
sinLin
earProgramming/1
38
5
.2.
3B i
sect
ionTechniqueI2 0
9
3
.5.
1 P r
i m
ala n
dDualProb
lem/1 38
5
.2.
4P ol
ynomia
lA pproxi
matio
n/211
3
.5.
2 S e
nsiti
vit
yAna
lysis/1 48
5
.25 Go
. lde
nS e
ctionMethodI214
R
efe
rn
ces/1
51
5
.3 I
mpo
rta
nceo
fth
eOn
e-D
ime
nsi
onlP
a r
oblem/217
P
rob
lem
s/1
52
5.
4 Add
iti
onalExamplesI2 19
5.
4.1 a mple5.2-I
l
1us
t i
onofGe
nemlGolde
nSe
ctio
nMeth
od/21
9
4 NonlinearProgramming 154 5.
4.2 Example5.3 Two
-Poin
tBoundaryVal
ueProble
mI220
4
.1 P
roblemD
efi
nit
ionI1
55 5.
4.3 Example5.4-RootFindi
ngwithGol
denSec
tionI223
X CONTENTS
CONTENTS x
l

R
efe
ren
cesI225 73.
. 3 Gener
a1iz
edRed
ucedGra
dient(GRG)MethodI297
7.
3.4 S ue
nti
alGr
adien
tRe
stora
tionAJ
gori
thm(SGRA)I302
P
rob
lesI225
m
7.
4A d
diti
ona1ExampJesI307
7.
4.
1 ExampJe7 .2-F
Jagpo
JeP r
oblemI307
6 NumerlcalTechnlquesf
orUnconstralnedOptlmlzatlon 227
7.
4.2 ExampJe7.3-BeamD e
signI310
6
.1 Pro
ble
mDefin
itio
nI2 27 7.
4.3 ExampJe7.4Optima
1Contr
olI313
.1
6 .
1 Example6.
1 I228
R
efe
ren
cesI316
6
.1.
2 Neces
saryandS
uffi
cie
ntCo
ndi
tionsI2
28
P
rob
lesI316
m
6
.1.
3 Eleme
ntsofaNumerica
1Te
chniq
ueI229
6
.2 Num
erica
lT echniq
ues-N
ongr
adi
entM
eth
odsI230
8D
lsc
ret
eOptlmlzation 318
6
.21 RandomWa
. 1kI230
6
.2.2 Patt
emS e
arch/234 8
.1 C
on ce
ptsinDisc
ret
eProgra
mming/320
6
.2.3 PoweJ'sM
1 ethodI238 .1
8 .1 ProblemRel
axa
tinI3
o 21
8
.1.2 Disc
reteOpt
imalS
olut
ionI322
6
.3 Numer
ica
lTh niq
ues-Gradie
nt-Bas
edMethodsI241
'6.
3.1 St
eepes
tD e
scentMethodI2 41 8
.2 D
iscre
teOpti
mizati
onT e
chniq
uesI324
6.
3.2 Con
jugateGradi
ent(F1e
tche
r-Re
eves
)MethodI244 8
.2.
1 E x
hausti
veE nu
merat
ionI326
6.
3.3 Davi
don-FJet
cher-Po
wel
IMethodI246 8
.2.
2 B ran
cha ndBoundI329
63.
. 4B royd
on-Flet
cher-
Gold
fart
ShannoMethodI249 8
.2.
3 DynamicProgramming/336
6
.4N
ume
ric
alTechniques-SecondO
rdrI2
e 51 8
.3 A
dditi
ona
lExampl
esI3 41
8
.3.
1 Exnmple8.
4--1BeumDes
ignI34
1
6
.5 A
dditi
onalExam
plesI253
8
.3.
2 Zero-OneInt
ege
rProg
rammi
ngI343
6
.5.
1 Example6.2-RosenbrockProble
m/2 53
6
.52 E
. x
a m
ple6.3-
Three-
Dimen
siona
lAown raRo n
gDi
skI2
55 R
efe
ren
cesI348
6
.53 ExampJe6.
. 4-
FittingBezie
rP a
ram
etr
icCurv
csI258 P
rob
lem
sI348
R
efe
ren
cesI262
9 GlobalOptlmlzation 350
P
rob
lesI263
m
9
.1 Pr
o bl
emDef
ini
tio
nI3 5
1
7 NumerlcalTechniquesf
orConstralnedO
ptl
mlz
atl
on 265 .1
9 .1 Gl
obalMinimum/3 51
9
.1.2 Na
tureoftheS
oluti
onI354
7
.1 Probl
emDefini
t inI266
o
9
.1.3 Ele
mentsofaNumerica
1Te
chn
iqu
eI356
.1
7 .1 ProblemFormulation-Example71 I266
.
9
.2N
umeri
calTh
n i
qusan
dA d
diti
onlEx
a am
ple
sI357
7
.1.2 Necessa
r yCon
diti
ons/2 67
9
.2.
1 S i
mul
atedAnne
aling(SA)I358
7.
1.3 ElementsofaNumerica
lT echni
queI269
9
.2.2G e
net
icAlgori
thm(GA)I366
7
.2 I
ndir
ectMet
hodsfo
rConst
raine
dO p
timi
zat
ionI270
R
efe
ren
cesI3
77
7
.2.
1 E x
teri
orPe
nal
tyFunct
ion(EPF)MeodI2 71
7
.2.
2 AugmentedLagr
angeMult
ipli
er(ALM)MethodI276 P
rob
lesI3
m 78

7
.3 Di
rectM
ethodsforConsain
edOptim
izati
onI281
10 O
ptl
miz
ati
onToolboxfromMA B
TlA 379
7.
3.
1 S e
que
nt 1L
ia in
earProgramm
ing( S
LP)I284
7.
3.2 Se
que
ntia
lQ ua
dratcP
i rogramming(SQ
P)I289 1
0.
1 TheO
pti
miz
ati
onT
ool
boxI380
x
ll CONTENTS

1
0.1
.1 ProgramsI380
1
0 .2 UsingProgramsI382
.1
1
0.1
.3 S
ett
ingO
pti
miz
ati
onP
ara
met
ersI384
1
0.2 E
xam
plsI3
e 85
1
0
1
0
.
.
2.
2
1
.
2
L
in
Q
ua
e
d
r
rP
a
at
r
i
ogrammingI3
cP r
85
ogrammingI386
PREFACE
1
0.2.
3 U
nco
nstra
inedO pt
imizati
onI388
1
0.2.
4 C
ons
trai
nedO pt
imizati
onI3 8
9
R
efe
ren
ceI3
91

Index 393 l
m
c
esu~ject o
a
o
n
s
ag
to
er
fp
s
r
fo
a
od
p
t
n
u
i

c
m
i
dm
t
z

i
a
t
o
o
i
s
o
ni
te
na
sr
v
n
e
e
c

df
e
i
r
v
y
i
i
n
b
n
gs
o
a
e
d
l
ri
o
ye
u

yt
l
sa
l
s
t
e
h
te
n
.T
es
ti
o
h
u
nome
i
c
si
ce
n
sd
s
g
r
so
i
n
i
ee
r
v
ft
s
e
h
s
cie
nti
st
s

nbycompe t
eb usine
s se
i
n
t
on
e
qua
e
li
t
.
l
ya
g
no
s
r
s
u
in
ranc
ge
e

pract
iceo fo ptimizatio
ni snotano ptiond uringcurrenttimes.
Optimiza tionisp racticedt hr o
ughs oftwar programsa ndr equire
ss ignifica
nt
compute rre sour
ces.Th et echniquesofo ptimizationhaven otc hangeds i
gnifi
cantlyin
c en
ty ea rsb uttl
lea reaso fa ppl
icationsh av emushroomeda tas ig
nific
antr at
e.
Success
fu llyembeddingt heu seo fopt im
izationi nprofessionalp r
a c
ticerequiresat
lea
stthreeP quisites.beyi ncludem ath
e maticalmo delingo fthed es
ignp robl em
knowledgeo fc omputerprogramminga ndknowledgeo fop t
i mi
zationt ec
hniques.
Many s pecial-purposeo ptimiz a
t i
ons oftwarep ackages r e
lax r equired
knowledge o fprogramming a r
ea vaila
blet oday
. To u se them e ffic
ient
lyt he
remainingtwoa re
assti
llh avet obea ddressed.
lerea res evera
le xcellentb ooksont hes ubjec
to fo ptimizationafewo fthem
releas
edr ecently.Mosto fthemc ovr thesubjectindepth.whichi sn eces
saryb ecause
thmathe maticalm odelsa reno nl
i nea
ra ndr equirespec
ialt echniqus t
hatareusually
notpao fa nycorecurriculum.A llofeb ooksassume er ea
derisfamilia
rw ilh
aprogrammingl anguagea ditio
nallyFORTRAN andrecentlyC.A nothera s
sum plion
hquentlymadei s t heo ptimizationc hniqueswi 1
lbeimplemented i na
mainframec omp utingen vironm enl
.S uchac om binationisex emelyd iffi
cu1
tf orthe
sel
f-Iea
r nere venw it
henormousm otivation.
Ane xplo sionofinexp en
si vede s
k t
o pcom p
u tingresourcesa idsengineeri
ngd esign
pra
cti t oday.P ara
llelingthisd evelopm entisea v
ailabi
lityo fextensive sou
ont h
eI nternetb
othforl ea
rn i
n ga n
ddeployment .Thisisj oinedbyt heavail
abilityof
sofs ystemst h
atpr ovide o pportunityforh andlingma t
h ematicsgrap
hics.a nd
programmingi nac onsisten
tm an n
e r.Theses oft war
es ystemsa r
es ignif
icant
1ye asyto
mastercompar t otheh igher-levelprogrammingl anguageso ft h
ep v iousye S.
lisbookp rimarilys eekst oh arnesst hisi angulationo fs rvi
c e
st op rovidea
pra
ctica
la pproa chtoth estudyo fd esigno ptimizati
on. l ebooku sesMA TI.B@t
A o
i
11us
tratea ndi mp le
me ntthev ariouste chn
iqueso fo p
timization.MATLABi sap roduct
fromMathWorks.I nc.
Thi
sbooka ttemps10a
t cco mplishtwoi mportantobj tiv
es.Thef ir
x
lv P
REF
ACE P
REF
ACE XV

ofsymb o
lic.n u
mer ic
al.a ndgrap
hicall
f tur
esofMATLABl tinteg
rate
si sp owerfu
l classrooms et
tingwith ou1computationalc xperienceisa lsofeas
ib1
e.I ni sc a
set h
e
combinationd uri ng n sla
t i
ono fmany a l
gorith msi nt
oa pp1
ied numerical a1gorithm
sc anb eprese n
tedandt hen ur
nericalresul
tsi llu
stra
ted
.Thes enior/g
radua
1e
techniquesf ord esigno pti
mizatio. Th
n ereis ac on stante nhance me n to ft he s1uden
tsi nv ariousd i s
cipi
nes.e speci
allye nginceri ga
n ret het a
rg c
1a udienc
e.
programmings killsthrougho
utth book.Thes ec o
nd0 e cti
veisthpr im ar ytas
ko f Optimizationt ech
niq ucsa rea ni mportanl1 00
1t os olved csignp ro blemsina l
l
b ook-toc om municat
eandd emonstratevariouslIu merica
lt ec
hni qu est h
ata re profes
sionala re
aso fs tudy
.Manyi l
lustr
ation
sa reomt hea reao fm echani
cal
currenlusedi nt l
teareao l
optimald es. engineeringrefl
ectin
g e xperie
nc eofeau or.
AHo ft h
cn u meric
altechniquesMEsupportedbyMMLABc odea va ila
ble Independentlear
ne l
'sp
articu
Iarlyprofession
alswhon eedtounderstandt h
esubjec
t
c om
pu ter file
s. These f i
le
s a r
e a vaila
bl e on a companion web s i
te ofo pt
imizationshoulda lsofindt hebookv eryu s
e f
u .
lA r eaderwhoh asa cc
essto
www.wilev.comlvenka t
.ltisnecessarytovisi
tt hewebs itetodownloadt hcfi
lesto MATLABs oftwarec us thebookt oi tsb e
sta dvantage
.The book i sl a
rgel
y
foll
owa l
loftheE Xt
lI
npies-Theboo kwillbee nti
a
lly
i n

c omple
t
.
ewi
th
0
o
u


tt
hcs
cfile
s. self-c
ontainedandd ev elopsalln cccssarym athemati calc oncep
t s when n ced
cd.
Att hewebs it
eyouw illalsofinduscfullink
s1 0o t
he rr esourc
esawebcourseon Abstrac
tm athematicali dcasofo ptimi tio
n i n
t roduccdgraphi
callya ndt hrou
gh
MATLABprogramming andu pdatedinformationa b
ou tA ppli
edO ptin t im uo
nw ith i
Ilustr
ativeexamplesi nt hcb o
ok.I nmanyi nstancest h
eo pera
tiono ft h
cn umcric
al
MAT l.
AB @Progra mming. techniqueis a tc
dt oshowhowt hed esignischangingw ithiter
ations.Thishas
Thed ecisiont oloc
atet h
ef i
lesonawebs i
tepmvidEsana venuet oshadowt he beenp o
ssibleb e
causeMATLABg raphicsarerichinf ca
tu r
esa ndsimplet oincooratc
.
dynamicc hangesi nMATLAss o
f 1w
areitsc
lfwhichisb c ingtransf
orm edi nam ajor makingUlcmc ff
cctivef orc onvcyingei dca.I
s ti sf orthisreasoner ead
eris
waya lmosteveryy ca
r.ltprovi
desamechanism1 0correc tbugsiec od ei nat i
mely cxposedt og raphical programming e ar
ly oni ncIud ing ac hap
t rong
e raphica
l
m anner.Itestab
ishesa noppo
rtunitytoim pro
ve c o det hroughreaders uggcst
ions optimi
zation.Tob alancet hcdevelop mentofprogrammings k
ill
sa ndthp resen
tatio
n
andpr o
videsawayf orea uthor10keept h
crca de
reng a gedw i
thnewd c vc lopm
ents. ofo ptimizati
onc o
nc eptsprogramming i ssuesa rei ncreme
ntallye xplor
eda nd
I
tdocutdownt hesizcofthebooke normousl ybylo cat i
ngal
lo fthep a g ofcode implemented.I nvestme nto ft im
ei ndv elopi
ngprogrammings ki
llsi sem ost
eff
e c
tivewayt oi mbib et h
em.Thca uthorisn Ola wa r
eo fs ho
rtcut
s.S tudc
ntsa r
c
ou
tsidethebook.
Anu nusualfeat
ureo fth
ebooki sci n
clusio
no fdi
scret
eo p
timiz
ationandglobal expectedt opr ogrami ndepend
e n
tly.makem istakes debuge rr
ors
.a n di nco
rporat
e
op
timiza
tion.Tradil
io n
alc ontinuo
u sdesignoptimiza
tiont e
chniq
uesdot a
keupa improve m
e ntsasp to ftheirlearn
i ngexperiencede l
i ver
edt hroughi sbook.
si
gnifi
cantporti
ono fthebook.C ontinuousproblemsgener
allyallowthealgo
rithms Thebookp roce
edsa tab riskpacet oprovidee xperienccinMATLA8programming
ob
t emathematic
allyd evelopedinac onvin
cingmanncr andei deascoudbe
l andcommunicatei deasi noptimizationinar easonablenumbero fp ag
e s.Th i
sc ou
ld
cor
eo fo r
igina
la 1gorith
msd cvc10pcdbyt her ea
derstoa dd
ressthei
rowns pe
cial notbep os
siblewithoutt akingadvantageo fIheaccompanyingwebs it
e1 0locat
emuch
necd
s.E veryc ha
ptcri ncl
u d
esa ddit
ionalnont
rivialcxamp1esa toftcnpres
cnta oft hec odef o
ra lg orithms and e xamp
l es
. Merely r unningt hec odew il
ln 01
noveluseorextcns
iono fthcoptimi
zationtechn
iquesinthecha
pte.Th
r emathc
matical signi
fican
tlye c et her e
ader'
sprogrammings ki
lls.Itisi mp
ortantf orthestuden
t
algori
thms and cxa mplesa r accompanied by MA' ABc odea vail
ableatt he tounderstandthecodea lso.To sistini sprocessthec odecarr
iesI
iber a
lcomments
companionwebsue-Thenumericalt echniq
uesu su
allyi n
cludestronggraph
ical oftencorrespondingt othea lgori
thmt hatisb ei
ngi m
p lemcnted.Thea uo rexpec
ts
suppor
ttoi l
1us
tra
teco pcrat
i o
no fthctech
niques
. er eadertoh averea dec omments .Th eaccompanyingc odeallowst heinstr
ucto
r
D
iscreteandglo
ba loptimi
za t
iontechniqu
esarebasedonv e
rydiffe
rental
goriths
m toassignbothprogramminga ssig
nm entsasw el
la ss o
and .c
ho fthcm c ane as
ilyj us
tifyf ul
l-fl
edgedi n
d e
pendentcourscsd t
e cd
exclus
ively10thci
rS 1udy
.I nac omprchensivcbooks uch
x
vl P
REF
ACE P
REF
ACE x
vii

approache st hei nst


ructorc anc hoos et oincludeo nl
y as ubs
eto fc o ntinuous Thebookwasmadep oss
iblet h
r o
ughsupportfromJ oh
nW il ey dSonsInc
. d
optimizationa l g
orithmstoa llowt hei nclu
siono fe sep opul artechniq
ue s.Ife MathWorksI nc
.S in
cerethanksa reowedt oBobA r
gentie
ri senio
re d
itoratJobn
studenthasa cc
esstotheO ptim izati
onT ool b
oxf romMATlABe nitcanb ein te
grated Wileyf oraccep
tingtheproposalandwhoa l
la lon
gd isp
laye dal o
to fpatienc
ein
intoec o ursef o
rh andlingt hefin
ald esignp r
ojec.
tThel astc h
apterp rovidesan get
t i
ngthebookmovingforward.Samei sduet oBobH ilbed -
a s
sociatemanaging
overvi e
wont heuseoft heto olbox. edi
toratJohnWiley forhisimp ssiveworka tc1ean
ingu pt hemanuscrip.
tB r
ian
Thisbooks tarte
do utu sin gMA TI.
ABV ersion5.Abouth alf wayt hroug
ht hebook SnappNew Media e d
itora tJ ohn Wileyc reat
ed companion web s it
e
et ran
sitiont oMATlAB V ersion5. 3wasc omplete.Att hec o
mpletiono ft he (www.wiley.com
lvenkat)a ndw a l
sob ernaint
ainingit
.NaomiFemandesom
m u scr
ip tMATLABV e rs
io n6wshippingf orsomet ime
.Aso fthi
st ir
neVersion MathWorks In.
c sawtoita t1h adthelate
stversio
no fMATLABa ssoona si
twas
6.1isavailable.Mosti n
stitu
t iona
lMATlABl i
cens
esa reusuallyb asedo nsubscription av
ailabl
e.Myr eg
ardforDr.An g
e loMieleProf
essorEmeritusatRiceU n
ivers
ityis
so t heyw il
lh ave l atestv e
rsiono fes oftwa
re.I nas en seandi sist rueof moret ha
nc anbeexpres
sedint h
e eI
s ine
s.Itwash ewhoi ntroducedmet o1hsubje
cl
al
lb ookst hatd ependonp articularsoftwaresystemsthebookr naya ppe
aro uto fdate ofo p
timizat
ionandd emonstratedthee ff
ecti
venessofs imp
l ep resenu
tion-Iw i
ll
withr es
pec ttoes oftware.T hisisnotr e
allyso
.Whilet heusag eofMATLABf unctions alwaysregardhimasag re
atteacher
.Ofc oursemyf amil
yd eservesspec
ialrnent
ion


rnayc hangeb et we
env ersions t
hereshouldbes ui
tablewamingsandi nstru
ctiona bout fo
rp utti
ngupw ithal
lt heNotnow "Later
"Howa bo
u tt orno
rrow?"d in2

dllpdLY
ed i f
ferentu s ag
eAni m portanti nsuranceisbuilti nt
ot hebook particula
rlyt o debuggingec ode.Sp ia
l k saretoA a na dV inay akrn
yo ffs
prin
g
i
t


handles uchc hangesiftheya ri
se.Sprinkledt hr
oughou tthebooki stheh abito fe th
eirp a
tienceund
erstan
dingandencouragement.Thea uo ra polog
izesf o
ra ny
usingeo n lin
eh el
p.I nmosti nstan
cesi swasp ri
mar i
lydonet oe xposeth ereader sh
ortcornin
gso nt h
ep r
esenta
t i
on and welcomes comments c ri
ticis
msand
su
ggestionsforimpro
ve me
nta ta
llt i
mes.
toalternativeu seofthesamecommand.A not
hers ignifi
cantc ha n
get heman uscript
hadt oe ndur ewas el o
sso fa ccesst oaUNIXv ersionb ecauseo fthuniv er
sity'
s
chang etod is
tribut
edc omp ut ingonPCc lu
ster
s.Thea u
thor'se x
periencew i e P
.VENKATARAMhN
R
och
est
e NewY
ork
earl
yc h
ap terss uggs
18t hatt h
iss houldn otma t
1er
.E xceptf o rexter
nalf ilesa n
d
resources u seo fMA TlA Ba si ll
ustra
tedint hebooki si ndiffere
nttot hev ariou
s
operatings y ( WindowsMacUNIXo rLinux)
.
Thet opicsc hosenforincl usionandt hesimpl
icityo fpresentationofet opicsare
dir
ectlyr elatedt ot h
ee x peri e
n c
eo ft eachingt h
ec ourseono pti
mizationa tt he
senio
r /g
ra duateleve
li neD partmentofM echan
i calE ngi
neer ingforovert enyears
.
Experiencep roved atco mpr ehensioni rnpro
vedw iths impleiIIust
ratio
ns however
complicate dthem athe
m at
i cali dea
s.Ont heothe
rh and s
traig
h o rwardmathernatica
l
expressionse lici
tednoi nteresto runderstandi
ng.Thee mphasisona ppli
cat io
nwas
importantt ok eepthes t
udents 'atten
tion.Int h
isconnec tio
nt hea uthorwouldl iket
o
1ka llh iss t
uden18forpu shi nghinf
r orsimpleexplanations forprovidingp o
sitiv
e
inte
raction andf o
rt h
eirc ontributio
no fo ri
gina
la ndu sefulid easint h
ed iscuss

-

1

a. .

tJFJJ-

p
d

rh
wAbrr=353thtY4y
INTRODUCTION

Optimizati
onh as become a n ecessaryp arto fd esigna c
tivityi na llm ajor
dis
ciplin
es.Thesed is
cipline
sa renotr es
trict
edt oenginee
ring.Them otivationto
producee c
on omicallyr el
evantp ro
ductso rservice
sw ithembeddedq ualityisthe
princ
ipalreasonf ori sinclusio
n.Improvedp roductionandd esignt oo
lsw i a
syner
gisti
ct hrustt hroughi n
e xpen
sivec omputationalr e
sourcesha vea idedthe
conside
rationo fo ptimization methods i n new d evelopmentsp a
rticular
ly
engineer
ingp roducts.Eveni nt hea bsencco fat angibl
ep roducto pt
i mi
z at
ion
idea
sp r
ovidet h ea b
ilitytod efinea nde xp
l or
ep ro bl
emsw h ilef ocusingon
solut
ions atsub scri
bet osomem easureo fusefuln
ess.G en
erally th
eu seo fthe
wordo ptimi
z at
io nimplisthcb estresu
ltu ndert h
c ircum
stances.T hisi nclu
des
theparti
cularseto fconstr
aintsont hedevel opmentrcsourc
escurrentknowledge
marketconditions andsoo n
.Everyoneo fush asprobablyusedt hcte rmatsome
timetod esc
r ib
e ep rimaryq ua
lityo fourworko re ndea
vor.Iti spr o
b ablye
moslu sedo ra b usedl ermina dv
ertisin
gandp re
sentat
ions.N everthclessc
abi
litytomaket heb e
stc hoic
ei sap erp
eluald esi
reamongu sall
.
Op
timizationi sfrequent
lya ssoci
atedw ithd esi
gn beitap roducts er
viceor
str
ateg
y.A e
ro spacedesignwasamong e arl
iestdis
cipl
inestoembrac eoptimizati
on
inasignif
icantwayd r
ivenb yan atu
ra1needt olowerthet rem
endo u
sc ostassociat
ed
withcarry
ingu nnecess yweightinaerospacevehic
les
.Minimummasss tructur
esar
l
n orm.Optimiz a
t i
onf ormspartofthep sycheofeverya er
ospacedesigner.Saving
onfuelthroughtrjec
torydesignwasa nothe
rp roblemthatsugge
steditsel
f.Ve rysoon
ent
i engineeringcommunityc ouldrecognizecn eedtodefineso l
utionsb a
sed
onm e
rit
.R ecognizingthedesireforoptim
izationa n
da c
tua1l
yi mp
le mentingwe two
dif
feren
ti s
sues
.
2 I
NTR
ODU
CTI
ON 1
.
1OP
TIM
IZA
TIO
NFU
NDA
MEN
TAL
S 3

Untilrecentl
y.f ormuchoft hetime.optimiza
t ionwasu su
allya ttemp
tedo nlyi n m
athe
matic
almode.
lbedi .i
chara
ctc
riza
tion
. dit
sci
rcu
mst
anc
esmustbe
tho
ses ituati
onswheret hereweres i
gnifi
cantp enalt
iesf o
rg enericd e
signs.Th e e
xpr
esse
dm at
hem
ati
cal
ly.C
onside
rt h
edesigna
cti
vit
yint
hefo
llo
win
gcas
es:
app
licatio
no fo ptim
i tiondemandedl a
rgec o
m p
u tationalr e
sourc
es.I nthen ascent
year
so fdigita
lc omputationthesewerea vail
ableo nlytol argenation
all ab
oratories ;:.~
"
.
Newconsumcrr e
searc
hi n
dicat
thatpeoplelike10drin
kab o
u t0.5lit
crofsoda
andr esea
rchp r o
grams.Theser esource
sweren ecess
a ryt ohandlet hn onlinear " popalatimeduri
ngt h
esummerm onth.Th
s efabr
icati
onCOSIo ftherede
signe
d
problemsa t assoc
iatedw ithengineeringo ptimi .t
io
n.Asar esu
ltoft hese sodacanispro
porti
onalto sur
facearea
.a ndc anbee s
tima tcdat$1.00pcr
con
strai
n t
s most of t hee verydayp roduct
s were d esignedw ithoutr ega
r dt o squa
remeterofthemate
riaIus
ed.Ac ir
cularcrosssect
ionisthemostp laus
ibl
e
opt
imization.Th i
sincludeseverythi
ngyous o undyouo ruseinyourd ailylif
e.It give
nc ur
renttooli
nga va
ila
bleform anu
fac t
ure.Fora e
stheticr ea
sonse
isinconceivableatt henewg ener
ationo frepla c
emen tp r
oducts
.l ikcthec a
r.t he hei
ghtmustbeatlea
sttwicet
hediamet
cr.Stu d
iesi n
dic
atea th o
l d
ingcomfor
t
house
.t hed esk
.o rep e
ncil.redesigne
da ndm anufact uredtodaya rcnotd esigned req
uire
sad ia
meterbetween6and9cm.
optim
allyi nones enseoranothcr. Ac antile
verbeamncedstobedcsi
gndtocarr
yap oi
ntl o
adFa tthecndofa
Today.youwouldd e
fmitIyexploreprocedurestoo ptimizey ourinveslentsby beamofl e
ngthL
.Thec r
ossse
cti
onofthebeamwiIIbeintheshu
peofthlt
ter
tai
lori
ng your p ortfol
io. You would o ptimizey ourb us
inesst rave
lt ime by I( edas I -
bm )
.Thebeams houl
dmeetp res
cribe
df a
ilu
recri
ter
ia.
appropr
i a
I ychoosingyourd csti
nati
ons.Youc anoptimiz eyourcommutingt imb y e reisa ls
oalimi
tonide f
Itio
n.A beamo fminimummassi sreq
uir
t o
choosingyo urtimeandr ou
te.Youc ano pt
imizey ourneces sar
ye xp
enditureforIiving bedesi g
ned.
byc hoosingy ourdaya nds t
oreforshopping.Youc ano ptimizctheu sef
ult imeyou MyPCCompanyh asdecidcdtoinvc
st$12m illi
oni nacqui
ringsev
eralnW
connectto I ntemetbyd et
c r
miningyourt imeofc on
necti o
n.Youc anbuys oftware Componenl Placem n
l Machines t o ma nu
facture diffe
rcnt kin
ds o f
w i
llo ptimizeyourc onn
cctiontot h
cl nte
mct.Youc a nbuybookso rreadartic
les mothcrb
oa r
dsf orancwg cnc
ratio
no fperson
alc ompu
lers.Threemodelso f
t cl
lyou howt op erformt he
sev ariou
so p ti
mizations.Theabovea c
tivit
ics thc
scm achinesareundercon
sider
atio
n.Totalnumbcro foper
atorsav
aila
blei
s
primar
ilyr ela
tcto: ;
crvI
cesors tr
ateg
y.Itisnowa pparcnt ate veryactiv
ityexcept 100b ec
au s
co ft h
el oc
allabo tA f
rmarke. Ioorspaccc o
nstrai
ntneeds10bc
aSeticprovidesthes copeforoptimiz
ation.l isjusti
fiesl o
okinga t estu d
yo f sa
tisf
iedb eca
u s
eo ft h
ed i
ffcr
entdimcnsi
on soft h
csemachines.Addi
tiona
l


ootimizo na sat o
ol c anbea p
plied10av ariet
yo fd isc
ipli
nes.Ifsothemyri a
d inf
ormationrcla
tingt
oe ac
hoft h
emachinesisgiveninTable1.
1.Thecompany
of
o

p

tim
iz
a

ti
on
p
r
obl
e
m
n
s
o


I
1
1
wishe
st od et
e r
minehowmanyofe achkindisa pp
ropri
ate10maximizet h
e
Thisi
seemph a
s
isoft
heboo k. numbero fboardsmanufac
turedperday.
The p artn
ershipb etween dsignand o p
timizatio
na cti
vit
yi so ft
enf oundin
eng
ineering.Thisbookr ecognizestha
tconnec
t i
o nandmanyo fthcproblemsusedf
or Theabovel is
trcpr ent
st h
reep r
oblemsa twiIIbeused1 0def
incformalelement
s
il
lust
ratio
nsandp r
acti
cea refrome nginringprimari
Iym echa
nicalciv
iland ofanoptimizati
onp r
obl e.Eac
m hproblem quiresi n
formationfromthespec
ificarca
aeros
p aced es
ign.N cverth
el esst hes t
udy ofo ptim
izati
on.p ar
ticu
larl
ya ppli
ed ordisc
iplin
et owhichi trefe
rs.Tor ccogni
zeo rde s
ignth e
sep roblem
sassumesa t
opti
mization.isn o
tm e xclusivepmpertyofmys ptcin
cd i
sci
purle.
Iti n
volve
sthe design
crisc onve
rsa n
twi ep a
rtic
ularsubj tmatte
r. lep ro
blemsa r
ek ep
t
dECOVEryanddesignof u ti o
nst hr
oughappro
pr i
atetechni
ques o c
iatedwitht
he simpl
et ofocusono pt
im i
zationissu
cs.Problemso fsuchv a
rielyareimpo
rtantt o
day
.
formu
l ati
ono fth eproblemi nas p if
icmanner.T h
isc anbedonef orexamplein Recenta dv
e r
tisementsi ng e
neralconsumerm agazinesi 1
I u
str
ate atAlcoa( a
n
economics c
hemi s
tryandb usines
sman aluminumm u f
aclur
er)isq uit
h appytoh aver cducedLhcw eightofthestandar
d
sodapopc anbyo v
er30%i nrecenlyea
rs.As imi
larc1aimbyt heplas
tic
sindustrywit
h
res
pecttothes ta
ndardm ilkjug(gaI
lon)isal50evi d
entint h
e s
em agaz
inesalthoug
h
iniscaset h
enumberi s409 .Roofc
oUapsesin cN or
theastd u
e1 0exc
essivesnow
1
.1 OPTIMIZATIONFUNDAMENTALS
T
abl
e1.
1 ComponentP
lac
eme
ntM
ach
ir
Opt
imizationcanbea pplie
dt oal
ld is
cipli
ncs.Qua
litat
ivelythi
sa s
serti
oni m
plies
mul
tipledecisi
onc h
oices
;i mp
licit
lyr eco
gnizingthencessi
tyo fchoosingamong M
ach
ine O
per
ablc
a
1tema
tives.Thisbooksdeal
sw it
ho p
tirni
zatio
ninaquantit
ativeway.Thismeansthat M
odel B
oar
dTy
pes Bo
ard
slo
Hur Opemto
rsS
/hi
ft Hour
sIDa
y C
ost
IMa
chi
ne
anoutcomeo fa p
plyingoptim
izationtoeproblemd esign.ors e
rvicemustyield
number atwil
ld e
finethesolu
tion.orinotherwordsnumberso rvalues will A 10 5
5 1
8 4
000
00
cha
ract
erizethepart
icul
ardesignors e
rvic
e.Q u
anti
tativedcscri
ptio
no f lut
ion B 20 5
0 2 1
8 60
0 0
00
C 18 5
0 2 2
1 70
0 0
00
req
uire
saq u
anti
tati
ved e
scrip
tionoft h
eproblemi t
sel
f.Th i
sd es
cript
ioniscalle
da
r
:
:
.
-:
l

'
"

4 INTRODUCTION 1
.
1 OPTIMIZATIONFUNDAMENTALS 5

du
ringt h
e 1998-1999 win
terwillhavestru
ctu
ra1desi
gne
rsa ndh o
meb
uilde
rs des
ign.Thi sissignific
antbecausethee f
for
ti no bt
niningthesolutionv a
riesasan
ex
plori
ng secondp ro
blem.Thvibr
antstoc
km ar
ketinthe
set i
meshasmade int
egerpowero ft h
enumbero fvaria
blesandthispoweri s1ypca
i 11ygreateran2.
ba
1anci
ngt h
einvestme
ntportf
oli
omorechal
lengi
ng.Thcthi
rdcas
emays ugg
esta M tingther equ
i rementensur
esr e
ducedd i
ffi
cultyinm at
hematicallyexplorin
gt h
c
math
ematica
1modelapprop
riat
eforsu
chdeci
sionmakin
g. sol
ution
.
l esetofd es
i g
nv a
riab
lesisiden
tifie
da sthed es
i g
nv e
ctor
.1Isv t o
rw i
llbe
1
.1.
1 ElementsofProblemFormulatlon con
sider ac olumnv e
ctorinthi
sbook.Inf a
c1a
1 1vect
orsarecolumnv ectors E
te
xt.Th elengthofi sv ect
orwhichisnist henumbero fdesignvaril e
sioE
Inthi
ss ecti
onwew illin duceef orma
1e le
me nt
so fthcoptim
izationprobl e
m .In proble.Th
m edesignv aria
blescanc xp
r e
ssd i
fferentdimension
alqu ti
ti
esin
th
isbookt het crmp roducta1so fer
st oas ervic
o ras tr
ate
gy.Its h ouldbe problembutinthema lhem
aticalmodeltheyaredistingu
ishedby c hara
c1erx
.AlI
understooda top z ati
onp r
esu p
posest h
eknowlcdgeo fed esignrulesf orthe ofthetechniq
ueso foptimiza
tioninthi
sbookn reb ascdonea bstractmathematica
l
sp i
ficpr ob
le mprimar
ilytheabili
tytod es
cribethed e
signinm athematica
1t erms. model.les u
bscriptonxf rcxamplcX3
o rcp
resentsthethi
rddesignv ar
iablewh
ich
Theset ermscJuded esi
gnv ari
a b
lesd e
signp arametersandd esignfunctions
. mayb et h
eh eigh
to fano bj
ec1inec hucte
rizatio
no fthep ro
d uct
.T hisabs
trac
t
Trad
itiona1designpracti
a tisdesig
nw itho
utr egar
dtoo pti
mizat
ionincJudesa11 modelisne ssaryf ormathema
ticalconvenien
ce.T hisbookw il
lr ef
ert oed esig
n
oft h
esee lements ughe yweren o
tf ormal
lyr ecognize
da ss u
ch.T hisa lso var
iablesinoneo f f ol
lowingways:
j
ustif
iesep r
er e
quisi th
atyoumustb ec a
pableo fdcsignin
gt h
e0 ti fyoua re
planni
n gtoappl yet e
chniqu
cso foptimi t
ion.Itisal80agoodi dea10r ecognizc (
1)[
-refc i
ngt
oth
evc
c10
r0'
1ds
ignv
ari
abl
cs
th
ato p
timizationisap roced
urcfors c
arching1hebestdesignamongc andida
t scach (
2)X o
rx -r
eferri
ngt oth
cvc
cto
rag
aino
mil
lin
g1h
csq
uar
ebr
ack
etsf
or
ofwhichc anp roduceana cc
eptableproduc.
tTheo cedf o
rt hcob
jec1orp r
oduc tisnot c
onvcn
icncci
fappr
opr
iat
e
questi
on e
dh er
e.b utt h
ismayb eduet oad ecisionbased00o ptimi
zationap pliedin
(
3)[
xjx
2'
...XIl]T_i
ndic
ati
ngt h
cv c
clorlhr
oug
hi t
se l
ement
s.N
ole e
anothe
rd isc
ipl
in c
.
s
uper
scr
iptt
ran spo
siti
onsymboltoi
den
tif
yita
sacolunmvec
tor
.
(
4)X;.i
=12....
n-r
efe
rri
ngt
oal
loft
hee
lem
ent
soft
hed
esi
gnv
ct
or.
DeslgnV arlab les: Designvariabl
esa reentitiesthatiden
tifyapartic
ulardesign.In
es e
archfor o ptimaldesigne seentitiesw il
lc hangeo verap rc
scribedrange.
Thca
bov
eno
tat
iona
1co
nve
nie
ncei
sex
tcn
dcdt
oal
lvc
cto
rsi
nth
ebo
ok.
Thev alueso fac ompletes e
to ft h
esev a
r i
a blesc harac
tcriz
eas pe
cificd e
sign.Th
numberandt ypeofcntit
iesb c
longingtot hi
ss eta revcryimportantinidentifyi
nga nd
se
ttingupequ ti
tati
ved esi
gnp roblem.Iti se ssen
tiali sc hoi
c ecaptu e DeslgnParameters: I nisbooke seidentifyconst
a n 1w il
ln otchange
essenceo f o bje
ctb eingd es
ie d da tesamct imep rovideaq u
antita
tive di
e r
entd e
signsa r
ec ompared. Many 1extsu se t e rmd es
ignp aramete
rs1 0
prescn
t dcsignvari
able
swed efinedear
lieranddon otf orm
allyrecogniz
edesign
char
a c
teriza
tiono fthedesignp robl
em.I nap plic dmathematicalterminology.design
para
metersasdef
incdh .T
c heprinc
ipnlreasonistha
tp a
ram et
ershavenor ol
e10play
vari
a b
less e
rvea stheunknownso fthep robl emb eingsolvcd.B orrowingana na
10gy
fromt heareaofs ystemdynami andc ontrolt heorye yaree quva
i 1enttod e
fining d eten
n ing optima
1desig.Th
n eyares i
gnifican
tint hedisc
ussio
no fmodeling
thestat
eo fthesystcmini scaseth
cs ta
tco fd esign.Typica
llydesignv ar
iable
sC an is
sue
s.Exampleso fparamet
e r
si ncl
udematcria1pr op
cy appli
edloads.andc h
oicc
bea sso
ciatcdwi t
hd escr
ibing o bje
ct'ssi zes ucha sit
sl e
ngtha ndheight
.I nother ofshap.Th
e ep ar
a m
ctcrsint h
ea bst
ractmathem a
ticalmodela rerep se
ntcdina
c estheymayr e
presen1thenumbero fitem s.Th ec hoic
eo fd e
signvariablesisthe si
milarformasthed e
signvec1o
re x
cep1 tweu sethecharact
crp.Th ere
fore
.[ ]
P
resp
o n
sibi
lityo fed esignerguidcdbyi ntuition expesean dknowledge. le is P[P"P2'.
.. P
q1r e
p se
ntep arameter
so fthep rob
lem.N ote el en
g ofthe
afundament a
1r equirementtobemctbyi ss eto fdesignvariab
lesnamelye ymust par
n ervecto
risq.Excepti ncd iscus
siono fm odeli
n geparn e
terswillnot
beiInearl
yi ndependentTh
. ismeansa 1youc an notcsta
blishthvalueo fonco fe beexp
lici
tlyr redtoasthe
yarep ri
maril
yp redetrmincdc o
nstan
tsin d e
sign
.
designvariable
sf romev aluesofer emai ningv ariab
lest hrou
ghb asicarith
metic
(sca
l i
ngora dditi
on)operation
s.F ore xampl einad esi
gnh avingar cctang
ularcross Des'nF unctlons: D esignf u
nctio
nsd ef
inem ea
ningfuli nf
orma
tiona b
outt he
sect
i o
nyouc annothaveev a
riable
sr epr enti n
ge lcngw
idthanda r
ea.Ifthe de
sig
n. Th eya ree va
luatedu s
ingt hed e
signv ar
iable
sa nddesig
np arameters
fi
rsttwoa rp rescr
ibedet h
irdisa utomatica1lye sta
blish
ed.I ncomplexd esign
s di
scus
sedearl
ier
.Theye stab
lishthemathe
maticalmodelofthedesi
gnproblem
.T hese
theserelati
onshipsmayn otbev eryapp a
r en.tN everthel
essthec h
oi o ft h
es etof fu
nct
ionsc a
nr epre
s e
ntd e
signobjec
tive
(s)andlorcon
str
ail
lts.Asinamei mpli
es
designv a
r i
ablesmustmeet c rite
riono fl inea
ri n
dependencef ora pplyi
ngt he de
sign0e cti
ved rive
st hesearchfortheo pt
imaldesig
n.Thes a
tis
fact
ionoft he
technique
so fo p
timizat
ion. Fromap ract
i cnlp crspcc1i
vct hcpropertyo fiInear tr
ai
llt
se st
ablis
h e
st h
evalidi
tyofthedesign
.Ifnotexpl
icit
1ystat
eded e
signer
independenceid e
ntif
iesaminimums e
to fv ariablest h
atcunc omplctelyd e
scribethe i
sresp
onsiblcforidnti
fyin
gthco bj
ectiv
ca ndcon
str
aint
s.Mi nim
izethemasso fthe
6 INTRODUCTION 1
.1 OPTIMIZATIONFUNDAMENTALS 7

s
tru
ctu
rewi
lltr
ans
lat
eto objec
tivU1ction.The sinthematerialmustbeless
e ConstraintFunctlons: As d e
signf unc
tionsthes
ew illb ei nf
luenc
ed bythe
t
hanth
eyie
Idstre
nghwi
t 1
ltra
nsl
atetoacon st
rain
tfun
cti
on.Inmanyp roblem
s i
tis de
signvaria
bles
.Th eforma
tofthesefunct
ionsrequi
resthemtob ecomparedtosome
p
oss
iblef
orth
csamef u
ncti
ontoswitchr
ol estopro
videdi
ffc
rcn
td esignscen
ario
s. num
ericall
yl im
itin
gv al
ueatisestabl
ishedbyd e
signr e
quirem
e n
torthedes
igne
r.
Thi
sv al
ueremainsconst
antduri
ngt h
coptimiz
ationoftheproblc
m .Awcl1-des
crib
cd
ObJectlveFunction Thet ra
ditionald esigno ptimizationpr o
b lemi sd c
find dc
signp roblemi se x
pectedtoi nc
1ude scvera
ls uchf unct
ions.w hichcanb e
usingas i
ngleo bjectiv
ef uncti
on. lef o r
m atoft hisstatemcntisusuallytom inimizc rep
resent
eda sav c
ctor
.Thec omparisonisus u1ys
l
a etupu si
ngt hethre
cs t
anda
rd
ormaximizesomeq uantity i sc alculate
du singsomcd csignf uncti
on.T his o na
lo pe
rator
s:=Sand .C onside
ro urfi
rstexample
.Le tfimJ(X)repr
ese
nt
functio
nm ustd epende xpl
icitlyo ri m
p l
icit
lyon t hed esignv ariable
s.I nt he ef u
nction c al
cula
testhevolumeo fthenews o
d acanwea red e
sign
ing. l
e
lite
rat
urcisp rob l
cmi scxp ssede xc
1u si
vel yw i
t h
outl osso fg enera
Iityasa co
nstrntont h
edsigncanbce x
presscdas
minimump roble m.A maximump rob lemc anb r c
castasam inimizationp roblcm
usingthencgativco r r ecip
rocalo fthcf unctionu sedfortheo bj
ectivcf un
ction.ln IIJ(X)=500cmJ
thefir
stexamplei n d ucedearlie
rco e ctivei stom inimizecost
.l eref
o r
e
desi functionr epre
s gc ostwilIbet heobj ectiv
ef unct
ion.In es econd s
e I
ntl
Ies
eco
nde
xam
ple
.le
tm2(X)b
th
efu
nct
iont
hatc
alc
ula
test
hed
efl
ect
iono
fth
e
eo b
jectiv
ei st om inimi zema s
s.I nt h
et hirdc asetheobjectivei stomaximizc beamu
nde
rth
eap
pli
edl
oa.Thec
d ons
tra
intc
anb
est
atc
das
machineu t
ilizat
ion.l ear o fsingleo bject
ived e
si i sconsideredm aturet od
ay.
Nonews olu
tiont echniquesf o
rc l
assicalp roblcm sh avbecna dvancedf orsomct ime f
t1
1l2
(X ;Imm
):
S
now.T oday.mucho ft heworki na pp l
i edopt imi tio
ni sd irc
cteda te xpanding
applic
atio
nst opractica
lp roblems.lnmanyc ase
s.t hishasi nvolve
dc r
cativeu s
eo fthe Thccons intfuncti
onscanbec1assif
iedaseq
lla
lit
yconst
rain
ts[ lik
e f
unl(X
)a bo
veJ
solut
iont ec
hnique s
.I n a bstr
actm at h
e maticalm ode
l .theo bjec
tivef unctionis orineq
ualit
yc ons n
ts[likef
un2(X)]
.
reprose
ntedbyt hesymbolfToi n
dicateitsd epe ndenceont hed esignv a
riabl
e s
.itis Problemsw i
th o
utconst
rain
tsaret c
rmcduncon
strai
nedproblems.Ifcon
str
aint
sa r
e
f q
uentlyc xpressed f(x"x 2.... x .A m
n) orec onc
i s
c p rcse
nta t
i o
ni sj{X). pre
sentthenm eeti
ng them is more pmount a no p
timizal
ion.C on
strai
nt
Singleobjec
tivep roblcmsh aveo nlyonef unctio ndcnotedbyfI tisas ca
Iar( nota sat
isf
actio
nisn ecessarybefo
rct hedcsignesta
bli
shedby c u
rrcntvalueoft h
e
V tor
).Notca taltho ughtheobjcctivef unct
iond ependsonP( parametervector)
.it des
i v ar
iablesisconside
redv a
lidanda cc
epta
ble.Ifcon
strain
tsa renotssfi
ed
i
sn otexpl
icit
l yinc1udedi nthef orma.
t the
nt he
reisnos o
luti
on.Af ea
sibledesigni
sonei nwhichallofthec o
nstr
aint
sa r
e
Mu
ltiob
jectivea n dm ulti
discipl
inaryd sig
nsa rci mport
antd evelop mentst od
ay. sa
tis
fied
.Ano ptimalsolut
ionison eath a
smett hedesignobjec
tive.Ano ptim
al
Multio
bjt i
ved esignormultip
leobjectived e
sign.r efersusingsevcr
aIdie re
ntd es
ign dcsi
gnm ustb efcasi
blc
.Thed e
signs pac
cc n
closc
dbyt hcc on
strai
ntsiscall
edt h
e

llY 2 44 yfJ
funct
ionstoes hf orop n a
ld ign.Gene ra
Ilye ya reexpecdbe fea
sibl
ed oma
i n.Dcsignspaceisdescrib
edafewp ara
graphsbclow.
conf
lict
ing0c ctive
s.Th eycouldalsob eo pcr
a tingobjecti
ves.l ecurrentapproach
toes olu
tiono fthesep roblemsinvolvess tand
ardo p
timizati
onp roced a pplicdtoa
sing
le(o nstructedo bjec
t i
veo ptim
iza t
i o
np robl cmb asedont h
ed iff
e r
entm ulti
ple EqualltyConstralnts: E qual
ityconstra
intsa remathematica
llyn eata ndeasyto
obje
ctiv
es.Apop a ra pproachistou seas uit
ablyw e
ig h
d lin rcombina t
iono f handlc.Numericallye yJu
1 ir
emoree ffor
ttos at
isf
y.Theya realsomorer es
tric
tiv
e
multi
plcobj
ectives.Ap ractica
llimit
ationw i isa p pr
oachis. ech
oi o fweightsus
ontlIedesigntheyl imittheregionfromwhicht h
es o
lutioncanbeo btained.The
inthemode lT
. hisa pproachh a
sn otbe enc mbrace dw id
ely.Ana lte
mativea pproachof symbolr e pr
e s
entingequalityconstra
intsint heabstrac
tmodeli sh .The remayb e
recogn
izingap rcn e ct
iveands olvingas inglco b
jectiv
cp roblemw ithadditio
nal moret ha
nonee quali
tyc onstr
aintint hedesignp roblcm.A v ec
torr epre
sentatio
n
cons
trai
ntsbasedon ningo ven ctionsc a
nu sua
llyg ene a ccep le for u a
lityconstr
aintsisint r
oducedt h
rought hefollowin
gr epr
esenta
tion.[ ]
8 hl
[
solu
tio
n.Inm ultiobjec
tivep roblen h2.... .andhk:k=1
h
] 2....1arewayso fidentify
ingee quali
tyc o
nstrain
ts.le
depe nden
c eont h
ed es
ig nvaria
blesXi somittedforconvcnien
ce.Notca tthelengt
h
ofth evectoris1
.Ani mportant onf ordistinguish
ingthee q
ualityandi neq
ualit
y
constra
intsisa tt heya rcm nnipul
at eddiffe
rentlyint hes e
nrchf ortheo ptim
al
solutio
n.Thenumberno fdesignvariable
sincp roblcmm ustbeg re
atcr t h
e
numbero fequal
ityconstra
ints1 f
oro p
t i
mizationtot a
kep l
ace
.l fnisc qu
alt o.
1t he
n
p roblemw i
llbes olvedwithoutreferen
cet otheobjec
tive.lnm a
t he
maticalt er
ms
thenumbero fequa
tionsm atchesenumbero fu nknowns.Ifnislessthan1thenyou
havea nov erdet
ermineds c
lo frel
atio
nswhichc o
u ldre
sultinani n
consis
tentp rob
lcm
defi
n i
tion
.Thes c
to fcqual
ityc o
nstra
intsm ustbel in
earl
yi ndcpenden.
tBr o
a dy
l thi
s
8 INTAODUCTION 4
1
.
1 OPTIMIZATIONFUNDAMENTALS 9
F

i
mpli
es y oucannotobta
ino neofthecon
sain
tsf romelemen
taryarithm
eti
c DesignSpace:led e
signs pacees p
acea twi
lb es e
a rc
hedf oroptim
al
o
pera
tion
so nth
er cm
ainin
gcons
trai
nt.Thi
s sser
ves10ensur
ethatthemat
h e
matica
l desi
gnist heE u
clide
ano rC artesia
nn -dimens
ionals pacegeneratedb yt h
en
s
earchfo
rsolu
tio
nw i
llnotfa.T
il h
esetcchn
iqu
esarebasedonm eth
odsf romI
inca
r indep
endentd esignvari
ablsX
e .T hisisag e
nera1i
zatio
no fthet hr
ee-dime
nsion
al
a
lgeb
ra.Inth
estan
dardfor
matforopt
imi
zati
onprobl
emsth
e u a
1it
yconsain
tsar
e phys
icals pacew ithw hich we a refamiliar
.F ort e
nd sig
nv a
riab
lesitisa
w
ritt
enwitha0ont h
eright
-han
ds i
de
.Thismeans eequa
litycon
str
aintinth
c ten-
dimensio
nals pac
e.Thisisnote asytoi magin
e.Ilisa1sonotcasytoex pr
essthi
s
f
ir
stexampl
ewil
lb eexpsse
das info
rmation r oughaf ig
ureo rg raphb ecauseo ft h
eI imita
tiono ft h
e
thre
e-dimens
ionalw o
rld.However ifed :
sig
nv a
riable
sareindependententhe
h
l(X
):f
unl
(X)-500 0 = l
1-dim
ensionalconsid
erat
ionsarem ereextra
p o
latio
nso fth
ee -dimensiona
1real
it
y.
Ofcoursewec annotgeomet
rica1lydefi
nt hemthoughwew il
lb eworkingw it
hthc
I
npr
act
ica
1pr
obl
ems
equ
ali
tyc
ons
tra
int
sar
era
rI
yen
cou
ntc
red
. numbe
rs.Thes ideconst
rai
ntsIm
ii tthesearch gio
nim p
lyingth
atonlysoluti
onsat
l
iew ith
in ac rt
ainregionw i
llb ea cce
p ta
ble.T heyd efi
nea nn-dimensio
nal
rec
tangu
larregion( h
yperc
ube)f romw hichef easi
bleando p
timalsolu
tionsmustbe
Ineq ualltyC onstraints:I nu a1it
yco n
s ai
ntsapp rmorenatur
all
yinp ro
b l
cm
chos
en.Lat e
rwewi ls att hem at
hemat ica
1m odelsinoptim
izationareusual
ly
formulati
on .Inequali
tyconst
raintsa l
sop r
ovidemoref l
exi
bili
tyindcsig
ns e
lec
tion
.
des
cribe
db yn onli
nearrelationshi
ps.1
1 es ol
utio
nst os uc
hp roblemsc anno
tb e
Thes ymbolr epres
cnti
nginequal
ityc ons'a
int
sintheabst
ractmodelis8
.T her
emay
ana
1yti
callypredict
ed t heyaret ypi
ca1lygovemedb yeu nderlyi
ngn umeri
cal
be more o nci nu a
1it
yc ons
train
ti nt h
ed esignp rob
lem. The vector
t
eci queusedt osolv
et h
em.Itisn ecc
ssaryt o(ictthesolu
tionstoana cc
eptab
le
reprsent
at i
onf o
ri n
equa
lityconstr
aintsi
ss imil
artowhatweh avseenbef
ore
.Thu s reg
ion
.Thes id
ec ons
tra
intsprovides readym echanismf o
ri m
plementingthi
sl i
mit
.
[G)[ 8
1 82...81a
/
] nd :j=1 2... ma r
cw aysofi d
enti
fyin
gIheineq
ualit
y Caremustb eta ke
nt h
atthcselimitsarenoti mposedo ver
zeal
ously.Thcrem ustbe
cons ai
nts
.m r epren
tsenumbero fi nequa
1it
yconst
raint
s.AIldesig
nf un
ction
s rea
sonab
l espacefor numer
ica ltechni
q u
e s10oper
ate.
expl
i ci
tlyo rimpli
cit
lyd ep
en dont hedesig
n( orinde
pende
nt)v a
riab
leX.8isusedto
descrihob o l o
ssthunorc qual10)dg rea
lcr 0"e
1 qul
ll10()con
stra
lnts
.
TheStandardFormat:Theab
oved
efi
nit
iosa
n 1l
owu
stoa
sse
mbl
eIh
ege
ner
al
Stri
ctlygre at
er(>)a ndstri
ctl
yI cs
st h(<)a renotusedmuchi noptim
izatio
n
a
bs .
c
tmat
hern
ati
calmode
las
beca use s olut
ionsare u a
11ye xp
ectedt oli
eatec o
nstra
intbound
ary.Int h
e
standardf ormatal
lp robl
emsa rce xpr
essedw i eSr e
lati
ons
hip.Moreoverth
e

1
l

.
right-hands i
deo feSs igni s
O. lei n
equali
tyconst
rain
tf romtheseco
ndexam p
le M
ini
miz
e f
(x.
x2..
.xn)
ftm2(X)iss etu pas
S
ubj
ectt
o
: hl(x"X
2

XII)=O
h2
(x.
x2
.. xn)=0
. (
1.2
)
8
1(X
):n2(X)-1O
h
/(X
I'X
2
..
XI
I)=0
I
n c aseo fineq
uali
tyc o
ns tr
aint
sad ist
inc
tionismadca stow hetherthedcsign
var
iabl
esli
eont h
econst
raintb oun
daryorin int
eriorofth
er egi
onboundedbyE
8
.(X
"X
2.
.Xn)O
con
stra
i .I
nt ft hesetofd signv ar
iabl
esl i
eo nt heb ou
ndaryo fec on
s t
rai
nt
math
ematic
a llyt
hi
se x
pressesef actth
atcons
trainti
ss a
tis
fiedwithst
ric
tequali
ty 8
2(X
I'X
2 Xn)S0 (
1.3
)
isg =O .Thec o
nstrainta c
tsl i
kea nequalit
yc ons
traint
.I noptimiz
atio
n g
m(I
X X
2
..Xn)SO
term
inologyispart
icula
rc onsain
tisrefer
redtoasa nacti
vec o
nstr
aint
.Iftheset
ofdesi
gnva r
iable
sdon otli
eont h
eb ou
ndaryth
atisthe
yliinsid
eer egionofthc
con
str
aint
st heyarcconsid
e dinac
tiv
ec o
nstr
aint
s.M athema
ti ca
1ly
ec onstr
aint lSXjSxii 1
x =
2
..
.n (
1.4
)
s
atis
fiser
e cla
ting<O
o .Ani ne
qual
itycon
sU'a
intc anther
cforebeeith
eractiv
eo r
l
llaJv
ct e. Thesamep
rob
lemc
anb
eex
pre
sse
dco
nci
sel
yus
ingt
hef
oll
owi
ngn
ota
tio
n:

SldeConstral
nts:Sidecon
sai
ntsareanecessarypar
tofthes
olu
tio
nt e
chni
qus
e M
ini
miz
e f
(x.
X2
...
X)
n (
1.5)
es
cia1l
yn u
meric
alonc
s.Theyexpresst h
er angef o
rt h
edesi
gnvar
iabl
cs.Each
de
signvar
iab
lemustb
eb ou
ndb yn
umcricalva1uesforit
slowe
randupperI
imit
.The S
ubj
ectt
o
: h
k(t
x X
2 Xn)=

0k=1
2.
. I
. (
1.
6)
de
sig
n e
rmakesthi
sch
oicebase
donh i
sa n
tici
p a
tionofanacce
pta
blede
sign
. (
X 2
"X ..
XI)S0j=
12
...
.m (
1.7)

d

10 I
NTR
OOU
CT0N
1 1
.
1OP
TIM
IZA
TIO
NFU
NOA
MEN
TAl
S 1
1

xlsxjSx i=1
2
.. n
. (
1.8
) d
E
xpl
oit
ingv
ect
orn
ota
tio
nth
ema
the
mat
ica
lmodeli
s

M
ini
miz (X)
e j [
X]. (
1.9
)

S
ubj
ectt
o: [
h(X
)1=0
] (
1.10
)

(X)
]nS0
t (
1.1
1) h
X10wSXSX
up (
1.12
)

Theabovemat
hem
atica
l model e
xpre
sses f o
llo
win
gst
and
ardf
orm
ato
fth
e
op
tim
iz onp
robleme
xpre
ssedinnat
ural
lan
gua
ge:
F
lgu
re1
.1 E
xam
ple1
.1-De
sig
n01anewb
eve
rag
eca
n.
Minimizetheob
jec
tiv
efu
nctio
n
js u
bje
c o1
tt eqa
ui
tycon
str
ain
ts
min
cqu
ali
ty
con
stra
intswi
thend esi
gnv a
ria
ble
sIyin
gbetwee
np r
cribe
dl
o
werand
upperlim
its
. ~
ma
tcri
alo fthec an
?Whata rclheassumpt
ionsf o
rthcdcsignproblcm?Oneo fth
e
p

ass
umplionscouldbel hatti ssmal
lcnought ob eigno
redint h
cc a
lculat
iono fth
c
J
:
<:

letechni
qucsinisbookw i
llapplytothcp roblemdescri
bcdincabovcf o
r m
at
. volumeo
fs odainec an
.A no t
herassumpt
ionistha
tem a
teri
al qui
redforlhecani
s
Tosolveanyspec
ificdesi
gnproblemitisrequirc
d10r efun
nulatcth
ep roblcmi
nt he on
lythecy
lindr
icalsur
fac
.'hetopandbotlo
mo ft
hccanwi
llbefit
tedwithcndcap
s
abovemanners o m ethodscanb ea ppl
iedd i
rec
tly.Alsoi nthi
sbook the atwp rovideemechanismbyw hichthesodacanbcpow . i snotpartofi
s
tec
hniqu
esa redevelopedprogr
essiv
elybyc onsider
ingt hestand
ardmodelwi dc
signpro
b l
em.I nth
eta ttem
ptatdcvel
opin
gt hema
thema
ticalmodelwec o
uldst
ar
t
ducedelemen
ts.Forexamplet
hu n
constr
ainedp roblemwi
lbee xpl
o dfi
rst
.The ou
tbyc o
nsiderin
gequ titie
siden
tif
ied ov
ea sde1v
s ar
iabl
es:
eq
uali
tyc on
s int
sa co
nsider
edn e
xtfollowedbyt heinequ
alit
yc o
nstr
ain
ts. d
fi
nal
lythecompletemodelT
. hisr e
pres
entsan at
uralprogre
ssionasprio
rknowledge D
esi
gnv
ari
abl
es:d
ht
i
su sedtodevelo
pa ddi
tio
nalcondi
tions n eedt obes a
tisf
iedbyt h
es o
luti
onin
ei nst
ance
s. R
eviewingthestaleme
ntofthedesi
gnp r
o bl
e moneo fthepar
ametersisthecostof
m
ater
ialperuni
ta r
ea isgive
nasl tp
( ersqU8I c
entimete
r.b
isisidenl
ifid C
e .
Du
ringthesearchfortheop
timalsol
utio
ni sq uant
itywillbeh c
ldc o
nstantate
1
.1.
2 MathematlcalModellng g
ivenv a
lue. Note th
atift h
isv al
ucc hangesl hen ec osto fthcc anw i
ll
c
orres
pondin
glyc han
ge.Th i
siswhatwemeanbyad esignp am
eter.Typicaly
l
I
nthi
ssec
tio
nethr
eedes
ignpro
ble
msi d
'O u
cede
arl
ierwillbea
nsl
ate
dtoe
c
hangeinparamete
rswilca
usethesol
utionto c omp
uted.
s
tan
dardf
orm .Them
at ath
emati
calmode
1wi
llf
irs
tbei
den
tifi
ed.These
condpro
ble
m
re
qui
resin
for
mat
ionfro
mac o
ursei
nmechan
icsa
ndm
ate
ria
ls.T
hiss
hou
ldb
ewi
thi
n
D
esi
gnp
ara
met
er:C
.
epurvi
ewofmoste
ngine
erin
gstu
den
ts.
Thedes
ignfunct
ionswillincl
udeec omp
utationoft
hevolumeenclo
sedbythecan
Example1
.1 Newconsumerr
ese
arc
hin
dic
ate
sa
tpe
opl
eli
ket
odr
inka
bou
t0.
5 andt
hes u
rfa
cea r
eao fthecyl
indr
icals
ectio
n.Thevolumeinthecanic
s f2h
14
.le
li
te
ro fsodapopa tat imeduringthesummerm ont
hs.Thef a
bri
c a
tio
nc os
to fthe su
rfa
ceareai
s1td.Th
h ea e
sthc
ticcon
str
aintreq
uire
sath~ 2d.Thesideco
nsain
ts
rede
signe
ds odacanispropo
rtion
al10t h
esurfa
ceareaandcanbee stim
aledal$1.00 on d ia
meterarepres
crib inep r
oblem.Forcompl
elne
ssthesidec
onst
rain
ts
persqua
rem et
e roflhematri
alused.Ac i
rcul
arcros
ss e
ctionisthemostplausi
ble on o t
hervari
ableshavetob epre
scr
ibedbyt h
edes
igne
r.Wec anforma
llysetup
give
ncurren
tloolingava
ilab
leformanuf
aclu
re.F o
raest
heti
cr ea
sonst
l
1eheightmust th
eopti
mizat
ionpr o
b le
m
beatl e
asttwicetl1ediame
ter.S tu
diesindi
cateath old
ingc omfortrequir
esa
diam
eterbetween6a nd9cm.
Figur
c1 .1showsas ket
cho ftl
1ecan.Inm ostprod
uctd es
ignspar
ticu
larlyin
ht
Minimize f(d : C7
) rd
1z (
1.13
)
engi
neri
ngthemodeli seasi
ertod ev
elopusingafigu
re.Th ediametrda
e ndthe
hei
ghtha resuffi
cien
ttod cs
cribetl
1esodacan.Whata boutthet
l1ick
nessto fe S
ubj
ecl
lO
: hMh
t
): 7
rd2
/14-500=0
/ (
1.14
)


3
12 INTRODUCTION 1
.
1 OPTIMIZATIONFUNDAMENTALS 13


g
M.h
.t: 2d-hSO
)

I

4

V
6Sds9; 5s/
ts20; O.OOIStsO.Ol (
1.15
) L

-1
In
tuit
ivelyt he
rci ssomeconcemw itht hep roble
ma se xpres
sedby E q ua
tions

-
(1
.13(1.15 )e venthough descr
iptionisvali
d.Howc ant h
ev a
lueoft hedesign

-
var
iabletbee s
tab1
ished?Thevariati
onintd oesn o
ta 'e
ctthedes
ign.Changingt he
valu
eo ftd o
e snotchange
fhl
orglHence i
tcannotbead esig
nv a
riabl
e.(Note:the

var
iati
oni ntmaya ff
ecttheval
ueo fc.)lfisw ercap r
acti
caldesignproblcmthen
cansh avet ob edesignedfo
ri mpacta nds t
ackin
gs tre
ngth
.I n C etw ill
prob
ablybeac r
iti
caldesignva
riabl
e.T hiswillrequ
ires ev
era d
ditiona
ls clu
ral
co
nstra
intsi nthep ro
blem.Itcouldserveasa ninte
resti
nge x
tensi
ont othi
sp roblem

d
fo
rhomeworko rp ro
jectl eop
timizationproblemafterdroppigt de
n xpr
essing
[d
.h] [ XIX2]becomes:
lg
F u
re1
.2 E
xam
ple1
.2 a
-Cnl
lle
verb
eam
.

M
ini
miz
e f
(XI
X2
):c: (
1.16
)
lntui
tive
lyel ar
gertheva
lueo fF.thegrea
t e
ris c
ro
s
8
-S
ec
l
li
on
a
l
are


=a
necs v
S
ubj
ecl
lo: h
l(l
x Xv:ru/4-500=0 (
1.17
)
t0h
. a
nd
lei.1
t1ca
e
nb i
lyconc
lu deda
ti
fFw a d


si
b selatit
sl owerlimta
i 8lhemasso fthebeamw i
llb edirec
llyproporti o
nal1 0e
g
l(
lXU:2x1-X2S0 (
1.18
) areao fcro
S88cc(
Iun.Not ech
niquesareru
iredfo
.rlh
isconclus
io..Byo
n .urd e
finition
Fi sago o
.dc andid
ateasap arneterrather asad esignv a
ria
ble.S im i
larly th
e
largerthevalu
eo f
L eg ateri
st hemoment Fg enerat
esa bo
utt hec anti
levered
6SX)S9
; 5SX2S20
end.l iswil
lr equi
rea nincr
easei nea reao.fcros
s-sec
tion.The r
e f
ore Lisn o ta
goodc h
oicefo
.red esi
gnv a
riab
l eeithe
ra stheb e
stc hoic
ef o
.ri
tw illb ci lo
. wer
Theproblem p
rese
nldbyE
e qua
tio
.n
s( 1
.16)
(1. )i
18 s m a
thema
ticalmodefo
.r i
Imit.Tor epr
escntmater
ialasadesignv a
riabl
e.wen ecdtou seit
sSlru
C l
uralp ro
pcrties
th
d e
signpro
b l
emexpr
ess
edintheslan
dardformat
.Fort
hi
sp ro
blemnoext
ranco
.u
s inef orm
ulalionoftheprob
lem.T ypi
cally.am a
leria
lisc ha
r a
cleri
zedbyi t
ss pecc
inf
orma
lio
.nwasn dtosetupep roble
me xc
eptfo
rsomegeome
tric
alrel
ati
ons
.

Ex
ample1
.2 A c
ant
ile
verbeamn
eed
s10b
ede
sig
nedt
ocr
yap
oin
tlo
adFa
lth
e
endo
.ft ebeamo
h .flenglhL.Th ecros
ss e
ctionofthebeamwi I
Ib einthes hapeo fthe b
t
le
tte
r1( ferredtoa s 1 b m). lebeams houldmeetp rescrib
edf ail
urecriter
ia. I~ 'l
Thcreisalsoai Imitoni tsdeflec
tio
.n.A beamo fminimummassi s quired1 0b e
digncd.
Figure1.2showsas idev i
e wo
.fthebeamc arry
ingt h
el oadandF igure1 3at
. y p
ical


cro
.s
ss n ofthb en.Th eI -s
hapedcros
ss ec
tionissymmetr ic.Th esymbol sdtw.
br
andrtco
.rrespondtothedep .ofthebcam th
icknessoftheweb w
idt hofthfl an
ge
andthickne
sso.fthef la
nge r
espect
ively
.Thes quantit
iesares uffi
cienttodefin eE 4 t
-W
cro
.s
ss ect
ion. A handbo o
.ko rt e
xtbo
.ok on strcngtho fm a
terialsc ana i d e
dvelopmento
.fthd esi
gnf uncti
ons.Ani mport
anta ssump
ti onforthisp rob
le mis
wew ilbewo
l .r
k in
gw ithint heela
stici
Imito fthcm ate
rial wheret hereisai Inear
re
lat
io
.nshipb et
w eenes tressandt h
estrai
n.AlIo
. fthevariablesidentif
iedinF igure
1.
3w il
ls nglya ff
ectthes olu
tio
.n.Th eyaredesignv a
riable
s .Thea pp
liedf o
.rceF
w
S
i
l
t
la
e
c
l
li
sod
sd
i
c
r
f
i
e
n
c
i
t
t
l
ya
el
f
ys
f
e
u
c
p
tt
cr
h
i
ep
o
.r1
r
.
ob
0c
l
o
.
e
p
m
p
.Sow
erfo
i
rt
l
li
h
t
sl
ebe
o
a
c
m
ati
.S
o
.
h
nL
ou
.Ho
l
. wa
dFLa
bou
n
t m
dthem
at
a
e
t
r
e
i
r
a
i
l
a
?
l

pro
.p
erti
esb einc l
udedasd esignvariabl
es? F
lgu
ro1
.3E
xam
ple1
.2-Cr
oss
-se
ctl
ona
lsh
ape
.
hFdf
15

m
14 INTRODUCTION 1
.1 OPTIMIZA
TIONFUNDAMENTALS

JdJiJdh

t y .E.i Thisisanexamplew i
thf ourdesig
nv a
riab
lest
hre
ei n
equa
litycons
tra
int
s.a n
d



weigh itsvalueofthemoduluso felast
ici
ty tsmoduluso fri
gid
ity.G.it
sy ie
ld

hbMUFF
lim
iti ntens i
ona ndcompr sion
.yie
'd.i
yieldins h yi
el
d.itsulti
matestreng noequal
itycons
train
ts.Oth crvcrs
ionsofthi
sproblemcane a
silybeformu
lated
.
inten
s ion
.ult.andit
sultimat
es tr
engthinshea
r.u
llOptimi l
iontechnique
sidenti
fy I
tcanbereducedt oatwo-variab
lcp ro
blcm.Stan
dardfai
lur
ec r
iter
iawithres
pect
dif
fe ntva 1uesoft h
ed esignvariab
les.IfE ist hev a
riabl
eu sedto p re
sentE tocombinedstre
sscsorp r
i n
cipa
1s tr
csse
scanbcf orm
ulate
d.Ift hecan
tile
vere
d
mate
ri aldes i
g nvar
iabl
ei nap roblem.t he
nitisp oss
iblethes ol
utio
nc an quirea endisb ol
tet
d h
ena dd
itiona
1d esig
nf un
ctio
nsregar
dingboltfail
ureneedtob e
mate
ria 1a tdoesnotexist
a ti.ava
s 1ueofEs t
il
lu ndis
c o
verd.Fora11int
entsand exa
rned.
ppos es.i sisbeyondt hes copeoft hedesig
ner.A g
ain.m at
e ia
r 1asap arameter
makesal otof.sens
eandeo ptimiz
ationp roblemshouldber ein
vesti
gatedifF Exam
ple1
.3 MyPCCompanyh
asd
eci
dedt
oin
ves
t$12m
ill
ioni
nac
qui
rin
gse
ver
a1
orthem ate
ri a
lc han
ges.C o
nclu d
in gfromi sdiscuss
iononm odeling
.t hefollow
ing ncwComponentP 1aceme
ntM achine
stom anufacturedieren
tkin dsofmo eoards
i
Istcanbee stabl
ishe
df o
rt h
isexample: fo
ranewg en
erationofpers
onalcompu
ters.Thre emodelso ft
hesem ac
h insa
e reunder
con
sider
ation.Tota1numberofo per
atorsavail
ableis1 00b e
causcofel oca
ll a
bor
.A f
market lo
ors pac
ec ons
train
tn eedst ob es ati
sfi
edb ecauseo fed if
fer
ent
D
esi
g 1
np e
te
r
s
F..{
L y
.
G
.Y
'e
ld
'
1
y
:ie
l
d'

u
'
1
1
E
1
:
dimensi
onso f s em ac
hines.A ddi
t ina
o 1i nformati
onr ela
tingt oe acho fe
D
esi
gnv
ari
abl
es: d
tw'
b'
r
If machinesisgiveninTable1.1
. ecompanyw i sh
e stodetermi
nehowm yo feach
kindisappro
priatetomaximizcthenumbero fb oa
rd smanufactu dperday.
Inthed evl opmento fthem a
th e
maticalmodels t
andardtechni
cald ef
initio
ns ltisdi
ffic
u1ttouseaf i
gureinth
ispr oble
mt osctupo urmathematicalmode.
lThe
used
. Mucho ft hei nf
or m
at i
onc anb eobtainedf romam echan
icale n
gineerin
g numbero fma c
hineso fcachmodeln ecdstobed eterm
ined.Thi swillserv
ea sour
handbook.Th f ir
std esignfu n
ct i
onis w eightoftheb e
a m.Thisisthep rod
ucto f desig
nv a
riabl
es.L e
tXIr e
prese
ntthn umberofComponentP l
ac ementMachinesof

i!i
yLandAc whereAci sea r e
ao fcrosssect
ion.Themaximums l
res
sduet ob end
i ng ModelA .Similar
lyX2wi1
lbea sso
ciatcdwithModelB andX3w ithModelC .
""
ndc anbec al cu
lateda st h
ep r od
ucto fFLd I2
1cwhereist h
cmomenlo fine
rtia
aboutthcc
m imums
c
h
n
e
t
a
roi
rs
do
tr
e s
ft
si
hec r
n c
os
r
ss
os
e
ss
c
e
t
i
c
o
t
na
io
l
ni
on
se
gt
xpr
h
ea
ess
x
e
i
sp
da
a
sF
r
Q
a
l
c
l
l
e
l
lt
c
ot
w
1
hef1an
whercQci
ge
.The
sfi
rst
D i
gl
lva
riu
ble
s:x
X2
X
3

momento far eaabou tthecen idparall


cltot h
cflang
e.Themaximumd eflec
tion(~) Thei nf
onnati
oninT a
ble1.1isu s
edtosetupt h
ed e
signfun
cti
onsint er
mso fe
ofthebeamwi 11bea tt heendo fthebeamc alcula
tedbyt heexpres
sionFL 3
/3El'Ac
c
f
des
ignvaria
bles
.Ana ssump
lionismadeth
atal
lm a
chinesar
erunforthr
eeshs.The
ofthecrosss e
ct i
ono ft h
ebeami s2brtr+Iw( d-2tf.Thef
) i
rstmomcnto fa reaQcc a
n s
co
sto facq
uisi
tionofthemachi
nesisthesumo fec o
stpermac
hi n
em u1
tipl
iedby
bccalcu
lateda s0 .5bft
f(d-t r)+0 .51w (
0.5d -tf
)2
. F
inall
y. c momcnt of i
nertiai
s n umberofmachi
n e
s( 'Th m
g1
) ach
inesmustsat
isf
yef l
oors
pacccons
trai
nt(82
)
obtai
nedfrom( b112) ( (br-t w) (
d-2 tf)3
/12.I
) n f ollow
ingforconvcnience whichisd e
finedwithou
td e
tai
lsinE .(
q 1.23
).Thec o
nst
rai
ntont h
enumbero f
wew il
lc ontinu etou seAe Q c'andinstcado fd e
tai
1ingt h
eirdepende n
ceone opemto
rsist h
reetimcs sumofep rodu
cto fthenumberofmach
inesof ch
desig
nv a
1ues.A ssoc iati
n
gx w ithdX2w it
ht w'X3withbrandX4withlrso atX= modelandtheoper
atorspersh
ift(
g3'Theu
) til
iza
tionofeac
hm a
chinei
sthenumber
[
xX2X
3'x 1
4 epr oblemi ns tand
ardf orm
ati s ofboardsperhourt i
mesthenumbero fho
ursthem achin
eo p
era
tesperda
y.Thc
opti
mizat
ionproblemcanbeassembl
edin fol
l o
wingfor
m:

Minimize .
ft
X:Y
) L
AC (
1.
19)
Ma
im
izef
(X)
:18 x55xxl+18x50x~+2Ix50xx3 (
1.2
1)
S
ubj
ectt
o: g(
X)
x
L
:F /
21c
-y
ie
'd~ 0
(
1.2
0) o
r
g
2(

x) .
x
:FQJ1
:
x
2-
1
:i
y
e
e

g
3
(X
):FL
3
c 3m ~O
'/3El T Minimize f(X):-1
8x55xx
-1
8x50Xx2-2
1X50xX
3
0
.
01~ x ~ 0
.25
; 0
.001~ X
2~ 0
.05
; c
Su tt
o: g(
X)
:400
OOOx +6
00.
00
0
X2+700
000
X 2
3~ 1 0 000 (
1.2
2)
0
.01~ X
3~ 0
.25
; 0
.001~ X
4~ 0
.05
g
2(X
)
-
2+X
:3x X 3~ 30 (
1.2
3)

Tosolei
v sprob
le Fmustbcp
m r
esc
ribed(0
1 000N)Lmustb egivcn(3m
). 8
3(X
):3
xI+6
X2+6
x3~ 1
00 (
1.2
4)
Ma
tcr
ia1mustbcse
lecte
d(s
te1:=7860kglm3
e ;Oy
"id=250E+06N/m
e
l 2;
yic
ld=1
45
E+06N/m2)
.A1soth t
emaximumdc1e
cti
onispr
cscrib
cd(amn~ =0
.00
5m ). X
I~ 0; X
2~ 0; X
)~ 0

61'.1.Y:.iK.~
-

Eri-522JJyd
1
6 I
NTR
ODU
CTI
ON 1O
1
. P
TrM
IZA
TIO
NFU
NDA
MEN
TAL
S 17

Equ
ati
ons(
1.21
)(
1.2
4)e
xpr
ess m
ath
ema
tic
alm
ode
loft
hep
rob
lem
.No
te t
in
t
hisproblemther
eisn oproductbcin
gd csigne
d.H ereastrate
gyf orplac
ingorde
rfor
n
u mberofmachinesisbeingdct
ermined.Equatio
n(1.21)illus
t hetr
ans
lat
ion
ofthem i miz
ationobjecti
vei n
toa n u iv
alen
tm inim
i zingo ne.Thei ne
qual
ity
co
nst
rain
tsinE qua
tions(1.22)(
1.24)arediffe
rentfromthep revioustwoexnpl
es.
He th
er igh
t-handsideoftheSo pera
torisn onz
ero.Similar
l ythesid
econst
rai
nts
ar
eb oundont hel o
wers id
eo nly
.T hisisd onedel
iber
ately.The reisas i
gni
fic
anl
di
ffer
encebetweenisp roblemandthepreviou
st wo
.Alloft hede s
ignfunc
tio
nshere
ar
eline
ar
.T hisproblemisc1ass
ifi
edasal inea
rprograrnm
in gpr o
b le
m.Thes o
luti
ons
1
0t he
set ypc
so fp roblemsa reveryd i
f f
ere
ntt hanthcs oluti
o n10t h
cf i
rs
tt wo
cxam
plswhicharere cog
nizedasnonlinarprogrammingp r
ob lms.

1
.1.
3 Natureo
fSo
lut
ion

leecxa
rnpI
si
ncprev
iou
ss e
cti
onar
cusedtodi
scu
ssenat
ureofs
olu
tio
ns
th
eopt
imi
zat
ionpro
ble
m.Exa
rnp
les1.1and1.
2d c
scri
beenonl
inrprogr
amming
pro
blc
mwhi
chform
sthem
ajorp
artofisb
ook
.Exa r
npl
e1.3i
salin
ca
rprogr
ammin
g 9
p
roblemwhichisverysig
nif
ica
ntindcci
sionscic
nccsbu
tra i
np ro
ductde
sign
.It
s
i
n1u
c si
o nherewh
ilen e
cess
aryforcomp
lctcne
ssisalsoimp
orta
ntforunder
stan
din
g
c
ontem
p or
aryo p
tim
izatio
nt e
chn
iquesfo
rnonlin
earprogrammin
gp r
oblc
ms.Exarn
ple
s
5 6
1
.1and1.2a de
al
twithft
rS
t.Bet
w ee
nthelwowenoti
cetha
tExar
nple1.
1isqu
itesi
mpl
e
r
ela
ti
vetoExarnpl
e1.2.Secodt
n
hef
ourva
riab
lesinExample1.
2makeitdif
fi
cul
ttous
e F
lgu
re1
.4 G~hlI r
epr
ese
nta
tio
n01E
xam
ple1
.
1.
lu
i
1 s
tra
tiontoest
abl
ishsomeofthcdi
scu
ssio
n.

SOLUT10NTOEXAMPLE 1 .1 Thcs impl


cstd eterminationo fnonli
near
ityis boo fthes
cf u
nctions
. le u al
ityconstr
aintglisl i
nc
ar
.l nE quatio
n( 1
.18)isis
throughag ra
phical P sentat
iono fcd c
signf u
nctionsi nvol
vedi nthcproble
m. evi
dentbausethedesi variablesappcarbyemselveswithoutbeingraised10apow c
r
lisc anbed onc si
lyf orO Deo rt wov aria
bles
.I fthef UDCti
ODd oesnotplotasa o1.Aswed evelopet e
chniquesforapply
ingoptim
izationisd is
tinct
ioni
s
str
aightlin
eorap lane
e nitisn onlincar
.F igu 1.4s howsat hree
-dimcns
ionalplo
t impo
rtanttok eepi nm ind.I ti sa ls
os ignif
ican
t g raphi
calr epresentati
onis
ofEx amplc1.1
.Thef igureiso b
taine dusingM A
T LAB.C hapter2willproviddct
ail
cd
typ
icall
yrestr
icte
dt ot w
ov ariables
.F orr eev a
riab
leswen eedaf ourthd im
e n
sion
ins
tructio
nsfordrawings uchplotsfo rgraphic
aloptimizatio.Thet
n hre
c-dimc
nsion
al 10resolvethei nformaIo
l na n dt hree-
dimension
alc onlourplotsa ren ote asyto

EZ

pr e n
tat
ionofExarnple1 .
1i nFigu re1.4doesnotreal
1 ye n
ha n
ceo urunde
rstandi
ng i
IIu
str
ate.Thep owero fimagina ti
onisn ece
ssarytoovercomes ehurdles
.
ofthep rob
lemort h
esolution.Figure1 .5isanaltemater e
p scnt
ationoftheprobl
em. 1 probl
emr ep
rcsent
edi nFi gu
re1.5p ro
vidcs oppo
rtun
itytoi d
entifythegrap
hica
l
Thi
si sth on
ee ncouragedi nthisbo ok.Thch orizo
ntal i srep s
cntsthediamet
er sol
ut
ion.Fir
stt
hefeasib
lere gionisiden
tif
ied.InFigur
e1 .
5i si
sE u alityco
ns in
t
(X
I)a nd v e
rti
cala xi
seh eight( xu.1 nFigure1 .5t heequalic on
strai
ntis [~
abovetheincq
uali
tyc onsi ntB
. o
thf eibl
ea ndo p
limalmusto ccurfro mthi
s :g
ion
.
mark cdappr
opri
atelyash1.Anyp r o
fv aluc
so ni slinewillgiveav olumeof500 5 Anys ol
utio
nf r
o misr eg
ioni sa nacceplab
le(s i
ble)sol
ution
.T herea r
eu sua
llya
cm3 Theinequa/
ityconst
raintisshowna sg1.Th epairofv alue
so nthisli
neexac1
ty lar
gen umberofs uchsolutions infini
lesolutio
ns.Ifopti
m iz
ationisi nvolvedthc
n
sa
tis
f ie
sthcaeseticrequi ment.H as hline
so nthes i
deo ftheinequali
tycons
trai
nt thes
cc hoic
esm ustb er cduce dtot heb es
to new it
h spcctt osomec rite
riat h
e
cs
tablishthedisallow
e d gionf ort hedes i
gnv a
riable
s.l econstr
aintsaredrawn obj
ecliv
e.1nthisproblemlfigur et
hes mall
cstv al
ueo ff
isd es
ired.Thel owes
tv alu
c
thi
ckerf o
remph is
.Thes caled0' ecl
iven Cl
i o
ni sr e
pr
en dt hr
oughsevcr
al offisj us
tlesst h
ant hec ont ourvalueo f3 08
.ltisa tei n
tersect
iono ft het w
o
lab
el cdcont
our.E
s achc ontourisa ssoc
i at
edw ithax e dv a
lueo ft h
eo bj
ccti
ve con
strai
nts.Whilet hev alueo ffn eedst ob ecalc
ulate
dt heoptimalv aluesoft h
e
fun
ct io
na ndt h
esev aluesa reshowno nt h
ef igu
re.l er angeoft het woaxes desig
nv ar
iabl
es r
eadf romt hef i
gureareabout6.75and1 3
5
.r espec
tiv el
y.A nother
es
tablishe
sthesideCOll
Stra
ints.Theo bje
ctivefunctionfandt heequa
lilycons
trai
nth1 sign
ifica
nti t
emo fi n
formatio no btain
edf r
o mFigure1.5i s g li sa nactiv
e
'
cn online
arsinc
ct he
yd on otplotII
Ss tra
ightlin
es.RcferringtoEquations(1.
16)and cons
trai tW
n. hi
l et her
ea rei nfin
itef ea
siblesolut
ions10t hcpr oblem th
eo ptima
l
(1
.17) t
hi
sissubs
tantiate
db yt hepl'OduCI
So fthetwou n knowns( de
signvar
illb
les
)in solu
tionisUlt
ique.
18 INTROOUCTION 1
.
1 OPTIMIZATIONFUNOAMENTALS 1
9

20
8
3(X
):3
xI+6
x2~ 70 (
1.2
8)

X1~O; X2~0

Ani n
teres
tingobservatio
ni ntheaboves etofe quat
ionsisa tthereareonly
two designv aria
blesb utt hr
eec ons
train
ts.T hisi s av al
idp roblem.I fthe
con
strain
ts were e q
ualityc o
nstr
aintsent his would notb e an acceptab
le
problemd ef
initio
na sitwouldv iolate er el
ationshi
pb etweent h
enumbero f
vari
ables and the numbero fe qua
lityc ons
traint
s.T herefoet
r he numbero f
{EHU}-Z

ineq
ualiconstraint
sa renotrela
tedtot h
enumb rofdesignvaria
blesu s
ed.This
fac
ta lsoa p
pliest ono n
linearconstr
nint
s.F igure1 .6isas cale
dp loto fc

Jtub//drvdrfLb
34

func
tions(1.25)(1.
28).Choosingt h
ef i
rs
tq uadrantsat
isfi
esthesideconstr
aint
s.
hel
' in
eari
tyo fal
lo ft h
ef un
ctionsisindicate
dbyt hestra
igh
t-lin
ep lot
sont h
e
fig
ure.Againsever
alc ont
oursoffareshownt oaidt h
er ec
ogniti
ono f
th esol
utio
n.

ff/yJX
Alloft h
ei ne
qualit
iesaredrawnw ithh ashmarksi ndica
tingthenonfeasib1
es id
e
oft h
ec onstr
ain.
tThef easi
bleregionise nclosedbyt hetwoa xesa longw i
th
con
strain
tsg2andg3'Theo bjec
tiveistoincre
as thevalueoff(whichisindicat
ed
byt hecontourl e
vels
)w ithoutleavingthef e
asibleregion
.Thes ol
utionc anbe

H137
5
6 6
.5 7 7
.5 8
.5 9
d
lam
ele
r(c
m)

Agure1
.5C
onl
ourp
lo
l01E
xam
ple1
.1
.

SOLUTIONTOEXAMPLE1 .3 Inc o
ntra
sttoExample1 .1a
llo ftherela
tion
ship
s
in m a
themati
calmodele xpre
ssedbyEq uat
ions(1 .
21)(1.24)areline
ar.The
wordequatio
nisgener
allyusedtodesc
ribetheequival
enceo ftwoq uan
titi
esone i
ther
sid
eo fthe= sig
n.Ino p
tirn
izat
ionwecomea crossmostlyi nequa
liti
es.eword
equ
atio
llwillbe edtoi n
cludebothofthesesitu
atio
ns.I nExample1.1ena

ofsolut
ionwase xp
lainedusingFigu1.5 .InExample1 .3t hep se
nceo fthr

desi
gnv a
riabl
esdenie
si sapproac
h.I n
steadofd es
igninganewp roblemsuppo
se
thecompanyp s i
denthasd idedtobuyf ivemachin eso fthethi
rdt y
pe.The
mathem
aticalmodelwithtwod es
ignvariab
lesXla ndX2'isr econs
tructe
du sin
gt h
e
info
rmationth
atX3isnowap a
rameterwiththevalueo f5.S u
bstituti
ngforx3int h
e
modelforExample1.3andcleani
ngupt hefir
stcons in:
t

M i
miz
e j
(X)
:90XXI+9 xX2+5
9 250 (
1.2
5)

S
ubj
ectt
o l):O
: g .4l+0
x .6x .
5 (
1.2
6) 5 1
0 1
S 20 2
5
2~ 8 n
umb
er0
1Mo
delA

g2(X):3
xI-X2~ 25 (
1.2
7) F
lgu
re1
.6C
onl
ourp
lo
l01m
odl
lle
dExa
mpl
e1.
3.
20 lNTRODUCT10N 1
.1 OPT1M1ZAT10NFUNDAMENTALS 2
1

spot
tcdatthei nt
ersecti
ono fconstr
aintsg2 dg 3.Th ev a
lue softhedesignvari Ics o
fthes
earc
hpr
oce
ssf
orl
ine
arp
rob
lcm
swi
llbee
xpl
ore
dus
ingEx
l
ple1
.3and
atthesolutioncanb er eado fffromt hcpl .I
ot tisn oto veryet.Beforeproceeding F
igu
re1
.6.
furt
herilisneccssaryt oacknowledgct ha
tas olutionof6 .5machinesf orModelB
isunaccepta
ble.Thes olu
tionmustb eadj u
st e
dt othen carestinteg
erv alu
e s.I n Nonll nearProb/ems:Exceptf oraf ewc1assesofp roblcmssol
utionstonon1inear
aCl
ualp rac
tice.t h
isa djustmcnth ast obcmadew ithoutv iola
tinganyo ft he problemsa r
eo b
t ainedt hroughn umericala nalysis
. Through c omput rc ode
con
strain
ts.Then eedf orintegervariablesisa ni mportantc o
nsider
ationind csign. numerica1a n
alysi
sbecomesn umc ricaltechniques.Them etho d
so rt echniq
uesf or
V a b
les atar quiredtoh aveo nlyintegervaluesb elongto et yp
eofv ariables fi
nd i
ngt hesoluti
o ntoo ptim
izationp rob1e msarec al
leds earchmethods.I napplied
cal
leddiscr
etev a
riable.
s hi
' sbookmost 1yc onsid
er scontinuousvaria
bles.Almosta 11 mathematicsa ndn umericalth niq u
est hese refer
redt oasi te
rati
vet ech
niques.
ofthem athematicsa ne ng
i n rencountersespeciallyacad emic
allybelongt oE Impli
cit
1yt h
ismeanss evemlt rie
sw illben ecessaryb eforct hes o
lutionc a
nb e
domaino fcontinuousvariab
les.Thca ssumptiono fcontinuityprovidc
sv eryfastan d ob
ta i
ned.A 1soimp liedisthatcac htryors earchise xecutedinac onsist
entm anner.
cff
ici
cntt ech
n iq
uesf ort hes earc
ho fc onstrainedoptimums oluti
onsaswew ill Informationfrom p reviousiteratio
nisu til
izedint h
ec omputationofv alue
sint he
developint h
ist x.
etManyr ea
l-i
Ifcde si
gns espe
c ial
lyt hoset h
atu s
eo ff-t
he-shelf pre
s e
nts equenc
e.T hisc o
nsistcn
tmannero rp ressbywhichthesearchi scarrie
do ut
mat
erialsa ndc omponentsd etermined i
scretem odels.D iscreteprogramminga n d and s olu
tiond eterminedi sc a
1ed a lg
orithm.T hist erma 1soreferstot he
int
egerprogramminga red iscip
linesthata ddresst hesem odels.Then atureo f t
r slati
ono ftheparticul
arsearchp rocedurei n
toa nordereds u enceofstep-bys
tep
sear
chm ethodsa tismetho dsus e
df orse a
rchingeo pti malsolu
tionindiscrctc act
ions.Th ea dvantageisd erivedm ostlyi nthec onversiono fthesestepsthrough
prograrnmin
gi sveryd i
fferentf roma tinc ontinuousp rogramming.Manyo ft h somec omp uter1anguageintocod ea twi1
le xecuteonec omputcr.D evelopingE
methodsa reb ased on t hes canning and r eplacemento ft hesolutio
nst h r
ou gh a
1go rithma ndtra
n s1
atingitintoc odethatwi l
e xecuteinMATLABwi l
beas t
andard
exha
uslives e
a rc
ho ft hed esignsp a
cei nt hed esignr e
gion.I nt h
isbook disc tc approachini sb ook.
problemsarctypica
llyh andleda siftheyw erec ontinuouspr ob
l e
ms.Thec onversion Thes ea
r c
hp ro
c essisstar
tedty pic
a
1ybyt ryi
ngt oguessthiniti
aldesignsolutio
n.
toed iscr
ctes o
lutionisthef in
alp a
rto fthed esigne f
fortandi susual
lyp erforme d Thed esignerc anb aset h
iss electio
nonh i
se xperience
.Ons evcm1o ccasio
nst he
byt h
ed esignero u
tsido fa nyoptimizationt echniquewed evel
opi nt h
isb ook. successofo pti
mizationmayh ingeonh isabilit
yt ochooseagoodi n
itia
lsoluti
on.The
Chapter8d i
scussesd iscr
eteo ptimizatio
nw i
t hexa mples. searchmethod e
v enwhenu sedc on
sistent
1y respondsd if
ferent
1yt othep a
rticula
r
pro b
le ma tisb eings ol
ved.Thed egreeandt ypeo fnonline
aritymayf requent
1y
Gettingb acktoel inearprogrammingp roblemjus
td iscu
s sd
e itsh ou
lda ls
ob e cause e method t of a
ila ssurningt herea re no i nconsi
stencie
si np roblem
notedthatonlytheb o
undaryo ft h
ef ea
sibl
er egio
nw il
la ff
ectthes o
lution.He i
sa formu1at
ion.O ften numbero fdesignva r
iablesenumbero fc ons int
saswe1
wayt h
atw i
llmakei sappar cn.
tNotethattheobjctiv
ef u
nctioncontoursarstrai
ght as ab adi ni
ti
alg uessp 1ay ap a
rti nu nex p
e c
te db ehavioru nders ta
nd a
rd
li
nes
.Ad if
feren
to b
jectiv
ef uncti
onwillbed is
playedbyp ara
llelli
neswit had i
ffer
ent imDlementationo ft hem ethod.T hish asl edt ot h
ec reationo fs evemld i
ffercn
t

pd
yd
techniquesforo p
t imiz
ation.P r
actica1ex p
e rie
nc ebasa 1sos u
ggested atac lasso f

eIin

sl
ope.I maginethes esont h
ef i
gureinstea
do ftheactl
lalobjec
tive.Notea tthe
sol
utiona l
waysa pp
earstolieatthintcrs
ectio
no ftheconstr
aintsth
atisthcorners
d
ydp
d pro bl
e msrespondw elltoc e
rtaina1 g
orithms.
Them cthodsf res
o ea
rcho ritmtivem ethods.a recurrent
1yt heon l
ywayt o
d

ofthedsignspacc
.S o
lutionc annevcrcom frominsideofthefcasib
le g ionun
like

huuk xydyM

inthen onl
inearprogramming p roblemwhich accommodates s olution on the imp lementnumericals olu
tionston onlinearprobl emsir
respec
tiveofthediscipl
inein

boundarya ndfromw it
hinth efeasi
bleregi
on.R ecognizingthcn a
tu o fsoluti
onsis w
hi cht h
esep roblemsapp r.1 ep roblemsa rep1enti
fu1i ndesigno p
t i
mization
.
dr

impo
r t
anti nd ev
elopingas earc
hp roce
dure.F orexamplei nl in
earp rograrnming optimalc ontr
o1.s tru
ctura
la n dt1uidm echanics.quantump h
ysics.a nda st
rono m
y.
Wh i
1eoptimizati
o ntechniquesarea ppli
ed a l
lo fthen o
tedd is
cipli
nes.in ditiona
l
i

problemsatechniqu
eemploycdt osearc
hf orth
eo ptimaldsig
nn eedo nlysearchthc
boun
d a
riesp ar
ticu
larl
yt hei ntcrs
ecti
ono ft heb ound
a r
iesw hereas n onl
inear design
problemsthesear
chp roc
edu recannotignoreinte
riorvalue
s.

1
.1.
4 CharacterlstlcsoftheSearchProcedure

l
ese
arc
hfo
rth
eop
tim
als
olu
tio
nwi
lldependonen
atu
reo
fth
epr
obl
emb
ein
g
s
olv
ed.Fornonl
inea
rprob
lems
itmustcons
i d
erthef
actt
hatso
luti
oncoul
dliein
sid
e
t
hefeas
iblereg
ion
.Example 1
.1throl
lghF i
gurc1.
5w i
llp r
ovideec on
textfo
r
d
isc
ussin
gt h
escar
chpr
ocedu
refornonl
incarpro
blem
s.Sim 1
i
arIy
thec
hara
cte
ris
tic
s
22 INTRODUCTION 1
.1 OPTIMIZATIONFUNDAMENTALS 23

2
0 a
tad i
stan s S
..T hispointsat
is
fie
st h
ec o
nst
rain
th .Ai
. rds Yw ouldbeto
ch
ooscX .Thi
sl i
eso nthecons
trai
ntb o
undaryofg..ltist ob en otedtha
tallE
sa ren
:
r
;
-
:.
ch
oice otfeasi
ble.Whichp oi
ntischoseni
sd c
ci de
db yt her u
lesofap a
rti
cul
ar
al
gori
thm.Assumep oin
tX )isthenextpoi
ntinisdiscussion .
Poi
ntX )nowb ecomes newp oi
n x
o
t Anew hd ir c
cti
o n~ isdennin.
Po
intX2is10 d.Ano th
Su enc
eofcalc
ula
tion
slocat X3 le n
extite
rat
io
nyiel
ds
esolu
tion
.Thee ss
e n
ceo fupda
tinged e
si duri
ngs uc s siv
ei te
rat
ionli
esintwo
ma
jorc o
m p
utationsthcsea hdi
rec
tio
ll8/andstep
size.l Cc hangeined esi
gn
ve
cto
rdefin
I as.6
Xw h
ichr ep
res
ent
s veclo
rdiffcre
nce f o
re xnpleX2- X.i
s
{ESEmgz

ob
tain
eda s
S/.F oreachiter
ati
onth
ef ol
lowi
ngsu e
nc eofact ivi
tycanb eide
nt
ifi
ed:
8
tep0
: ChooseXo
S
tep1
: Id
ent
ifyS
Det
ermin
e
AX=S
XM W=Xo+.6X
StX
e oXn en
GoToStepO
Theaboveisthebas
ics t
ruc
tur
eo fatyp
ica
lo p
timi
zationalgorit
hm.Ac om
plete
onew i
llindic
ate m nerinwhichSa ndarec omputed
.I lwil1inc
Ju d
et e
st
s
5
whi c
hw il
ld ete
rmincif solut
ionhasb ce
nr eache
d( convergen
ce)o rifthe
6 7
.5 8
.5 g procedur
en e
edstobesuspende
dorrest
art
ed
.Thed if
fcre
nttech
niq ue
stob expl
orcd
d
la
mo
le
r(c
m) i
nt hi
sb ookmost
lydif
ferinewaySi sest
abli
she
d.Ta kealookatFigure1.7aga
in.
F
Jgu
re1.7 At
yp
ic
als
sar
chm
eth
od. AtXot he
reareinfi
ni
techoice
sf o
rt h
es ea
rchdir
ect
ion.Tor eacht h
es olu
tionin
o n
abletimeanacc
epta
blealgor
ithmwi
lltr
yn o
ttosearc
ha l
o ngdir
ecti
ons d o
noti m
provethecur
ren
td e
sig.l
n e
rearemanyw aystoaccom
plis hisstrat
egy
.
i
ni
tia
ls tartin
g e ssisep o
intm arke x
o
d Remember whens o lvi
n g
o
ptimiza
ti onprob
lem.suchafiguredoesnot is
t.Ifi
tdide nwec aneasilyo bt
ai n L
inearProgrammingProblem:I
twa
spr
evi
ous
lym
ent
ion
ed t
hes
olu
tio
nto
t
hes o
lutionbyi n
spec
tio
n.l i
sstatemen
tisespcci
allytrueif eea
r r
emoret ha ntw o sepro
ble
msw o
uldbeont h
eboun
daryo
f fea
sib
le gio
o( a
lsocal
ledthe
v
ariab
les
.I ntheeventth aret wovaria
blesi sn or e
asonn ottoo btai
na jib
led
oma
in) nF
.I igu
re1.6
e esa
ndsomeofth
ec o
ns in
tsdete
nnin
et h
is
g
raphicals olu
tion(Chapt
er2 )
.Thcm ctho
dsi no pti
m i
zationr el
yo nt hcd irc
ct reg
ion
.Thel
alt
eri
sdi
sti
ngu
ish
edal
sobyep
oint
sofint
ers
cct
ionofth
econs
trai
nLs
e
x p o
lationoftheconce
ptsandi dea
sde v
elo df o
rtwov ariab
lestoa nyn umb ero f amongthemse
l vseo
e ri
ginandeinters
ecti
onofthebindi
ng(ac
tiv
e)coost
rain
ts
d
esignvariable
s.Thatisthereasonwew illuset wovariab
lestod is
cussa n dd es
ign wit
htheaxe
s.T hesearev
ert
icesorco
rnersofthequ
adri
lat
eral
.Esse
nti
allythedes
ign
mo
sto fthea lg
orithm
sandm et
hods.M oreoverus
ingtw ovariab
les
c onc eptscan impr
ovesbym ovin gfromoneo fth
esevert
icestothenextonethro
ughi mprov
ing
a
lsober e
i n
for dusin
gg e
ometry.Thed es
ignatt h
ep o
intXoi snotf e
asib
le.l tisnot fe
asi
bledes
ign
s.Tod oth
atyouhavetost
artatafea
silc
b omer.Thi
swil
lb eexplo
red
u
sefultod iscu
ssw heth
eritisa no p
timalsoluti
on.A tleasto n
emorei tera
tionis moreful
lyinthechapt
eronlinea
rprogra
m ming ti
.I stobeemphas
ized atonl
yw i
th
n
ecessar
yt oo b nthesol
utio
n.C onsi
deren extsol
utionatXI .
Mos tm etho dsin twovari
abl
esc anwea ct
ual
lyseethegeometri
ciIu
I st
rati
onofthetech
nique is
o
ptimiz
ati o
nw i
llattem
pttomovet oXI byfi
rs
ti d
entif
yingas e
a r
chd i
rectionS1This th
eselec
tio
no fver
ticesa
sthes o
lut
ionconve
r g
es.
i
sav ec
tor( samedimens
ionasd e
signvariab
lev c
ctorX)p oi mX oloXI e Thi
spartofChapte
r1h asd
eal
twiththeintr
odu
ctionoft
heopt i
onprob
lem.
a
ctu
ald istanc
ef rom t oXI c
ax
o
l
li tXoX..issomem ult
ipleo fSI's SIX10 nce Whil
eitwa sappro
achedfromanengin
eeringdes
ignp e
rsp
cct
iveth
emath
emat
ical
a
gainisn o
tf eas
iblealtb
oughiti sani mpro v
em e
nto n s x
o
inc
eits atis E modli
e nabstr
actters
m i
snotse
nsi
tiv
et oanyp tic
ul
ardis
cip
lin
e.Af ewde
sign
i
ncqua
lilyc on
str
ainlg ly
l( inginlheinle
rio
ro fec on
strai
nt).Alt e
mately usinglhe ru
le
sw i
thr es
p ttospe
cif
icexamp
lesw ereexamin
ed.TIl
es t
anda
rdmath
emat
ical
sa
m escac
l
' hdirc
ctinS1
o ano
thertechniq
ueJme odmayc hooseforit
snextp ointX1' mode
lf o
ro pt
imiza
tionprobl
emswase s
tabli
she
d.Twob r
oadcJas
seso
fp r
obles
m

.1"
"':
-..
.
..
.
1:
n' '

2
4 I
NTR
ODU
CTI
ON 1
.2 I
NTR
ODU
CTI
ONTOM
A11
.AI
I 25

linea
ra ndnonline
ar.w erei ntro
duc.T hegeome ic
alchara
cte
risti
cso ft hesol
ut ion 1
.2 INTRODUC
TlONTOMATLAB
forthes
cp roblemswe res h ownr ough g raphic
ald e
scrip
tionofep roblems.An
overviewo fes e
archt echn
iquesf o
ro btai
n ingthesoluti
ontot hesep roblemsw MATLABisi ntroduccdb yMathWorksInc.asth
elangu
ageforte
chn
ica
lcomput
ing.
alsoiI
Iustra
ted.I tw asa 1som entioneda tes ol
ution
sw er et ob eo b
taine d Borro
wingf romt hed escr
ipt
ionin yo neofit
sm anua
lsMATLABi n
teg
rat
es
numerical
.primari
l yt hroughdigi
talco m
puta tion
. mputationvisualizatio dprogramminginaneas
y-tou
seenv
ironm
entwhere

JA22// J1
Thenumericalm e
t hod susedini sareaarei te
rat
ivemethods
.N umeric alsolu
ti ons prob
lemsa nds olulionsa r
eexpre
sse
dinf a
rni
lia
rmat
hemat
icalno
tat
ion
.Thet y
pic
al
involvet w
oc o mpo
ne nts: a lgorith
mt ha
tw i
lls t
abli
sh i terativ
es e
to f use
sforMA T
I
..ADi nclud


calcu
lati
ons.an dsecond.t hetransl
ationoft hea lg
orithmint
oc omputerc odes.usi ng
aprogrammingl ang 'g
e.T hisfinis
hedc odeisr ef
err
edto s oft
ware.U nt
i lrec
en tly Mathandcomput
ation
i
p
ne
red
n
o
g
i
m
n
i
e
n
e
a
r
n
t
in
ge
l
yF
d
u
O
R
c
T
a
R
ti
A
ona
Nw i
sw
t
e
hai
l
la
It
tl
sp
ePa
r
s
a
c
c
t
a
ic
la
e
.t
n dC
h
ecompu
.Thec o
r
m
put
l
a
a
n
t
g
i
u
o
a
n
g
a
eo
le n
fc
vi
h
r
o
o
i
n
c
m
ew
en
a
ti
s
n
A1g
ori
tllmdevel
opment
Model
ingsim
ulat
ionan
dpr
ototyping
whi c
hitw asdeliver
e da ndp ra
cticedw emai 'amecomputingsystems.Today
es ceneisve rydif
f e
re n.I
t ndi
vidualpersonalc omputersC s)runningWindows Dataan
alys
ise
xplo
rat
ion
.andvisualization
MacintoshLINUXo ro therflav
orso fUNIXo peratin
gs yste
msa renowt heme an s Scientificandengineeringgraphics
fortech
nica
lc omputing.The ypossessmo rep owerthantheoldm a
i na mec omputer s A
ppl
ica
tio
nde
vel
opm
ent
in
clu
din
gGUIb
uil
din
g
andt he
ya reinexpen
s iv
e .Thep owero ftheg raphic
alu se
ri n
terf
ace( GU I)eway
eu serinte
ractswit h ec omputerandes o ftw
areh revol
utionizedth ecre
atio n TheuseofMA T
I..
ABhase xpl
odedrec
ent
lyandsohavei
feat
ures
.Tbisco
nt in
uous
ofs oftwar
et oda. New programming paradigmsa11
y y 0' ec
lo r
ien ted e
nhancementmakesMA T
I..
ABanid
ealveh
icl
eforexp
lori
ngproble
msinald
l i
scipli
nes
programming h a
vel edt onewa ndi mpr o
v edw ayst od e
velops oftware.T oda y t
hatmanipu
1atem athematica
lc ont
entT
. h
isa bi
1
ityismult
ipli
edb yapp
licati
on-
cnginc
crings oftw
arcisc rc
atcdbyB uchg cnc l
'a
lp rogramminglanguagc sI
lS CC++ s
peci
ficsolu
tion
st hr
ought oo
lbo
xes.Tol ea
rnm o
rea bo
utthelate
stMA T
I.
.AB
.its
JavaPas
calan dVisualB asic
.Manys of t
warev endorsdevelopthei
rowne xt
ensiol1s f
eatu
resth
et oolboxe
sc oll
ect
ionofu se
r-s
uppo
rtedarch
ive
si n
form
ati
ona bout
tothestand
ardl angu
a geprovidingac o
m ple1en vir
onmentforsoftwared e
vl opmen t Us
enetacti
vit
ie
sotherf orum
sinfo
rmat
ionabou
tb oo
ksand80onvi
si
tMATLAIla1
byeu se
r.T hism akesi tv eryc onvenientf oru se
rswhoa ren otn eces
saril y h
up:/w
l w
w.ma1hwork s
.c om.
programmerst ogete irj obdoneinar ea
s o
na b1ysho
rtt i
me.
Ones uc
hv endorisMa Wo s wi t h
eirf la
gshi
pp rodu
ctMA TLABa10 ngwit ha
1
.2.
1 WhyMA
11.
AB
?
complementaryc ollectiono ft oolboxes a td eli
vers pec
ifi
cd i
scipline-or
iente d
infor
mation
.I ni sbkMATLABi su s
ede xclusivel
yforn u
mericalsupport.Nop rio r MATLABisas tandardtoo
lf orin'oduc
torya ndad vanc
e dc o
ursesinm ath
ematics
f
amiliar
itywithMATLABi sexpectedthoughf amil
iari
tyw it
hthePCi sr equire
d.L ik e eng
ineer
ingands c
ienc
einmanyu n i
ver
siti
esa round world.Inindus
tryi
ti
sat oo
1
al
lh ig
her-1cvcllan
gu a
ge seffec
tivenes
sw itht hi
snewp rogrammingr esourcecom e s ofcho
iceforre
s hdevelopme
n tandana
lysis
.I nisb ookMATLAB'Sb a
sicarr
ay
witheffo
rtfrequencyo fu se
.o r
igina
lw o rka ndac o
nsiste
ntm annero fapplica
tion. elem
entisexpl
oitedtom a
nipulat
ev ector
sa ndmatricesthatarenat
uraltonumeri
cal
Byt hecndo fthisbo okitish opedt h
e a derw i
llb everyfamilia
rw itht hcu tec
hniq
ues.Int hen extchapte
ri t
sp ower
fu lv i
suali
zationf e
atu
resa reusedf or
gra
phic
alo p
timizat
ion.Iner estoft h
isboo ktheinte
ractiv
ef e
atu
rl dbui
lt-i
n
supp
ortofMATLABa reutil
izedtot ra
nsla
tea1 g
orithmsi nt
of unc
tionin
gc odeina
fra
cti
onofthetimen eede
dino t
herl a
nguageslikeCo rFORTRAN.Toward eend we
wil
linoducetheu s
eo fi
tsOptimi tio
nT oo
l box.
Mostb ookso no p
timiz
ationp rov
idee x
cellntco v
erageo nt e~hniques a
h n d
a1g
orith
msandsomea 1soprovid
eap rinte
dv ers
iono fthecode.Thec odei
s quid

tobeusedinmainfmmEorl egac
ye nvironmentsthatmus tsuppor
tac ompile
rint he
langu
ageec odeisw ri
tte
nw hichisp redomina
n t
lyF ORTRAN.Eachs t
uden
te n
ansl
ate
st h
eo rint
edc od
ei n
toaf o
rrnsui
tableforc om
putation. lenextste
pist o
compil
et heco dedebugc omp
ila t
ione r
rorsr u
n p rograma ndt r
oublhoot
exec
utioncrr
orsb e
foreusef
ul sult
sc anbeo bt
ained
.Ani m
portan
tc on
sider
ationis
thestude
ntise xp
ectedtobec onversa
ntw i thep r
o gramminglangua
ge.W h
i le
FORTRANwasf ormall
yt au
ghttoe nginrsseveraly rsa goisisn olonge
rtrue.
7
-



T

1
.
2IN
TRO
Duc
nONT
OMATl.AB 27
2
6 I
NTR
ODU
CTI
ON

Manye lectr
ica
le n
g inee
ringde partme
ntshavestartedtoe mbraceCa ndC ++.PCsa r
e
gr
eatfort heuseofr ead
y-madea pplic
atio
nses
peciallyt ho
sew i
thGUI
butitsu sefor
programm inginFO RTRANhasy ettotakeof
f.
MA TI.
.ABsu
ffer
sv eryfewoft hesedis
adv
anta
ges.Itsd eiscompac t di ti
s in
itive
t
ol eam.Tomakep r
oblemsw orkr equ
ire
sf ewl i
neso fc odecomp aredt ot ra
ditio
nal
la
nguages.Inst
eado fprogrammin gfromeg r
o undu ps
tanr dMA T
I..
ABpiecesofc ode
canbea dedtogee rimplem entthenewalgorithm.Itavoid
st hesn dard :pr
u:

mpilationandlinks uencebyusing i nt
e
.r et
er.Ano therimp
or tant asoni scode
po b
ilit
y. led ew ri
tte
nf orePCv ers
ionofMA TI.
ABd snoth avetob ec hange
d
fo
rtheMa cint
oshort h
eU NIXsystcms.li
swil
ln otbet r
ueifsystem-dependentr e
source
s
medinec e.Asa niIu
l strati
onofMA TI
.AB'Sl eamin
ga g
ili
ty bo MA TI.ABd
ap
pliedoptimiz
ationarev ere
di nthi
sbooks
o
me thingverydiff
ict aomplishwi
sa
yFORT RANandoptimiza
tionorC++ do pti
mization.F
l e rmo
r eI
A'
..A
Bl ikeCo r
FORTRANisaglob
allyr e
lev
antp roduc.
t

1
.2.
2 M
ATL
ABI
nst
all
ali
onI
ssu
es
1g
F u
re1
.8 MATLABo
pen
ingv
ie
w.
Thisb ookd oe
sn o
tC areify ouarer u
nni ngMATLABo nani n
dividu
a lPCo rMaca
networkedPCo rMac orindivi
dualorn etw orkedU nixwork
statiols
J .MATLABt a
kcs h
'
m
.
careofthisissu.Theb o okassumesy ouh av eaw orkinganda pp
ropriate
lyIicensed cre
atefile
s(orcode )an o
therg rap
hica1windowi sneded.ThisiseMATLABMf il
e
copyo fMATLABi nt hem achineino n to fy ou
.Ony ourpersonalm achinefor editor
/debugg
erwindowa n disshowni nF igu1.10 .Thee di
torusesc o1
0rf o
r
ins
tall
ingMATI .ABf ol l
owt heinstr
uctio
nst h
ata ccompanidtheb o
x .Typicallye enhancingcodereadabili
ty.E achofthe
sewindowsspawna dd
ition
a1d i
a10gboxes(i
f
systemadminist
r atorh andlesn e
tworkinstallat
ions
. n
e
c )if

o
rs
c



.t



t
in
1
g
fi
e
a
t
ur
e
sd

u
I
r


i
i
r
Th
isb oo kusesMA Tt.
ABV ersio
n5 .2(untilC ha
pt e
r4 )andV ers
io n5.3(er e
st
). workspacebrowser.
Version6h asb e e
ns hippingsincethefallo f2 00
0.MA ABversion5.0a nda bove Whileth
isi
sn otsomucha sa nin
stall
atio
ni ssuei
two u1dbeappr
opri
alelodis
cusse
shouldwork.IfMA TI.ABhasc hangedanyb uilt-i
ncommandsi nn ewerversions way kp laI1stow r
i a ndexec MA TI.ABC Gen y erearetwoway sto
theone e dint heb ookitshouldprovidei nformationonthea v
ailabi
lityofn ewer wor k MATI.
AB:i nter
activelya
ndt h
ro ' pts
.Ininter
act
ivemode.rnn1a nds
versi
ono f commands( orl hr
owa ne rrorar arecase
).TheMATLABc odea nd areent
ed d u tedonea tatimeintheMA T
t.ABcOrnn1an
dw indo
w.Once s e
ss10n
examplesw erec r
ea tedo na nInle
lP ent iumP ro2 00r unnin
gt heWindowsNT4 isoverandMA Tt.Be
A xite
d
t her
eisn oinformation1tainedon se
tofcommands
f
.
opera
tings ysl
em .Thee arli
ercodesw erea lsotest
edo naDECAlp haserverru n
ning wereu seda n
dw h atw ork ed( u
nle
ssac hoicew asmadet osavethesessi
on.L
) arge
OSFlV 4.TheMA T
I .
.ABversiononthes erverwas5 .1. e
s a
ue
n sofcOrnn1aI
1dsa reu s
uall
yd ic u
1u
.ok Pac
kof in
E

e
r
ac
Uv
s
e
ss
10
n.
I
no r
ganizat
i onsa ndi nst
iluti
onsMA Tt.ABs oftwareisu sua
llyl icense
do na
4

o
o


p
i
t

subsc
riptionbas
i s.U se r
st heref
oreh avt he1 a
tes
tv ersio
no fthes oftwa
rei nt h
ese
f
il
einMA
TIAB
.
Thisi
sca
lldas
e cr
ip
tm -
f
tl
e
.MostMATLABfi
l lldm-
e f
tle
s.The
sit
uati
ons.Ins u
c hac asethenewv ersi
on( at t imethebookisfir
stp u
blishe
d )wi
ll misam eex t
BIES
ionusuallymservedfo
rMA-
I-L
AB.A
nycodechangEsmemadethmu sh
beV e
rs i
on6( orR el easeR1 2).Thisbooki sba s
edo nV er
sion5( ReleaseRI1).l e eedit
or.thechang
estoef il
es a
vedan
defil
cex
ecudinMATt.
ABag
ain
.Exc
u

t
in

E
g
code d p rogr am minginstruc
tion
si nt heb ooksh o
u1dexecutew it
hoUlp roblem M
ATt.
AB
t
l ghs


cd




p
t

m
l

es



p
i
s
r
e
do
m

1
l
i
n
i
nt h
enewv ersion.I nt h
enewR eleaseR12o nt hePCp 1atformthed efa
ult t
o
re
vertt
oi n
ter
act
ivemodea n ytime
.
appearanceofMA TI
..ABisac ompositeofs everalwindowsp res
entingd i
ffere
ntp ie
ces
ofinform
ation.T hisisshowni nFigure1.8.T hisc b ecusto
mizedt hroughthemenu
b byV iewD esk topLa youtCommandWindowO nlywhicha l
socoponds 1
.2.
3 UsingM
ATL
ABtheF
irtT
s ime
oep
t reviou
s 1 ease.Itisshowni nF igure1.9.l isviewi ss implean dl e
ss
dis
tracti
ngforge tt
in gf a
milia
rw i MA Tl
..A.N
B oteeMA Tt
.ABcommandp rompt MATw i

lb eu s
edinte ive
1yin issec
tio
n. The au.
tho
rv ery n y
s>
i >.T hi
s windowd elive
rss tanda
rdo peratings ystemcommands f ors avin
g r
ecornn1e
ndsahand
s-onappro
achtou
nder
stan
dingMATtAB
. Thismeanstypmgt
te
1
prin
tingopeningf ilesa ndsoo nlhroughmenusa ndacommandb ar.Ino rderto c
odesy ou
rse
lf.I
ta1s
oin1u
c desund
ers
lan
dingth
es y
nta
xr r
or
s an
dd eb
ugginga
nd
28 I
NTR
ODU
CTI
ON 1
.2 I
NTR
ODU
CTI
ONTOMAl UB 29

re
ctr
i ingec o
de.Theaut
horisn o
tawareofasin
gleexamplewhereprogramming
waslearne
dwithoutt
herea
derty p
ing de
.lnisbkMATLABcodesegmentsare
cou
rierfontw
itheb ol
ds t
ylelIsedfo
remphas
izingcommandso roth
erpiecesof
inf
ormat
ion.A n
ythingel
sei sr ecom
mendat
ionssug
gesti
onsore x
erci
ses. The
pla
ceholde
rforcommandisinit
alic
.
i
sisaCla
sstoo
mLice
nsef
Otins
ttuct
iona
lus
eon
ly.
R
eseat
cha
ndcom
etci
alusei
spt
ohib1
ted. l

BeforeWeS
tar
t o
:Theflowingp
unc
tua
tio
n ds
pec
ialc
har
act
ersa
rew
ort
h
Toqets
tat
teds
ele
ct"HAT
LABH
elp
"ft
om.
theH
elpm
enu
. no
ting
:

A
lt e
xta f
tert he% s ignisconsidereda
comment . MATLAB i gn
oresa nythin
gt o
ther i
g h
to ft he% s i
gn.Commentsa r
e
usedl iber
allyi nt h
isbookt oindicat
e
why'sandw hat' so fcommando rcode
usage.Don oto verlookt he
m.Youdon o
t
A havet ocodethemi nhowever prob
a b
ly

twoweeksl ateryouwi
ln otremember
F
lgu
re1
.9 MATLABCommandw
lnd
ow.
whyyoud evel opedt ha
tp ar
ticula
rp iec
e
ofco d
e .

.
J >> Thisist h
ed efaultMATLABpromp .
t

h
.
U

As e m
i colonatt hee ndo fal i
neprevents


MA ABfrome choi ngtheinform
ationyou
ent
e ront hescreen.

Ft
A commaw illc a
u set h
ei nform
ationt o
echo.D ef
aultisacomma.
As uccessiono fthreep e
riodsattheendo f

J-

thel ineinfo rmsMATLAB codew il
l
continuethen extline
.Youc anno
ts p
lit
av ariable name a cross two lines.You
cannotc ontin ueacommentona nother
I
in.
vl

O
ptm1z
i ati
on 11 ~IATtAB Youc ansto
'pMATLABe xecutio
na ndg et
c
A
rEYHHEJr

IJ
'
i o
hn~iley
D
t.P
.Ve
nka
ta;a
J m
enl backthcomm! mdprom pt
bytyping^ c
(Cl
-C) byh01
din
gdown
t
og
eer
.
pL

>> help command_name WilId isplayi nformationont hevarious


wayst hecommandc anbeused.Thisisthe
quickestwayt ouseh elp
.
>> helpwin Opensah elpt extwindowt hatprovides
i

morei nformationona llo ftheMATLAB


resourcesinstalle
dony oursystem
.
1g
F u
re1
.10 MaUabE
dit
or/
Deb
ugg
erw
ind
ow. >> helpdesk Providesh elpu s
i ngab rowserwindow.
30 I
NTA
ODU
CTI
ON 1
.
2IN
TAO
DUC
TlONT
OMA
TlA
D 3
1

Forthos
eo fyouprogrammingforth
ef i
rs
tt i
meth
eequ
altosi
gn(=)hasaverys
peci
al r
el e
vanc
einmat
hema
ticsora
nywh
ereel
se 1u
.Wewi
J s
cital
oti
nth
ene
xtc
hap
terf
or
meaninginal
lprogrammingl a
nguagesi
ncJudi
ngMATLAB.I
tiscal
ledthea
ssig
nment g
ClIer
ati
ngda
taforg
rap
hic
alopza
tio
n.
ope
ralor
. lev a
riab
leont hcIcft
-handsideofthesi
gnisas
s i
gnedtheval
ueofe
rig
ht-ha
nds i
de.Thcactule
a qll
allOop e
rationi
nMATLABisusual
lyaccomp
lishedby AnI ntera
ctl veSe sslon: S MA AB.On PCp rcsstheStartb u
tto
n.Pres
sthe
adoublecqualtosig
n( =
=). Programb utto.P
n r
csst h
cMATLAB' gra
mG rou
p.P ressM A TLAB.TheMATLAB
Commandwindowo pe n
supa ndaf
tersomci n
trod
ucto
rym e
ssagesE w i
llbeaMATLAB
SomeA
ddi
tio
nslFeatures promp
tindi db ydoubleforwardarrow.lisi
s i nd
icati
on MATLABi srea
dyto
aeptyour mmands.Ont henetworkedstio
nst
ypingma tJ
aba tthewindowp r
ompt
shou
lddot hes ame
.N o t
et h
attheMATLABp rogrammustb einthep aa sdefmedi
ne
MA ABisca
sese
nsi
tiv
e.Anai sd
iff
ere
ntt h
anA.Thi
sisd i
ffi
cul
tfo
r
.I
oginor.h fil
e.As kthelabas
sist
antforhe
lp.The s tand
a rdUNIXp r
occd

p
ersonswhoarcu
scdtoFOR
TRA
N.Allbui
lt-
inMATLABcommandsarci
n
t r natthee ndo fel i
ncorb ef
o ecommen tTh
. ecommcntsr cl
at
ctow h
atis
l
owerc
ase
.
bein
gt y
ped dw hatisdisp
layedi
nt h
eMATLABcommandw indow.F I
1frc
c y our
MATLABd oe
sn o
tn e
cdat y
ped e
fin
iti
ono
rad im
ens
ionsta
tem
enttoi
ntr
oduc
e ownvaria
tios.I
S nfat t
c ounde d andreinf
o c ommandsitis commended
va
riab
les.I
ta u
toma
tica
llycr t
esoneonfi
rs
tenco
unte
rincode
.Thetypei
s youmakeupy ourowne xample
soften
.
ass
ignedincont
ext
V
arial namess
b t
ar
twithal
et
te
ran
dco
nta
inupt
o31c
bar
act
crs(
onl
yIc
tt
rs >>a 1.0; b 2.0; c 3.0d 4.0; e 5.0
d
igi
tsandunde
rsc
orc)
. >> why did only c and e echo on the screen?
>> who lists all the variables in the workspace
MATLABu
scssomeb
uil
t-i
nva
ria
blen
ame
s.Avoidu
sin
gbu
ilt
-inv
ari
abl
enam.
>> a gives the value stored in a
Al
lnumbersa r
cs to
rcdi n
tern
all
yu singthelongfor
matspc
cif
icdbyIEEE >>A 1.5 ; variable A
f
1oat
ing-
poi
ntstan
dard
.The senumbershaveroug
hlyapre
cis
ionof16d
eci
mal >> aA % case matters
d
igi
ts.Theyran
ger o
ughlybetween1 0E
- 3
08and1 0
E+308
.Howeveyare >>one a; two b; three C;
di
splaye
ddif
fer
cntl
yd ep
endingont hecont
ext
. >> a ssigningvalues to new variables
MATLABu se
sc on
ven
tio
nald
ecima
ln ot
ati
onf ornumbersus
ingd e
cimal >>four d; five e ; six pi; valueof pi available
po
ints and le
adi
ngsig
nsop
tio
nallyf
or example1-9+9.00.0
01 >> A1 [ab c ;'d e f ] A1 is a 2 by 3 matrix
99.
9999. >> % space or comma separates columns
>> % semi-colon separates rows
S
cie
nti
ficn
otat
ioni
scx
prc
sse
dwi
tht
hel
et
tre
e
forc
xam
ple
2.0
e-31
0 .07
e23

1.732e
+03. >> A1(2
2) accesses the Matrix element on the
l
mag
ina
rynumbersu
see
ith
erio
rjas
uff
ix
fore
xam
plel
i3.
- j
l4 3
e5.
i >> % second row and second column
>> size(A1
l gives you the size of the matrix

Operators:Thef
oll
owi
nga
rct
hea
rit
hme
tico
per
ato
rsi
nMATLAB. > > (rowcolu mIls
l
>>AA1 size(A1l What should happen here?
> > f romprevious satement the size of A1
+ Additi on(wbena ddingm atricc
s/ar
rayssizemustm a
tch)
> > c ontains two numbers organized as a row
Sub action( samea sab ove) > > m atrix. This is assigned to AA1
* Multiplication (the subscripts ofarrays must be consistent when >> size(AA1l AA1 is a one by two matrix
multiplyingt hem)
" >> A1' this transposes the matrix A1
/ Div i
sion >>B1 A1' the transpose of matrix A1
Power > > i s assigned to B1. B1 is a three by two matrix
Complcxc ouga ttranspose( 0 a yt ra
nspo
se) ' A1 *B1 SinceA1 and B1 are matrices this
>> C1 "
> > i 8 a matrix multiplication
Intheca
seofa
rra
ysea
cho fthe
seope
rat
orsca
nbeuse
dw ia per
iodpref
ixedtoe > > S hould this multiplication be allowed?
ope
rato
rfo
rcxampe
l (.*) r(^)o
o r(1). h
asaspe
cialmeaninginMATLAB.I
t > > c onsidermatrix multiplication in C or
impi
1esle
men
t-by-
eleme
nto pe
rat
ion.I
tisus
cfu
lfo
rq ui
ckc om
putat
ion.Ithasno
3
2 I
NTR
ODU
CTI
ON 1
.2 I
NTR
ODU
CnO
NTOMAn.AD 3
3

>> % Fortran > > the index ranges from 1 to 20 in steps of


> > thepower of MATLAB derives from its > > 1(default)
> > a bilityto handle matrices like numbers > > t he loop is terminated with "end"
>>C2 81 * A1 How about this? > > t heprompt does not appear until "end" is
>> C1 * C2 What about this? > > e ntered
>> % read the error message >> plot(sin(0.01*f)cos(0.03 f
))
> > i t is quite informative >> xlabel('sin(O.Ol*f)') strings appear in single
>>D1 1 2]' D1 is a column vector
[ > > q uotes
>>C3 [C
1 D1] C1 is augmented by an extra column >> ylabel('cos(0.03*f)')
>>C3 [
C3 C2(3 :)] Note is an assignment >> legend ('Example')
> > m eans do the right hand side and overwrite the >> title ('A Plot Example')
> > o ld information in C3 with the result >> grid
> > o f the right > > T heprevious set of commands will create plot
> > h and side calculation > > l abel axeswrite a legendtitle and grid the
> > On t he right you are adding a row to current > > p lot
> > m atrix C3. This row has the value of the third >> exit finishedwih MATLAB
> > r ow of C2 -Notice the procedure of
> > i dentifying the third row. The colon Th
iscompletesthef
ir
stsessi
onwi t
hMATLAB.Ad
ditina
o 1commandsandfe
atu
reswi
ll
>> % represents all the columns beencou
nteredthrou
g h
outthebook.Inisse
ssio
ni
tisevi
dent MA.ABaows
l
>>C4 C2 * C3 permissible multiplication ea
sym a
nipulati
onofm a
trice
sdefi
nit
elyi
nrel
ati
ontooth
erprogramm
inglan
guag
es.
> > N ote the presence of a scaling factor Pl
otti
ngisnotdif
fic
ultei
the
r.The sead
van
tage
sarquit
esubs
tant
iali
nth
es u
bje
ctof
> > i n the displayed output op
timi
zatio
n.1 n n ex
ts es
sionwewil1usetheedit
or10I1c
comp
lis
hesame
>>CS C2 * C3 seems to multiplyl thr
oughscr
ip
ts.Thissessio
ni n
troduc
ed
> > I s there a difference between C4 and CS?
>> % The * represents the product of each element MATLABCommandwindowa
ndW
ork
spa
ce
> > o f C2 multiplied with the corresponding Variableassignment
> > e lement of C3 B
asi
cma
tri
xop
era
tio
ns
>>C6 inverse(C2) % find the inverse of C2
A
cce
ssi
ngr
owsa
ndc
olu
mns
> > a pparently inverse is not a command in MATLAB
> > i f command name is known it is easy to obain S
upp
res
sin
gec
hoe
s
> > h elp
whoinv
ersecommands
>> lookfor inverse this command will find all files .
*mu
lti
plic
ati
on
> > w here it comes across the word "inverse" in
> > t he initial comment lines B
asi
cpl
ott
ingcommands
> > T he command we need appears to be INV which
> > s ays Inverse of a Matrix 1
.2.
4 UsingtheE
dit
or
>> % The actual command is in lower case. To find
> > o ut how to use it -Now I
nth
iss
ect
io
nwew
il
lus
eth
eed
ito
rto
t
e dr
unaMATLABas
cr
ip
tfi
l
e.Norma
1y
l
>> help inv % shows how to use the command ee
dit
ori
sus
edt
oge
ner
atet
wok
ind
sofMA Bf
.A i
le
s.1 ef
il
esa
ret
erm
eds
cri
ptf
tle
s
>> inv(C2) inverse of C2 an
dfun
ctio
nft
le.A
s Ioughboofths
efi
Iesc o
n nMATLABcommandsl ik
ee ones
>> for i "' 1:20 wehaveused
theseco
ndtypeoff
i
Iesneed
st obeorgan
izedinaspe
cif
iedforma.
tBo
f(i) i
"'2
;
f
il
ety ssho
uldhavetheexte
nsi
on.m.Althoughthes
ef i
le
sareASCIIt e
xtfiI
e
end ge
nerc.ms
i h
ouldbe edb
ecaeMATLABs hesfo
ri se
x sion
.hisext
ensio
nis
> > T his is an example of a for loop quetoMA.AB.1csc
ri
ptfi
leco
ntai
nsaIis
tofMA TLABcommands areexe d
i
ns e
quen
ce.Thi
sisdiff
ere
ntmt h
einte
rac
tiveses
sio
no fth
eprevi
oussect
ionwhere
34 I
NTR
ODU
CTI
ON 1
.
2IN
TRO
DUC
TIO
NTOM
ATL
AD 35

MA1.ABndedt o chconunandi mmediate


l .Th
y escri
ptfileismoreu se
fulwhen init
senti
rety
.P rio
rtorun
ningthes
cri
ptyouwil
lhavetosav
et h
escri
pteachtime50
therearm anyconun ds n eedt ob eex utedtoa cmplishsomeobjectivelike t hec hange
si nfiJea r
er ec
ord
edand thechange
sa recurrnt
e .Another
runningano ptimiza
tiont e
chnique.Itisimportanttoremembert htMATLABa
a I
l owsyou recommendationistod
elib
era
telym
is'p
esomes t
ate
mentsandatt
empttodebugthe
toswitchba ckinteracti
vemodea tan ytimebyj u
stt y
pingcommandsi neworkspace err
orgeneratedbyeMATLAsdebuggerduri
ng u
tion
.
windowl ikeinep v io
uss ec
tion.
MATLABp rovidesane di
torf orcreatingthesefil
esont h
ePCp latform.T hiseditor C
rea
tin tM

gtheScr -.
fl
le(Thef
oll
owi
ngw
illbet
ype
dls
av i
naf
i
l.
)
usesc ol
ort oidenti
fyMATLABs tatem
en t
sande le
m e
nts.Itp rovidesec urr
entvaIu e
s
ofthev ariable
s( aft
er eya rea vailabl
ei nthew orkspa ce)whent hemousei sov er example of using script
thev ar
iablenamei nthee d
itor.Th el t wowayst oa ccessee ditorthrought h
e A1 [1 2 31;
MATLABCommandwindowont h
eP C.5 t
artMATLAB.T hisw illopenaMATLAB A2 [4 5 61;
Commando rWorkspacewindow.I nt h
iswindowt heeditorcanb es tart
edbyu sin
g the commands not terminated with semi-colon will
themenuo ret ool
bar.On t heF ilemenuc l
ickonNewandc hooseM- f
iIc
. display information on the screen
Altemately c
lickont heIeftmosticonont h
et oo
lbar(et o
oltipreadsNewF ile)
.The A = [A1; A2]
iconf o
rt h
ee ditorcana Is
obep lacedont h
ed esktopinwhichc asethee di
torc anbe B [A1' A2']
starte
dbyd oub
l e
-clickingt h
ei con.Int hi
se ventaMA TlABCommandw indoww il
l C A*B
notbeo pened.Th ee d
itorp rovidesit
sownwindowf orentering s cr
iptstatements
.
Atthisp o
intwea r
er eadytou set h
ee dit
or.Makes ureyou ad commentsand now re-create the matrix and perform matrix
understandthem ast hes
ep rocedu sw i
llbeu s edoften.Usingt hee dit
ori m
plieswe multiplication as in other programming languages
wil
lbew orkingw ithm -
files. example of for loop
Thecommandsa r es amea sin1hi nt
eracti
ves essio
ne xceptthereisnoMATLAB for i 1 3 variable i ranges from 1 to 3 in
promptp refixingtheexpressions.Toe xecut
et hesecommandsyouwi Ilhavet osa v
e steps of 1 (default)
themt oafil.Let u
sc a
llt ef
h ilesc
riptl.m.The.me xtensionn eedno tbet ypedifyou a1(1i
) i;
areu sing MATLABe d
itor.Youc ans avet hef i
leu singt heSaveo rSaveAs end loops must be closed with end

commandfrommoste di
tors.Itisi mport ttoknowt hefullpa t oi sfil
e.Le tus a1
assumet hep athforef i
leisC:OpCbookChl s c
riptl.m.Note epa h ereis
specifi
eda saPCp athd es
cription.Th er ea
sonwen e
e di sinformationist oinfo r
m for i 6:-1:4 note loop is decremented
MATLABwheret ofindef i
le
.Wedoi sineMATLABCommandwindow. a2(1i-3) i; filling vector from rear

Thisimplieswes h
ou dhaveeMATLABCommandwindowo
l pe n.OnPCswes tar
t end
MATLABt hrought heicons
.I nt h
isbookwew illa ccomplishmostt asksbyt ypingin a2
theCommandwindowo rthr o
ughp rog ramming.lnmanyi nstancese rearea ltem
a t
e
creatingmatrix A and B (called AA and BB here)
waysu s
ingmenui temso ret oolb
ar.T hisisl e
ftt other eadertoe xp e
rimenta nd
for i 1:3
discove
r.I nt heMATLABCommandwindowu sea ddpathcommandt oi nform
AA(li) a1(1i); assign a1 to AA.
MATLABo fthel oca
tionoft hefil
e:
AA(2i) a2(1i);
BB(i1) a1(1i);
>> addpath C:Opt_bookCh1 BB(i2) a2( 1i);
end
Thes
cri
ptth8
1wi
llbecr
eat
edands
ave
di t
nSCT l
.mcanber
unbyt
ypi
ng(
not
eth
at
the same can be accomplished by AA (1:) a1
eext
ensi
oniso
mit
ted
)
without the for loop
AA print the value of AA in the window
>> scriptl
BB
who list all the variables in the workspace
Tounderst
andandas
soc
iat
ewitht
heprog
rarnm
ingconc
eptsembeddedin
.thescr
ipt
consider code for Matrix multiplication
pa
rti
cula
rlyforpe
rso
nswihI
t im
itedpr
ograr
nminge
xperien
cei
tisrecommendedto
% which Matlab does so easily
runth
escrip
taft
erablo
ckofst
ate
men
tshavebeenwr
itte
nr a
erthantypi
ngef il
e
36 I
NTR
ODU
CTI
ON 1
.2 I
NTR
ODU
CTI
ONTOMA AD 37

multiply two matrices (column of first marix must C


lea
rst
ale
men
t
match row of second matrix)
szAA size(AA) size of AA
szBB size( BB); 1
.2.
5 CreatlngaCodeSnlppet
if (szAA(l2) szBB(l l
) )
only in column of AA match the rows of BB Int h
iss ec t
ionwew ille x aminet h e0e rt ypco fm-fil whichisc al
1e dt hefuncti
o n
for i ~ l:szAA(ll) m-fil
e.F ort hosef amiliarw i lho therprogrammingl a
ngua g
esI ik eCJ avao r
for j 1:szBB(l2) F'ORTRA Ne sefilesr epresentf unctio n
so rs ubrout
i nes
.Theya repr imarilyuscdt '
O

CC(ij) 0.0; initializevalue to zero handles '


Omes pecifi
ct ype
so fc alculations.Thc ya l
s opr'Ovideawayf orthem odu
la r
for k 1:szAA(l 2) de ve
l op mento fco dea sw ell c od ereuse.T hesec o d
em odulesa r u
sedbyb eing
CC(ij) c CC(i j) + AA(i
k)*BB(k j); callc
do rr ef
crredino thers ectionso ft hecodc sayt hroughas crip
tf ilewel ooke
da t
end k -l oop ea
r l
ier.Thec odet ha
tc allsthcf uncti onm-fileisc a
lledt hecallin
gp rog ram/ c
ode.The
end j - loop essen
ti a
lp ar
a mct
c rsind cvel'p
O ingt hef unct
ionm -filcarc( 1)w h
a tinp u1isnecessa
ry
end i - loop fort hec aIculati
ons( 2)w hats pecificc alculatio
nsmustt akep lacea nd( 3)wha t
end if - loop inform ationm ustber e tumedt ot hec alli
ngp r'
O gr
am .MATLABr equi
r est heSlru
cture
CC ofef unctionmf i
let of ollowap rescribedf ormat
.
Note the power of MAT~B derives from its ability to Wew illu se1hee di
1 0r10d evel'OP afunc1ionm -fi
l etha1wi I
1p crfor map olynomi
al
handle matrices very easily curve
f tI
i. Irequiresas eto f d ata represen1in
gac urvet ha
tn eedst ob efi110
ge1her
this completes the script session wi t heo rdero fthep ol ynomialt ob efit
.T hi sexerciscisc allcdc ur v
ef iuin
g.In
Chapt cr6 s uchap robl emw illb ei den
1ificda s ap ro blemi nu nco n
strained
Savetheabov
efi)e(sc
rip
tl.m).Addthedir
ect
orytotheMATLABpat
h ind
icat
ed optimization.F ornowt h eca l
cul a1ionsn ecessaryt oa ccomplisht hee xerci
sea re
be
fore
.Runt hesc
riptfi
lebyt yp
ingsc
ripJa
t tthecommandpromp tThccommands
. consid eredk nown.Iti nvo
l ve
ss olv ingal ine
are quationw ithenomtalm atrlxanda
sho
uldallexe
cutea ndyoush o
uldfmall
ys e
etheMATLABp romptinth
cCommand right
-h dv cctoro btainedu singt hed a
tap oi
nts.' heou tputf r
o mthem -
fi l
ew i
llb e
window. e coe i cie
ntsr epresentingep o lynor
nial.
Note: You ca
na lw
aysr cver
ttot hei n
tcr
act
ive mode bydire
ctlyen
teri
ng Befo rewes ta
rttod evelopt hec ode th
ef i
rstl i
neo fthisfilemus tb efor mat
teda s
commandsineMATLABwindowa f
terth
epromptI
. ntheCommandw indow: specifiedb yM ATLA B.I nt hefi
rstl ine t
hef i
rs
tw'Or ds ta
rtir
igumef i
rstc ol
u m
ni s
cw ord function.Iti sf ollowedb yt heseto frelump ar a
me ters(r etumva l)
.N ext
>> who en ame( mypoly
f it)'Ofthefunctio nw iththepar ametersp assedtothcf unctionwithi
n
>> clearC % discards thevariableC fromtheworkspace p e ses(XYN). l efilemu stb es aveda sname.m( mypolyfi
t.m).Thecomme
> > use with caution. Values cannot be recovered be 1w
e ent h
efirs
1l inea ndt hefirs1e xecutablcs tatementwi I
1a ppc i fy ou1 yp
eh e
l p
>> help clear Ia
l me ( he l
pm ypolyfi t)i nt h
c Command w indow. The r easonf ort hcn ar
ne
>> exit mypol yfi tm i
. sthatMATLABh asabui 1tinf unclIonp oly
fit.Opent hee ditor10creat
e
thefilec ontainingthef oll ow
in gin formation
:
Thi
sse
ssi
oni
l
1us
tra
ted
:
function returnval mypolyfit(XYN)
Usco
fth
ed
ito
r
Creatingascript

These comments will appear when the user types
helpmypolyfit in the Command window
R
unn
ingasip
cIt
This space is intended to inform the user how to
E
rro
rde
bug
gin
g(recommcndcda
cti
vit
y) interact with the programwhat it does
Programmingconcepts what are the input and output parameters
. Lo
opc
ons
tru
cts
ifa
ndf
orl
oop
s Least square error fit of polynomial of order N
xy - Data found in XY
Loopv
ari
abl
ean
din
cre
men
ts returns the vector of coefficients starting from
Arrayaccess % the constant term
~.
i '~ S~-:t'~!{j!':it~\.J\".'l\"~' ~ ~ f:~' . j~ ;';~E
..

\U! t:J.\i. ~~tn::~!;:)_.~r..i:1 1


:'
. : j'J I

1
.
2IN
TRO
OUC
TIO
NTOMAl1.AB 3
9
38 l
NTR
ODu
cnO
N
end end i 100p

i f the x-points are distinct then inverse is not a
or i 1:N+1
a(i) = 0.0; initia1ize the coefficient to zero prob1em

end
returnva1 inv(A)*b';
sz size( XY);
NDATA sZ(l l); number of data points - rows 0
S
avethefi
l sm
ea y
polyfu
.m.Tousethefunc
tionwewilln eedt
ocrea
tesomex
ydat
a
dthcnca
llthemy
polyf
itfun
cti
on.S MA 1LABi
ncd i
rec
toytm
r ypol
yf
it
.m
xymatrix
r
esi
desin
.oraddthedir
ect
orytoth
ep a
th.IntheM A11.ABCommandwindow
:The
if NDATA == 0 f
ol
1owingcoi
d stype
dinthecommandw indo
w.
fprintf('There is no data to fit');

-
reurnva1 a; zerova1ue returned

a

o

..
10 J )
ryy

oX2
a
return; % return back to ca11ing program



xxx

1

= 4

u
end

==



E

x
x
*

*
+

n
1

A
X
2J


if NDATA < 2*N

J
3
n
e
fprintf'(

M
Too few data points for fit
')
returnva1 a;
reurn >>coeff mypolyfit(XY1 3)
end >> ac ubic po1ynomia1 was de1iberate1y created to
>> % check the results. You shou1d get back

The processing starts here. >> t he coefficients you used to generate the curve
usmuadu

The coefficients are obtained as solution to the >> t his is a good test of the program
Linear A1gebra prob1em [A][c] [b] >> L et us create another examp1e
Matrix [A] is the Norma1 Matrix which contains
the sum of the powers of the independent variab1e >> XY2(:1
) XYl(:1); same first co1umn
O

[
A] is symmetric >> XY2(:2
) 20 + exp(XY2(:1
))

>> n ote the power of Mat1ab - a vector fi11


for i 1:N+1; >> an ew set of xy-data
b(i) 0.0;
for 11 l:NDATA; 100p over al1 data points
>>coeff1 mypolyfit(XY23) cubic po1y. again
variab1e is "11" (e1)(e) >> helpmypoly it
b(i) b(i) + XY(112)*XY(111)^(i-1); >> y ou shou1d see the statements you set up
end 100p 11 >> I n the next exercise we wi11 create a script
>> f i1e that wi11 run a program for po1ynomia1
for j 1:N+1; >> c urve-fittingwe wi11 save XY2 so that it can
if j >= i ca1cu1atingupper diagona1 terms >> b eused again
power (i-1) + (j1);
A(ij
) 0.0 initialize

save C:Opt_bookChlXY2.dat -ascii doub1e


for k l:NDATA; sumover data points this wi11 save the fi1e as an ascii text fi1e
A(ij) = A(ij) + XY(kl)^power; withdoub1e precision va1ues
end k loop
end c10se if statement
T
hi sc o
nc1u
d e
see xerc
isew h
ereacod
esp W w r
itt
ento l
cateE
Ai ) = A(ij) exp10itingMatrix symmetry
end end j 100p
fficientsofthepolynooualusedt
C of
i
tac
urvt
osome d
at
a. et
ypeoffi
l
cist
hc
40 I
NTR
ODU
CTI
ON
1
.2I
NTR
ODU
CTI
ONTOMATLAB 4
1

f
imct
ionm-
fi
le
.Itn beuse
dinace
rta
inway
.lec o
dewas t
edus
ingacub
ic the stri variab1epath wi11 have the path
po
lyno
mia
l.Nonpo
lynomia
lda
tawcea
r 1s
otes
te
d.Thed
atawer
esav
edfo
rla
teru
se
. information the defau1t directory pointed wi11
differdepending on the p1atform
1
.2.
6 Creatlngaprogram
if isstr(file) if a fi1e is se1ected
10adpathfi1e ['load' path fi1e];
h i
ssect
ionaprogra
m will ad datc

a ur
vef
itth
edatausin
gap oly
nomia
l a
nd
1 0adpathfi1e is a st ingvariab1e concatenated
mpare or
igi
nalandf
i dda p ru
llywillbede
velo
ped.Th e t
awil
lber e
ad
with three s trings "10ad " path and fi1e
us
ingaUserIn(UI)windowa ndad i
alogbox
.Th ecodewil
lb edeve
loped a
n ote the space after 10ad is important
s
cri
ptfi
l.Thi
c sgive
susa nop
port
un i
tytorev
is
itm o
stofthec o
deweu s
ed rl
ierfo
r
info
rceme
ntWcw
. il
la l
sous
ethcf u
nct
ionm-f
iIecre
ate
din pre
viousex
erc
ise
. eval(10adpathfi1e);
l
er
s
eve
ralw
aysf
ory
ouo
rth
eus
erst
oin
te
ra
ctw
itht
hec
odey
oud
eve
lop
.1
eva1uates the string enc10sed -which inc1udes the
b
asi
cme
tho
dist
opr
omp
tus
ersf
ori
nfo
rma
tio
nat p
rom
pti
nth
eCommandw
ind
ow.
Mat1ab command 10ad. This wi11 import the xy-data
i
seq
uic
kes
.
tTisi
h spr
oba
blyw
haty
ouw
il
lus
ewhend
eve
lop
ingt
hec
ode
.Once
the data wi11 be avai1ab1e in the workspace as a
ted
h eh asbeentes
td
e
d ep
encli
ngonu s
efuln
essi
tm ig
htb erel
eva
ntconsid
eru si
ng variab1ewith the same name as the fi1ename
moresoph
istic
atedcustomeIemen
tsiIk
ei n
putboxesandfil
esele
cti
onbox
es.lisbook without the extension (this assumes you se1ected
wi
llconti
nuetouset h
eseelement
st h
rougho
utasappro
priat
e.Wh il
eth
ei n
puteleme
nts the xy-data using the fi1e se1ection box)
us i
ni scodearcncwcommands there
stoftheprogramwil
lmostl
yusecommands
t havcbccnintro
dud r l
ie
r.Insuent
ialord
ertheevcn
lsin sprogr
amare
:( )t
1 o newname strrep(fi1e'.dat'");
re
adthe d a
tasa v
edear
lierusin
gaf i
lcsc
lecti
onb o
x(2)torea
deo rd
eroffi
tu s
ing newname is a string variab1e which contains the
anInputdialo
gb ox(3
)t ousethemypoly
fitfuncti
ondcvelope
dinthela
stsect
ionto string file stripped of the .da extension. Thi
obt
at hec f
fic
iens
t (
4)too b
tainec i na
o fth
ef i
tt
cdc v
e(5
)togra
pruca
lly is a string rep1acement command
compa
re o r
igi
nal dfit
t data

a nd(6) tonef it
te
dauracyone fi
m
i
tse
l n ewscrip
tfil
ewillbecall
edprog.
.
.J
1m
j . x eval(newname); assigns the imported data to x
just for convenience. The above step is not
S
tar
tth
ecd
ito
rtoc
rea
tet
hef
il
cca
lldp
e '
necessary

program for fitting a po1ynomia1 curve to xy data NDATA length(x(: 1)); numberof data points
from clear path 10adpathfi1e newname
App1iedOptimization using Mat1ab get rid of these variab1es to recover memory
Dr. P.Venkataraman end

Chapter 1Section 1.2.6 Note: if a fi1e is not se1ected nothing is being
The program 100ks for a fi1e with two co1umn ascii % done
data with extension .dat. The order of the curve is Use of an input dia10g box to get the order
obtained from user. The origina1 and fitted data of po1ynomia1 to be fitted
are compared with re1evant information disp1ayed on PROMPT {'Enter the Order of the Curve'};
the same figure. The program demonstrates the use PROMPT is a stringArray with one e 1e
r
of the fi1e se1ection boxan input dia10g box note the curlybrackets
creating specia1 text strings and disp1aying them TITLE 'Order of the Po1ynomia1 to be Fitted';
as tring variab1e
[fi1epath] =uigetfi1e('*.dat''A11 Fi1es'200 200); LINENO 1 ; a data variab1e
uigetfi1e opens a fi1e se1ection box
checkout he1p uigetfi1e getva1 inputdlg(PROMPTTTLELINENO);
the string variable fi1e will hold the filename
42 I
NTR
ODU
CTI
ON 1
.
2IN
TRO
DUC
TIO
NTOM
ATlA9 43

the input dialog captures the user input in getval this places the string errstr2 which is obtained
geval is a string Array bycombining the string 'squared error' with
check help inputdlg for more information the string representing the value of the error
wherever the mouse is clicked on the plot.
no str2num(getval{l l}); moving the mouse over the figure you should
the string is converted to a number- the order see location cross-hairs
clear strorder titlestr errstrl errstr2 a y x i j
clear PROMPT TTLE LNENO deletingvariables clearNDATA no coeff XY2 file err2 getval
grid
% call function mypolyfit and obtain the coefficients
This finishes the exercise
coeff mypolyfit(x no);
Runt heprogr b
a yfir
strunningMATLABi n di
rect
orywherethesee sar
e.or
generate the fitted curve and obtain the squared

addin
gt hep to1 ate AtecommandprompttypeproLP.The
error programshouldE XEcut
er equ
iringuserinputt h
roughthetil
eselect
ionbOLinput
err2 0.0i '
dia
logandfina
l1yd i
splayi
ngF i
gure1 .1
1.lea ppeancemayb eslig
htlydiff
ere
nt
for i 1: NDATA for each data point depe
ndingo n p la'ormMATLABi sbeingru
n.
for j l:no + 1
MT hisfinishe
st heMATLABs ectio
no ft h
ec hapter.
Tlms ec
tionlIa
si ntrodu
ced
a(lj) = x(il)"(j-l);
A
TLABi nar obu
s tmanner.A b roadmng o fprogmmminge xperie
nceh asbeen
end ml
tlat
edi nt h
isc hapter -
A Hm wcommandsh av
eheni de
ruincdw it
hab def
y(i) a*coeff; he data for he fitedcurve
ex
plana
tionin c omments.Itisi mpo
rtant youu setheOPP t
Olunitytotypein
err2 err2 + (x(i 2) -y(i))*(x(i2)-y(i));
ECodEy ou
rs e
lf;Thatistheonlywayt heuseofMAT1ABw i
llbecomef amiliar
.The
he square error
p
ract
icea1sow i
llleadtof ewersyntaxerr
o T hewrit
ingofc od
ew il
ls i
gnif
ican
tly
end im
provey oura bi
1itytod ebuga ndt ro
ubles
hoo.Wh
t i
leisc hap
t e
re mployeda
plotting
plot (x(:1)x(: )
2 ro'x(:1)
y
b-');
% original data are red o's P
oly
nom
ialc
uref
v I
tofo
rde
r3o
ffi
leX
Y2.
dat
fitteddata is blue solid line 5
xlabel(x')i
ylabel(y');
strorder setstr(num2str(no));
convert the order of curve o a string
same as getval if you have not cleared it
setstrassigns the string to strorder
titlestr ['polynomial curvefit or order'
srorder 'of file'file)i
the three dots at the end are continuation marks
the title will have the order and the file name
title(titlestr)
legend('original data''fitted data');

errstrl num2str(err2);
errstr2 ['squared er or errstrl]
gtext(errstr2); x
F
lgu
re1
.1
1Or
ig
ln
ala
ndf
ll
le
dda
la
.
t

2
J:;
!
. l
;'
fl
. i44uu1uikJt:i

2
44 INTRODUCTION

s
eoa
rat
ese
cti
onont h
eu s
eofMATLABoutofn s
itsub uentchapmMe
y
CMa iz
edbyacompl r at
ionof
theu
sm ofMA.
T
TL
AB
o
pti
miz
a
t
i
o
n.

u
ruu
z;z
tm
PROBLEMS

:; l
r
;
::
;
t; a
mathe
matic
almodeJ.
1
.2 Ide
ntifys
ever
alpos
sibl
eop
tim
izati
onp
roble
msrel
ate
danairc
raf
t
.F ore
ach
problemide
ntif
yaled
l i
sci
pli
nes w
illhe
lpesta
bli
sht
hemathe
matic
al GRAPHICALOPTIMIZATION
mode l
.
1
.3 Id
nt
sev p
oss
ibl
e0pti
miza
p
m

0b
i
l d
e a
1
thed
i

s
ci
p
lin
s
w
i
ll


h

e



1
l
pe
s
i

sl
h ma
l
a n
a
t
i
L

modeJ
..
1
4 Id
ent
ifysev
era
1pos
sib
lopt
imi
zati
onpro
blemsre
lat
edt
oamicro
syste
rnu s
ed
fo
rcontr
ol.Fo
rBa
chprob
lemide
nti
fya
llthE
dis
cIP
lin
est
hatw
illhel
pesta
blis
h
Thisbooki nclu
desal argenumbero fcxamplesw ithtwov ar
iabl
es.T wo
-variable
em
ath
ema
tic
a .
lmodel problemscanb ed ispla
yedg raphic
allyandt h s
olutiono bta
inedbyi n
spectio
n.
1
.5 De
fineap r
ob l
emwitIr
1 espe
cttoyourinv
estmen
tinthest
ockmark
et.Des
cribe Along w itht heu se
fulnesso fo b
tainingt h
es olutionw ithouta p p
lying
en atu
reofthem
athematic
almodd- mathmatic
alc ond
itionstheg ra
phicalrepresenta
tiono ftheproblemp rovidesan
1
.6 Defin
e p roblema n
de stab
lis
h m athe
matica
1modelf ortheI-beam oppo
rtunitytoe xploretheg eometryo fmanyo ft hen umericalt e
chniqueswe
hold
ingupa nindep
endentsin
gle-
fami
lyhome. examinelat
er.Thisisn e
cessa r
yf o
ri nt
uiti
velyu nd
er st
a n
dingt h
ea lgo
rithmandi t
s

P U 1
1
.7 Definethep r
oblema ndident
ifythemathem
atic
a lmodel f
ora noptimum prog
resst owardthes ol
ution.Inp ra
c t
icalsi t
uati
onswhichu suall
yi nvolveover
s

2
o
verhang
ingtraf
fi
cl i
ght
. twovariab
le thereisnoo pportun
ityf o
rn ea
tg raphicalcorre
latio
nb ecauseofthe
1
.8 Def
ineep r
o blemandiden
tifyamathem
atca
i 1modelf
ors
che
dul
inga
nd I
imitat
ionsofg ra
phicalrepresent
ation.Itwil
1ben ecessarytoreviewt h
enumbers
oo
timi
zatio
no ftheda
ilyro
utin
eact
ivi
ty. todecideonc onvergenceort helackt h
ereof
.Whath appensw it
hmanyv ariabl
es
D
ne ep emf oral am
in
i
sa ne
twov
x
a
r
t
i
e
a
n
b
s
l
e
i
s
onoft h
eg
.A goodi
eo
m
m
a
e
g
t
i
ri
n
a
cf
ti
e
o
at
ni
ur
sa
e
st
ne
ha
ta
s
r
sn
eo
t
ia
b
lt
se
o
o
rv
lf
edi
o
np
rth
r
e
o
s
bl
ep
em
r
si
obl
n
e
m
vol
v
sw
i
i
n
t
g
h
i
v
gi
venasp
e
:e
i
c
pump.
manyv ari
ables
.

110 D
efineac h
emica
le n
ginee
ringproblemt
omixv i
ousmix
turesof1
im
ite
d

19U

Contourp lot
sp rovidet heb estg r
aphicl p
a resentat
iono ft heo p
timizati
on
a
vai
lab
ili
tytomakespec
ifi
e om ts
dcompoundst pec
ifi
eddma
nds.
problemintwov ar
iable
s.Thep oi
ntso nanyc ontour(orcurve)havet h
esamev al
ue
ofthefunc
tion.Severalsow arepackagesa r
ea vail
a b
letoc rea
tea nddisp
layt he
se
1
m
pl
ots
.M ATLAB.M athematica MapleandMathcada
r
eamongeg ene
ral-puqJO
se
soft
warepackages c andrawc on
tourp l
ots
.I nthisbook wewilluseMATLABf o
r

gra
phica
1o pt
imizat
ion.

2
.1 PROBLEMDEFINITION

Thestan
dar
dform
atforopt
imiza
tio
npr
obl
emswase
sta
bli
she
dinC
hap
ter1
.lti
s
re
ino
duc he
reforc
onv
enien
ce:
4
6 G
RAP
HIC
ALO
PTI
M'Z
ATI
ON 2
.
1PA
OBL
EMD
EFI
NflO
T N 4
7

M
ini
miz
e f
l
.x
JX
2.

Xn) (
2.1
) F
igure2
.1iI
Ius
tra
testh
egra
phi
cals
olu
tio
ntoispr
oble
m.l
efig
ureal
sod
isp
lay
s
a
ddi
tio
nalinfo
rmati
onrel
ate
dtotheine
qua
lit
yconsa
insp
t lac
edo ni
taft
erth
e
S
ubj
ectt
o
: h(
x
2
"X Xn)=0
p
rin
cip
algrap
hicinfo
r m
ati
onwasgen
era
tedanddi
spl
aye
d.

h2
(x

X2
.
.x
)=O
2
.1.
2 Formatf
ort
heG
rap
hlc
alD
lsp
lay
h
t(I
X X
2
...X
)=0
(
2.
2)
Theg rap
hicals o
lut
iontoE xample2 a
.
1 ss eeninF ig
ure2 i
.
1 sgenera
tedu s
ing

gl(X"X2.
..Xn)o MA T
I.AB[1.2]ex:p
tfortheide
nti
fi t
ionofth
ei ne
qua
litycon
str
ain
ts.Alline
quali
ty
co
nstrai
ntsaredisti
nguis
hedb yhashmarks.Theh as
hedsideind
icat
estheinfe
asib
le
g
2(X
I.X
2
.
. Xn)SO re
gion.InMA'
1.AB5.2ereisnofeatu
retoins
ertthe
semarksthroug
hp rogr
amming.
g
lll
(X"
X2
.
..x
)SO (
2.
3) Ana dd-onpr o
gramcalle
dMatdraww asusedtocrea
tethehashi
Inesinthefig
ure
.It
canb edownloadedf ro
mt heMathworkssit
e.BeginningwiV ersi
on5 3t
. h
ereisa
x
:gx
iX
7 2
. i=I .
.
.n (
2.4
) fi
gure(plote
di)d
t it
or w il
la ll
owy outoin
sertadd
itio
nalgrap
hicelemen
tstoE
fi
ge . l
es tu
dentcanal
sop c
ilineh ashtine
safte
robtain
ingthepri
ntoutI
tis
I
nischap
terwhi
lea d
heri
ngtotheforma
t.theneces
sit
yforzeroont herigh
t-ha
nd t
ob en ot
e datthegraphi
cals o
lut
ionisincomplet
eiftheineq
uali
tyc o
nst
rain
tsa r
e
s
id sr
ei ela
xed. isisbeigd
n on
e fo
r conven
ience a
nd 1
0 a
idcompreh e
nsion. l
e no
td isti
nguish
edorifth
ef ea
sib
ler e
gionhasnotbeenesta
blis
hedinsomem an
n e
r.
r
ight
-ha
ndsidecan a
lso h
ave n
umeric
al valu
es o
ther1ha
n ze
ro. Th fi
rs
t examp
le
c
hosenfri
o llus
tr
ati
onisas im
pleon E
us i
n gelem
entaryfun
ctio
nsw ho segmp1
2ica
l
n
atur
eiswelk
l nown.Thissimp
lee xamplewil
lp e
rmitexa
rnin
ntiono ftheMATLAB
c
odeatwilg
l en
craeec
t urve
sa ndthesolu
tio
n.Itwi
llaloa
s l
lowu stod e
fineE
fo
rmatf
orthedis
p1ayofsol
uti
ontothegraphi
calopti
miza
tionprob
lcm .
1
0
2
.11 Example2
. .1 g

Thefi
rte
s xa
mpl
eE
xam
ple2
.1
wilh
l a
vet
woe
qua
liyc
t o
nst
rai
ntsa
ndt
woi
neq
ual
ity
B
con
str
amt
s:

M
ini
miz
e .XI'X2)=(XI-3
f
l )2+(
X2-2
)2 (
2.
5)

S
ubj
cctt
o
: h
l(x
l.X
2):2
x1+x2=8 (
2.6
a)

h2
(x"XU:(
XI-1
)2+(
-4)2=4 (
2.6
b)

gl(X"X
2):X 2S7
l+x (
2.7
n)

XU:XI 0.25~SO
g2(x. (
2.7
b)
3

oSXIS10; OSX2S1
0 (
2.
8)

nt
I heabovedcf
mi1ionwehavet os
w t
rai
ghtli
ne.t
s wocirc
ls
e nndapar
abo
la.Note
t
htt
a woequa
litycons in
tsa ndtwov ar
iabl
esi m
ply tE isno sc
ope f
or

oz at
io. l
n
i

n
t
ep
sar
ei
ro
In
b
e
l
e
a
rl
mw
yi
i
l
n
l
d
b
e
e
p
d
e
e
n
d
t
e
c
n
r
t
m
i

n
w
e
h
i
db
c
y
hi

stru
ei
u
al
i
nt
1
h
yc
se
i
o
n
x
s
n
t
ra
l
r
i
n
e
tspr
o
.Thi
v
se
id
x
a
e
d
mp
t
h
l
e
e
2 3 4 5 6 7 s 1
0
twoc
ons 1v
x a
lu

wa
s 1 d1
e 0helpunde
rstand cod
cinMA' ABatw
illbeuse
dtodrawgra
phi
cal
s
olut
iosi
n nthsb
i o o
k. g
uro2
.
1 G
rap
hic
als
ol
ut
io
nfo
rEa
xmp
le2
.
1.
48 G
RAP
HIC
ALO
PTI
MIZ
ATI
ON 2
.
2GR
APH
ICA
LSO
LUT
ION 49

Int hegra
phicaldisp
layo fsoluti
onsonlyeo bj
ecti
vef un
ctionisdrawnf o
r m-f
ilef oref ir
stexample.Thef o
llowingi nt
r o
ducessomemoreu se
fulI nformo n
sev
eralcon
tourssothted
a irect
ionforeminimumc anbeiden
tif
ied
.Eachcquali
ty abouttheu seofMATLAB
8high-
Ievc
lg raphicsfunctions.
:
.
L
con
strntisdrawnasas ing
lec urveforen um
ericalv a
lueont herig
ht-
handsid
e. Thetwomaing raphica
le leme
nts a r
ct ypi
callyc o
ntroll
edu sin
gt hehigh-Ievel
Theyshouldbeiden
tif
ied
.Eachi nequa
litycon
strIn
a tissim
ilar
lydrawnforavalueon grap
hi c
sf u nct
ionsarethefigu andthea xe
s.U singH andleG r
aphicsyouc ancontrol
er ig
ht-h
andsid
e.Theyn eedtobeident
ifi
cdtoo
.Theh ashmarksar lr
awn
/penc
i l
ed mosto fth eothergraphica
le leme
ntsw hichincludeelem ntsusedint h
eGU I.These
inonthefi
gurcoraprin
toutofe fi
gu .Theext
entofthedcsig
nregioni
sesta
blish
ed oth
ere le mentsa r
et ypica
llyc h
ildrcno fea xeso rfigur
e.Thef ig
uref unctiono r
andthesol
utionid
enti
fiedonthefigur
e.Thereleva
ntr e
gioncanbezoomedf o
rbette
r commandc reat
esaf igur
ewindoww ithanumbers tartin
gato neorwillcreata new
accu
racy. d a
tafor eplotareobtainedus
ingMATLAB'Sm atrixope
rat
ionsafte
r fig
ure window i nc
rementingt he window c ount by o ne.N ormallya l
lg raphics
est
ablis
hin
gt heplolt
ingm e
s h
.Thi se xpl
oit
sMA TI
.AB'Snal
urals p
eedform a
trix fun
ctionsa retarge
tedtot hecr e
ntf ig
ur windowwhichi sselectedbyc lickingit
ope
ratio
ns. wit
ht h
emouseo rexecutingthecommandf igure( number)wh e
r enumberi st he
numbero ft hefigur
ewindowa lwillh avelhef ocus.AIlcommandsa r eissuedi n
commandwindow.G raphicsf un
ctionso rcommandsw i
lla utom
aticallyc reatea
2
.2 GRAPHICALSOLUTION windowi fn oneexi
sts
.
Invokeh elpcommandnamea tt heMATLABpromptt oknow morea boutt he
MATLABp o
ss sap owerf
ulv isu
aliz
atio
ne nginet h
atp e
rmitsthes olu
tionofe fun
ctionso rcomrnands.Thewordh andlea pp o nm yp l
ao rmsandi nmany
two-
variableoptim
izatio
np roblemb yi nspecti
on.T herea r
et hre
ewayst ol ake ap
plications p
artic
ularlythosetha
td ealwithg ra
phics.Theya r
ew idelypre v
al e
nti n
advanta
geo ft hegraph
icf eat
uresofMA TI.AB
. ef ir
stisl h
eu seo fMA TI.
AB'S obj
ectorientedprogramming p rac
tice. MA TI
.ABsv isual
izati
ons yste
mi so bject
hig
h-Iev
elg raph
ingroutin
esf o
rd a
tavisua
liz at
ion.Thiswillbe p rima
rywayt o or
iented.Mostg raph
icale l
ementsarec onsi
dereda sobject
s.Theh andle"i nMA TI.AB

solv
eg raph
icaloplimi
zationproblemsint hisb ook.Thiswi l
1alsob eeway10 i
sas y o ftwarecreatednumber c ani dent'ythespeci
ficg rap
hico bjectI
. f
inco
rporategrap
hicalexplo
ralionofn ume
r icalt echn
iquesineb ook.F ormo
th
isha ndlei savaila
blee np r
oper
tieso ftheo bj
ecls u
cha slin
es ie
z marke rtype
pre
cisecontroloverthed i
splayofd a
a MATLABa
t llowsusrintcra
ctio
nt hrough co
loran ds oonc anbev iewcdse
torr e
setifneccssary.InMATLAB Handl eGra p
hic s
programming usingano bjec-
torie
nteds yst e
mi dent
ifie
di n MA T
I.ABa sHandle sewayt
i oc us
torni
zeeg raphi
cale leme
nts.I nhi gh
-Ieve
lg rh ic
sf unctions s
Graph
ics.Th ethi
rduseoftheMATLABg raphicse ngin
eistou s
et h
eH andleGraphic
s
i
su s
e dinal imi
tedw a
y .Inthi
sc hap
terwew illuseiti nam inimalwayt oc hangeE
ch
arac
t c
rist i
cso fsomeo ftheg r
aphicalelementsont hefig
ure.
systemtod e
velopaG r
aphicalUserInter
face( GUI )forth
ep rogramo rm-
file
.Th i
s
To u nd erstandt hec oncepto f" handlcs" we w il
lr u n e f oll
o wingc od e
cre
alesafaci
lit
yf o
rsophis
licat
eduserinte
raction.MOSlo ftheplo
ttingneedscanb e
in
ter
actively.Itd ea
lsw ithcreati
ngap lo
twhichwasi ntrodu
cedi nChapt er1.Th e
melbyt hehigh
-Iev
elgraphic
sf un
ction
sa v
ai lab
leinM ATLAB.
bo
ldfacecommentsi nt h
ec odes egmenti ndica
tet henewf ealur
est ha
ta r
eb ein g
emp
has ized.
2
.2.
1 M
ATL
ABHigh-LevelGraphlcsFunctlons StaM ATLABandi nter
acti
veLyperf ormthefollowing:

ceo
aey
eyv
xv
vc
con
tr
rat
e

et--

rh

0

'erearet h
reeu se
fulwindowsd uringat ypic
alMATLABs c
ssio
n.Th efir
stise >>X O:pi/40:2*pi;

L
h

cp

ex
rl



MATLABCommandwindowt hr
oughwhichMATLABr ecei
vesinst
ruct
ionanddispl
ays >>y X. sin(x);

e
c
o
r
D
>> plot(x y


'b-');


alphanu
merici nform
ation.l es econdwindowi sthet e
xl-e
dito
rwindoww here
m-fi
Iesarec o
de d
.Thet hi
rdist h
eF igurewindoww herethegraphi
cel e
mentsare >> grid;
dis
playe
d.T he
r ecanbemorea nonef ig
urew indo
w.Thef igu
rewindowis tar
gel >>h plot(x y'b-') h is the handle to the plot
ofthehigh-
leve
lg raph
i c
sf u
nctio
ns. > > anewp lot is overwritten in the same figurewindow
Theg raphi
csf unct
ionsinMATLABa llowyout oplotin2Do r3D.Th eyallow >> an umerical value is assigned to h
cont
ourplotsin2Da d3D
n mesha n
ds uaplots b
arara
e piechar
ts
h i
stogra
ms > > We can use the variable name h or its value
>> t o refer to the plot again
animat
ionandg rad
ientplot
s.S ub
plotsc analsobedisplay
edu s
ingthes
ef un
cti
ons.
Inaddit
iont h
eyp ermitoperati
onw ithimage sand3Dm odeling.Theya l
lowbasic >>
con
trolo fthca ppe
ar ceo fthep l
ott hroughcolol
r inestyl
eandm arkesi
r s >> set(h 'LineWidth' 2); this should make your plot
t hickerblue
rang
esand pe c
tratioofthegraph.
' heypermitannot
ationofthegraphinsev
eral > >

ways.Someo ft he
sef un
ctio
n swil
lb eusedi nthenextsec
tionwhenwed e
vclopthe >> set(h'LineWidth' 3'LineStyle'':'
'Color''r')
50 GAAPHICALOPTIMIZATION 2
.
2 GAAPHICALSOLUTION 5
1

>> The handle is used to refer to the object F


il
e:Ex21.m
>> whoseproperty is being changed
>> Usually Property information occurs in pairs of Chapter 2
: Optimization with MATLAB
>> property-namejproperty-value %Dr. P
. Venkataraman
>> property-value can be a text string or number Example 2_1 (Sec 2.1-2.2)
>>
>> get(gca) this will list the property of the axes graphicalsolutionusingMATLAB (twodesignvariables)
>> of the curren plot. Note there are a significant the following script should allow the display
>> amount of properties you can change to customize of graphical solution
>> the appearance of the plot
>> Minimize f(x1
x2) (x13)**2 + (x22)**2
>> set(gca'ytick'[
-5
2.5
02.5
5]) h1(x1
x2) 2x1 + x2 8
>> youhave reset the ytick marks on the graph h2(x1
x2) (x1-1)^2 + (X2-4)^2 4
>> set(gca'FontName''
Arial''FontWeight'.
.. gl(X1
x2) x1 + x2 <= 7
>> 'bold''FontSize'
14) gl(x1
x2) x1 - 0.25x2^2 <= 0.0
>>
>> Changes the font used for marking the axes % 0 <= x1 <= 10 0 <= x2 <= 10
>> set(gca'Xcolor''blue')
>> c hanges the x-axis to blue NOTE: The hash marks for the inequality
>> % concludes the demonstration of handles constraints must be determined and drawn outside
of this exercise and on the printout
Fromthese
ssio
na bo
veitisevi
dent tofin
e-tu
netheplo
tyoucre
ateyou ----- ""--
n
eedt ofi
rs
tide
nti
fytheobj
ecthand
le.Youu seth
eh an
dletoacc
esseo bje
ct x1=0:0.1:10i the semicolon at the end prevents
p
rop y.Youchangeaprop
ertybysett
ingit
sval
ue.Wew il
lseemoregraph
ics % the echo
f
uncti
ona sweobtai
nt h
eg r
aphi
calsolut
iontoExample2.1in follow
ing x2=0:0.1:10i these are also the side constraints
s
ectl
on. x1 and x2 are vectors filled with numbers starting
at 0 and ending at 10.0 with values at intervals
of 0.1
2
.2.
2 Example2
.1-Gr
aph
ica
lSo
lut
ion
[
X1 X2] meshgrid(x1 x2)i
Figu
re2.1istheg rap
hicalr e
presentatio
no fExample2 .
1.Ther angefortheplo
ts generates matrices X1 and X2 corresponding to
matche
st hesidecons
traintsforthep roble
m.Thei n
ters
ectio
no fth
etwoe q
uali
ty % vectors x1 and x2. It is a mesh of x1 and x2 values
at which the functions will be evaluated
co
nstra
intsidenti
fie
stwop oss
ibl solut
ionstot h
ep roblemappro
ximately(2.6
f1 obj_exl(X1 X2)i the objective function is
2.
8)a nd( 16 ). The i neq
ualityc onst
raintg 2 makcs thep oint( 2
.62 .
8)
evaluatedover the entire mesh and stored in f1
una
ccepta
ble.P oint( 6
1 )isa ccptablewithr e
s p
ecttob othconst
raints
.Thc
MATLAB will compute the values for the objective
sol
utio
ni sthereforeat(1 6).Whilet heo bj
ectivefunctio
nwasn otu sedto
througha functionm file called obj_exl.m
dete
rminethcsolutio
n co
ntourso ftheobjec
tivefuncti
onaredrawni n
dicatin
g

ineq1 ineconl(Xl X2)i the inequality gl is


di
recti
onforeminimumo ftheo bj
ectivfunc
tion.Thesolutio
nc a
nb eident
ifi
ed
evaluatedover the mesh
byinspec
tiono ftheassmbledp lot
sw ithoutrefe
r e
ncetot h
et er
minologyorthe ineq2 inecon2(Xl X2)i the inequality g2 is
tech
niqucsofoptimiz
ation.Recallhowever.thatthi
sisonlyp o
ssibl
ew ithoneor evaluatedo ver the mesh
twodesignvariab
lesint heproblem. eq1 = eqcon1(Xl
X2)i theequalityh1 isevaluated
Thec odeforise x n
plei nvolv
ess i
xm -f
ile
s:as cr
iptm-file willinc
ude over the mesh
th
eMATLABs tateme
ntst ocreateandd ispla
y ed ataandfivem-fi1onef or eq2= eqco n2(X1
X2)i theequalityh2 is evaluated
cachfunctio
ni nvo
lvedi n Example2 .1
. Web eginw itht h
es cr
iptm-file- over the mesh
E
x2_
1.m
.
52 GAAPHICALOPTIMIZATION
2
.
2 GAAPHICALSOLUTION 5
3

[C1han1] contour(1x2ineq1[77)'r-')i on1.m


a single contour plot of gl (or ineql) is drawn for
thevalue of 7 in red color as a continuous line function retval inecon1(X1X2)
duplicationof the contour value is necessary retval X1 + X2i
ford rawing a single contour X1X2 are matrices
han1 is the handle to this plot. This handle retval is the value being returned after the
canbeusedtochange theplotdisplaycharacteristics computation
Cl contains the value of the contour Since X1 and X2 are matrices retva1 is a1so a
matrix
clabel(C1han1)i By this way the entire information on the mesh
labels the contour with the values in vector C1 is generated by a sing1e call to the funcion
contour(x1x2ineq1[7
7]'r-') will draw the contour inecon1
without labeling the value 2.m
hold on allowsmultiple plots in the same figure
window function retva1 inecon2(X1 X2)
gtext(gl')i retval Xl - 0.2S*X2.^2i
will place the string 'gl' on the plot at the spot Note the use of ^ operator for element by e1ement
selectedby a mouse click. This is a text label operation. That is each e1ement of the X2 matrix
this procedure is repeated for remaining is squared. Without the dot the imp1ication is a
constraints matrixmultiplication -between matrices whose
innerdimensions must agree. Similar operators are
[C2han2] contour(x1
x2
ineq2[
0]
0
'r- )i defined for element by element muliplication
clabel(C2han2)i anddivision
gtext('g2')i Lm

[C3han3] contour(
x1
x2
eq1[8
8]'b-')i function retval eqcon1(X1
X2)
clabel(C3han3)i retval 2.0*Xl + X2i
gtext(h1')i
2.m

[C4han4] contour(x1
x2
eq2[
4]
4 'b--')i function retval eqcon2(X1X2)
clabel(C4han4)i retval (X1 -1).*(X1 1
)+ ( X2 - 4).*(
X2 -4
)i
gtext(h2')i
U
[Chan] contour(x1 x2f1'g')i function retval obj_ex1(X1X2)
contourof ' f'i s drawn in green color. The number retval = (X1 -3).*(X1 - 3
) +(X2 - 2). (
X2 2
)i
of contours are decided by the default value
clabel(Chan)i
xlabel('x1 values' 'FontName''times''FontSize'12
. 2
.2.
3 D
isp
lay
lngtheGraphics
'FontWeigh
'bold')i label for x-axes
ylabel('x2values' 'FontName''times''FontSize'
12 Al
1oflhcfi
le
srequ
iredforgr
aphica
ld i
spl
ayoft
hep
roblemhavebee
ncrc
alc
d.Inth
e
'FontWeight' 'bold')i Commandwindowlypeaddpatbfollowdbyec
e o
mplel
epathfort
hcdi
rec
tor
yat
grid ho
ldsthes
efil
es
.Att hep rompttyp
et h
cnameofth
cs c
rip
tf i
lefo
rtheexamp
le
hold off wi
thou
tthe.meXlen
sion
Thef
unc
tinm-f
o i
Iesa
re
: >> Ex
21
54 GRAPHICALOPTIMIZAnON 2
.2 GRAPHICALSOLUTION 55

Thef i
rstcontou
rp l
otw i
lla pp
ear.Movet hemouseo vertoep l o
ta ndac ros
sh ai
r 1
0
app
ears.C l
ickingont heplotwi1lplacthest
ring"gl"att hecrosshai
r.Thes e c
ond
contourplo
ts houl
da ppearandt her
eisap ausetoplac
et e
xtlabe.
lA f
terthef ou
r
consaint
seo bj
ectivefunct
ionisplott
edforseve
ralcontourvalues
.F in
allytheplo
t
shouldapp rinF igure2.1w ith
outtheh a
shm arks( a
n dwi y ourchoiceofB
loc
ationforcons
traintlab
els)
.Youc anins
ertthehashmark sthrougheditin
gt h
ep lo
t
di
rectl
y(V ersin5.
o 3onw ds). s olut
ionforthepro blemisat1
(6 )wheref ou
r
pl
otsinters
ec.
tThev a l
ueo ftheobjec
tivefunc
tionis20 es ol
ution.
Iftheplotisacce
p ta
bleyouc anpri
nttheinform
alionont hefigurebyexpo n gi
t



(us
inga nappropr
iatee xtens
ion)1 0af ileandl at
eri ncorpo
ratingiti na nothe
r

=
J
tYouc ana


documen . l
sos endittoep r
inte
rf romIheprintcommandont heF il
e
menu.T ypinghelppr i
ntint h
eCommandwindows h
ouldiIstasetofcommandsyou
canuset osaveef i
le.

>> print -depsc2 plot_ex_2_1.eps

wi1
lc a
tethelev
el2c o
lorpost
scr
iptfil
ecall
edplocex_2_l
.ep
sinthework
ing
di
rec
tor
y.Ac omp
letepat
hnames houl
ds a
vethefi
letoespec
ifi
edd
ire
cto
ry.You
canthenexec
utestan
dardoper
atingsystemcommands1 0dumpthefil
c10e
ap
plic
ablp
rin
tcr
.Youc anals
os av
et h
efigu
re(ex sio
n.fi
g)andl
at
eropeni
tin
2 4 6 s 1
0
MATLABusi
ngthefi
lcopencommandfrommenub ort
oolba
r. Xva
lue
s
1

2
.2.
4 CustomlzlngtheFlgure lg
F u
re2.2 C
ust
omi
zed
U f
orE
m
ple2
.1
.

I
nt hi
ss ec
tionthcb asicfigur
ea ndplo
tsc rea
tcda bov wil
Ib ec us
t or
nizcdusingt h
e
gt t('gl');
HandleGraphicscommandsf ir
stexplod inScti
on2 .
2.1.A llofthep l
otsdesc
rib i
ng
k1 gtext( gl'); k1 is thehandle tothe text element
ec on
strai
ntswillh a veal i
newidt
ho f2p oi
nts.l eob j
e c
tivef u
nctionwillha vea
set(k1'FontName' 'Times''FontWeight''bold'
lin
ewidthof1p oint
.Thet ex
tlabeswi
l 1
lbei nthe"Tim es"font.ItwilIbeinb o
ldface
FontSize' 14'Color''red')
wit
haf ontofsize1 4a ndinec olorofthecons in.
tTh ex dYt ic
kmarksw i
l lbe
changedtoe s
tablishab r
oadergri.Th
d ex dyl abe
1sw illi nc
ludeas ubscri
p .
tA
..clabel(C2
han2}i
two-rowtextwi1
lbei nser
tedatthepoin
ts ele
ctedthrought hemou s
c .Thencwf i gu
re set(han2'LineWidth'2)
i
sshowni nF igu
rc2 .2. k2 = gtext('g2');
Firtpyt
s hefileinep re
viousexercis
ea ndrena meit.lerenamedf i
lewi
l lbe set(k2'FontName''Times''FontWeight''bold'
usedmakethen e ssarych
gestoec o
de.Th e
sec han g
esi nc
1udeb othnewc ode FontSize'14'Color''red')
aswe la
I sre p
lacemen tofexist
ingline
so fcode.Inef oI
lowingo nlyec hangesto clabel(C3
han3);
c odearei1
Iustrated.Th eori
gina
lc odeisshowni nt h
ei ta
licstyleandi d
entifi
ed set(han3'LineWidth'2)
wit
ht hr
eeellip
sisp o
ints(.. .
)at beginningoftheline.Thec odetobei n
sertedor k3 ~ gtext('h1');
rep
l a
cementcodei sshowni nnorm styl.I
fnoreplacemcnti sa pp
ar e
ntthentheold set(k3'FontName''Times''FontWeight''bold'
codeisused10d e
f inethelocat
ionswhe ewd eisa ppended. 'FontSize'14'Color''blue')
clabel(C4
han4);
{Cl
hanl} contour(xl
x2
ineql{77}'r-'};
set(han1'LineWidth'2); sets 1ine width of the gl set(han4LineWidth'
2)
contour to 2 points k4 ~ gtext('h2');
56 GRAPHICALOPTIMIZATION 2
.3 ADDlTIONALEXAMPLES 57

set(k4 'FontName''Times' 'FontWeigh 'bo1d' !


(xI'X2)= +bx~ cco) d c
os(
qx -c+d (
2.9
)
2)-
1
FontSize' 14'Co1or' 'b1ue')
c:label(Chan);
w
ith
set(han 'LineWidth'1)
.. xlabel( xl values' FontName''times'
x1abe1(' x 1 va1ues''FontName''times'FontSize'
12
. a=
1b= c=
2 0
. d=
3 0
.4p=

3 q=4
FontWeight' 'bo1d')i
y1abe1(' x 2 values' 'FontName' 'times'' Fig
urcs2.
3-2.7ar eg ra
phic
aldispl
ayofsolu
tion
s issect
ion
.Thef ig
ure
sin
FontSize' 12'FontWeight' 'bo1d')i th
ebookbein
gr e
sc tedtoblac
ka n
dw h
itewi
llnotn v
ey eimp
actofcol
orima
ges
set(gca xtick'[0 2 4 6 8 10]) set xticks youwil
lseeont hes c
ree
n.Thc rearetwofi
lesass
ocia
tcdwit
ht h
eplot
s:thesc
rip
t
se(gca 'ytick'[0 2.5 5.0 7.5 10]) set yticks m-f
iIe(e
x2.
-2.
m )andt h
cf un
ctinm-f
o iIe(o
bLex2.m
).
k5 gtext({'Chapter 2 : Examp1e 1 '
'pretty graphical display'}) ..z.m
the above gtext describes a string array
string array i s defined using curly braces Chapter 2: Optimization with MATLAB
set(k5 'FontName''Times' 'FontSize'12 Dr. P.Venkataraman
Fontweight' 'bo1d') Examp1e 2.2 Sec.2.3.1

(at the end)
c1ear C C1 C2 C3 C4 h h1 h2 h3 h4 k1 k2 k3 k4 k5
get rid of variab1es from the workspace 1
1
IA
bc l
o
dCo
nl g
d
ef
au
llc
Glc
r
Runtheprog
rar
ntosecef i
gur
einF i
g 2
.2
.Oncet heplo
tiscustomIzedtoyour
sa
tis
fac
tio
nyoucanmakei
t sta
ndardforoth
erplot
syouwillpr U inMA As.
Th
isfil
ecouldal
sobeatempl
ateforgene
ralcontourpl
ott
ing
.N ot
ea ta lf
1 unct
ion
in
forma
tionisob
tain
edthro
ughfunct
ionm-fi
I e
sw hic
ha r
ec od
edo uts
idethescri
pt
f
il
c.S c
tti
ngupncwp rob
lemsore xamplcso nl
yr equ
ire
sa dding
l c
hangin
gnew
fu
ncti
onm- f
i
1.

2
.3 ADDITIONALEXAMPLES


Thef01
l0wingadd
itio
nalex npleswi
lls erv
etoiI
lus tebo
o ptim
izat
ionproble
ms
wel
lasaddit
ion
algmphicalfcat
u r
esofM ATLAatwillbeus
efulindv
elopin
ggrap
hica
l
sol
uti
onstoopt
imizat
ionp rob
lems. lCgrphi
calrouti
nesi
nMATLABa repower
ful d
SYtouse.Theyc ng
a rp
hica
llyd i
splaytheproble
ms v em1waysw iverysimp
lc
mm d s.Theusefu
ld is
playishoweverdetcn
ninedbyeu se
r.Thefir
stexamp
lein
th
issect
ionExample2 .2isap ro
bl eminu ncon
si nedoptt i
on. s eco
nd
cxampl
eisastru
ctum1enginee
ringprob lcmofrea
sonabl
ccompl
cxity
.l C ex
arIc
demons sopti
mizat
ionint h
ca re
ao fheatIa
rnsf
crdcsi
gn.

2
.3.
1 Example2
.2
-
0.5 O 0.
5
Th
iscxamp
lciI
Iustss
e cvc
raldi
ffc
rentwaysofg
mphic
aUydisp
layin
gafu
nct
iono
f Xv
J
alu

twov
ari
abl
es.Thep r
oblemwasuscdtoiI
Ius
lra
teg
lob
alopt
imi
zatio
ninRe
fere
nce3
.
Thes
ing
lcobjc
cti
v efun
cti
onis g
u 2
.3F
il
le
dco
nlo
ursw
it
hco
lor
ba.
rEx
amp
le2
.2
.
58 T
GRAPHICALOPTIMIZAlON 2
.3 AOOmONALEXAMPLES 59
2DCon
w
ithGr
ndi
.nlV:10
82-gJ

.
-05 o 0
.5
Xv a
lue
s !Vu
X
: es -
1
1 X1v
alu
es
g
ure2
.4 C
ont
ourw
lt
hgr
adl
entv
ec
to
rs
:Exa
mpl
e2.
2. F
lgu
re2
.5 3Dc
onl
ourw
ihl
l or
barE
. x
l
e2
.2
.

graphicalsolutionusingMATLAB (twodesignvariables)

f1 obj_ex2(X1
X2); the objective function is

Unconstrained function illustrating global minimum 1

y't
. evaluated over the entire mesh

Example will introduce 3D plots3D contoursfilled filled contour with default colormap
2D contours with gradient information helpgraph3d gives you the choices for colormap
-------------- [C1han11 contourf(x1x2f1
x1=1:0.01:1; the semi-colon at the end prevents
[0 0.1 0.6 0.8 1.0 1.2 1.5 1.8 2.0 2.4 2.6 2.8 3.01);
" the echo
x2=-1:0.01:1i these are also the side constraints specific contour levels indicated above
x1 andx2 are vectors fil1edwith numbers starting clabel(Clhanl);
at -1 and ending at 1.0 withvalues at intervals of colorbar il1ustrates the default color scale
0.01 set(gca'xtick'[ -
1 -0.5 0.0 0.5 1.01) custom ticks
set(gca'ytick'[1 -0.5 0.0 0.5 1.01) custom ticks
[Xl x21 = meshgrid(x1x2); grid
generates matrices X1 and X2 corresponding xlabel(' X_1 values''FontName''times'
vectors x1 and x2 'FontSize'12);
reminder MAT~ is case sensitive % label for x-axes
ylabel(' x 2 values''FontName''times'
60 GRAPHICALOPTIMIZATION 2
.3 ADOmONALEXAMPlES 6
1

CO
!U
'SCMeshP
101 C
oaS
ur
fa
ceP
lo
t

lor
map1 lon
nn
p-j
cVd
ef
nu
lt

4
4

3
.5 3
.5
3
3
2
.5
2
.6
2 2
2
1
.5
.
15
1
.5

0
.
5
a
m
w
u

0
u

0
.
5
0
.6
0
.
5
5
0.
. 5

v
x
X va
lue
s -
1 -
1


-
1 -
1

a
X va
lue
s

HM
2 Xv a
lu 2
1

F
lgu
re2
.6 3Dm
eshp
lo
twl
thc
ol
or
ba
r:E
xam
pl2
.2
. F
lgu
re2
.7 3Ds
u
plo
twi
thd
efa
ultc
olo
rb:
arE
xam
ple2
.2
.

clabel(C2 han2)

FontSize'
12);
[GXGY] gradient(f20.2);
title({'Filled Labelled Contour'
'...
default color map'}'FontName'
imes'
'FontSize'
10) % generation of gradient information see help gradient
hold on muliple plos on the same figure
quiver(Y1 Y2GXGY);
a new figure is used to draw the
d raws the gradient vectors at grid points
basic contour plot superimposed with gradient
see help q uiver
information
also information is generatedon a coarser mesh to hold off
keep the figure tidy. grid is removed for clarity set(gca 'xtick'[-1 -0.5 0.0 0.5 1.0])
set(gca 'ytick'[-1 -0.5 0.0 0.5 1.0])
figure a new figure window is drawn xlabel(' x_1 values' 'FontName''times'
y1 -1:0.1:1.0;
FontSize'12);
ylabel(' x 2 values' 'FontName''
imes'
y2 1 :0.1:1;
'FontSize'12);
[Y1Y2] meshgrid(y1y2);
f2 obj_ex2(Yl Y2); title({'2D Contour' 'with Gradient Vectors'}
[C2han2] contour(y1y2f2
FontName''times''FontSize'10)
[
0 0.5 0.75 1.0 1.5 1.75 2.0 2.5 3.0]);
6
2 G
RAP
HIC
ALO
PTI
MIZ
ATlON 2
.
3AO
Orr
tON
ALE
XAM
PLE
S 63

A final example of contour information is a 3D FontSize'12);


% contour plot -or a stacked contour plot ylabel(' x_2 values''FontName''times'
figure FontSize'12);
colormap(spring) set(gca'xtick'[-1 -0.5 0.0 0.5 l.0])
contour3(x1x2f1 set(gca'ytick'1-1 -050.0 0.5 l.0])
[
0 0.3 0.6 0.8 1.0 1.5 1.8 2.0 2.4 2.6 2.8 3.0]); title({'Coarse Surface Plot'
colormap -jet/
set(gca'xtick'[-1 0.5 0.0 0.5 1.0]) default'}'FontName''times''FontSize'
10)
set(gca'ytick'[-1 -0.5 0.0 0.5 l.0 ])
grid
change colormap and set colorbar
changing color for display is easy by selecting Q s.m
among some colormaps providedby MATLAB
function retval obj_ex1(X1
X2)
colorbar
Optimizationwith MATLAB
xlabel(' x 1 values''FontName''times'
Dr. P.Venkataraman
FontSize'12);
Chapter2 . Example 2.2
ylabel(' x 2 values''FontName''times' ...

FontSize'12);
f(x1x2) a*xl""
2 + b*x2^2 c cos(aa*x1)
tile({'Stacked (3D) Contour' :colormap -spring'}
d*cos(bb*x2)...
FontName''times''FontSize' 10)
+c+ d
grid a"'1 ; b 2 c 0.3; d " ' 0.4; aa
he next two figures w
i.l
l display 3D plots 3.0*pi; bb 4.0*pi;
he first is a meshplot of the function notematrix operations need a dot operator
oncemore coarse data is used for clarity retval a*X1.*X1 + b*X2.*X2 -c*cos(aa*X1)
figure d*cos(bb*X2) + c + d;
colormap(cool) anothercolormap
Theb
rie
fcommentsi
nth
eco
des
hou
ldp
rov
idea
nex
pla
nat
iono
fwh
aty
ous
eeo
n
mesh(y1y2f2) using information generated earlier
f
i
gu
re
.Fi
gur
esc
anbef
urt
herc
ust
orn
ize
dass
ecni
nep
rev
iou
sse
cti
on.Froma
n
set(gca'xtick'[-1 -0.5 0.0 0.5 l.0])
set(gca'ytick'[-1 0.5 0.0 0.5 1.0]) op
tir
nizat
ionperspe
ctiveF
igure2.4p rovidesthcbestinf o
nnationabou
tt hcnatu
reo f
colorbar th
eproblem.The2Dc ont
ourcurvesi den
tifythene ighborhoodofthe10 lrnin
imum .
xlabel(' x 1 values''FontName''times' legradi
entvectorsind
icatc directio
no fef unct
ionss te
epes
trisea1 point
FontSize'12); so sa ndv al
lcyscanb cdistingui
shcd.Thec o ntou thern
selve
sc anb ecolo
re d
ylabel(' x_2 values''FontName''times'... wit
houtbeingfil
lcd
.
FontSize'12); Thcq u
iverp l
p1showni nF igure2. 4alsop ro
v i
d e
sam echan i
sm1 0indic
atee
title({'Coarse Mesh Plot''colormap -cool'} fe
asi
bler e
g i
onwhend ealingwi thi neq
ualityco n
straint
ss incct h
eyi ndic
atce
FontName''times''FontSize'10) di
rec
tioninwhi c
h c o
nstrai
ntf uncti
onwi Ii
I n
crse
.I fsever
alfunctio
nsa r
ebcin g
wn ent hccIut
terprodu db yea rrowsmaydf useec Iar
it
y.Th eu s
eri s
grid enc
ouragcd10usethe.pow
erfulgraphicalfeatu
resofMATLABt ohisbene
fitatal
lt i
me s
he final plot in this series wit
houtlosin
gs igh
to feo bje
ctiveo fhisc f
for
t.MATLABg ra
phicshasmanym or e
surfaceplot with default colormap fe
atu
resthanwillbec over
e dini sc h
aptc
r.Thee x p
os inth
ischaptershouldb c
figure su
ffi
ci
entforEd e
rconfiden
t lyexplor
emanyo therusefu
lg r
aph m
i mands.
colormap(je} Thc3Dmesha n
ds ur
faceplo
tsh avel i
mitedusefulne
ss.Th eseplo
tsc anbeuscdt o
surf(y1y2f2) usingold information re
info
rcesomeo fthefea
turesfoundi nFigure2.4
.Thei nfonnat
ionintheseplot
smay
colorbar beimprovedbych o
osingac ameraangle emph lZCSme aspe
ctoftheg r
aphi I
xlabel(' x 1 values''FontName''times'
. de
scr
ipti
on.Thise x
plora
tionisle
ftt oC a derasa nexerc
ise.Usinghelpv ie
wint he
MATLABCommandwindows hou
l dgety oustart
cdi nisd icti
on.
64 GRAPHICALO
PTI
MIZ
ATI
ON 2
.3A
DDI
TIO
NALEXAMPLES 65

2
.3.
2 Example2
.3 Y(
' m
ater
iaJde
nsi
ty)
:7860kglm3

FS(fa
cto
rofsaf
ety
):2.5
l
ene
xte
xam
plei
sacomplexonefroms
tru
ctu
rale
ngi
nee
rin
gde
sig
n i
sre
lev
ant g(g
ravi
tat
ion
alacc
ele
rati
on)=9.1m
8 l
s2
i
ncivil
lmech
anica
llaero
spacecngin ri
ngapp
lica
tion
s.Ita ppea
redasap ro
blcmin
R
eferc
nce4.Itisdcvelopedindet
ailhere
.Thep roblemistor ed
esignthebasi
ctal
l F
ort
hea
cro
dyn
ami
cca
lcu
lat
ion
sth
efo
llo
win
gar
eco
nsi
der
ed:
f
lag
polcinviewoft h
ephe no
m e
nali ncr
easci
nwinds pcedsduringextremeweathe
r
c
ond
itio
ns.Inr e
centcatas
'Oph
ice ven
ts.thewinds p d
si nt omad
o cshaveb cc
n p(st
anda
rdairde
nsit
y):1.2
2 5kglm3
m
easuredatove
r350m ilesperhour
.Th esehig
hs pe
cdsapp rt
ob ethenormr a
ther Cd( coe
ffic
ientofcy
lin
der):1.0
u nusualcven.
t Wp(fl
agwindloadat8m):5000N
Vw(windsp
eed):350mph( 156.6m
4 ls
)
DeslgnProblem: Minimizethemasso fas tand
ardIO-m tubu
larfla
gpol
ct o
wit
hsta
ndwindgust
sof350m il
esperho
ur.Thef lag
poewi
l lbemadeofstru
ctu
ral Thegeome
cp
ara
met
ersa
r

s
tee.
lUseafact
orofsa
fetyof2.
5forcs t
ruc
turJd
a e
sig
n. lCde
fle
ctio
nofthetop
ofthef
lag
pol
es h
ouldno
te x
ceed5cm.Thep rob
le mi
sdesc
ribedinFig
ure2.
8. L
p
:thelocationofflagwindload(
8m)
L:len
go f
thepol
(10m)
Ol
I
l:
lperm
iUedde
flec
tio
n(5cm)
MathematicalModel: The mathem
atical modcl isd ev
elope
di nd etai
lf or
comp
leten
cssandt oprovid
ear c
viewo fusefu
ls ct
ura
l( 5
)a nda e
r o
dynamic
re
lati
ons[6
).Therel
ati
onsareex
prcssedinori
gin
als y
mbolsrat
herthaninstand
ard DeslgnV
alb
i l
es:Thed
esi
gnv
ari
abl
esshowni
nFi
g2.
8ar
e
for
matofopti
miza
tionprob
lemstoprovid
ea nins
igh
tintoprobl
emf o
rmul
ation.
do:ou
tsid
ediam
eter(X)[N
I ot:x
e '
sar
eno
tus
edi
nem
ode
l]
dj:i
nsi
dedia
meter(
.x
2)
DeslgnParameters:Thcs
tnl
ctu
cals
tce
l[5
]ha
sth
efol
1owingm
ate
ria
lco
nst
ant
s:

E( mo
dulusofcl
ast
ici
ty)
:200E 9Pa GeometricRe u on
s:Th ef
ol
1owingr
elation
swil
lb eus
efuli
nlat
ercJc
a u
lat
ion
s:

011(all
owabl
cnormaJs):250E+06Pa A:areaofcross
ctio
n=0 .25 *(d~-df)
1
:01(a
llowa
blesh
carstr
ess
):14
5 E+06Pa :d
1 iamei
calmomento fin
ert
ia=* (d~ -dt)/
64
Ql
t:f i
rs
tmomcnto fareaabovet
hene
utral isdiv
ide
db yth
ick
ness
=(d~ +dodi+dr)/6

Obj
ectiveF
unc
tio
n: Theo
bje
cti
vef
unc
tio
nist
hewi
ghto
fth
e IO-mu
nif
orm
f
lagp
ole
:

8m

A
10m

s
8ct
lonAA
Constra
ca
Icula
te
t
da
s
Fu
nct
ion
s:l
Weight

Fo=0
.
:

ewind l
o
j
{

5*
xl

dp
e

P*
ru
n

V~
:L*
'X2)

i
A*

tl
en
Y*
'

g
t
g

h (F
D) o

*Cd*do
nt
hef
lag
pol
eis
(
2.1
0)

Thcbend
ingmomenta
tth
eba
seo
fth
epo
led
uet
oi
sun
ifo
rmwindl
oadont
hee
nti
pol
eis

g
ure2
.8 F
lag
pol
ede
slg
n:E
xam
pla2
.3
. Mw=0.5*Fo L*L


f

66 G
RAP
HIC
ALO
PTI
MIZ
ATI
ON 2
.3A
ODI
TIO
NALE
XAM
PLE
S 67

Th
ebe
ndi
ngmomentduet
oth
ewindl
oadont
hef
1agi
s Tod
isc
our
ages
olu
tio
nswheredo<d
j wew
illi
ncl
udeag
eom
etr
icc
ons
tra
int
:

M~= W
F-""n
""
P'L_
D
AJ
84(X1X2
)
d 0.001 2.
( 14
)

Bending(
non
nal
)st
res
satt
heb
aseo
f ep
olei
s
S
ideC
ons
tra
int
s:l
i
sde
fin
est
hed
esi
gnr
egi
onf
ort
hes
ear
ch.

'b
cd=
n 0
. l
5 (Mw+MF) di

Nonnals
es
sduet
oth
ewe
igh
tis 2cmSdoS1
00cm; 2cmSdiS100cm (
2.1
5)


wei
ght='
Y g L
MATLABC ode:The m -filesf ort his example a reg ivenb elow. An i mp
o r
tant
Tota
1nonna1sUsse
st oberesi
ste
dfordesig
ni sesumo f nonna
1s t
res
ses observ
a t
ioni nisproblem ands t
r u
ctur
ale ngineerin
gp robl e
msi nparticula
r i
s
computedabo
ve.Incor
por
ati
ngt hefa
cto
ro fsaf
etyandtea
h 1lo
wablest
res
sf rom ordero fm agnitudeo ft h
eq u
antitiesint hec on
straining u ation
s.l es tre
ss
mate
ria1va
1us
e th
efir
stin
u a
1itynsUin
tcanbesetupa
s coosn t
sa reof eordero f108 +06 w
hi l
et hedisplacemeotl ennsareo feo r
der
of1 08-0
2.Mostn umerica
1t echniquess g gletoh and
l ethisrang
e.T yp ica
1lysuch
problems0 dt obenonna 1ize
db efor
eb eiogs oIved'Iti se s
sentia
1i na p
p l
ying
gl(XI'~): bcnd +
wc
igh
tS
nUI
FS (
2.1
1)
numericalt e
chniqu
esu s
e dino p
timization
.
Thi
sexamplei sp l
ottedintwop 1 5.Int h
ef i
rstparteachi ne
qua1ityCOIi n
tis
Themaximums
hea
rlo
adi
nth
ecr
osss
ect
ioni
s
inves
tigateda1on
e.Twoc urv
e sareshowlIf o
re achcons nt.Thisav oidsclu
tte
r.'he
sideforthelocat
ionoftheh a
s hmark00t heconst
raintisd e
te nnin
edbyd rawingt he
se
s=WF+Fo"
'L C Vinc olo
r.l ebluec olorindicate
st hef e
asibled i
rectio
n.A ltemate l
yquiver
plo
tsc anb eused
.Thes e c
ondp ar
ti sec onsolidatedcurves hown.Thec onsolid
ated
Themaximums
hea
rst
res
sint
hep
olei
s curveh ast ob edrawn by r emovingt he comments on someoft hec ode d
commentingt hedea tisn otneeded.S inceeo ptima
1s olut
ionc annotbec 1ear
ly
=S*QI(I t
) estab
lished zoomf e
a t
ureofMATLABi su sedton arrowdownt hes olut
ion.

Th
ese
con
din
equa
1i
tyc
ons
tra
intbedonh
and
lin
ge rs
tre
sse
sint
hef
1agpole
2.
:.J
...
.(the main script file)
1
8 Chapter 2: Optimizaion with MATLAB
Dr. P.Venkataraman
g2(X ~): g:aIJIFS (
2.1
2) Example 2.3 Sec.2.3

lethi
rdpr
act
ica
1co
ost
raio
tisbase
d00thedef
1e
cti
ooo
fth
eto
pofep
ole
.'
his graphicalsolutionu6ingMATLAB (twodesignvariables)
df
lec
tio
oduetoaun
ifonnwindl
oadont
hepo
l ei
s Optimal design of a Flag Pole for high winds
Ref. 2.4
w=Fo
o 0
1
<
4
L/
(8 E* '---------"
global statement is used to share same information
f
Thede1e
cti
ona
tth
eto
pduet
otef
h 1agwindl
oa ti
da s % between various m-files
global ELAS SIGALL TAUALL GAM FS GRAV
global RHO CD FLAGW SPEED LP L DELT
=2 WF'
OF ( 3
"L _ WF L'
"L"
'Lp
)/(
E'"
-----------"-----"
Initialize values
Thet
hir
dco
ost
rai
ott
ran
sla
test
o
ELAS 200e+09i Modulus of elasticity -Pa
SIGALL = 250E+06i % allowabe normal stress -Pa
C3(X1X2)
o
w+OFSO.u (
2.1
3) TAUALL =145e+06i allowable shear stress - Pa
I l i 7
l I
I
I 1
E

68 G
RAP
HICAlOPTIMIZATION 2
.3 ADDITIONALE
XAM
PLE
S 69

GAM= 7860; densityof material kg/m3 ylabel{'inside diameter''FontName''times'


FS 2.5; % factor of safety FontSize'12)
GRAV 9.81; gravitational acceleration grid
- hold on
RHO l.225; density of air kg/m3
CD l.0 ; % drag coefficient figure a new figure window
FLAGW 5000; concentrated load on flag -N contour{x1x2ineq1[glvalglval]'r-');
SPEED 156.46; I
/S hold on
"- draw another contour at 10 the constraint boundary
LP 8; location of drag load on flag -m contour{x1x2ineq1[O.l*glvalO.l*glval]'b-');
L 10; lengthof pole set{gca'xtick'[0 0.2 0.4 0.6 0.8 l.O])
DELT 0.05; allowable deflection - m set{gca'ytick'[0 0.2 0.4 0.6 0.8 l.O])
-- xlabel{'outside diameter''FontName''times''...
glval SIGALL/FS right hand side values FontSize'12);
g2val TAUALL/FS for the constraints ylabel{'inside diameter''FontName''times''.
g3val DELT FontSize'12);
g4val 0.001 hold off
----'------ grid
x 0.02:0.01:1; the semi-colon at the end prevents
t he echo the following code maybe usefu1 for the consolidated
x2=0.025:0.01:1; these are also the side consraints figure. Not used here __ uncomment below
t x1 and x2 are vectors filled with numbers [C2han2] contour{x1 x2 ineq1[glvalglval]'r-');
note a way to avoid x1 x2 clabel{C2 han2);
[X1 X2] meshgrid{x1x2); set{h2 'Linewidth'1)
generates matrices X1 and X2 corresponding to k2 gtext('gl');
vectors x1 and x2 set{k2'FontName''Times''FontWeight''bold'.
FontSize' 14
Color'red')
f1 obj_ex3(X1 X2);
the objective function is evaluated over the entire figure
mesh contour(x1 x2ineq2[g2valg2val]'r-');
hold on
Constraints are evaluated contour(x1 x2ineq2[0.1*g2val0.1*g2val]b-');
ineq1 ineq1_ex3{X1 X2); set{gca 'xtick'[O 0.2 0.4 0.6 0.8 l.0))
ineq2 ineq2_ex3(X1 X2); set{gca 'ytick'[0 0.2 0.4 0.6 0.8 l.0))
ineq3 ineq3_ex3{X1X2); xlabel{'outside diameter' 'FontName''times'
ineq4 ineq4_ex3(X1X2); FontSize' 12);
ylabel{'inside diameter' 'FontName'
[C1han1] contour{xlx2f1[01000050000 'times' 'FontSize' 12);
100000 150000 200000250000300000]'g-'); hold off
clabel(C1han1); grid
set(gca'xtick'[0 0.2 0.4 0.6 0.8 l.O])
set(gca'ytick'[0 0.2 0.4 0.6 0.8 1.0)) [
C3
han3] contour(x1
x2ineq2[g2val
g2val]'r--');
xlabel('outside diameter''FontName''times' clabel{C3
han3);
FontSize'12); set(h3'LineWidth'
1)
70 G
RAP
HIC
ALO
PTI
MIZ
ATI
ON 2
.3A
OOI
TIO
NALE
XAM
PLE
S 7
1

k3 gtext('g2');
se(k3'FontName''Times''FontWeight''bold' the equality and in~quality constraints are
FontSize'
14'Color''red') not written with 0 on the right hand side.
If you do write them that way you would have t
figure 0
include [ 0
] in the contour commands
contour(x1X2ineq3[g3valg3val]'r-');
hold on 1neal ex3
.
.
..m (the first constraint)
.
contour(xlx2ineq3[0.1*g3val0.1*g3val]'b-'); function retval ineq1_ex3(XlX2)
set(gca'xtick'[
set(gca'ytick'[
0 0.2 0.4 0.6 0.8 1.0])
0 0.2 0.4 0.6 0.8 1.0])
xlabel('outside diameter''FontName''times'

global statement is used to share same information
between various m-files
global ELAS SIGALL TAUALL GAM FS GRAV
FontSize'12); global RHO CD FLAGW SPEED LP L DELT
ylabel('inside diameter''FontName''times'
FontSize'12); AREA 0.25* pi*(X1.^2 - X2.^2)i matrix
hold off INERTIA = pi*(X1.^4 X2.^4)!64i matrix
~rid FD 0.5*RHO*SPEED*SPEED*CD*X1i
MW 0.25*FD*L*L.*X1.!INER T1Ai
[C4han4] m contour(x1x2ineq3[g3valg3val]'b-'); MF 0.5*FLAGW * LP*Xl.!INERT1Ai
clabel(C4han4);
set(h4'LineWidth'1) SIGW GAM GRAV*Li
k4 = gtext('g3')i
set(k4'FontName''Times''FontWeight''bold' retval MW + MF + SIGWi SIGW is added to al1 matrix
FontSize'14'Color''blue') % elements

figure 1nea2 ex3.m (the second constraint)


contour(x1x2ineq4[g4valg4val]'r-')i function retval ineq2_ex3(X1X2)
hold on global statement is used to share same information
contour(x1x2ineq4[0.001*g4val0.001*g4val]'b-')i betweenvarious m-files
set(gca'xtick'[0 0.2 0.4 0.6 0.8 1.0]) global ELA8 8IGALL TAUALL GAM FS GRAV
set(gca'ytick'[0 0.2 0.4 0.6 0.8 1.0]) global RHO CD FLAGW SPEED LP L DELT
xlabel('outside diameter''FontName''times'
FontSize'12)i AREA 0.25* pi*(X1.^2 - X2.^2)i
ylabel('inside diameter''FontName''times' INERTIA ~ pi*(X1.^4 - X2.^4)!64i
FontSize'12); FD 0.5*RHO*SPEED*SPEED*CD*X1;
hold off 8 FLAGW + (FD L)i
grid o (X1.*X1 + X1.*X2 + X2.*X2)!6.0i
retval 8.*0./NERTIA;
[C5han5] contour(xl
x2
ineq4[g4val
g4val]

b--')i inea1t:L.m (the third constraint)
clabel(C5
han5)i function retval ineq3_ex3(X1X2)
set(h5'LineWidth'1) global statement is used to share same infonation
k5 gtext('g4')i betweenvarious m-files
set(k5'FontName''Times''FontWeight''bold' global ELAS.SGALLTAUALL GAM FS GRAV
FontSize'14'Color''blue') global RHO CD FLAGW SPEED LP L DELT
72 G
RAP
HIC
ALo
pnM
IZA
TIO
N 2
.3 AD
DlTI
ONA
LEX
AMP
LES 73

AREA 0.25* pi*(Xl.^2 - X2.^2);


INERTIA pi*(Xl.^4 X2.^4)/64;
FD = 0.5*RHO*SPEED*SPEED*CD*Xl;
dw FD*L^4./(8*E S INERTIA);
df (2.0 FLAGW*L^3 - FLAGW*L*L*LP)./(ELAS*NERTIA);

retval dw + df;

in 4 ex3.m (the fourth constraint) ~


function retval ineq4_ex3(XlX2)
retval Xl X2;

Figure2.9di
spla
ysthegraph
icalorcons
ol id
atedsol
utionto pr
oblcm.le c
odc
i
savaila
ble lhem.fil
ea bov
e( bycommentingt hecode
s c real
ct h
enewf igur
e
windowsandr emo
vi n
gt h
ecommentsont hecodc isc ur
rcnt
lycommentcd).Thc
opt
imals o
luti
onisn o
tv eyc
r 1ear
.F igu 2 .
10iso b
taindb yzoominginn e
are
neigh
bor h
oodof0.6.Sechelpz o
o mforin ucti
ononi t
su s
e.ltcanbea ch
icvedby

F
1l
lgP
ol
cb
lc
m
0
.5
80.
60.
620
.6
40.
660
.6
80.
70 .72 0.
76 0
.8
out
sid
edia
mCl
cr

ig
F u
re2
.10G
rap
hic
als
olu
tlo
n(z
oom
ed)
: :
amp
le2
.3.
0
.81
-

t
ypi
ngzooma
tth
ewo
rks
pac
epromptandu
sin
gth
emouset
odr
agar
ect
ang
lea
rou
nd
er egi
onthatndstobee n
lar
ged.FromFigu
re2 .1
0cs olu
tionisarou
ndt h
e
outs
idcdiam
eterof0.
68m dtll
cinsi
dedi
ameterof0.65m.Typingzoomin
aoa

unu

workspa
c eag
ainwi
lltog
gle ba
cktononnaJst
at
e.InFigu
re2.10 tic
k
UES-

marksarepl
acedonth
efigu
rethr
oughecommandwindowf orb
cttc
rint
et a
tio
n
ofthes
olu
tion
.
Theg ra
phicsinea boveexnplewerecre
atedusingthesamestat
emen
ls
enc
ounte
redprev
iou
sly.C
olorco
ntour
swereuse
dtoest
abl
ishth
efeas
ibl
ere
gion.
he

zoomfeat
urewasemploy t
oobta
inabet
tcres
tim
atcoftheso
lut
ion
.

2
.3.
3 Example2
.4
0
.2
Thisexampleisumea rcaofheattr
ans
fer
.Thep roblemistodesignatria
ngul
ar
fi
no f smalle
stvolumet ha
tw i
llatleas
td e
live
rs pe
cific
df i
neffic
ien
cies
.The
gra
phic
alit t
u ofthi
sc odeisverysimil
artoExample2 .3
.l nisc xamplet
he
0
.2 0
.4 0.
6 0
.8 in
equal
itycons
train
tsarecomputedandretumedfromas in
glefunc
tionm.fi
lerath
er
ou
tsi
ded
iam
ele
r
ans ep
aratcfi
lescon
sideredintheprev
iousexample
.A notherncwf ea
lur
ei nth
is
F
lgu
re2
.9G
rap
hlc
als
ol
ul
io
n:E
xam
ple2
.3
. exampleistoi nvo
kespec
ialm at
hemat
icalf u
ncti
onsthesesse
If un
ction
st h
ata
74 GRAPHICALOPT
lMIZATION 2
.3 ADDITIONALEXAMPLES 75

ava
ilab
leinMATLAB.sexamplea loi
s I
1us
trsap rob
l e
mwheretheopti
mizat
ion
problemcanbea deq
uatel
yd ef
ine
db utthesolu
tioniseas
ilydet
ermine
df romthe
equ
alit
yands ideconsa
int
s.Inothrwords
e t
heproblemcaneas
ilyaccommodate
add
itio
naldemandingcon
stra
int
s.Inlar
gecomplcxmathemat
icalmode
lsw i
thmany
dcsi
gnvari
ablcsi
tisnoteasytoen
suretha
tatleas
to n
eo fthci
neq
uali
tyconst
rnts
Sa
I c
tiv
e.

Des 'nProblem: M z e amounto


fm a
ter
ialuse
dinedi ofasc
ric
s b b
ofide
ntic
altri
ang
ula
rfi
nst
hatcov
erag iv
cnar
eaandope
ratea
torabovct
hesp
eci
fie
d F
Jgu
re2
.11 F
lnd
esl
gnf
orh
eatt
ra
ns
fe
r:E
xam
ple2.
4.
c
f f
icicn
ci.

Cons
train ns:Thc h
tFunct
e
att r
ans
fere
qua
tionsfort hefi
na r
ca va
ilab
lein
MathematlcalModel:T hi
st y
peo fpro
ble
ms ho
uldbeabl
etoaccommodate Re
ferenc
e7.Finsar
ety
pic
all
ymountedonas
pec
ifi
ed . 1
efi
rs
tcons
i nti
sone
se
vera
ld c
signvar
iab
les
.I nth
issec
tinep
o rob
lemiss
etuptoh
avetwod e
sign onare
a:
va
ria
bl.1efinmat
eria
lisalum
inum.

h
(b
L):Af 0
.01 =
5m2 2.
( 17
)
DesignParameters: Foraluminum
Not
e:isc o
nstr
aintess
enti
allyfix
estheva
lueofb.Ineg ra
phthi
scon
strai
ntwil

=
h 50W/m 2[co
nvec
tionc
oef
fic
icn
t] beastr
aig
htlin
eparal
leltoc La
xis.lfi
swcretohappeninaprob
lcmwithscv
era
I
k 1=
77W/m-K[ th
erma
lcond
uct
ivit
y) desi
gnvar
iabl
esi
twouldb eprudentt
oelim
inat
eisvaria
blcfro
mthemath
e m
atica
l
=
N 20[numberoffi
ns] modelbyident
ifyi
ngitasad e
signpa l
r e
te
r.
W=O.1m [
wid
of
thef
ins
) eeffi
cienc
yo fasingl
efincanbeest
abli
shed

F
ingapi
sts
h amca
sth
eba
sel
eng
tho
fth
etr
ian
gul
arf
in
. =
r (
l/mL)1(
2mL
)lI
o(
2
mL)
w
her
e
DesignV
ari
abl
es
m =(
2
/
h )
112
b
:ba
seoft
hetri
ang
ula
rfin
L
:he
igh
tofth
ctria
ngu
larf
in del
'sa
reB
ess
ele
qua
tio
nso
fth
efi
rstk
in.Thef
d ir
sti
ncq
ual
ityc
ons
tra
inti
s

F
igu
rc2
.11i
lu
J s
at
egeom
yof f
in
s.
b
g( L): f~ 0
.95 2.
(18)
Theo
ver
allc
ffi
cie
ncyf
ort
heh
eatt
ran
sfe
ris
GeometricR
elat
lons:Thfol
low
ingaresomeo
fth
ar
eac
alc
ula
tio
nst
hata
reu
scd
l
ate
rinthedcv
elopm
cntofccons
ain
ts: Jo=l-N*41)(
T

Af=(2N-1)*bV fo
otpri
ntofef i
nandg a
p Thef
ina
lin
equ
ali
tyc
ons
tra
inti
s
Ac=2*W*[2+(
L !
b2)
2
]11
2 f
ina r
eaforhea
ttran
sfe
r
Ab=(N-l)*b*W gapar
g2(b
L):T
Jo~ 0
.94 2.
( 19
)
A=
t N*Ac+Ab to
talareafo
rheattr
ans
fer
SideC
ons
tra
int
s:Thes
idec
ons
ai
nts
O
bje
cti
veF
unc
tio
n: Thet
ota
lvolumeo
fma
ia
lfo
rth
efi
nis
0
.00
1SbSO. 5 (
2.2
0)
j
(b
L =
) O.
5*N*W*b*L 2.
( 16
) 0
.01SLS0
.03
76 G
RAP
HIC
ALO
PTI
MIZ
ATI
ON 2
.3A
DDI
TIO
NALE
XAM
PLE
S n
MATLABC ode:S im
ilartoeprevi
ousexample.thehashm arksont h
einequ
alit
y eq1 eq1_ex4(X1
X2); the equality constraint
consai
ntcanb ees
tab
lishe
dbyplo
ttin
gtwov a
I u
esoft h
econstr
aint
:theli
mitvalu
e
andav a
luehigh
er.Onceyhavbeendeter
mined.the
nt h
econsoli
datedfi
gur
ecan [ineq1ineq2] ine~ex4(X1 X2);
beesta
blish
ed.Th
c odeshownher
ewilldrawaIlth
ef u
ncti
onsinsepar
atewindo
ws. inthe above note that the two inequalityconstraints
Fortheconsol
idate
dplotthi
sco
den ec
dstob eedit
ed.Iti
sl e
fttothestud
ent m are obtained simultaneously. Keep in mind
ex
ercls
e. that each constraint is a matrix

mThemains
cri
ptf
il
e ready for the plots
[
C1han1] contour(x1 x2f1[0.000010.00002 ...
Chapter 2: Optimization with MATLAB 0.000040.000060.00008O.OOOl] 'g');
% Dr. P.Venkataraman clabel(Clhan1);
% Example 2.4 Sec.2.3 set(gcaxtick'[0.001 0.0015 0.002 0.0025 0.003
0.0035 0.004 0.0045 0.005])
graphicalsolutionusingMATLAB (twodesignvariables) set(gca'ytick' [0.010 0.015 0.02 0.025 0.03 0.125]);
Minimumfin volume for efficient heat transfer xlabel('fin length' 'FontName''times''FontSize'12);
material Aluminum yl el('finwidth' 'FontName''times''FontSize'12)
------------------- grid
global statement is used to share same information % hold on
betweenvarious m-files
global N H K W AREA figure open a new figure window
"---------


! p10tting the equality constraint
nitializevalues contour(x1x2eq1[h1valh1val] 'r-');
N 20 number of fins set(gca'xtick'[0.001 0.0015 0.002 0.0025 0.003
W 0.1 widthof fins 0.0035 0.004 0.0045 0.005])
50.0 convectioncoefficient W/m*m set(gca'ytick'[0.010 0.015 0..
02 0.025 0.03 0.125]);
K 177.0 thermal conductivity W/m-K
AREA 0.015 available fin foot print area xlabel('fin length''FontName''times''FontSize'12);
------- ylabel('fin width''FontName''times''FontSize'12)
right hand limits for the functions grid
h1val AREA;
glval 0.95;
I
'
t
' plotting the first inequality constraint
g2val 0.94; figure
---- contour(x1x2ineq1[0.9680.968]r-);
x1=0.001:0.0001:0.005; hold on
x2=0.01:0.001:0.03; x1 and x2 are vectors filledwith contour(x1x2ineq1[0.9690.969]'b-');
numbers set(gca'xtick'[0.001 0.0015 0.002 0.0025 0.003
[ X
1 X2] meshgrid(x1x2); 0.0035 0.004 0.0045 0.005])
g enerates matrices X1 and X2 corresponding to
v ectors x1 and x2 set(gca'ytick'[0.010 0.015 0.02 0.025 0.03 0.125J);
xlabel('fin length''FontName''times''FontSize'12);
f1 = obj_ex4(X1X2);
ylabel('fin width'
FontNar 'times'FontSize'12)
the objective function is evaluated over the entire hold off
mesh
grid
Constraints are evaluated plotting the second inequality constraint
78 G
AAP
HIC
ALO
PTI
MIZ
ATI
ON 2
.4 AoomONAlM
ATl
.ADG
AAP
HIC
S 7
9

figure
contour(x1x2ineq2[g2valg2val]'r-');
1
m
hold on
contour(x1x2ineq2[1.01*g2val1.01*g2val]'b-');
set(gca'xtick'[0.001 0.0015 0.002 0.0025 0.003
0.0035 0.004 0.0045 0.005])
set(gca'ytick'[0.010 0.015 0.02 0.025 0.03 0.125]); 0
.0
45
xlabel('fin length''FontName''times''FontSize'12);
ylabel('fin width''FontName''times''FontSize'12)
hold off
grid


1 l

i
O

nb.Lel
eob
jec
tiv
efu
nct
ion

function retval obj_ex4(X1


X2) 0
.0
25
volume of the fin
global N H K W AREA
retval 0.5*N*W*X1.*X2

qlJ.mThee
qua
lit
y i
nt
1
.
5 2 2
.5 3 3
.5 S
function retval eql_ex4(Xl X2) f
inb
ase
(m) x
10-
3
the equality constraint on area
global N H K W AREA g
ure
2.1
2 G
rap
hlc
als
ol
ul
io
n:E
xam
ple2
.4
.
retval (2.0 N - 1)*W*Xl;

~ Theinequ~lity c
ons
tra
int
s 2
.4 ADDITIONALMATLABGRAPHICS

function [retlret2] ine~ex4(Xl X2) Thiss ectionprovidab rie


fe xposuretoa dditionalf e
atur
eso fH andleGraphics
returns both the inequality constraints inc
1ud in
gd evelop
m en tofaGUIi nM ATLAB.Th ec ov
erageisv erym ode
s ta n
di s
global N H K W AREA inc
1u dedh crefort hcs akeo fcomplctenessasweh aveaccomp lish
cdo urgoalo f
c 2*sqrt(2.0)*sqrt(/K)*X2./sqrt( X l); grap
h ic
alo ptim
izatio n ep reviouss ect
ion s.T hiss ec
tionc a
nb ea voided
retl (besseli(1c
)../((0.5*c).*besseli(Oc))); postponedo re mphas izedfort hepr o
jectsinec our
seasi th asnoa ddi
tiona
l
Ae 2.0*W*sqrt((X2.*X2 + .25*Xl.*X1)); info
r mationf rg
o raphicalo p
timizat
ion.I tdoesc ontainreasonablcinfonn
ationin
Ab (N-1)*W*X1; E
undcrstandingMATLABg r
aphicsa n
dp rogrammin g.Ther ead
erise ncour
agedt otake
At N*A e + Ab; somct imeg et
tingfamiliarwithev ersionofMA TI.ABin
stal
ledo nhismach
ine.Th ere
Ar Af./At;
.
. areusuallys ign
ific
a nte nhancementsi nnewcrv ersionsofM AT LAB.Fore xample
ret2 (1.0 -N *Ar. (1 - ret1)); MATLABV rs
ion5.3(i sbooki sbasedonV ersio n5.2)allowsyo utocust
omizey our
plta
o nda ddannotationstoitr oughadditio
na1ed itingi
t1o f w in d
ow.
Thea bovesc
rip
tfil
esshoul
dd isp
layeachfun
ctio
ninas cp
ara
tefig
urewindow
. Youdon oth avetoc ustomizeyo u
rf igu
ret h
roughc odealon
e.I nthisse
ctin
o wew il
l
Theinequ
alit
yconst
nli
ntfig
uresshouldco
ntaintwocont
ourswihcb
t luecon
tour a
1sob ede vel
opingt heGUIu s
ingMATLABH and leG raph
icss o weh av emore
ind
icat
ingef e
asib
lereg
ion
.F ig
2 .
12disp
lay
sac omp
ositeplo
tTh esol
uti
onis expe
r ien w i MA TI.ABHandleGraphics.MA TI.ABd oprovidcaGUIc reati
ont o
ol
detc
nninedbythee
qual
ityco
nstr
aintandth
el o
werI
imiton ef
inlen
gd i
scu
ssed
11
<' guidea ttheuserisrecommendedt oexplo
re.
pr
eviou
sly. nt
I hep revio
uss ectiontherew ereonlyt wod e signvar
iable
s.Anc qlIys pace
d
vect
o rwaso b
tainedf ore a
chv aria
blcb asedon s idcconstr
aint.A mshgridwas

."
'
80 GRAPHICALO
PTI
MIZ
ATI
ON 2
.4A
OOI
TIO
NALMA BG
TA R
APH
ICS 8
1

eng e
nera
ted.AlIfunc
tionswercevaluat
edont hi
sg r
id.Contourplo
15weredrawn ob
jt. o bjti ntumhast h
el in
etex
tandimageobject.All0e c
tsin
f
orthefunct
ionsrepr
esent
ing obje
ctiveandc o
nstra
ints
.E xc
eptfort h
eobje
ctiv
e MATLABcanbea s
soci
atedwi ase
tofp r
oper
tiesatisusua
llybasedoni1
5f u
ncti
on
fu
nctio
nwhichd ispla
yeds e
vera
lc on
t ou
rs t
heconstr
aintswereo n
lydrawnf ora oruse
ful
ncss
.D if
fere
nto bj
ectty
peshaved i
ffer
entset
so fpr
oper
ties
.Eacho fthc
s
s
ingleva
luc
.T hi
sp r
oceduresugg
eststhepos
sibi
lit
yo fautom
ation
.U serinpu
twil
lbe prop
eesisd e
scrib
cdthroughapai
ro frel
atedinfo
rmati
on( nameval
ue)
. ef i
rs
t
ne
cessar
yforselc
ctig ngcf
n orthevari
ablesaswellasthcfunc
tions a
twi
llbe elem
ento fthi
sp ai
rist henamcf ort h
ep roper
tyand t h
es econdisthev al
ue
p
lott
ed.
cor
respo
ndingto p r
operty
.Wheneo e c
tiscreat
edi
tinhe
rit
sallofthede
fau
lt
Inth
isscct
ionwewillcrea
teplo
ttingfac
ili
tytoincludeaGUIt ha
tw i
ll
prope
es.Fore x
ample:

O
bta
in enumbero
fpl
o15 plot(
sin(2*)'-go'
. Th
era
ngeandi
ncr
cme
nto
fth
ede
sig
nva
ria
ble
s LineWidh'2
Useafi
lese
lec
tio x/u
nbo ti
li
tya
tth
eus
erw
illu
st
oid
ent
ifyef
unc
tio
nto MarkerEdgeColor'''
k
bepl
ott
ed MarkerFaceColor'[0.49 1 0.63]
MarkerSize'12)
Promptt
heu
serf
ort
henumbero
fco
nto
urf
ore
achp
lot
Allowselectionofcontourlevels Thelas
tf o
ur1inesabovcr ep
resen
tf ourprop
erti
eso fep lotte
dl in
ethatisbeing
Creatctheplot c
u
h
n
i
a
n
t
ge
sa
d
r
.Th
einp
ep
oin
r
t
o
s
p
ertyn
.Thec
a
o
r
l
n
o
o

rv a
neI
lu
ei
cf
tc
sarowv
anbee
c
cto
a
ro
si
lyu n
d
f c
er
o
l
s
o
to
rv
od
a
.l
lu
e
ef
sbet
o
r
w
m
e
a
e
ts
nz
i
e
z
r
e
o
l
eex
crc
isew
illr
equ
irctwom
-fi
les
:on
e10s
etupeGUIa
ndeo
rt
oas
sis
tin andoncreprese
ntin
gt h
er d
e gr
eenandb l
uev a
luesres
pect
ively.Therearesevc
ral
t
hepl
ott
in.Th
g euse
rwillbeabl
etotw
eakth
cploti
ntheCommandwindowa
ftri
e t ot
hrpropee soft h
ep lo
ttedlinewhichw il
lb esctatt hci
rd efa
ultvalue
s.Th c
i
sdra
wn.Thef ol
lowin
gs u
bse
ction
spse
ntabr
iefin
tro
duc
tio
ntoHan
dlcGra
phics MATLABonlinercf
erenc
es houdI
l is
tallobjec
15andt h
cirpropees.
an
dGUIc on
tro
lsinVersion5
.3. Ingene
ral.objec
tp r
oper
tiescll
nb ec ha
ngedbyu singthes rf
e un
ctiontochange
th
eirv
alue
s.S im
ilar
lyobj
ectprope
rtiesc bercadbyt h
eu seofthegetfun
ction
.To
in
quir
ea b
outt h
epropert
yo fan0t:
2
.4.
1 HandleGraphics
get(handle'Property Name')
MA T
I.
.AB HandleG raphicsr efertoac ollec
tiono flow-levelg r
aphicr outinest hat
ge(h_1'Color')
act
uallygeneratcorcarryoutgraphicalc hang
esyous i nthcMA.A Bfigurewindow.
Forthemostp a
rttheseroutinesaretra n
sparen
t dt ypical
lyu s
ersn cedn o
tbea wa rc I
nth
eab
ove
h_li
seh
and
leo
fth
eob
jec
twhosec
olo
risd
esi
rcd
.Si
mil
ary
l
ofthem.I nfa
cttounderstandoptimizationandtop rogramt h
et echn
iquesi nMA T
I.
.AB
i
tisn otn ece
ssarytoknowa boutHan dleG r
aphicss inc
eu singtheh i
gher-lev e
lp lot se(handle 'Property Name' 'Property Value')
commandss uchasplotandc ontouriss u
ffici
enttog e
tthejobd one."Th
es ccommands set(h_l'Color''r') or set(h_1'Color'[1 0 0])
act
uallyk ickins c
vcralo feHandleG r
aphicsr ou
tines10d isp
lay ep lo
tont he
fi
gure.A notewor lyf eatu
reo fMA TI.
.ABgraphic
si s i tisi mp l
e mente d i
nt h
eabove valueofColorfortheobjcc
trepre
scn
t bythehand
lch_lisse
t10
obj
ecto
riente
dm anncr.Wh atthi
smeansi st h
atm ostoft he e syous eeont h
e r
cdintwow ays.Thes ccondspecifithecol
orredthro
ughthevect
orval
uc.I
tis
fig
urcI
ikea xsl
e abes
l tc
x
t andl inesarcal
lo bj
ec15.Thismcanst hatmosto ft h
e e
xpectc
dthattheob
jectide
ntif
iedthrou
ghh _1sho
uldhav
eaC o
lorprop
ert
y.MA T
t.A
B
gra
phicali temsont hefigureh avepro p
ertie
s C b echa ngedr ou g
hprogram w
illinfo
rmyouo fth
ce r
rorincaseyouareassi
gnin
gaprop
ert
y/val
ue tisno
tvali
d
cod
e.I nt heprevio
uss ecti
onsweu sedt hi
stom anipulatecolorfon
ts ie
z li
n wid

f
ortheobje
ct.
andtheIike.
Ino rdertoc hangeep ropee so fobjecs
t itisn e
c sarytoi d
entifyo rr e
ferto
thcm.Obj ect
si nMATLABa reident
ifiedbyau niquenumberr eferred asah andle
. 2
.4.
2 GraphlcalUserI
nte
rfa
ce
Handlesc anbea s
signedtoallo b
jec15whent he
ya rccrc
atcd.Someo b j
ec15 p artof
oth
ero b
jccts.Objectsthatcontainothero bj
ec15arcreferre
dt oascontainero rparent Themosts i
gnifi
can
tf e
atur
co fsoft
waredesig
nandd evel
o p
men ttodayisthe
. Thereisad ef
initch ie
rarch
i s ctureamongo bj
ects.
' her ooto fa l
l obj
ect
-or
ien
tedd e
signpara
digm wasb r
ief
lyiI
Ius
trat
edinep rev
ioussec
tio
n.
MATLABg raph
ic01 5isef igu
reo bjt.Th efi g
ure0e ctforexamplec a nho l
d Thecomb
inati
o nofth
eabovewithe
vent-
dri
venprogrammingisbothanatu
ralanda
se
vcralGUIc ontr
olswhicha reknowna su i
contro
lo bj
ec15.It31socontainst he es q
uir
edfca
turcincur
ren
tsoftw
arcprogr
ams.Ins
tea
do ftheprogra
m scon
trol
ledby
82 G
RAP
HIC
ALO
PTI
MIZ
ATI
ON 2
.4A
DDI
TIO
NALM
ATL
ABG
RAP
HIC
S 83
E J

ap redeterminedp rocessings u enc e( ba


tchp rocessing)t od
ay '
sp roc
essingi s 'Position'[2.50.10.7.
2]
govemedbyt heusert hroughsomed ir
l tedmousec lick
sa ndb uttons.Th e
s euser 'BackgroundColor''red'
sel
e c
tionscausec e
rtaineventst h
atinstru
ctthes o
ft w
aret ocarryoutsomea ct
ion.The String'EXIT'
o 1f ir
eeevenareu suallyreferre
d1 0 u se
ri nt
e e lcmc . Itis 'Callback''close');
importanttou nderstandt hatt h
csamee vc
n t
sc anb et r
iggeredbyo b tai
ningu ser
responsctos ce np romptsa lt hecommandl in
c( unattr
activ
c).U sin gb u
tt o
nst o Int
heabo
vcIinesofc
odc
.Hpushisth
ehand
letoth
epush
-but
tonob
jec.
tI
tiscre
ate
d
achievet h
esamer esu
lti 5moreg la m
oro u
sa lthoughi tu s
esmorecompu t io
n byusi
ngth
ef u
ncti
onuic
ont
ro.
lTh
i si
sth
efunc
tio
ntha
twillc
rea
tetheu
serin
tcr
fac
e
s
ources.lnf a
c
tf orco m
me rcialsuccessitisn essa
r ytoi n
cludet h
ismechanismo f elements.Th esamef unc
tionisu sedt oplacesevera
ld ierentuserint
erfacee lements
userintr
e.
actioninth esoftwarep r
o du tAl
c. s
o.u s
erse xpecttheseel emen ts10b ehave thr oughtheselecti
ono fthestylep r
o p
e rt
y.I ntheexampleb elow.t h
esei n
c ludelabel
inas tandardw ay.T herea remanye lements t h
eu se
rc anu set oi nter
actw ith box csandu sere di
ta b
letexlb oxe
s.S eve
ralp aramete
rsi denti
fyL h
et ypo fl emcnt
program5.Manya pplicat
ionsa cr
ossse v
eraldisci
plinesh avcnowd e finedaminimum UEatisc rea
tedandt heproper
t ie
sU Eatn eedtobeset.Eachp ro p
e n
yi ssett hrougha
5tanda
r dcolle
ctiono fe seelements.MATLAB5 0providcst hem.Th eo rg
anization propertynamelproper t
yvaluep ai
r.HfilinIi ncso fc odea bovc t ot he
ofe seelemenlsa ndt h
eirpresentat
iontot heuserinag raphlc
almanneri sidentif
ied hand l
eo fthefigurewindowi nwhicht hiselementwi Ubep lace
d.Thet ypeo fe lement
asegr phlcaluseri n
terf
a .A n umbero fGUI-basedt 1
s .n ct
i on
s. a v
a ila
ble createdisap ush-but t
one lementc s
tablish t h
ro u
gh S tylepropertysn gname
attheMATLABs i
te. push."TheU nitsu sedtos i
zeandp ositionthep ushb u
t t
onisi nc
hes.TheP osition
T h
iss ectio
np rov
i desonlyab ri
efin t
roductio
nt oee le
m e
ntsu sedi nthee xample. propertyisarowv ec t
oroff o valuesg ivingtheLe f
t
.B ottom.W idth.Heig hto fthe
Thsee lcmentsarep rimar
ilyu sedt hroughMATLABH an dlcGraphi csp rogram ming. elementi ntheU nitssclecte
de ar
lier
.Thed efaul
tl oca
tiono ftheorigi
ni stheb o tto
m
Considerthec ascofab u
tton att h
eu sercanp ushtoc ausesomea ction.referredto lc
ftcomero fthefigu window.TheB ackgroundCol o
rf orthebutto
nisscttor ed.Th c
asap ushb uttonint hcsubseq u
entd isc
ussion.Att heo ut
set.thereru t wop r
i nci
pal labelthatwil
beont hefaceo fthep ushbuttonisEXIT.T hisistheTCXlp ropertyo f
requiremcntsa tarec xpe
ctlo
ft h
ep ushb ut
ton.Firs
tt he erm ustb eablet osee thep u
sh-buttono b
je c.
tTh cCal l
Ba ckpropertyoft h
ep ushbuttonis estri
ng c
lose."
it
.Second.whcneu s
erclicksonit( si
ngleversusdoub leclic
ksc anb ed isti
nguished Thiss t
ringwillbet hcparameterint heevalf u
nctionatisc all
edwhen p ushlclick
inmanys oftwarede velopmentc ode
s)t heb ut
tonmust spondwi s omee xpected eventi st ri
gged.MATLAB commandc losew illb ee xecutedint h
eCommand
act
ion.InMA TLABthep ushbuttonisag ra
phicalott.Ith asmanyp rope t hatcan wor kspacewhent h
ep ushb uttni
o sp s sed.Th lswillc ausel h
ef igur
ewindow
beu sedtodescribeitsapp r an
ceont h
cs cr
ecn.InMA' LAB.al
lg raphicalo bj
ectsc an displayingthepu s
hb u
ttontoc1 o
sc.
onlyappe inaf igurcwindow.Henccaf ig
urewindowi se sse
ntialt od isp
l aythc Onlyafewe lementsareu sedini ssccti
on.TheCal 1Backs trin
gsarea lsoq uit
e
pushb utto
n. i sf igurewindowactsac ontai
nera ndca nco ntainmanyu ser s ighorw .B efo redcvelopingt hcc o
de.itisu sef
ult oo b
serve h lerarchica
l
int
erfacee l
cmcnts.C onsideringt hep r
esentati
ono ft heb utt
onont hcs crccnitis orderinw hicht heg rap
hicalo bj
ectsi nMATLADa reorg a
n iz
ed( repro
ducedfrome
nessaryt odccidewheret hebuttons h
oulda ppr onefigw w indow howb igit MATLABd ocumentation)inF igure2.13.Th er oo
ti mpl
iest hestar
tingresourcef oraI
l
shouldbe whatlabelits h
oul dhave( ty
pical
lyi n
dicatesk indofa ctionitisl ik
ely graphicdisplaysinM ATLAB.Itsh andleu sua
llyh asav alueofO.Ther oota lsos erv
es
cause) ds oon .S incct h
ep ushb uttonisag raphicalobject mucho ft hese asac ontain
erf oral
lo ft h
ef igur
ew in dows.A notherexprcssionforisr elationshi
p
propee sc b esetifthercisah andleavailab
leforIhep ush-buttono bjcct
.Oncet he i
sth a
taf igur
ewindowi sthech il
do fther oo.
tFromt hehierarchyi
tisessent
ialnote
graphl
1a ppearancei st ak eu se
ri nte
rfacee le
ments.uiconrolo ruimenuc o n
lye xis
tw ii na

R
o+o
t

U
lco
ntr
ol Ax
es Ulmenu

Image L
lne Patch Surface Text l
igh
t
Hpush uicontrol(Hfig_1'Style''push'
'Units''inches' 1g
F u
re2
.13H
ler
arc
hic
als
lru
clu
rel
orMA
TlABg
rap
hlc
alo
bj
ec
ls
.
8
4 G
RAP
HIC
ALO
PTI
MlZAnON 2.
4 A
DOI
TIO
NALM
AT
LA
DGR
APH
ICS 8
5

f
igu
rewind
ow.80a
l50the e
5obj
ectI
. nth
efoll
owi
ngcodeea
chint
erf
aceele
men
t BackgroundColor''white'
i
sfi
rs
tass
oci
ate
dwi ahan
dle50ep ro
per
tyofth
eeleme
ntcanbe f
en t
o String''
i
fnec
ess
ary
.Thisi
sespe
cia
llytr
ueofth
etex
tentr
yboxestoinv
oktheCal
l8ac
k 'Callback''Np str2nUm(get(Ht_2"String"))i');
s
ng5.
HLX1L uicontrol(Hfig_l
2
.4.
3 GUICode 'Style''text'
'Units''inches'
l
efo
llo
win
gco
dewi
1g
l e
ner
atet
heGUI
.Th
eui
wai
t q
uir
est
ha
li
swi
ndo
wbe 'Position'[0.10.80.5.
2]
c
los
edb
efo
res
ubs
equ
entp
roc
ess
ingc
ant
akep
lac
e(o
ruiresume b
euS
edi
nE 'String''x1(min)')i
d
e).
HT_XIL uicontrol(Hfig_l
.
Gll
..
yl 'Style' 'edit'
'Units' 'inches'
GUI for Plotting facility 'Position'[ 0.70.8 0.7.]
2
D . P.VenkataramanApplied Optimization Using MATLAB 'BackgroundColor' 'white'
'String'"
%Ch.2 Sec. 2.4 'Callback' 'xlmin str2num(get(HT XIL
'

String' ))i')j

GUI is createdwithin a figure window


------- HL_XIM uicontrol(Hfig_1
Hfig_1 "
' figure; Hfig_1 is the handle to the 'Style''text'
figurewindow 'Units''inches'
'Position'[1.50.80.6.
2]
set(Hfig_l'Color'[ 0.30.60.] ... set color
5 'String''incremen')i
NumberTitle''off' nowindow title
Name' 'Set Range for Design variables' HTX1M uicontrol(Hfig_l
'Units''inches' inchesused to layout 'Style''edit'
%o ther controls 'Units' 'inches'
'Menubar''none' 'Position'[ 2.20.8
0.7.]
2
'Position'[444.41.5]); BackgroundColor''white'
String'
Positionpropertyis [leftbottomwidthheight] in 'Callback' 'x1inc str2num(get(HT_X1M
'
Units selected String' ))j')j

Ht_1 uicontrol(Hfig_1 HL_X1U uicontrol(Hfig_1


Style' text' Style'text'
'Units' 'inches' 'Units''inches'
'position'[ 0.11
.12.4.2] 'Position'(3.00.80.5.
2]
'String''Number of Functions to Plo
); 'String''xl(max)')j
--
t
c


o''o


n''n
o
H'86
1


4'''
t

es
ulti
H

ztno

sL''
f

HT_X1U uicontrol(Hfig_l
1 'l
qd
hU

' n
e

- 1
sup

'' 1

--CI
Gn'
yi

'Style' 'edit'
--'

'Units' 'inches'

]
s

'Position'( 3.60.8
0.7.
2]
u
J
L



8
6 G
RAP
HIC
AlO
PTI
MIZ
ATI
ON 2
.4 A
DDI
TIO
NAlMA
11A
IiG
RAP
HIC
S 8
7


BackgroundColor''white' 'Position'[3.60.50.7.]
2
String'
'BackgroundColor''white'
'
Callbac

l 'x1max str2num(ge(HT_X1U
String''
String'));
);
Callbacl'x2max str2num(get(HT_X2U
'
String'));
);
E
_X2L uicontrol(Hfig_l
Style'text' Hlabel uicontrol(Hfig_1
'Units''inches' Style'
text'
'Position'[0.10
.5
0.5.
2) 'Units''inches'
'string''x2(min)'); 'position'[0.10.12.2.
21
'BackgroundColor''y'
HT_X2L =uicontrol(Hfig_l 'String''After enteringvalues please press
Style'
edit' EXT');
'units''inches' Hpush uicontrol(Hfig_1 'St
yle'
'pu
sh'
'Position'[ 0
.70.50.7.)
2 'units' 'inches'
'BackgroundColor''white' 'Position'[ 2.50.10.7.1
2
String' BackgroundColor' 'r
e d'
'Callback''x2min str2num(get(HT_X2L
' String' 'EXIT'
String'));
); 'Callback''close');
uiwait
HL_X2M uicontrol(Hfi9_1
Style'text' I
ntheabovecodees tate
menl
SshouldbecYt oin
terpretM
. ucho fth
ec odec be
'Units''inches' e
dit
aft
erc op
ya ndp t
eoper
ati
on.Thelastcommanduiwait i n
st
ruclSMATLAB
'Position'[1.50.50.6.
2) t
oh o
ldoffexecut
ionunti
ltheuserclos
eseGUIw i
n dow.Figu 214s
. howsthe
'String''increment'); ima
geoftheGUI i ta
pprsinMATLAB.letex
tb o
xesa rcin
it
ia
liz
.edwi
thn oval
ues
fo
rci
ngeu sertosetvalue
se r
ebyc a
usinga1o
l ft heC a
llBackstri
ngstob e
HT_X2M uicontrol(Hfig_1 ev
alu
ate
d.Ina d
diti
ont
hd a
taent
eredbytheuse
risas ing
.Ithastobeconvert
edto
Style''edit' anum
ber.T hedehe i
sb a
si
c.Itdoesnotver
ifyatt heuse
rd i
de n
teran u
mber.
'Units''inches' isv e
rif
icati
onc anbed oneb ye xt
endingeC a
l lBackstri
ngo verm u
lti
ple
'position'[2.20.50.7.)
2 st
atem
enl.T
S h
isisle
ft anexer
ciseinprogrammin
gf ortheus
er
.
'BackgroundColor''white' Thesc
riptm-f
ileusedtose
lec
t dc r
eat
et h
ep l
0lSi
sa sfoll
ows.
'String''
'Callback''x2inc str2num(get(HT_X2M
' m.m
String'));'); Script file to gowithContourplotting
Dr. P.VenkataramanAppliedOptimizationUsingMATLAB
HL_X2U uicontrol(Hfig_1
'Style''text'
'' '
'Units inc
'Position'[
h
3
e
.
s
00.50.5.
2]
-

'string''x2(max)'); El1li E
HT_X2U uicontrol(Hfig_1
'Style''
edi
t'
'Units''
inche
s' E
F
lgu
re2
.1
4Im
ageo
fGU
I.
88 G
RAP
HIC
AlO
PTI
MIZ
ATlON 2
.
4AO
DIT
ION
AlMA11ABG
RAP
HIC
S 89

Ch. 2Sec 2.4 for Mp10t l:Np


text1 ['The function which is being p10tedmust
script M fi1e for 20 Contour P10tting of functions 'nbe a MATLAB'
% invo1ved in optimization 'nfunction M - Fi1e. Given a meshed matrix input'
A11 functions are expected to be avai1ab1e as 'nit must return a Matrix'
MATLAB function m-fi1es 'nP1ease se1ect function name in the dia10g box .
F unctionswil1bese1ectedthroughthe input se1ection and hit returnn '1;
box % this prints the text to the screen in the command
Function input parameters wi11 be meshed matrices windowand serves as a prompt
basedon the range of parameters avai1ab1e from GU the n is a new 1ine command

The Number of p10ts and range for the p10t fprintf(tex1
)
are obtained from running the
user interface script GUI2_4 prior using the uigetfi1e dia10g box
to the ca11 to P1ot20.m [fi1epathl uigetfi1e('c:*.m''Fi1es of type
MATLAB m-fi1e'300300);
check if fi1e is string
GU
2 4 call the GUI
strip the .m extension from the fi1e so it can be
ca11edby the program
XnfoYlnfo are introduced for introducing default if isstr(file)
values functname strrep(file '.m'");
Xinfo [xlmin x1max x1inc1; e1se
the va1ues x1minx1maxx1inc are avai1ab1e in fprintf('nn')
the Command workspace due to Ca11Back text2 [ You have chosen CANCEL or the fi1e was
'nnot accepab1e'
if isempty(Xinfo) 'nThe program needs a Fi1e to Continue'
Xinfo [
-4 4 0.051 defau1t 'nP1ease ca11 P1ot20 again and choose a fi1e OR '
end 'npress the up-arrow button to scro11 through
fprintf('n') 'nprevious commands nn'
l
1
:
r Bye 1'];

2

Yinfo [x2min x2max x2inc1; error(text2);


11

if isempty(Yinfo) end
Yinfo 4 4 0.051
end c1ear text1 text2; c1ears the variab1es text1 .
fprintf('n') and text2 for reuse
xvar Xinfo(1):Xinfo(3):xinfo(2); % xl vector c1ear Fun maxva1 minva1 strcon conva1ue oneva1ue
yvar Yinfo(1):Yinfo(3):Yinfo(2); % x2 vector 1abcont 1abcontU
[X1X21= meshgrid(xvar yvar); matrixmesh
Fun feva1(functname XlX2);
maxva1 max(max(Fun));
set defau1t number of p10ts to 1 minva1 min(min(Fun));
if isempty(Np)
fprintf('Thecontourranges fromMIN: 12.3fMAX.
Np 1 ; 12.3f 'minva1maxva1);
end fprintf('n');
c1 ; c1ear figure
strcon input('DO you want to set contour va1ues ?

90 G
RAP
HIC
Alo
pnM
IZA
TIO
N R
EFE
REN
CES 9
1

[no]:''S'); labcont input( 00youwant labelledcontours ? [...


strconU upper(strcon); no]:' 's');
if strcmp(strconU 'YES') Istrcmp(strco 'Y') labcontU upper(labcont);
fprintf(' Input a vector of contour levels ); if strcmp(labcontU'YES')Istrc (labcontU
Y')
fprintf('n') [Ch) contour(xvaryvarFunncon);
fprintf('between 10.2f and 10.2f 'minvalmaxval); clabel(Ch);
fprintf('n') else
convalue input( ' Inputcontourlevel asaVector : '); contour(xvaryvar
F lncon)
labcont input('Ooyouwant labelledcontours ? end
[no]:' s');
labcontU upper(labcont); end
if strcmp(labcontU'YES')Istrcmp(labcontU 'Y') end
[Ch] contour(xvaryvarFunconvalue); if Np > 1
clabel(Ch); hold on;
else end
contour(xvaryvarFunconvalue); Hf gcf;
end end

else figure(Hf)i
ncon input('Input number of contours [ 20] :'); grid
if isempty(ncon) hold off
ncon 20;
labcont input('Oo you want labelled contours ? Inthea bovetheplot
tingcommandsh avebeenusedbefo
re.ThenewMATLAB
[no]:' s') commandsa r
eisempty clfisstr strrepmaxminupper strcmp an
d
labcontU upper(labcont); fprint.Uset h
eh e
lpcommand1 0lea
rnmoreaboutth
ese
.Runt hescri
ptfie d
l
if strcmp(labcontU'YES')Istrcmp(labcontU'Y') unde
rstan
dt hesu en
ceo fact
ionsaswell epromptsreg
ardin
gthec o
ntour
.In
[Ch] contour(xvaryvarFunncon); isexamplethefun
ctio
ns c r
ealeth
eplotdon
otneedglo
balval
uesforca
lcul
atio
n
clabel(Ch); sfe
'e
df romecommandw orksp
ace.Inoth
erwordsthefu
ncti
ons a r
etobe
else pl
otte
dc a
nb ecalcu
late
din d
epen
dentl
y.
contour(xvaryvarFunncon);
end
elseif ncon 1 REFERENCES
onevalue input( 'Input thesinglecontourlevel ');
labcont input( '00youwant labelledcontours ? 1
.MATLAB The Langooge ofT
ecl
lli
1 c
alC
omp
lui
ng:U
sil
l V
g MATLAB e
rsi
on5

[no]:' s') MaWos Ic
n.19
98.
labcontU upper{labcont); 2
.MATLABTeLa
h nguageo
fTe
chn
ica
lCO
u
lin
g:U
sin
gMATLABG
rap
his
c V
ers
ion5

if strcmp(labcontU'YES')Istrcmp(labcontU 'Y') M
ath
Wor
ksInc
.1
996.
[Ch] = contour(xvaryvarFun[onevalueonevalue]); 3
.Bo hac hevsk
y1.0.10hn80nM.E.andSle
i nM.L.Ge
nera
lize
dS im
ulate
dAnnea
lin
g
clabel(Ch); f
orF u nci
LonOpti
mizationTecl
mometriVo
c .2
l 8
No.31986
.
else 4
.Aro ra J
.S.ln
trodu
c l
ion10Oplil
llu
mD esignMcGraw-H
I
i NewYor k1
98
9.
contour(xvaryvarFun[onevalueonevalue]); 5
.Be

'

rF
.P.andJ
0s
E .R
.J
r
end Yo r
k1 99
2.
else 6
.Fo x R.W.
andM cDonal
d A
.T.ln
t r
oducl
i o
n10F l
uidMecha
nics4 e
d.W
iley
New
Yo rk 199
2.
7
.Ar paciV.S.Con
ductiollHeatTral
lSf
erAddis o
n-Wesle
yReadig
n MA
196
6.
92 GRAPHICALOPTIMIZATION

3
8
.Hansel
manD.a
ndLt
itl
et
ie
ld
B.Mas
ter
ingMat
lab5ACompr
ehe
nsiveT
uto
ria
la n
d
Refe
ren
ce. M
A''
LABC ur
ricul
umSer
ieP
s ren
tic
e-Ha
JlE
nglew
oodCl
iff
s.NY.
1
996
.
9
.Buil
din
gGUIsw iMATLAB.o n
lin
eref
ere
ncei
npdffo
rma
t.Math
WorksInc
.
.1 9
98.

PROBLEMS

(Manyo ftheg r
aphica1enhancementsarenowp os
sib
lethrou
ghplot
edi
tf e
atu
resi
n
l
ar r
eleas
eso fMA 1LAB.Thefo
lowingp ro
blemsarej
ustsu
gge
stio
ns.Thesugge
ste
d
prob
le m
su s
ea ddi
tionalgraph
icaleleme
nts.anda1sor
u i
redel
eti
nghand
les.Pl
eas

co
nsultMA T
I.
.ABdocumentatio
n.)

2
.
2
.
1 P
l
2 P
r
o
o
tt
d
u
h
c
eba
a
1l
na
i
n
i
s
a
ma
te
je
dd
i
c
t
s
o
p
l
r
yoms
ayo
ft
i
1
1
mp
let
w
j
e
o
c
-
d
t
o
i
r
m
e
y
.
ns
iona
1m h
ani
cs. LINEARPROGRAMMING
2
.3 C
reat
eat w
o-di
mension
alp rogr
amt h
atwil
ldisp
layarandomfi
r i
ngl
oca
tio
n
an
d arandom ta
rgetloca
tio
n.A llow th
eusertochooseini
tia
1velo
cit
y
m
agnitu
deandang
le.Plo
thiste
r c
toryandca
1cu
lat
ehi
serro
r.
2
.4 C
reat
eat h
red
i
mens
iona
lprogramatw i
lldis
pla
yarandomfiri
ngloc
ati
on
a
nd arandom ta
rge
tl o
cat
ion
. Allow eu se
rtochooseini
tia
1v el
oci
ty Them ajorp a
rtoft hisbookd ealswithm nthemntica
1modelsn tn r
ec hn
rncteriz
edby
ma
gnitu
deanddir
ect
ionan
gle
s.Plo
thistra
jec
tor
yandc
alc
ulat
ehiserr
or.
nonlinea
re quati
o n
s.I ikemostof examplesu sedf oriI
Iustr
atio
nu sfar.The
2
.5 Drawtheb
oundaryl
ayerp
rof
ileo
flami
narl
10wov
eral1a
tpla
te.Drawl
ine
s presenceo fas inglen onlineare q
uationint hemodeli ss uff
icien
tt oi d
entif
yt he
in
dic
ati
ngvel
oci
typr
ofi
lea
ttenpo
int
sinth
ebou
ndaryl
aye
r. problemf r omthec lasso fn onl
inearprogramming(NLP)p roble
ms.M athematica
l
2
.6 Cr
eat
eap r
ogramatwi
llpl
ot v
elo
cityp
rof
ilef
orus
er-
spe
cif
ici
npu
ts. programmingi sano e rt ermt h
atisusedtod escr
ibes uchmodelsa nde irsol
utio
n
Al
Iowth
eusert
oex
pres
shisi
npu
tsth
roug
hadia
10gbo
x. chniques.Mosto fe ngineringdesignfal
lsinthi
sc ate
gory.Havingr e
presente
ds uc
h
problemsg raphica
1 1
yi nt hep revio
usc hap
ter.itapp r
s t hegradientandt h

C vareo fn cti
onsi nt hemathematicalmodelhadas igni
fica
nti mpacton
iden
tifyinges olutioneventhoughnoe ffo
rtwasmadet opointouti sf ea
ture
sp if
ica
lly.I nf actg
raphicals olu
tion waso btainedb yi nspe
ctionr ath
ert ha
n
determinedbym athe maticalrelati
onsorentit
ies
.
Thereisanequ a
llyimpo tcIas
so fproblemswhos mathemati
calmodeli smade
upex c
Iusivelyoff unctionst h
ata r
eo nlyI
inearsuchasExample1 .3
modeledi n
Equ o ns1.21-1.24.Thesameexamplew m odifiedinEq ua
tion51.25-1.2850 t
agraphicalsolutionc ouldb edi5cu
sSed.Itisappe ntom g raph
ica1descri
ptio
n
inFi g
ure1 .6a t isnoc u
rvatureevidentinef igu
re.The sepr obl
emsa r
e
m dl inearprogramming ( LP)p roble
ms .Theya ren a
turalines ub
jecto f
operat
ionsr ese
archwhichcoversav astvarie
tyofm odelsu sedforsevera
lk in
dso f
decisi
onm aking.Ex nple1 .3doesrepresentadecision-makingproble
m .Typica
lly
LPc anbeac our
s ebyi tsel
f( orsev
eralcoursesfor tm a
tter)
.As ig
nifica
ntportio
n
ofs uchac o w ouldb etod evelopmathe m
atica1modelsfromd if
feren
ta re
aso f
appl
icationsast h
erei su sua1
1yonen ume
ricalt ec
hn i
quea tiscommonlyu sedto
solveLPp ro
blems.I tisca l
1edt h
es imple
xmethodandi sb as
edont hea lgor
ithmby
D i g[ 1. The method i
] nvolv
esm ostlye lementary row operat
ionst ypic
al
1y
encounteredi nG auss-eliminationt ypemo dst ha
ta rep arto fthen umerica
l
93
94 L
lNEARPROGRAMMING 3
.1 PR08LEMD
EFI
NIT
ION 95

techn
iquesusedinl in
earalgeb
ra.Inischapt
eronlyalimi
ledbu
tu s
efuldisc
ussion ec
onst
rai
ta
n r
erequ
ire
dtobepos
iti
ve(>0)
.Ineprob
lemdefi
ne nE
di qua
tio
ns
ispsent
ed.Fir
stitisimporta
nttounders
tandLPp roble
ms modelin
gi s
suesand 3.
(1)-
(3.
4 t
) hecha
ngesatmustbecar
rie
do u
tin
clu
dec o
nve
rtin
gtheo
bje
cti
ve
the
irsoluti
onase ya redif
fere
ntfrommosto feo the
rp roble
msi nthi
sb ook. fun
ctionto o ppositetype andt ra
nsformingtheconst
rain
15t o e qual
ityt y
pe.
S ondm Yo f c urre
ntn um
erica
lt ech
niquesforNLPp robl
emso bt
aint h
eir Thevi ab
lesXJandX2 re
pres e
ntingthenumbero fComponentP la
c em
entM achines
sol
utionbyl inear
izingt hesolut
ionatthec ur
rentdesignpoint
.The selineari
zed ofmodelAa ndBr esp
ectivel
yc anbeexpectedtobesemiposi
tiveP-0) iseit
her
u at
ions nb esolve dbyemeth Softhi
sc h
apter
.l e a
d e
risdir t
edto y somema ch
ineswillbeo rderedo rnomachinesw i
llbeo rd
ered.Note t hedisete
ofthebooksonLPf oramored eta
ile
dd e
scri
ptionofthemodelsandt h
et ec
hniques mreo ftheprobl emisbeingi gnor
as3.75m achinesofTypeAi snotsomething
astheps e
ntat
ioni ni sbookissimp
lea ndbr
ief
.R ef
erences1-3areusefu
lfort h
is th
atwouldbeo rdered.Th eso l
utionwil
lb er oundedtoas u
itabl
ei nt
ege
r.1tereare
puo s
e. ext
ensivedisc
ussionsindisc a ndint
egerprogrammingl it
era tos ug
gest
ismayn o
lbeeoptimumv alue.Thej us
tifi
cati
onf o
rr oundin
go ffis i tis
conv
enient10dos oatthi
sj unct
ure.
3
.1 PROBLEMDEFINITION Intheo bj
ectiv
ef u
nctionj(x) c o
effic
ien1
5990a nd900a r
ec alle
dt hecost
co
e.cien
15.Eachc oef
fici
ent i sasso
ciatedwi ad esig
nv ar
iable:pre
sen15
Example1.3wi
llbeu s
edtod e
fineth
et e
rminol
ogya ss
ociat
edw iLPproblem. l
e
inc
reas
e( de
ca s
e)inc os
tp erunitchangeintherelate
dv a
ria
ble.les im
plestwayt o
modi
fiedvers
ioDofthep r
oblemisused10develo
pef ormatofth
eLPp r
oblemso
lsform oe c t
ivefunctiont oer equ
iredformatistomultiplyal
lo ftheterms
atwec anfoll
owthroughwitheg r
aphic
alsolu
tion.Them at
hema
ticalmodelh a
s
by-1.Therefor
eenewo bject
i v
ef u
nctionis
twod es
ignvaria
blesxJX2 t
halrepr
esentenumbero fComponentP lacemen
t
Machinesofty
peAandB .res
pect
ive
ly.Theobjectiv
eis10maximizethenumbero f
t M
ini
mize j
(x)
:-990XJ- 900X2- 5250 (
3.5
)
boar
dstobemanufact
ured.Const
rain
tglr e
pr tsea cqu
isiti
ondo]a
J r
sa v
aila
ble
.
InE quati
on( 3.
5) cons
t an
tt ermont her ig
ht(-5250)c a
nb ea bs
oe din t
ot h
e
Con
strai
ntg2 repr
esen1
5ef loorspac
ec on
strain.
tC o
nstrai
ntg3 rep
resen
15e
numbcrofoper
ator
sa v
aila
blc
. lefl-
handsidebydefini
nganewo bjec
tivefunctionL(x
)w i
thoutaffe
ctinge op tal
va1uesforthedesignvari
ables.ltcanbeo b
se r
veda tincre
asingthev a
lueso ft h
e
varia
bleswillmaket heobjectiv
emoren egat
i e
v whichisgooda swea retry i
ngto
Maximize j
(x:990XI+900X2+5250
) (
3.1
) makej (x
)a slowa spos
sibl
e.Ifap a
rtic
ularcostcoe
ffic
ienthadap osi
tives i
gn th
en
incre
asingtheamounto fthecorrespondingvaria
blewouldl e
adtoa nincreaseo fth
e
S
ubj
ectt
o: g
l(x
) 4XI+0
:0. .6X2S8
.5 (
3.2
)
objec
tivefunctin
o whichisn o
ld esi
rableif efunc
tionneedstobem in
i mized.T h
is
ideaisexpl
oitedin eSimplexmethodp res
entedlat
er
.
g2(X):3XJ- X2S25 (
3.3
)
Theq ual
ityc o
nst
rain
t shavet obet ransfor
medtoan u al
ityco aint
.The
simples
twayachievet h
isc hangistoin
d uceanaddi
tiona
ls e
mipositivevariab
le
g
)(x
):3XJ+6X2S70 (
3.4
)
foreachinequa1i
tyconst
raint
.T halwillcrea
teE p o n
dinge q
ualityc o
n snt
inas tr
aightfo
rwardway.Consideref i
rs
tc ons nt
:
x
J~O; X2~0

l
epr
obl
em.d
efi
ne nE
di q
ti
ons(
3.1
(
) 3
.4)i
san
atu
ralr
epr
ese
nta
tio
nof g
J(x
) 4xJ+0
:0. .6~ S8
.5 (
3.2
)
mathem
atica1modeli nengine
eringdesi
g nor yo therdis
cipl
ine
.Bya llo
win
g
u a
lit
y( =)const
J015 dgrterano req 1()c
o
nstr
ain1
5t h
ep r
oblemcoul
d sc
i a
nbet
ran
sfo
rme
dto
accommodateanym a
themati
calmodel a
tischara
cteri
zedbylinea
rfunc
tion
s.Thi
s
ncanbec
r
a
e
l
p
r
t
e
h
o
s
u
e
n
g
ta
hi
li
ti
o
sno
te xp
s
o
s
n
e
s
di
i
dere
nes
dt
t
h
a
ei
nd
a
n
r
e
q
d
u
f
a
o
l
i
r
t
m
yf
atf
o
o
rmo
rth
ft
eLPp
h
em
ro
a
b
t
l
h
e
e
m
m
.
atica
lmodel
g
J(x
) 4x
:0. J+06~ +x
. 3 8
.5 = (
3.6
)

Thenewv aria
bleX3 isreferr
edt oast hs lac
kv ar
iabl
e.Th edefinit
ionisq uil
e
3
.11 S
. ndardFormat
}
appro
priat
eb ec
auseittake
supt heslackoftheorig
ina
lc ons
ainttermswhenitisles
s
8 .
5.1teslackwi1
lbep os
itiveasef rr
sttwot erm
sw i
llbeless o r u a
lto
Thestand
ardform
atoftheLPproblemi
ncl
udeson
lyequa
lit
yc o
nst
rai
n15
.Itiss
ctup 8.
5( fo
rconst
raintsat
isf
actio
n)fr omeo ri
ginaldef
init
ioninEqua
tio n(3
.2.I
) nothe
r
as aminimiz
atio
np roble
m (somcaut
hor
sp rc
fer amaxim
izationprobl
em)
.l n wordsi
tisthediffer
encebetwecn c o
nstr
aintlimi
t(8.5
)a nd f i
rsttwote r
mso f
ad
diti
on.al
lo fth
evaria
ble
sinemodel ee x
pecte
dt obesemip
osit
ive
(0 )or thecons
trai.
ntIftbevaluesofXIa ndX2c a
us ethecon
stra
inttobea ti1
5limitvalue
.
non
negativ
e[ 4
].F
ina
llyth
econsi
ntl
imi
15equa
ntit
yont herig
ht-h
andsi
deof e nX3wil
lb ezero.Thi
sist h
er easo
nitisdetinedtobesemip
osit
ive.Byd efini
tion
.
96 UNEARPROGRAMMING
3
.
1 PR08LEMDEANmON 97

t
her
efo
re3i
X ssim
ila
rtoth
eorig
ina
Jvari
abl
esi
nth
eLPprob
lem.Tr
ansfo
rmi
ngthe wh
ereall=0.4.a12=0.
6.al3=1.Bec
a u
seth
erearefi
vedes
ignvar
iab
lesine
pr
oble
md e
fin
itina
o d
dit
ion
alter
mswi foll
owingc
oef
fic
ien
tsa
'4(=0)and
r
e
a
r
m
e
ain
ingco
nst
rai
ntsinas
imi
larmann
erth
eco
mpl
etee
qua
tion
sinsta
nda
rdfor
mat
al
5(=0
).ar
einclud
edi
nee xp
res
sio
nforg(x
)witho
utchan
gingi
tsme
aning:
g(
x)
:alX +a
' 2+a
2x ' 3+a
3x ' 4+asx
4x s 8
.5 =
M
ini
miz
e j
(x)
:-990x 9
00X
2-5
25
0- (
3.5
)
l
eco
nst
rai
ntg
2()c
X a
nbes
imi
1ar
lye
xp s
seda
s
S
ubj tt
o
: 8'
(X)
:0.4x+0.
6X2+X
J=8.
5 (
3.
6)
g
2(X
)
:z
Gx
+au +a2
3x3+a2
4x4+s
Xs=2
5
8
2(X
):3X-X2+X4=25 (
3.
7)
ec
Th o
ec
ien
tsi
nth
eab
ovee
qua
tio
nca
nbe s
il
yes
tab
lis
hedb
yco
mpa
ris
onw
ith
8
3(
X):3x+6X2+Xs=70 (
3.
8) Eq
uati on( 3.7)
.Le tt
in
gerig
ht-h
ands
idevJu
a e
softhec
onst
rai
ntsbere
pre
sen
tedb
y
b"b2 bm e s
t r
dfor
matinE
quat
ions(3
.5
)(3
.9)c be s
lat
edt
o

x~ 0
; ~~0
; x3~ 0
; x4~ 0
; Xs~ 0 (
3.9
)
M
ini
miz
e j
(x)
:cT
x (
3.1
0)
Equ
ati
ons(
3.
5)(
3.
9)e
xp
rl t
heLPp
rob
lemi
nst
and
ardf
orm
at.Ani
nco
nsi
ste
ncy
canb eobservedw ir es
p ttoef o
rmatoftheproblemsprevious
lyd e
finedinthe S
ubj 0
: g
(x)
:Ax=b (
3.1
1)
book
.Namely 8
(")w asr eserveddefi
nei n
equaJi
tyconsin
tsw hi
leh()d
ef
ined
u aJiyma
t ints
.H ere8(
X)isaJsobein
gu s
edforequaJi
tyn sain
ts.Thischange S
iden a
int
s:"~ 0 (
3.1
2)
i
sa cc o
nunodatedi nisc ha
ptero n
ly.Insubseque
ntc ha
pterstheprio
rm eaningfor
thes ymbolsisr e
stor
ed.A ct
uallysymbolsarenotrequir
ed ec onst
raintunder xrep
rese
n tsthec o lumnve
cto
rofdesig
nvari
abl
esin
clud
inges l
ackva
ria
bleslx
"
dis
c s i
on na 1sobe r rd1
e 0byequati
onn um
ber.Thef ormu1at
ioninE quat
ions X
2
...x]Tmentst heans
posi
tio
nsymbol
).c pre
sent
st h
ecolumnv e
cto
r
(3.
5) -(
3.9
)c a nb ee xpsseds ucc
inct1
yb yr es
orti
ngt oam a
trixn otat
ion.lis ofco
stcoeffi
cient s.[ "C2.
c C
. JT
.br ep
res
ent
sec olumnvect
orofth
econs
t r
ain
t
conversio
ni sq ui
tes t
raight
forward
.B efor
ee mbarkingoni st ran
sforma
tionthe i
Imi
ts.[b"b2 b
m]T.Arepr
ese
ntsth
emxnm atr
ixofcons
tra
intco
eff
ici
ents
.In
repr
e se
ntati
ono ftheobje
ctivefuncti
onneedstobechangd
' ag
ain.Thec o
nstantterm isbooka l
lvec to rs c olu
mnvect
orsun
les
so I
tl
erwi
seide
nti
fie
d.

-
aM

MIN

i
sb roughttother igh
l-han
ds ideso o bj ti
vefuncti
on nb eexpres
s wi

-B

1
c
1h
a

r'EBEEE'EEEEEEaEEE

r -EE E -E E -EEEa--
U U . L U
rEEEEEEEEEEEEEEEEL


12m
12m
term
so n
lyi n
v o
l vi
nged es
ignv ar
iabl
esont h
er i
gh.T h
isiss howna sL(x)below.

EEEEEEEE'EaEEJ
t

Elli--J
-

l
c

aa


aaj

h
.

J
l
A
Oncea gainforconveniencethesames ymbo
lj(x)i
su sedi
np lac
eo fth
isnewf unc
tion


hu

l
.c
t

l
i
ns u bse
quentd isc
ussio
ns.T hesee xt
ras y
mbolsh avebeent hrownint ok eepthe



-W
der
ivationdisti
n .T
ct hisisas mallpric
efortheabil
ity10d e
veloper n
athemat
icaJ


mode linan a
t u
m lwaya nd constr
ucti
ttoc o
nf o
rmtot h
es ta
ndardrepsenta
tionin


mostr e
feren
ces.T h
erefor
e: Co
mpari
ngEq
uat
ion
s(3
.10
)an
d(3
.11
)wi
thE
qua
tio
ns(
3.
5) (
3.8
)ev
ect
orsa
nd
m
atri
xare
M
ini
miz
e L
(x)
:jx
()+5
250=-990x 9
00~
- (
3.
5)
c=[
-99
0-9
0000O
]T
Thfol
lowin
gdefi
nit
ion
sa r
cu sedtor ewrit
tIl
eproblemusin
gmalr
ice
s.Letth
ec o
st
co
eff
ici
ent
sb erep
re
nt
edb yc
C2 . c
"
.Thec o
effic
ient
sinec on
str
ain
tsare b=[
8.
5257
0]T

A
zh
?i:
!

re
pres
ente
db yesym 1 a
ij(usingdo ublesub
scr
ipt
s).lefir
stsu
bscr
iptid
ent
i
c
onst
rai
ntn um
berwh i
1et hese co
n dc on
str
ain
tist hesameasthevari
abl
eitis
mu
lti
plyi
ng.Iti
saJsous
efu1t oide
ntifyr s
tsubsc
riptwithth
er o
wn umberand
th
esecondsub
scr
iptwit hecolum nn um b
ertor respo
ndw iopem
tions tuse
i
Ine
aralgeb
m.F o
re x
amplethe a in
t8(x)wil
1ber ep
s e
nte
d ThefoU
owi
ngaddi
tionaJde
fin
iti
onshav
eb e
enu s
edinthesta
nda
rdforma.ni
t sE
numb
erofd
esignva
riabl
es dmisen umberofco
nst
rai
nts
.Intl
teexa
mple
n=5

g(
x)
" x +a
:a ' 2+a
2x ' 3=8
3x .5 andm=3.Nol
eItl
atthesla
ckvar
iab
lesar
einclu
dedinth
ecountf
orn.
98 LINEAAPAOGRAMMING
3
.1 PAOBLEMOEFINJTION 99

NegatlveValuesofDesignV arlab
les:T heLPs ta
ndar
dm a
the
matia
c1model the
mselvesc a
nb ei g
nored.Thesecoe
fficiensw
t hicharep re
sentasv ec
torsora
all
owsonlyfo
rnonne
gativ
edesi
gnvar
iab
les
.Thi sdoe
snotlim
iteap
pli
cat
ionofLP max canbem an
ipulatedtoyie
ldsol
utionsusingconce
ptsf romline
aralge
bra.
i
na nyway.Ther
eisastan
dardpr
oce
duretohandleneg
ativ
evalu
esfo
rvar
iab
le.I
s fa Al o
o katthegra
phicalsol
utio
ntoth
eLPp ro
b l
ems u
ggeststha
tt h
es o
lut
iontoth
e
de
signvari
abl
esayx
..iscxp
ect
edtobeunres
lrIct
edinsin
g eniti
sde
fine se
da prob
lem i
fi
te x
ist
s m
us tl
ieonthecon
straintboundarybecausethecurva
tureofth
e
di
ffere
ncoftwononn
egati
vevar
iab
lcs oect
ivefunctio
niszeroeverywhe
re(i
ti
sl inea
r)
.F urth
ermorethesol
utio
nto LP
pro
blemisp ri
maril
yi nflu
encedbyEqua
t ion(3.11.B
) ei
ngai Inearequa
tion
.t o
pic
s
x
. =x
-1 .
I-^J
.
;-^
x1
J (
3.1
3) fro
ml i
neara lge
braaren ece
ssarytounderst ds omeo fei mpl
icati
onsofe
m
athema
ti c
alm ode
l.
wher
ex~ a
ndx~ a
reacce
ptab
leLPvar
iab
les
.Ifth
elat
te
rishig
herth
anth
eform
erx
J I
fn=m atis
then umberofunknownsi sthesameast henu mb
ero fva
riab
les
.
ca
nh av
enega
tiveval
ue.E
s qu
ati
on(3.
13)i
su s
edtorep
lac
ex i
nt h
emath
cal t
h
p
r
e
o
r
ec
vid
a
nb
e
do
enos
nee x
i
c
s
t
o
s
'
pef
.I
o
nt
ro
h
pt
ef
i
m
o
iz
1o
l
a
t
w
i
i
o
n
g
sE
na q
.manyo
u
a t
ion(3
f c
.1
1
o
)w
nc
e
i
p
l
t
ld
sa
et
r
e
ec
rm
x
i
p
n
l
a
e s
i
ne
o
dt
l
h
u
r
t
i
o
o
u
g
n
.
h
modelN
. otet
hatisproc
edurca
lsoi
ncre
ase
sthcnumberofdes
ignvar
iab
lint
he
mode.
l s
implegraphic
alillus
tra
tin
o o
rb ycon
sideratio
no fsimplee x
amples.T he
ym ost
ly
d
ealwithexamplesoft wovari
abl
es(x"X2).Fore xampl
econsidrtwoconsain
ts
TypeofC o
nstrai
nts: Theless anore qu
alto(::
:
:
)c on
stra
intw ashandl
ed
g
l: xl+Xz=2
n
a
t
e
a
t
c
u
h
r
a
n
dba
n
l
i
q
l
yi
u
l
s
nd
efo
ob
e
ro
v
e
b
ep
l
t
a
o
o
i
s
p
n
i
t
i
n
i
n
i
gt
gt
v
h
h
et
eLPs
es
h
o
r
l
o
u
u
g
t
t
i
h
a
o
o
nd
a
nr
u
r
e
q
tI
.
dm
ui
r
ft
a
t
e
h
e
he
st
r
m
h
a
ei
at
ica
lmode
tes
sac
l
o
n
a
c
s
kv
t
ra
a
i
n
l
.
r
i
l
ab
l
es
e
t
sb
t i
an
d
ep
sr
a
o
e
r
s
iv
qu

dn

i
r
u
e
e
m
e
t
r
o
s
dt
i
t
c
a
a
r
ob
l
t
e
g
2: -x1+
Xz=1

m
aintai
nedabo
veas p
eci
fie
dv a
luef
orexam
ple F
igu
re3
.1ill
us
tr
ate
sth
egrap
hic
als
olu
tio
ntothepr
oblem
.Theso
lut
ioni tx =
sa 0
.5
a
ndX2=1 .T
.5 hisi
sinde
pend
ento
ftheobj
ect
ivefun
cti
on(w
hate
veritmayb
e)
.ln
m
atr
ixf
orm.Aa n
dbare

g(x):a 2x
" x +aJz+a'3x3~ b (
3.1
4)

U
--

-
r

-


-
-EAt-
-
A

lE

-
A


t
heni
tapp
esna
tura
ltointr
oduc
ean
ega
tiv
esl
ackv
ari
abl
e-X4t
och
ang
eEqu
on

EE -L
-

LU
-


(
3.1
4)t
oaneq
ual
itycon
str
aint
:


g(
x)
lX +a
:al 2x
l 2+a
'3x3-x4bJ
l
w
ee
i
t
x
i
hr
s
o
t
e
w
nc
o

son
fas
l
o
yf
l
o
r
u
t
c
i
o
n
o
nd
ve
e
p
n
i
e
e
n
d
n
c
so
e
nt
)
h
er
.If
t
o
w
h
so
fA(
ero
o
w
rc
o
so
lu
m
fAa
nso
r
fA-wew
elin
ear
l
il
ld
yi
nd
e
a
e
p
l
en
den
tt
henth
ere
i
sau n
iqueso
lut
iont
oes ys
temofequ
ati
ons
.
Whil
eiti
sposs
ibletoch gees i
gnonX4bymul
tipl
yingwit
h-1r o
ughout
is
c
aus
eser ig
ht-
handcon
strai
ntlim
ittob
enega
tiv
ewhic
hs h
ouldb
eavo
ided
.Ins u
ch T
hDefinean
otherprob
lemasfol
lows(on
lycha
ngingb omth
eabov
eexamp
le)
enewproble
mis
c
ass
e ano
thervar
iabl
exsi
si n
clud
edinth
eexpssi
on
.I nth
isca
se
twoaddi
tion
al
v
ari
abl
esarenowpartofthemodel
:
g:
x+ =2

g(
x)
:a
" x +a
' 2+al
2x 3x3-x4+Xs=bJ g2
: 2xl+2x2=4

'ev
h a
ria
bleXsi
sca
lle
d a
rti
fic
ialvar
iab
le.A
rtf
iic
ia
lva
ria
ble
s al
soin
trod
uced Thenewf unct
iong 2rep
rese
ntstwiceev alueo fglThisme a
nsg 2canbeob t
ained
f
or c
hequ
ali
tycon
str
ain
t isn at
ural
lypr
esen
tinth
emode .T
l heus
eo fth
ese m8 J'Th e
refo
re 82i
ss ai
dtod ependon8 1T e
chni
callyetwoq uations e
v
ari
abl
eswi
1b
l ei
ll
ust
rat
edla
te
rt hro
ughanxa
mple. lin
ear
d e
pendent ea c depende
nc eoft hefunc
tionsi
sn otaconcema smuch
asth
efacte yarnotlin
ear
lyindependentB
. oth81and8 2es
tabl
ishth
es amelin
e
gra
phi
call.Wha
y tist h
esolut
iontotheproble m?T h
ereareinfl
nies
t o
lut
ios
n a
sl on
g
3
.1.
2 ModellngIssues asthepairo f(XlX2) va
luessati
sfi
es8 1I nF igur
e3 .a

1 nyp oi
nto nt helin
e
rep
rese
nting81isas olu
tio
n.N otonly(0.51.5)but(2
0)(0)a
2 r
ea l
sosolut
ions
.
TheLPp ro
grami
sc h
ara
cte
rize
db yemathe
matic
alm odeldefindi nEqua
tions From o pti
mizationper
spect
iveisisq u
iteg oodf o
ru n
liketheprev
iousc a
seo f
(3.
10
)(3
.12
).Duetoth
elin
earna
tur fa
eo 1
1ofth
ef u
nct
ionsinv~lved t
hedi
scus
sion uquesoluti
ontheobje
ctiv
ef u
nctio
nc anbeu se dtofi
ndt h
ebestsolu
tio
n.1two u
ld
ofthes
olu
tionne
edonlycon
sider coe
ffi
cie
ntsofthefunctions -theva
ria
bl
bebet
terhow
ever i
fthechoi
cesw e
refinit
er athertha
ninfin
ite
.
1
00 L
INE
ARP
ROG
RAM
MIN
G 3
.
1PR
OBL
EMD
EFI
N1
0N 1
01

-
u
-
i
m

u
U
e
n

e
FM

RH
RM

RM
g.f-
ena 2
;ma 3
:Nos
ol
ut
lo
n;I
n s
ls
te
n!5
e
!

auy
u

H
HM
2


Cas

0
4

F
4


lo

V

vb//
3
3

KAA
m

d////
2
1

)
(
'
"1 )(~ 1


1 1

-
2

-3
J -2 o 2 3 -3
4 -
2 -
1 o
X 2 3
1 X
1

F
lgu
re3
.1U
niq
ues
olu
tio
n-U
nea
rin
dep
end
enc
e.
F
lgu
r3
.2N
oso
lu
li
on
Inc
on
sl
st
en
tse
t01e
qua
tio
ns.
Whiles ever
aJc xa
m ple
sc a
nbec o
nstruc
tedt oill
ust
ra
tel i
nea
rd cp
endencei
t R
cde
fin
eg3a
s
ap
pearsreasona
bletoa ssumethatfo
ra 11 ercis
e optim
izat
iont
henumberof
co
nstra
intscannotequalthenumberoful
Iknowns(m n).Inth
ep r
evio
usill
us n
n=2 dm=1( ther
ewaso n
lyo neef
fec
tiveconsai
nt.I
) ti
susefu
ltorecog
nizetha
t g
3:X
I+2 =
3.5
iscorre
spondstothec a
sen>m .
Thi
snew8 sed
3i as
hedli
nei
nFigu
re3.3
.Nowau niqu
solu
tio
nt oeprob
lem
Ifm>n the
rearemoree quati
onsthanthenumberofv a
ria
ble
s. l
isimp
lies
a
t(0
5
.1 .5)i
ses
tab
lis
hed
.lisi
s othesol
uti
onest
abl
ish
edbyconside
rat
iono
f8
th
es ys
temo fequat
ionsreprese
ntedbyEquation(3.1
1)is inco
nsis
ten
tsetorhasa
dg2a l
one
.Thisimp
lies g3isredu
ndan
t.If81ismulti
pli
cdb y1.58
2is
re
dundantsetofc q
uation
s.C onsi
derthefollowi
ngi l
lus
tra
tio
nform=3a ndn=2
mul
tip
liedby0.
5andbothad
ded
.thcre
sul
tisg3de
fine
dabove
.Thatis
whichusesthesame8a ndg 2asinth
cfirs
tillu
str
ati
onwhileaddin
ganew8 3:

g
3=1
.5g
l+0
.5g
2
g
: X.+X
2=2
canb
eobtai
nedbyl
ine
arl
ycombi
n i
nggandg. i
2 s
.addi
ngcon
sta
ntmul
tip
les
g
2: -x1+
X2=1
o
f n c
tio
ns.Thi
sisa no
there xa
mpleo flin
earde
pende
nce
.T hsl
i in
ear
g
3: X 2=
+2x 1 d
epe
nden
ceandred
und
allC
Yisa
lsoi
IIus
tra
tedbyth
eset

F
e
i
g
x
i
u
s
rc3
.I
t
.
fo
2i
n
l
ew
l
us
e
t
r
r
a
t
et
es t
oex
istt

h
es
h
e
e
to
nth
fe
et
q
u
h
a
r
t
e
i
el
o
n
i
si
ne
si
sm
n
u
s
c
on
tp
s
i
a
s
s
t
en
st
ts
hr
o
i
n
u
c
g
easo
l
hes
u
o
t
i
l
u
o
t
ndonot
i
on.Si
nce
g
: X+"
2=2
eyar a
llsghtlin
ese ec
r anbeo nl
yo neuni
queint
crs
ect
ingp
ointInFig
urc g
2:-
x =1
3.
2onlyt woofthth
reeline
sint
ere
ctatdi
ffe
ren
tpoin
ts. g
3: 2x1
.2
x2=4(
sam
easg
l)
102 L
lNEARPROGRAMMING
3
.1 PROBLEMDEFINITION 103

F
orn=
=mandw
ithg
l l+x
:x 2==2a
ndg
2:X
1+X2=1
em
atr
ixA i
s


C
asena 2 .=:Un
lqU
8so
lu
ll
on
Uno
ard
epe
ndo
nc9

11
;m

-EEEEEE J
3

A
=
4
-
-
E-
a

a
ndi
t
sde
ten
nin
anti
s
h
h

d
et(
A)=I
AI=(
1)*
(1)
(1
)* 1)=2
(

.
r1 Fromt heor
emsinIinearalg
ebra[5]
ifd
et(A)isno
tzero
inwhichca
set h
em atrixA
ter
me dnonsi
ngularauniqueso
l u
tio
nexi
ststoth
esetofeq
uati
on.Th
s i
swasu cfo
r

- "3.5 ee
gr
aph
xamplei
ica
llyi
I
Iu
nF
s
i
g
t
ur
e
e3
da
.1
b
.
oveas o nl
ys o
luti
onw locate
dat(0
.51.5)shown

Considertheexamplewithgl:XI+X2=2dg 2:2x1+2 x
2=4.In i
sc ase

d
et(
A)=I
AI=(
1)*
(2)(1)2
)==0

l
fdet(
A)iszer
oth
ati
sm
atr
i ss
xA i ingu
lar rear
eei
thrn
e oso
lUl
ionsori
nfi
ni
te
s
oll
ll
io
ns. For i
se xa
mpleere were in
fin
iteso
lut
ion
s.Dctcr
m i
nan
tso f
-3 h
igherrdersqu '
ematri
cesareevaluatedbys ett
ingu pl o
wer-or
derdeter
minan
ts
-3 -
2 O 2 3
X u
nti
leyare ducedt oa2x2d ete
r m
inantwhichi se v
aluada sabov
e.An y
1
t
extbookonenginee
ringmathe
maticsorlinera
a 1gebrashouldill
ust
rae i
t stech
niqu
e.
F
lgu
re3
.3U
nlq
ues
ol
ut
ln
o I
In
ea
rde
pen
den
ce. I
tisnot produc
edh e
re.
I
fn" "m d
iscus
sionoftheexi
stenccofsoluti
onsrequi saddi
tio
nalconc
eptsI
ike
r
anko fam at
rixa nda ugme
nledm atr
i x
.S ince c asen>m i so fint
ere
stin
Thissuggests ec on
cepto fredun
dancyc an be ass
ocia
tedw ithl i
nea
r o
ptimi
za t
iononlyt ha
tc aseis employed ins ubsu enti l
Ius
tra
tio
n.A u sef
ul
depe
ndence.Th edis
cussi
onofli
nea
rdependen
c eandinde
pendencewasestabl
ishe
d d
iscus
sionwillneedat1eas
tthre
ev ar
iablesandtwoe q
uations
.T hre
ev a
ria
bleswi
ll
ge q
ua t
ionsabove.Thesamed is
cus
sionc antak
ep lac
cbyr e
asonin
gont h
e d
en yth
eu seofgraph
icstodevel
opt h
ef ol
Iowingc on
cepts.Usingtheset
co
effi
cic
ntst he
mselv
cs.Inthi
scasetheco
effi
cientma xA shouldleadustoe
sameconcIu fI
i
conc
eptofad
si
o
e
nr
ler
m
c
g
i
a
n
r
a
d
n
in
gel
li
sn c
i
n
s
s
e
a
a
ri
r
yt
nd
od
e
e
p
v
e
n
e
d
l
e
o
nc
pt
eo
h
fas
ec
rit
er
e
to
i
aforl
n
i
e
a
n
e
re
ard
q
u
e
a
p
t
e
i
o
n
n
d
e
s
n
. e
ce.
g
t: x1+X
2+X
3 3 =
g
2: -X +0
.5x3 1
.5 =
De
termln
an t:Thed
ete
rmi
nan
tisa
sso
cia
tedw
ithas
qua
rcm
atr
ix.F
orag
ene
ral2x
t
hem
atr
ice
s
2ma
trxA
i where

-
I

A
fl L

--
Il

35
Il
35

1 n
rMlML


-
-

--EE E. J

EEE E
A


-
FEE-EEaE
a

EEEEEEJ
-
=
Ea.
EEEEBEE-J


hu
a
(
3.1
6)
=

--a
A

-
E a

Z
-

u
M

4

d
ed
ete
rmi
nan
tise
xpr
es'edande
val
uat
eda
s Thenewma
tri
xA.i
sca
lldea
e ugm
ente
dmatrix-thecolumnsofbarea
dde
dtoA
.

1
i

a
a
Ac
cordi
ng10re
msoflin
eara
lge
bra(
pre
sent
edh e
rewithoutp
r of
o )
:
3.
(15)

=d



d

t
(


A


)
=a
=

a
21 2 I
fthea
ugm
e n
tedmatr
ix(A)an
dt h
ematr
ixo
fco
eff
ici
ent
s(A
)ha
vet
hesame
r
ankr<nen e
rM manyso
lut
ion
s.
1
04 L
lNEARPROGRAMMING
3
.
1 PROBLEMDEFINITION 105

.I
feaugme
ntedma x(Adem
) a
trixofc
oef
fic
ien
ts(A
)donoth
aveth
e i
neb oo
k. l
e(+1)d( )b
1 elo
war o
bta
inedbyusi
ng
(1);
w
herian
dj
s
ameran
kasolu
tio
nd oesn
otexist
. r
epr
ese
nterowandcol
umnv
alu
esoft
hecoe
ffi
cie
ntmu
lti
ply
ingth
evalu
e
I
fth
eaugment
edm a
trix(A
)a ndth
ematr
ixofcoe
ffi
cie
nts(
A)ha
veth
es a
me
r
ankr=1wheem=n
r the
nt h
erei
sauniqu
sol
uti
on. a
l1 a a
ll "
l -

Rank01aM atri x:W hilether


ea reformaldefi
nition
sf o
rd ef
inin
gt h
er anko fe
A=1 0
;lln ailn(+l)a111273+( l)a1212J2+(+l)a13
~1 ~2 1

I~. ~ I 1
-
-~ I -~:l l
33

max ausefulwayt odetermin


e r ankisl o
o k e deten
n t.'
h erank o
fa
ma
trixAi st h
eo rderofel ar
gestnonsinl a
rs qu
ares ubm
atrixofAt hatise (
3.1
7)
l
arges
ts ubmatrixw i
thad etermi
nanto t
hera nzero. l
ere
for
e
Int h
ee xampl eabove t
helarg
estsquaresubmatrixisa2x2m atri
x(sincem=2

Ill

dm <n

-
an .T aki ngthesubma ixw hichi n
clud
est hefir
sttwoc olumn
so fAe

-EA--A2
''
)

11
-

-
-
A

'Ea'EA

2A
a

-

f2

-
tA
de
terminantw asp reviouse s
tab
lishedtoh aveav alueo the
refor
eno ns
ingular
.

a
'

-
a

-
A

a
s

a
L
Thu th
er anko fAi s2( r=2).l esamec olumnsappearinA m
akingi
tsr ankalso

M
2
. l er
eforeinfini
telym ys o
lution
se xis
t( r<n ).Onew ayde r mineE
so
lution
sist oa ssign(n-r )var
iablesarb v alue
sa ndu s
et hemtod etermine
=(
1)(
0)+(
-1)
(-)+(
2 1)
(3
)=-1
va
luesfort here mainin
grv a
ria
bles.Thev aluen-ri salsooft
eni d
nt
ifiedas
de
gr e
eo f
fr eedom(DOF)f orth
esy st
emo fequ
atio
ns.lnt h
eparti
cul
arexamp l
ea bove A.isnons
ing
ularandi
t
sr a
nkis3wh I
ietheran
kofAis2.Thesys
temofequa
tion
s
eDOFc anb ei den
tifiedwithav alueo f1(i.
e.3-2 .F
) orinsta
ncex3 canbe w
illhavenosol
uti
onsfr
omtheabovet
h orc
ma n
dcanbese
engra
phic
all
yinFigur
e
as
signdav alueo f1inw hichcaseXI=0 .5 dX2=1 .Ont
.5 h
otherhanc
J.ifX3=2 3
.2.Forthesakeofcom
plete
nessus
in gth
ep r
evi
ous
lydef
ine
dd ep
enden
ts e
tof
th
enXI=0 .
2 5andX2=0 .7.Thea
5 b o
vec as
esillu
str
atetha
tforaDOFo f1on c
ex3is e
quati
ons
:
s
elece
td.Xl dX2c anb eobtain
edt hrou
ghsomef urthe
rp r
ocess
ing
.
Anothere xam pleforiI
1ustr
ati
n ger ankisei nconsi
sten
ts yste
mo fequation
s
i
no ducede li
erw heren=2 dm=3 rep
roducedforconvenie
nce g
l: x1+x
2=2
g
2 2=
: -x1+x 1
g
l: x1+x2=2 g
3 x1+2
:2 x
a=4
g
2: -x1+ =1
w
hic
hyi
eld
sth
efo
llo
win
gma
ce
s:
g
3: x1+2
x2=1

l}
[
-l 1
Them
atr
ice
sfo
rth
iss
yst
ema
re
A= b=[!} A'=H !
]

A=H }
l b=[I} A'=H i
]
l Ther
det
er
a
n
m
i
ko
na
n
fAi
tyi
el
.N
s2
d
o
t
sas
e u
i
ngu
la
si
ngt
hefi
rs
ta
r2x2subma
n
dl
x
a
str
o
.Thed
wo
e
te
fAf
r
min
a
o
n
rt
h
to
ec
al
fA i
c
u
s
la
tio
noft
he

-
-


'


'1 1 L
-

-
TherankofAc annotbegrea
ter 2s
incen=2a n
disl es
sth m=3 .Fromp r
ior

.


A--a--E

a ' A a


'
a

2
'ia T

'A
A

+
2A

=
(

'
.
Z
'
ca
lcul
a t
iosed
n e
termina
ntoft h
efir
sttworowso fAis2 .Thisisgr te
rt h
anzero

nu

z
z

00

'

U


.E


B
andthre
for
ether a
nko fAis2.ForA.t h
ed et
ermina
nto fthe3x3m at
rixh a
stob e

exa
mined.Thed eterm
inantofag e
nera
lnxns q
uarematrixAC a
nb ecalcul
atedin
ter
mso fth
ec'act
orsofthematr
ix.Thecofac
torinvo
lvesede nni
nanto faminor whic
hmakesA.s in
gul
ar.Howevert
herankofA i
satle
as
t2duet
o pr
esenc
eof
matrix-whichisan(n-1)x( n-1)matr
ixo bnedb yd
el et
inganappropr
iatesin
gle l
esubmaixwhichdet
ermin
edtherankofA.Fromth
eab
ovetheo
reme
r k
rowa ndasingl
ec olumnf r
omt h
eo r
igi
nalnXnma xA
i multip
liedby1o r-1 ofAise
qua
ltotherar
tkofA.wh
ichis2andthi
sisle
ss m=3.I
tcanbec
oncl
uded
depe
nd i
ngone t
o o fth
er owandcolumnvalu
es.References5a n
d6c p ro
vide ter
earein
fil
li
tesol
o nsfor s ys
temofequat
ion
s.
morinfor
mat
ion.He r
e de
t e
rmin
antforth
e3X3m at
ri xi
sd efi
nedforilu
I st
rat
ion
106 L
lNEARPROGRAMMING 3
.2 GRAPHICALSOLUT
lON 107

rhHh

1111111

rlll111L
r'EEEaEaE E -EL
EEEEEEEEEEEEJ

-
Ause
fulob
serva
tiono
fmatr
ixA thep
c ed
ingexa
mplei
s twooft
herows

FEE--EE E -BEE-L
'znunu

EE--EEEBEESEEJ
nu' nu

nunu'E
EBB-a'EBEE--J


(
3.1
8)

+
a
reaconst
antmult
ipleofe
achoth
er.smakesema ce
ssi
ngu
la.Th
r esame


43

eq

e
43

d
L

'
h
oldsf
ortwocolumnsata
remul
tipl
esofeac
hothe
r.

d
Un /tV ectors:R eal-worldo ptim
i z
ationp roble msf requentlyi nvolve al ar
ge Thea dva
ntageofunitvect
orsise yc ancst
ablis
h ypointintheCars ia
n sp
ace
numbero fdesignvariables(nvariab
l e
s).Inrea
lLPp roblems. enumbero fvariab
les throug
ha na pprop t
et ri
ado fnumberss i
gf yi
ngc o
ordin
atev alue
so r10 tio
n.
canbes ta
ggering.F oras u
ccessfuls ol
utiontoeop z atio
np roblem.i tis Acallyanyp oin
ti neCartians p a
cec anbed e
tennine
db yanys etoft h
l
impli
citlyassumedt hatt heseto fdesignvariab
lesi slinearlyi ndep
e nd
e .
ntTh a
ti s
. lin
earl
yi nde
pendentvecto
rs.Th es
ev e
ctorsaret er
medthebasisvect
ors.Inthi
sc as
e.
thereisnod i
rectd epende nceamonga nytwov ariab
leso ft hesct
.I ni scase.the th
es implec on
nectionb etweenthep oin
ta n
dt heelementa
rya dditi
onillust
rat
ed
abstract~pace spawnedbyt hedesignv a
riable
sisc al
1eden -dim
eflsi
oflalEuclidean abovewi
llnotbeavaila
bl.Fu e rmo
reought hemethodsofiIne
ara l
gebrathe
se
space.Th eworda bstractisuscdh erctosig
nifythati
tisac onstructintheimaginatin
o th
reev cc
torsc anber educcdt otheunitv cct
orst hr
oughele m
entaryr ow/column
aso nlythreevariable
sc a nbeaccommodatedi n f a
miliar3Dp hys
icals pa
ce. le opc
rationsa l
socalledG aus
s -Jor
dane liminat
iono rred
uction
.I nnd i
mens i
onal
designv e
c t
orisap ointi n i
ss pac.Th
e eE uclid
e anspa i sad i
rectextrap
olationof Eucl
i d
eans p
aces p
a nnedbythend esignvariabl
esep oi
ntp"(p..P2...p")wi
ll
thep hysiclgeome
a c al3Ds pace ts urroundsu .T
s hiss paceist er m
e d berepres
entedbyac ol
lecti
ono fnvaluesenclosedinpar
neses.Thec orres
po n
ding
Cartesians p
ace.Fora ni11ustra
tionconsid
erthep oint(232
)i nCartcsi
ans paceorin unitvecto
rsaredf i
nedas
there c
t a
n g
ularc oo
r d
i natesystem.I nFigure3
4
.t hep o
i ntismarkedP .The adof
numbers w ithinp arenthesesd enotest hev alu
esa longt ex
h "X2andX3 es o (
3.1
9)
s p
ectively. o
TheC artes
i ans
markedx"x2'andx3
pacei
Thep
sid
o
e
i
n
t
n
ifi byas
twherct he
yi
e
to
nt
e
fm
rs
e
u
c
tu
ti
a
st
l
lyp
heor
e
i
e
gi
nd
n(
i
0
cu
)o
l l

ft h
i
ec
n
eso
oor
ra
di
x
n
a
e
t
s
e
e
"
=I
.
syslem.Thep o in
tPc a nalsob eassociat
edWitl
lt hev e
ctorOP.drawnf romtll
eo ri
gin
otoepointP.Veryoftenapointandavector-twoverydifferententities-are
useds ynonymou sly.Frome lementaryv e
ctora d
ditionp rinci
plesthevectorOPc an l
eve
cto
rfrom o
rig
in(
0)t
oP"i
s P s
ent
eda
s
becons ctedbyc onsecut i
velyj o
iningthre
ev ectorsalongt hethr coordi
nate es.
Int h
ef igurethisisshownbyl ayingo u
tav e
ctora longt h
ex a xsa
i d
dingav ec
tor OP=
pe +P
2e2+.
..+p"ell

alongeX2a xist oitandf i
nallya ddi
ngt hcthirdv ectora longthcX3 a x
is.The Th
esenewd
efi
nit
ion
swi
llb
esu
ffi
cie
ntt
oun
der
sta
ndt
het
ech
niq
uesu
sedt
oso
lveLP
addit
ionals mallarrow sint hefigureareeL mitv ec
tors.l eyhaveam a g
n itudeof p
robl
ems
.
oneandad irectio
na longe acho fthe es.Th eseunitv ectorsarelabelede"e 2and
e3int hef i
gure.Mathe maticallyp o
intP( 232)andt hevectoradditioncanb e
rcpresented(columnv ecto
rs) 3
.2 GRAPHICALSOLunON

leg r
aphic
ald is
cussio
ni sagainl im
ited10twod esig
nv aria
blesin o ri
gina
l
X
3 problemde
scri
ptio
n.Itisusedh e
ret odevelopcer
taingeometr
ici d
easr e
lat
ed10LP.
InLPthint
roduc
tionofslac
kv ar
iableswil
le a
sil
ye xceedth
islimi
to ftwovari
able
s
fo
rg r
aphic
alil
l atio
n.s othegraphica
ls ol
utionisill
us te
dw ith spe
cttoe
2 or
igin
alv a
riab
lesint hedesig
np roblem.MATLABi sonc eagai
nu sedt o awe

3
g
s
e
r
a
o
l
l
p

e
m

h
uo
e
i

n
c
a
n
ls
.I
ti
o
ti
lu
t
si
ses
i
m
o
p
.Th
n
o
t
r
r
a
t
i
a
n
g
h
ep
tt
tl
r

i
ob

Le
1
lemi
odo50f
sn
o
otr
ran
e
um
afunctionf
d
u
e
c
r
o
e
i
rd
d10t
c
als
ra
o
w
h
l
i
n
es
ut
t
i
o
g1
a
n
in
nd
.S
e
a
i
si
r
df
nc
sd
o
r
eI
e
m
h
v
atf
ep
el
o
r
p
o
i
e
rt
ma
h
r
dt
eg
yg
hr
r
r
a
o
u
a
p
p
g
h
h
i
i
ht
c
a
c
a
h
l
l

X2 fu
nctio
nm -fi
ledrawLine.mb elo
w. i sf uncti
oni salsou sedtop rovi
demore
expo
s toMATLABp rogramming.

draw L
lne.m: i
saf
unc
tio
nmf
il
efo
rdr
awi
ngs
tr
gh
tli
ne
s e1
.l i
ne10b
e
F
lgu
re3
.4R
ect
ang
ula
rco
ord
lna
tes
yst
em. drawnisr
epre
sen
teda
s
108 lNEAAPAOGAAMMING
L 3
.2 GAAPHICALSOLUTION 109

+by=c else cmult -1;


end
Sin
cexya r
eusedsymbolsf orva
ria
bleslr
x e
pres
entsth
elowerran
geonx w
hile end
X2r
epr
ese
ntst
heu
ppe
rra
ngc
. Limit
ingI
ines/c
onst
rain
tscanbcdrawnbyse
ttin
geith
er
aorbt ozer
o.Color(r
ed)i
su scdt
od rawap 'a
ll
elli
neat10%i n
crea
se/d
ecre
ascin set up a factor for drawing the hash constraint
t
heorigin
alvalueofc(dep
endingonthed i
rect
ionoftheor
igi
nalin
equ
alit
y)inst
ead if (abs(c) >= 10)
ofhashmark
s.L im
itcon
stra
intsar
einm agentaandthobj
ect
ivefun
ctio
nisinblue cfac 0.025;
das
hedl in
e. ThenewMA 11.B c
A ommandh er
ei sel inecommand. Youa re elseif (abs(c) > 5) & (abs(c) < 1
0)
enco
a gedtos khe
lpont h
ecommand.Th ecod
e: cfac 0.05;
else
drawLine.m cfac 0.1;
D rawinglinearconstraintsforLPprogrammingproblems end
Dr. P.Venkataraman
OptimizationUsing Matlab if (
c 0)
Chapter 3 linear Programming cdum cmult*O.l;
else
Lines are represented as: ax + by c (c >= 0 ) cdm (
1 + cmult* cfac)*c;
x1x2 indicate the range of x for the line end
typ indicates type of line being drawn 1 (<=)
9 (>=) if b 0 then determine end points of line x line
n (none) b-
if ( =0)
y1 (c -a*x1)/b;
The function will draw line(s) in the figure window y1n (cdum -a* x1)/b;
the green solid line represents the actual value y2 (c - a* x2)/b;
% of the constraint y2n (cdum a*x2)/b;
the red dashed line is 10 larger or smaller else
(in lieu of hash marks) identify limit constrains by magenta color
the limit constraints are identified inmagentacolor str1 ' m'
the objective function is in blue dashed lines str2 'm';
y1 x1; set y1 same length as input x1
function drawLine(x1x2a
b ctyp) y2 x2; set y2 same length as input x2
recognize the types and set color x1 c/a; adjust x1 to actual value
if (typ 'n') x2 c/a; adjust x2 to actual value
str1 'b'; y1n "
'0 ; set y 0 ;
str2 'b' y2n 0 ; set y 0
cmult 1; end
else
str1 '
"' g' if (
a 0)
str2 '
" 'r'; str1 'm'; set color for limit line
end str2 'm'; set color for limit line
end;
values for drawing hash marks
drawaxis with solid black color
dependingon the direction of inequality
if (typ -= 'n') hh line([
x1
x2][
00]);
if (typ == 'l')
cmult +1;
110 lN
L E
ARP
ROG
RAM
MIN
G 3
.
2GR
APH
ICA
LSO
LUT
ION 1
11

set(hh'LineWidth'
1'Color''k'); 8
Or'

hv 1ine([ 00][xlx2]);
set(hv'Linewidth'1'Color''k
'); 5
60
start drawing the lines
line([xl x2] [yl
3
hl y2]);

if (
tp 'n')
set(hl'LineWidth'
2'LineStyle'"
' 'Color'strl);
else
set(hl'LineWidth'
1'LineStyle'
''
'Color'strl);
end
if (b -= O)&{a -= 0)
text(x2y2num2str(c)); ~~
end
if( b ==0)I (a ==0)I( yp 'n') .
.---

grid
..


.



.
.
.
.
..

returnend

grid;

.
.
..
.
.
h

h2 line([xl x2] [yln y2n]); 0


-4

-
5
.J-25
0
0 5 1
0 15 2
0 2
5 3
0
set(h2'LineWidth'
0.S'LineStyle'
':''Color'
str2); Nu
mbo
r01m
ach
lna
s01I
yp
eA
grid
hold on F
lgu
re3
.5G
rap
hlc
als
Ol
ul
inE
o xam
ple3
.1
.

3
.2.
1 Example3
.1 3
.2.
2 C
har
act
erl
stl
cso
ftheSolutlon

Thep
rob
lemf
romp
age94i
sre
pro
duc
ed00 moref
orc
oov
eoi
eoc
e. begm
l etryevidn
tinthegraph
icalsol
utionofExample3.
1isusedtoexpl
ainsome
oftheco n
ceptsassoc
iate
dw ithLPa ndi lSnumeria
c1techn
ique
.F i
gure3.6isE
gra
phicaJrcpse
nlatio
nof c on
stra
intsinvolve
dinExample3 .
1( sa
mea sFigu
re
Maximize j
{X) J+9
:990X 2+5250
00X (
3.1
) 3.
5w i
thouttheobjec
tivcn c
tio
n).Inorderto l
at
eegcometryLPc oncepl
t
S h
c
st
anr dforr
natofLPisn Sy.Thes tanda
rdforr
nates
tabl
ishe
dbeforei
s
S
ubj
t
to: g
.(X
):0
.4.+0
x .62S8
x .5 (
3.2
)
M
ini
miz
e {X
j :-99O
) xJ-900x
2-5250 (
3.5
)
g
2(X
):3
x 2S2
J-X 5 (
3.3
)
S
ubj
ectt
o
: g
.(X
):0
.4.+0
x .6x )=
2+x 8
.5 (
3.6
)
):3
x 2S70
.+6x (
3.4
)
g
2(X
):3
x.-X 4=
2+X 25 (
3.7
)
;.
.~ 0
x
i~ 0
g
3(X
):3
xI+6x s=
2+X 70 (
3.8
)
T
hg ra
phica
1soluti
ooisshowninFigure3.
5.Thesolu
tion
rcadfromt
hcfi
gu (yo
u
Zme
C arcaofsol
utio
o)i
sxj= 10and
xi= 7
.Itisci n
ter
sec
tio
noftheac
tiv
e -
x.~O; x2~0; X3~0; X4~0; x5~0 (
3.9
)
c
onst
rain
ts(3.3)d( 3.4)
.leactu
alv al
uesaex
r j= 1 48 dx
0. i= 6.
42
.S in
cean
i
nter
ga1numbero fm achineshavet ob eord
eredthesolu
tionisadjusteda I
nFigure3.
6t h
econs
tra
int
sx.~ 0andX2~ 0ar
ea ddcdtothet
hre
efunc
tio
nal
ne
ighbor
inginteg
erva1u a
tsat
isf
ieslheco
ntr
ain
ts. c
ons
tra
intI
ine
s(3.6
)-(
3.8
) a
.Theh.
'!
he
dare
aisth
cfeas
ibl
er e
gio
na
tist
hdes
ign
112 L
lNEARPOGRAMMING 3
.2 GRAPHICALSOLUTION 113

(
)
=

50

40
i
Thswouldy
iel
d10p
oin
tsf
oro
ure
xn
ple
whichi
sshowni
nFi
gur
e3.
6.

30
BaslcVarlab
les:Thes e
tofvar
iablesi
nt hebasi
cs o
luti
ontha
th a
ven o
nzeroval
ues
ar
ecal
ledbasi
cvari
abl
es.Cor
respondingy
l thesetofvar
iabl
esinthebasi
cs o
lut
ion
!

20 hav
et h
evalueofze
roarecal
ledn on
basi cvaria
ble
s.Fort h
epointPlXJ dX2
ar
enonba
sicvari
abl
eswhieX3
l
X4 andxsar bas
icvaria
ble
s.
i
2
10

BasicF
eas
lbl
eSo
lut
lon
:Thi
sisab
asi
cso
lut
iont
hati
sal
sof
eas
ibl
e.'
hes
ear
e
ep
oin
tsPl
P2
P3
andP4i
nFi
gur
c3.
6 nLP
.I thes
olu
tio
ntot
hep
rob
le
mifi
tis
uni
quemustbeab
asi
cf e
asib
leso
lut
ion
.Thebas
icso
luti
oncanasobec
I o
nsi
der
ed
geome
caI l
yasac
ornerpoi
ntoranextr
emep
oin
tofth
efeas
ibl
eregi
on.

ConvexPolyhedron:Thi sisaboundedr egionofth


ef e
asibledsignspace-e
rcgi
ondefine
dby q uadrilat
eralcomprisingthepoi
ntsPIP2 P3andP4inFigure
3.
6.Thet e
rmc Ollv
exs e
tr epr
esent
sac olle
ctionofpoint
so rv ec
torshavin
gt he
-3
0
0 5 10 1
5 20 2
5
foll
owingpr
operty:Foran ylwop o
intsinthesct(orwi
thinarcgion)i
fal
lofthepo
int
s
Numbor0
1Ma
chl
n0 1T
80 ypoA onthelin
cconnectingt wopoint
salsoI
iei ncsamer egiont
her egi
onisaconve
x
se
t.Imagin yl in
ed r
lwni
1 nlhcr e
giont
l f
ine
tlbyeq u
ad r
ila t
endwhosecomer
F
lgu
re3
.6F
eas
ibl
ere
gio
nE
xam
ple3
.1
. po
intsarePl P2P
3 andP 4
.FromF igu
re3 .6itisc
1earthelinewilIst
il
lbewi in
spaceinwhichal
lofthecons
trai
ntsaresa
tisf
ied
.Thecirc
lesexa
ggera
tet h
epoin
tsof th
er eg
ionestabl
ishedby qua iJate
r -m akingitaconvexs et
.
int
erse
ctio
no ffi
vecon
strain
tstakentwoatat im
e.Manyo fthemarenumberedPl
P
2. ..P
6.AIIofth
esepoint
sofint
er t
ioncanbeas
socia
tedwithacer
tainp
roper
ty OptlmumS olut
lon:This i
s afea
sib
lesol
uti
on atm
inimi
zesth
eo b
jec
tiv
e
concemingtheva
luesofthevar
iab
les.Notether
earef
ivedcsi
gnvaria
bles(n=5)and func
tion
-pointP4inFigu
re3.6
.InLP t
heoptimums
olu
tio
nmustbeabasi
c
thr
ecfunct
ionalc
ons
train
ts(m=3 ).F o
ren p
lc: fe
asi
bles
olu
tio
n.

P
I x1=
:( x
02= X)=
0
5
8 4=
.x 25
Xs=70) Bas
ls:'heb
asis P s
ent
scco
lumn
softh
eco
eff
icie
ntma
trixA coespond
t
othebas
icvari
abl
es.Theyf o
rmthcb
asi
softh
em -d
imen
sionaIs
pac
e.Th eyare
P
2 x1=
:( ~=
0 11
.67X)=
x
.5
1 4=3
6.7
6 Xs=0) t
ermedt
hebas
isvector
s.
P
5 xJ=
:( 1
0. x
72=7
.0 X)=
5 x
04=0
Xs=-4.4)
CanonlcalForm:' heb a
sisvec
tor duc tounitve
ctorsthroug
hr ow/colu
mn
P
6 x1=
:( 0
x2=1
4.7
1 3=
x 0
x4=3
9.7
1 s=1
X 5.2
4)
op
erati
ons( orG aus
s -
Jordane I
imin
ation
). Th ebasicfeatu
reo fen umerical
Thevaluesofevaria
blesareobta
in e
daseint
e ti
onofth
econs
tra
intstak
entwo te
chniqu
ef o
rLP( Simplexmethod)isa pet
iti
veproced
estart
ingfromaninit
ia
l
/

ba
sicfeas
iblesolu
tionanddeterm
iningeb estneig
hboringbas
icfeas
ibl
es ol
utio
n
/

atatime
.Inea boveI
is
tf oreac
hp oin
tex
act
lytwoofthevar
iab
lesarezer
o.The
J6
4

t
hatimprovestheob
jectiv
e.Thep roc
edureiscar
rie
donu n
tiltheoptimumsoo
l nis
2

number2c orr
espon
dst otheval
ueo fn-m .nrep
res
ent
sthenumberofvari
able
sand
2
p

re
achdori
fitisdetermine
d nos o
lut
ionispos
sibl
e.Thcc an
onica
lf o
rmisu se
d
l

mt henumbero fcons
traint
s.PointsP5a ndP6a r
einfe
asib
lebecaus
eoneo ft
he
z/4124

var
iabl
esh a
san e
gativevalue
. fo
rrapid
1yi de
ntif
yingthesolu
tio
n.Eachi ter
ati
onin proce
durecanbed e
scribe
d
math
ematica
Ilyasfollows
.
Thestart
ingcons
train
ts'corganize
das

BaslcS ol
utlon:Ab asicsoluti
onisoneobta
inedbysett
ingcxa
ctlyn-mv ari
able
s
hr
YY

t
oz er
o.I nFig
ure3 .a
6 Iloft h
ep oi
ntsiden
tifi
edbyt hec i
rcl
esr c
prc
scntbasi
c

[
A]
II
[ 1=[
b] (
3.2
0)
so
lut
ions.Thepoi
ntsc hoscna b
ovea r
eallbas
icv a
riab
les
.I ngene
ralfrnd
o esig
n
va
ria
blesandmconsin
ts numherofba
sicsol
ulio
nsisgiv
cnbyt h
ecombin
ation A
fte
rth
eGa
uss
-Jo
rda
nel
imi
nat
ion
Eq~Jation (
3.2
0)i
sas
sem
ble
das
114 lN
L E
AAPAOGAAMMING 3
.3N
UME
RIC
ALS
OLU
TIO
N-T
HES
IMP
LEXMETHOD 1
15

m[X]m +[
R] n
-m)
[X]
(s)=[
b] po
intisno
tfeas
ibl
ewit
hre
spe
cttoeco
nst
rai
nt82Th
ere
for
et
her
eisnop
oin
t
isfe
asi
bl.Th
e e
rei
snoso
lut
iont
oep ro
ble
m .
These
tofm des
ignv a
ria
ble
sinth
ef i
rs
tterm t
hebas
icvar
iab
Jc.Th
s esc
tof(n-
I
nth
eab
oved
isc
uss
ion
. e t
wo-
var
iab
les
itu
ati
onsp
rov
ide
dano
bvi
ous
m)dc
signva
ria
bJesincsccon
dtcrmare nonbasicv
alu
cs.I
ncS im
pJxmethod
e
Ja
c s
sif
ica
tio
noft
hes
olu
tio
ns.I
npr
act
ice
.LPm
ode
lsa
rel
arg
ewi
tho
verh
und
red
sof
th
cnonba
sicva
riabl
csaresumm
ari
lys e
ttozcr
o.
v
ari
abJ
cs.M ode
l i
nga ndt r
ans
cri
ptionerr
orsmayg i
veris
et omanyo ftheabove
s
itu
ati
on.Th
s eg enemtio
no fsolu
tionisbasedonnumer
icaltcchni
qucsofline
ar
3.
2.3 Di
ntSol onTyp
a
lgebr
a
whichisofte
ns e
nsi
tivet
oeq uali
tyofth
ematri
xo fco
eff
ici
ents
.FiJt
eri
ng
o
uterra
ntdataisusu
allyasign
ifi
cantex
ercis
einth
esear
chofoptima
ls o
lut
ion
s.
Thcrea
atmostfourdi
ffer
entres
uJt
s atcanbee
xpcc
tedfo
rthesoJ
utiono
ftheLP
pro
bJem:(1)auniques
olut
ion(2
)inf
init
eJymanyso
Jut
ios
n (
3)unboundedsol
uti
on
and(4
)t h
ep o
ssi
bil
ityatther
eisnos o
Juti
on. 3
.3 NUMERICALSOLUTION-
THESIMPLEXMETHOD

Thes ta
ndardn u
m e
r i
c a
lp r
ocedureisbasedonea lgorithmduet oOantzig
(
1)Uniques olut
ion: l eexampleu sedf ordiscussi
onh asaUsi qu
es olu
tion mention
ede a
rli
er.Itisrefe 1
0aseS im
p lexmeth o
d.Thep rocedu
reisr e
lated
(F
i 3 .5). leconditio
nn ecess yf oristoo ccuris eo bje
ctive to s ol
utiono fas ystemo fI
inearequations.Th ea ctua
la ppli
catio
no f
fun
ctiona ndthecons
traint
sh avedis s
imilarsJop
e andt
s hefea
sib
Jeregionis proce
durec anbea ssociatedwiththeGauss-Jordanmethodf romlinea
ra l
gebra
.
boundcdlJo
c sed
.G eo
metricallyth
isc a
nb evisua
llyexpJai
nedasthemovement wherethecoeff
icintrowsa retransfo
rmedt hroughe1ementarymulti
plicat
ionand
ofel in
er epr
escnt
ingt h
co bjec
tivefu n
ctionp u
llc
J10itse
Jfi
naf avo
rabJe add
itio
n.Mostmainframecomputcri nst
allati
onsu sua
llyc ar
rys of
twarethatwil
l
di
recti
onunti
litremainsjustincontactwithoneo fthefea
sibJ
ecomers( bic helpsolv
eLPp roblems.MATLAsa ls
op rov
i d
esp rocedures10so l
veLPp roble
ms
fea
sib
Jes oJuti
on)o fthef easi
bler eg
i o
n.Thef e ib
Jer eg
ionisi d
enti
fied init
sO ptimiz
ationT ooJb ox.Inthissccti
ont heSimplxmethodi sa pp
liedto
ui
stin
ctlyinF ig 3.
6.A s imp
lr ciscufi magin
ingd i
ffe obje
ctiv simpl
ep ro
blm primaril
yt uundcrs
tunuthcpl'Ogrumminga ndge o
mctricfeat
ures
.
fun
ctionJine
ss hou
ldc onvincethevi e
w ertha
ts e
veraldif
fere
ntobje
ctive
s n Thiswil
lb eusedwhenwed iscu
ssdire
cItechniquesf o
rn on
linearproble
ms.I nthe
bedefinedtoloca
tetheu ni
q uesol
utionatP1 P
2
P3 orP4.This20geome nextsecti
ontheSimplexmethodi si n
troducedi nd e
taiJwithe xp
lanati
ons.In
andconstru
ctioncanbeu sedtounderstandtheextensio
ntond im
ension
s.He subseq
uentsectionsMATLAB.o rspr
eadsheetpr ogra
m si
IkeExcelcana lsobeu sed
tei
h IneswilJbereprese
n t
edbyl y
Iperplanes. toimplementtheSimpJexm ethod.
(
2)ln
fin
ilesolu
tio
n: Inorde
rf o
ri stooccur eo
bject
ivefunct
ionmustb e
p
aral
leltooneo fth
ec on
sint
s.ForexampleinFigur
e3 6
. le
tt h
eorigin
al 3
.3.
1 FeaturesoftheSlmplexMethod
prob
lember ed
efine
ds o theobj
ecti
vefuncti
onispar
all
eltothecon
strai
nt
hAnyp oin
tont h
ec o
nst
rain
tandlyin
gb e
t we
enthelin
es egm
entdcfinedby I
nth
issec
tion
.themachineseJe
ctio
nexnpJeint
roduce
dear
Jie
rissetupforap
plyin
g
epoint
sp2a ndP4 i
sanoptima
lsolu
tiontothepr
o b
lem.Theywillyie
Jde t
heSimpl
exmc od.Itisins
truc
tivet
onotcthemethodisi
ter
ati
ve.Givenastar
tin
g
sa
rnevalueof v e
. p
oiti
n
twillmarchforwar
dt hr
oughimpr
ovingdesi
gnsunithasf oun
dthesohon
o
rcann
otp ro
ceedfu
rthe
r.F o
rc om
plet
enesstheor
igin
alproble
misr e
writ
tenher
e:
(
3)Unboundeds ol
lll
io: I
n ni scaseth
ef e
asibl
er eg
ionisnotb ounded.In
Figure3.6i
fthecon
strai
ntsglandg2weren otpar
toftheprobJemformuJ
ation
e nt h
ef e
asib
Jer e
gionisnotboundont hetop
.R efe
rringt
oF igurc3.5
.E Maximizc j
(X:9
) 90xl+9
0O2+5
x 250 (
3.1
)
obj ti
vefunctio
nc anbes hi
ftedunl
ilTUtedhighe
rv a
lue
s.Inp r
actie
c there
S
ubj
ectt
o: 8
1(X
):O. l+0 2:s
;8.
5 (
3.2
)
4

wi
l lbeanu pp
erboundon rangeofth
ed esig
nv ar
iabJ
es(no
tp t o
fstandd 4x .6X
5F

format)tha
twilJbeusedtocJoseisre
gion.inwhichc a
sesol
utionsoftype(1
)
i

:3
x 2:
I-X s
;25 3.
( 3
)
r

or( 2
)c anberecove
red.Th eprcs
enceofa nunboundeds o
lut
iona1sosuggcst
s g
2(X
)
-2TIz--

tt hef o
rmulat
iono f p roblemmayb el ac
kin
g.A dd
itio
nalm eanin
g f
ul
c
on st
rain
t(s)c beaccommodatedt odef
i nethesoJ
utio
n. 8
3(X
):3xI+6
x ;7
2:
S 0 3.
( 4
)

(
4)Nosolu
lio
n:Figu
re3.6isusedtoexpl
ainispos
sibi
Iit
y.C
onsi
der E x1~O; x2~0

d
ire
ctio
no fine
qual
ityi
n8 1ischan
gedtoth
co p
posit
et y
pe(
).Thef
easib
lc

r
egio
nw i r
cspec
ttoth
ec on
stmi
ntsgland8
3istotherig
hto
fXI J5.
0.T=
his Thep
rob
lemwasa
Jsot
ran
sfo
rme
d10t
hes
tan
dar
dfo
rma
tasf
oll
ows
.
116 L
lNE
ARPROGRAMMING
3
.3N
UME
RIC
ALS
OLU
TlO T
N- H
ESI
MPL
EXMETHOD 117
Ex
ample3.1
Withth
isinmind
theS
imple
xmethodisa
ppl
iedt
othemachines
ele
cti
onp
rob
lem
.
Thcexamplew
illu
seandc
Jar
ifyt
heit
emsint
heab
oveI
is.
t
M
ini
miz
e J
(X:-
) O
99xI- 90
Ox2- 5250 (
3.5
)

S
ubj
ectt
o: g(
X)
:0
.
4x
l+0
.6x2+x
3 8
.5 = (
3.6
)
3
.3.
2 AppllcatlonofSlmplexMethod

g
2(X
):3
x -x2+X4=25 (
3.7
) SimplexTable3
var
iablenames
.1
.Thel
:I
as
nTable3.
trowi seo
1(SimplexTnble1)cf
bject
ivefun
ction.Spread
i
s
r
h
s
trowi
eetsar
n
ea
d
ic
ne
a
f
t
c
f
st
ici
e
h
n
e
t
n symbolfc
g
3(X
):3
xI+6x
2+X
s 70 = (
3.8
)
wayt op r
o sst
removedfromel
hei
a
s
nf
onnati
o
tcolumna
n. i
ndlas
tisb
trowt
ein
oa
gcmployed
ll
own u
m eri
c
e
a
lc a
1 cu
lati
ons(s h
a
o
nb
wn)
.
e

x10
;x2~O; x
30
;x ; Xso
4 0 (
3.9
) Thelnstcol
uD1nis rig
htn nd
s i
d valu
es.Theres
to fthccntr
ies theco
effic
ients
oftheconsain
te qu
ations
.
X3X4andXsares l
ackvar
iabl
es. Th ecurr
entitcr
atio
niso v
erifthet a
bledis
play
st ec
h anonicalfonn.Inprac
ticee
TheS implexmethodisu sedonthep ro
b lembein
ge xpress
edint h
es ta
ndard canon
icalfonnc omprisspottingthemu n
itvcct
orsi nthetableaswell making
forma t
.Thefollo
winginformat
ionisus
eal
li norgan
izingthecal
cul
atio
na swel
la s suretheene su n
dert ebcolumn
h ex
ceptforther owsr e
presentin
geo bj
ective
co gnizi
ngthemotivat
ionf o
rs u
bseq
uentiter
ati
ons
.1 eserefc
rtoap roblemfor fun
ction(
s)arenonnegativeP-Q
).A glancea tSimple xTable3. 1indic
ates tE
whichau niq
ues o
luti
one x
ist
s.Wh il
em yo ftheitemsb c
loww cr
ci n duce
d canon
icalfonnisp res
ent
.
ea
rlierth
eyarerefe
rence
dh er
eforcom
plet
eness. Thcu ni
tv ec
torsinct a
blealsoidcnt
ifytho
semv ari
ablcsa twillbelon
gtot he
b i
s.Th os
ev ar
iableswil
lh avean onzeroval
uef orisi ter
ation
.Ther em
aining
Thcnumbero
fva
ria
ble
sint
hcp
rob
le sn
mi . i
ncl
ude
sth
esl
ackands
urp
lus
n-m non
basicvaria
blesaresc
ttoz e
ro.Thissolu
tioni
sd ir
ectlyintcrp
rete
domTable
va
ria
ble
s. .1
3 .Thes olut
iontheref
oreis
sm(m<n
1
enumbcro
1
epr
obl
emi
fc
sa1
o
nst
ra
wayst
i
n
om
t
i
n
si
im
izet
h
)
eo
b
.
je
cti
vcf
unc
tio
nf
x
z
x =0
.0 =0
.0=8
. x
54=25Xs=70df=-5250

Thenumbero
fba
sicv
ari
abl
e sm (
si sam
eas numbero
fco
nst
rai
nts
). Hast heO ptima lSolutionBeenOb i ned? Theo ptimnlsol u
tionr equir
esthatf
Thenumberofnonbasicvariablcsisn-m. ber e
duced mucha spossi
ble.Fort h
ecurrentsolu
tion v alueo fXIi sO.From
Thes
eto
fun
itv
ect
orse
xpe
cte
di " e2 em
se Equatio
n( 3.
5)i
fx wer einc
reasedfromzeroent h
eo b
jectivef u
n c
t ionfdecre
ases
Thecolumno
fth
eri
ght
-ha
nds
ide(
b)i
spo
sit
ivea
ndg
rea
ter a
nore
qua
lto
fur
therinvalue.S i
milarreason
ingc n
nbeu sedforX2Therefo
re thesolutioncanb e
ze
ro. fu
rtherinp
roved.S ol
utionhnsnotc o
nverge
d .Thes ec
ond/nexti t
erat
i onwill q
uire
nssembl
inga nothertab
leTable3.2
.
Th
ta
b
ec
le
a
a
u
1c
u
.I
la
t
tw
i
i
l
on
sa
lb
r
eo
er
ef
r
e
r
g
r
a
e
n
dt
i
zedi
nat
o th
et
a
b
a
b
l
l
e
ei
wh
i
nt
c
h
i
hi
sc
sb
oo
a
k
.
ll
edat
abl
eau
orS
imp
lcx Theo nlywayf o
rx a nd/
orX2t ohaveap os
itivevalueisifyb ameab a
sic
var
iabl
e.S incethenumbero fb n
sicvaria
blesispresc
ribedforth epro blemsomeo f
Onlytheva1uesofthcc i
cie
ntsa
rn
ece
ss yf
ort
hec
alc
ula
tio
ns.Thet
abl
e ec urr
entb nsicvariab
lesmustbecomen onba
sic.Fore achi tera
tioneS implex
crefore contains only coefficicnt va
1ust
e hem
atr
ix[
A]i
npr
evi
ous methoda1low sonlyo nepairofv a
riab
lcstoc ond
ucti sbasis- no
n b
a sise xc
hange.
d
isc
uss
ion
s.These t
hec
oef
fic
ien
tsi
nth
eco
nst
rai
nte
qua
tio
ns. Eachiter
ationtakesplacethroughanewt ab
le.Toa ff
ecttheexch angitisn ece
ssary
1
eob
jec
tiv
efu
nct
io se
ni las
tro
wine
tab
le.1
eco
nsi
ntc
oef
fic
ien
tsa
re
w
rit
ten
t.
T
abl
e3.
1Si
mpl
exT
abl
e3.
1
Rowope
rati
onscon
sistofndd
ing(s
ubtr
act
ing
)ad e
fin
itemul
tipleoftep
h iv
ot
rowt
ooth
Errowsofth
e t
able
.Thepivo
trowid
ent
ifi
estherowinwhichth
eun
it X
I X X
J X
4 b
2 X~


vc
cto
r(i
na.cc
rta
incolumn)w
illha
vcthevalu
eof1.
Rowo
y
per
ous
a
h
t
i
o
o
u
n
sa
l
r
en ee
d
dbEablet
cdt
oo
os
po
bt
a
tt
i
h
E
nt
un
h
ec
i
tv
a
n
e
o
c
n
t
o
i
r
c
alf
si
o
nt
n
n
h
.P
et
r
a
a
c
b
l
t
e
i
c
.
a
I
l
ft
l
yt
hi
hi
s plics
shappens
0
3
.
4
-
0
.
1
6

2
8
.
5
5

the
nt
mustb
h
ec
eg
in
u
r
.
ren
ti te
rati
oni
scomplt
eandc o
nsi
dert
ionsforthenextonc
9
9
3
0 -
9
6
5
2
7
8
0
0
118 L
lNEARPROGRAMMING 3
.3 NUMERICALSOLUTION-
THESIMPLEXMETHOD 119

todeterm
inewhichi
st h
evaria
ble w i
llent
erthebas
is(X
IorX2)Ente
ringBasic SimplexTable3.2(Table3
.2)
:Thepivo
trowi
sob
tai
nedf
romo
rig
inrow20f


Vari
a b
le(EBV).Alsotobeestab
lishe
diswhicho fevari
abl
(X'X4'o
3 rx
s)will Ta
ble3 .Th
.1 efol
lowin
gis o
rig
ina
lrow
lea
ve b as
isLe
avingBas
icVariab
le(LBV).Interm
softhenu
mericalca
lcul
ati
ons
25
3
inthenewtab
let
heuni
tvecto
ru n
dertheLBVcolumnwi l
Ibetran
sfe
rredtoth
eEBV
columnthrou
ghelem
entaryrow/columnop
era
tion
s. Thevalu
eofthef
ir
stel
ementi
nt enewrowwi
h 1
lbe1.Therowi
smo
dif
iedb
y


div
idi
ngthr
oug
hby3.Thenewsec
ondrowi
nTa
ble3.
2wil
lbe
Enteri
ng8 a
sicV ari
able
:TheEBVi schosenbyitsabi
lit
ytop r
ovideforthelar
gest 0.3333 0.
3333 O 3333
8.
de
crl
i nt
ho b
ject
ivefun
cti
o ni
nec urren
titer
atio
nlt
able
. li
sisdetercnin
edby
I
nTable3.
2efir
ste
leme
ntofthefi
rs
trow(Tabl
e3.1
)mustbered
uce
dtoO.Th
is
th
elarg
estne
gativecoei
cie
ntinth
erowa sso
ciat
edw i
ththeobjec
tivefunct
ion.From
i
salway
sachi
evedbya
ddi
ng/s
ubtrac
tingf
romth
erowbein
gmod
ifi
edanapp
rop
ria
te
Tabl
3.1th
isvaluei
s-990andc o pondstoev ari
ablcXIEBVi sX!.A ti
ec a
n
m
ult
ipleof
thepi
votro
w.Themod
ificat
iontoefi
rs
trowis
bebrokcnar
bit
rarJy
i.
row1-[0.
4"(
piv
otrow2)
}toy
iel
d
Leaving8 asicV ari
a bl
e:TheLBVi sa lsoc ho senbyi tsa bility l prov
ee o 0
.73
331 - 0.
1333 0 5 .
166
7
ot i
ve.Th eLBVi so nlyd eterminedaftert heEBVh asb e enc hosen. i s
Thet
hir
droww
illbeo
bta
ine
dby
importantbecauseo n
l ythecolumnu ndereEBVi s e
xaIn edt oestabI
ish LBV.
Theminimuml a
' t
ioo fthev aluesofer i
gh t
-hands ide(bcolumnv alues)tot h
e row3-{
3"(
piv
otrow3
)}
corrcspondingco e
fficie
ntsi ntheEBVcolumnp rovidedcc oeffic
icntv alucis
r
Thefour owwi
1
lbeo
bta
ine
dby
pos
it i
vcdc
idcseLBV.T h
isr ninimumv aluci d
cntif
iest heroww hichi saIsothe
piv
otr ow.I nth
isrow thecolumn whichc ontainstheu n
ityv alu eof someu ni
t row4+[
(99
0"(
piv
o )I
trow2
vector(orac ur
re n
tb asi
cv aria
ble)i
st hccolumno fcI e
a vin
gb asicv a
riable
. l i
s Tab
le3.2isobta
inedaf
terthes
ec al
cul
atio
ns.
istheLBV. Thenegati
vevalueofthecoec
: ie
ntinTable3.2inrow4i n
dic
ates wen ee
d
InTable3.1eEBVh a salre
adyb eeniden
tifiedasXl'Th eratiosund e
rt h
iscolumn a
tleas
tonemorei te
rat
ionl
tab
le.TheEBVi sX2Byexamining p
osit
iverat
iosof
are21.258 .33
3 3and23. 3333.Th eleastval u
ei s8 .
3333.lIsc orrp ondstoe ev a
1ue
sin bcolumnt othecoe
ffic
ienti
n X2columnth
eLBVi sid t
ifi
eda
s
Scondrowo fTable3 .1
.Theu n
itv ec
toru ndertheX4columni si ni srow( row2 )
. s
X Thepivotrowisrow3.T a
bl e33wi
. 1
lbeconstr
uctedbytran
sfor
mingtherowsof
ThcreforeX4iseLBV des econdrowi st h
ep ivotrowf orT able3 .
2.T his Tab
le3.2
.
impIies s e
ondroww i
llb eutiliz
edt oc hang c urrentXIcolumn( EBV
column )ii
ltoau nitvector alisc u
rrentlyun derX4Thism e c
h anicalp rocedureis SimplexTable3
.3( T
able3.3)
basedont hefollowingreasonin
g.l evalueofEBVmustb es uchthatitwil
ln otc a
use p i
votrow3=( r
ow3 )

con
st r
aintviola
tionw iththec ur
rentvalueso feo t
h e
rb asicfeasiblevariabl
cs.The
newrow1=row1-{ 0
.73333 (pi
v o
trow3*
)
}
newrow2=row2+{ 0
.3333*(p
ivotrow3)
}
app
li c
ationoftheGauss-Jo r
danpr o
cesss hou
l dsh
iftt h
ecolumnu n dertheLBVt oe
newrow4=row4+{ 123
0(piv
otrow3)}
EBVl eavin
gt h
ecolumno ft h
eo t
herunitvectors(thatarepartoft hebasis)unaltre
d.
Table3 .2i
st he
nc onstructedusingthcpivotrow2 . T
abl 3i
e3. so
bta
ine
dba
sedont
hea
bov
eop
era
tio
ns.

2S
Table3. i
mpl
exT
abl
e3.
2 T
abl
e3.
3Si
mpl
exT
abl
e3.
3

X
I X
l .
t
) X4 X
s b X
I X2 X) X4 X
s b
nu--nun

nu---nunu

nunu--AU
nunUEnu

'
0.452
4
-

0.
733
3 -
0.13
33 5.16
67 -0.
0285 -0
.04
7
nununu

nunU U
-0.
333
3 0
.33
33 8
.33
33 0.2
857 0.
047
6 10
.476
2
7 4
5 -0.1
428 0.
142
8 6.42
85
1
54.
28 1
75.
71 2
147.
3 14
-
1230 3
30 1
353
0
1
20 lN
L E
ARP
ROG
RAM
MIN
G 3
.
3NU
MER
ICA
LSO
LUT
ION
-TH
ESI
MPL
EXM
ETH
OD 1
21

Tabl
e3. 3d
oesnothave yneg
ati
vevalue eobje
ctiv
ef u
nct
ionrow.A 'The row identifies the pivo row to create he next
so
lut
Then
i
o
o
nh
nb
a
a
s
sb
i
e
e
cv
na
a
ri
c
a
b
h
l
i
e
e
v
sa
e
d
r
.Th
ese
eb
tt
a
s
oz
i
e
cv
r
o
a
ria
ble
sh
.FromTab
a
v
l
et
e3
.
h
eu
3t
n
i
h
tv
eo
e
p
cto
rint
numv
h
e
a
l
i
u
rc
e
o
l
sc
u
a
mn
.
nb l
1 l
table';

obs
erved: A(:6)/A(:
1)
ans
;
x=10.4762xi=6.4285.X
;=0.4524I=-21437.14 o 0 0 -17/1980
o 0 0 -51198
N
ote
theva
lueo
fj"+21437.14=Ofromw
hic
hth
so
lut
ionf
ort
heo
bje
cti
vef
unc
tio
n o 0 0 -7/99
(
f)c
. anbeob
tai
ned
. 0 0 0 16/3
'something not right - The above division should have';
3
.3.
3 SolutlonUslngMATLAB 'been an elemen byelement one'i

Thet a
blesint h
ep re
viousc o
mputationc a
nb eg e
nera
tedquit
ee ff
ort
lessl
yu singa A(:6)./A
(:
l)
spr
es heet.l i
s would b ea ccomplis
hed by s e
tti
ng up . em athemat
ical ans
mani
pulationino nece
llan dcopyinga ndp gt oeo t
hercell
s.Sincethi
sbook 85/4
al
so si
stsinMATLABp rogrnmingtheill
usati
onherew
illallow opportu
nityto 25/3
pr
acti
cet heuseo fMATLABf o
rm at
r ixmanipul
atio
ns.Thec odep r
esentedhereis 70/3
pturedusingMATLAB'Sd ia
rycommand.Thecommandr e
quir
est h
enameo fa -16/3
fi
lewhichr e
cordsal
lc ommunicati
onw ilhMATLABa swel
litsr e
sponseduring format short

-
in
tera
ctivesessi
on( s
eeh .Th etex
tf i
leiscommentedl i
ber
ally(foryour

H1U4y
el pdia
ry)
unde
rstandin
g)a ndusin
gt hesemicolonatee ndofthest
r
.gsp rev
entse ire
cho. A(:
6) ./A(:
l)
hi sfi
lethecommentsa requod sn g
.Thec oderep
res
ents det
ail
so fanactu
al ans =

4ur
se
ssio
n.Th e
ses tate
ment
sa r
et ypeda ereMATLABp r
o m
pt t heCommand 21.2500
window.Th i
sisther
efor
ea nint
erac
tivesess
ion.Valu
estoerightofans=istheecho 8.3333
ofres
ulto fee x uti
ono feMATLABcommand.N ot
e:commentsn eedn o
tbe 23.3333
ty
ped. -5.3333
'Second row is the pivot row and x4 is LBV';
Exam
ple3_l
.tx
t 'Constructing Table 2';
format compact 'note the scaling facor for the matrix'i
format rational A
'Set up the coefficient matrix and b as matrix A'; A
1.0e+003 *
A=[O.4 0.6 1 0 0 8.5;3 -1 0 1 0 25;3 6 0 0 1 70;-990 0.0004 0.0006 0.0010 0 o 0.0085
-900 0 o0 5280] 0.0030 -0.0010 o 0.0010 o 0.0250
A 0.0030 0.0060 o 0 0.0010 0.0700
2/5 3/5 1 o 0 17/2 -0.9900 -0.9000 o 0 o 5.2800
3 1 0 1 0 25 'The element at A(21
) must be 1';
3 6 0 o 1 70 A(2:) = A(2:)/A(21
)
990 -900 0 o 0 5280 A
'This is Table 1 - note the canonical form'; 1.0e+003 *
0.0085
'EBV is x1 - first column'; 0.0004 0.0006 0.0010
0.0010 -0.0003
o
0 0.0003 0.00 3

'To find LBV divide last column by coeff. in EBV'i 0.0030 0.0060 0 o 0.0010 0.0700
'column'; -0.9900 -0.9000 0 o 0 5.2800
'Take the minimum of the positive values';
122 L
INE
ARPROGRAMMING 3
.
3NU
MER
ICA
LSO
LUlO
T T
N- H
ESI
MPL
EXMETHOD 1
23

'The element at A(l


l) must be a 0 '
; 'A(22) must have a value of 0';
A(l:) =A(l:) 0.4*A(2:) A(2:) =A(2:) - A(22)*A(3:);
A 'A(42) must have a va1ue of 0';


1.0e+003 A(4:) A(4:) - A(42)*A(3:);
0.0007 0.0010 -0.0001 o
00..00005823 A
0.0010 0.0003

o 0.0003 A'"
0.0030 0.0060 o 0.0010
50..20870000 1.0e+004 *

nu
nu
nu
nu

nunununu
nunununu
nununU
nununuEJ
nununU

nunununu
nunununu
nununu
nununup

nununu 4
nununU
nunununHE
nu nU2d
nunUFO
o

----

----

0.9900 -0.9000 o o 0

U
ununu
'Element at A(3


1
) must be a zero'; 0.0001 0


A(3:) =A(3:) - A(31)*A(2:)


o 0.0001
o


A 0
1.Oe+003 *
0.0052 format rational


0.0007 0.0010 0.0001 A
0.0010 -0.0003
0.0003 o 0.0083 A

'
'
'

Rdrf
nu

nunU 4

'
4nununu
o 0.0070 -0.0010 0.0010 0.0450 -11/105 19/42

--

4
4nunu
-0.9900 -0.9000

'
o o o 5.2800 1/21 220/21


'
nu
'Element at A(4


-anu
1) must be 0'; 1/7 45/7

oau
A(4:) A(4:) - A(41)*A(2:) 1230/7 150060/7
A 'No further iterations necessary';


1.0e+004 * diary off

0.0001 -0.0000
0.0001 0.0001 0.0000
0.0000
o 0.0005
O 0.0008
Th
ma
n
el
i
a
p
u
s
l
tfewcommandss
at
ions
.Iti
ss u
gge
s
u
t
g
g
e
s
da
lIh
cp o
ssib
il
saproblema
i
tyo
tth
fd
ee
e
n
ve
do
l
opi
n
fec
gaf
h
apt
e
o
rl
r.
oo
pfo
rth
erow


o 0.0007
0.1230 o -0.0001 0.0001 0.0045
0.0330 o 1.3530
'Table 2 complete - and canonical form is present'; 3
.3.
4 SolutlonUsingM
ATL
A8' onToolbox
SOptimiza
'Solution is not converged because of A(42)';
EBV is x2'; T
hiss
ect
ioni
sus
efu
lfo
rth
osct
hath
avea
cce
ss1
0th
eOp
tim
iza
tio
nTo
olb
o.
xfrom
'Calculation of LBV'; MA'
1.AB(
Ver5
.2
).
A(:
6)./A(:
2) St
artMA T
I.
.A.I
B ntheCommandwindowt ypeh
elplp
.T h
iswillprov
ideinform
ation
ans onth
eu seoftheline
arprogr
ammingrou
tine10s
olvetheprob
lem.Here.thesta
ndard
7.0455 usei
se m
ployed.Itinvo
lvesspe
cif
yingva
1uesfo
rthecoslcoe
ffici
ent
s(
vecto
r).the
25.0000 co
eff
icien
tlcons
tra
inlmatr
ix(A-max )
.a ndth
er ig
ht-ha
nds i
dev e
ctor(bv
ecto
r).
6.4286 befollow
ings eq
uenceofst
epsil
lu
sate
seu seoftheprogram
.
-11.0000
'Pivot row is third row and LBV is x5' U
sin
gth
eLin
earProgrammingR
out
ine
ans >> f 990;900];
Pivot row is third row and LBV is x5 >>A [0.4 0.6 3 -1; 3 6
)
'Oops forgot the semicolon'; >>b [8.5 25 70)'
'Calcu1ation of LBV'; " 1p(f
>> x ' Ab)
'Construction of Table 3.3 -no echo of calculations';
'A(32) must have value 1'; Thes
olu
tio
nasp
osl
edi
nth
eCommandw
ind
ow:
A(3:) = A(3:)/A(32); x
'A(12) must have a value of 0'; 10.4762
A(l:) A(l:) - A(12)*A(3:); 6.4286
>> sol "
' f'*x
124 lN
L E
ARPROGRAMMING 3
.4 A
ODI
TIO
NALE
XAM
PLE
S 125

801 x+y~ 64O (


3.2
2)
1.6157e+004
Tothi
ss ol
uti
onmustbeadde
d con
stant-5280whichwaso m
itte
di nproblem Thes
idec
ons
tra
insonxa
t ndya
ret
hr
esp
ect
ivew
are
hou
sei
I
mit
s.Thes
hip
pin
gco
sl
de
fin
itio
nforMATLAB.T
her
earmanydif
fere
ntwaystouse l
ine
arprogramming I
S
fu
ncti
oninMATLAB.
Cost=4.2 x+4
.5*
y+6
.0*(
200-x-y)+
0

3
.4 ADDITIONALEXAMPLES 4
.
7 ( )+5.
8oo-x)+4.(10-y x+y-6
1( 40)
Cost=1
.4
'"x-y+19120 (
3.2
3)
h i
sse
cti
ona
ddi
tio
nale
xam
ple
s ep
s
ent
ed.Th
esee
xam
ple
sil
lus
tra
tee
ext
ensio
n/ m
odifi
catio
no ftheSimp
lex method t
oh an
dlegre
atr o
e requ
al 1
ingt
Assemb hep
rob
lem(
Exa
mpl
e3.
2)
co
nstr
aintsneg
ativeval
uesfo
rth
edesignva
riab
lese
qua
lil
ycon
str
ain
tsa
ndsoon.
Inal
Iec a
sestheproble
mistrans
form
eda p
propr
iat
elyan
desameS im
plex Mbz
e f
(x
y:1
) .4x-y+1
912
0 (
3.2
4)
melhodisthenappl
ied.

Subject81(Xy:x+y:
) 52000 (
3.2
5)

3
.4.
1 Example3.2-
TransportationProblem 8
2(
Xy:x+y6
) 40 (
3.2
6)
TheF
loc
ate
re
s
di
hMi
nBu
I
f
f
kc
al
perativesuppi
o(NewY o rk)an
1esmi
dWilIi
I
a
ki
ms
ng
p
or
al
t(
l
P
o
nj
enn
s
u
y
g
sfromi
lva
nia
)
t
.1
stwow
th ac
a
a
r
p
e
a
h
o
c
it
u
se
yo
s
f
0$x: ;
58 0:
5y:
514
40 (
3.2
7)

2000gallo
nsperdayatBuffaloand1600ga Ilon
sperdayatWi11i
amspo
rt.Itde
liver
s Fig
ure3.7iI
Ius
tra
testh
eg r
aphic
alsolu
tio
ntoExample3.
2.Thel i
nerep
rese
ntin
gt h
e
800gallons/dayRochesr(NewY o
rk).S yra
cuse(NewY o
rk)r u
ire
s1 440 con
sta
nto b
ject
ivefunc
tionvaluesle
rmdoesnotinc
lud
et h
ec o
nstantte
rm(19120
).
gal
lonsld
ayanderemain d
er( 1
360ga1lons
)aretruck
edtoNewYorkC ity
.l ecos
t Thesol
utioni
sattheinte
rse
clionofco
nst
ri
ntglandth
eu ppri
e 1mitonev al
ueof
toshiplhemilktoeacho fl hedes
tin
a t
ionsisdiff
ere
nta ndi
sg iv
eni nTabe3.
l 4
. xaseo bj
ecti
veistodecrea
sefasmuchaspos
sib
le.Fromthefigur
ethesol
utio
nis
Esta
bi
1shes hip
pingst eg
yf rminimums
o t
.
x=800;y=1
20
0f=168ooor$168.oo (
3.2
8)
ProblemFo
rm u
lat/
on:Le txbeenumberofga
Ilo
nsship
pedfromBuf
fal
oto
Ro
che
ste.Le
r tybeenumberofg
all
onss
hipp
edmB u
ffa
lotoSy
racus
e.
Thew
are
hou
sin
gco
ns i
nta
tBu
ffa
Ioi
s2 ogallons/day.Therefore Two-PhaseS/mplexMethod:Themaind iff
erenc
eb elweenExamples3.1a nd
3.
2ise c ons
ai
ntintheIat
ter
.S inc
et h
es ta
ndardLPp roblemonlyrequ
iresthe
x+y$2000 (
3.2
1) des
ignvar
iabl
esbesemip
osit
ive 0 )er igh
t-han
dc ons
trai
ntsonxa ndyh aveto
beaccommodatedthro
ugha d
ditiona
Ii ne
quaIi
tyconst
raint
s.A ppl
yingt h
er eg
ular
Amounts
hip
pedomW
ill
iam
spo
rtt
oR
hes =8oo-x Simpl
exmethodwith
outadd
itiona
Ip r
ocessi
ngwouldc r t
eap ro
bleminrecog
nizing
Am o
unts
hip
pedomW
ill
iam
spo
rtt
oSy
racus
e=1440-y ec o
ni 1form
. Example 3.2e xpress
e din es tand
ardf or
mato fl in
ear
Amounts
hip
pedfr
omW
ill
iam
spo
rtt
oNewYorkCit
yis programmmgIS

1
600-(
80 1 O
0-x)( -y)o Minimize f
t
.x
y
):1
.4x-y+19120 (
3.2
4)

T
abl
e3.
4Sh
ipp
ingCost(Cen p
erG
all
on)
S
ubj
ectt
o: g
l(
Xy:x+y+S
) I=20 (
3.2
9)

g
2(
Xy:x+y-S2=6
) 40 (
3.3
0)
R
och
est
er S
yra
cus
e NewY
orkC
ity

B
uff
a10 4
.2 4
.5 6
.0
g
3(
Xy:x+S)=8
) 00 (
3.3
1)
Wi
I
lin
spo
rt 4
.7 4
.6 5
.1
8
4(
xy:Y+S4=1
) 440 3.
( 32
)
126 lN
L EARPROGRAMMING 3
.4A
DDI
TIO
NALE
XAM
PLE
S 127


25 ob
jectiv
ed ependsonlyont heart
ific
iaJvari
ables. difitsvaJueiszeroisimp
lies
t
hat a rt
if
icia
Jv ariabl
esa relIonbasicvariabl
es.Thi salsos uggeststh
att h
ese



d

va
riabl
eswercb asi
cv ar
iable
satth est
artoftheprocedu
rc.WhenP hase1iscomplete


enb ot
ht h
earti
fic
iaJobjct
ivefunctionandthearti
flc
ialvari
a b
lesaredisca
rdedm
t a
bleandP hase1/begins.
PhaseIIist hestandardSimple xtechniqueappliedtot h
et abl
efromt heendo f
Phase1neglec
t i
ngall a r
ti
fic
iale l
ements.Th etableshouldb einc a
noni
calform.
Add
itionaltab
lesareo b
tainedasn eces
s a
ryuntilthesoluti
onisr ea
ched.
~
InExample3 .2setupearli
ert
h er
ewi l
lbeonea rti
fi
ciaJvaria
blea1 andanar
tif
ic
iaJ
2
2 c
ostf u
nctinA"I
o nt heexampleo nlyEquation(3.30)willbea ff
ectedas
~ 5
00

E
g
2(X
y:x+y-s2+al=640
) (
3.3
4)

go
=

--
-
i
40 Thea
rt
if
ic
iaJc
ostf
unc
tio
nwi
llb
e



Hhh


-
5

-
h


- 3.35)

Af=al (

-
100
0 Ta
ble3 .5repsen
ts f 1f
Sttablei
nP haseI.Thef1rs
tf ou
rrowsr ep s
entE
c
onst
rain
ts.Thef
1fthrow p se
ntseori
ginalob
j ef u
ncti
on.Thelas
trowise
-
150
0 a
rt
ifi
cia
Jo bj
ecti
vefunct
ion.Thisis rowu Sedto i
v iter
ati
onsinP ha
se1
.
0 1
00 2
00 300 4
00 50
0 6
00 7
00 8
00 T
able3 .5isnotinc anon
icaJf or
m.butr e
placi
ngthes i
xthrowbyt h
er es
ultof
x
:g1
0 1
10m
Bfo
loh 1
R 0
1
s
ubtra
ctinges ec
ondrowfromt hes
ix rowwillpr
ovideac a
nonic
alform.Tabl
e
F
lgu
re3
.7G
rap
hlc
al8
0lu
lln
o E
xam
pla3
.2
. 3
.6illu
str
ate
stheresu
ltofsuc harowman
ipulati
on.

SlmplexMe
odPhBse1
:InT
abl
e3.
6th
erea
retwoc
hoi
ces(
x)a
y v
ail
abl
efo
r
;y~ 0
x~ 0 ;sl
's2
's3
's4~ 0 (
3.3
3) eEBV(
ent
eI
gba
sicv
ari
abl
e)a
sbo
tho
fthemhaveac
oef
fic
ien
tof-1i
nel
as
t
r
ow.W hil
et h
ec hoi
cec anbea rb
itra
ryxisagoodc h
oicebeca
useithasalarg
er
HereslS3
's4aretheslackv aria
blesandS 2is s urp.
l (sim
ilartoaslack-usedf or n
egat
ivec o
effl
cie
nti ntheo ri
ginaJobje
ctivefun
ction
. leLBV( lea
vin
gb as
ic
~ co
nstrain
ts)variab
le.I nExample3 1
. whent hef1r
stS implext ab
lewass etup v
ari
able
)iside
ntif
iedthroug
ht h
eminimump o
sit
ivevaJueoft
herat
ioofth
evalu
esin
(SimplexT a
ble3.1)
t hes lac
kv ari
ableswereh elpf
uli nidentifyi
ngt hecanonical t
hebcolumnt o evalue
su nder xcolumn. le
scrati
osare2000
/1640
11and
form
.Herei nExample3 .2i
tdo notworkout twayb ec
a usethecoef
flcien
to fS2 8
0011
.Thes ele
ctio
ni d
ent
ifie
ses econdrowas p i
votrowanda1 eLBV.
i
s- 1.Multiply
ingEq uation(3.30)by-1m igrat e
st henegativesigntot h
er i
ght-hand U
singthes ec
ondrow ep ivotrowt h
eu n
itvector[01000O Thtobe
]
si
de.whichi sa ls
od isaJloweda s:f
a ser e
c o
gnitionofec anonica
lformi s
conc
e r
ned.T hi
smeansa ddition
alp r
oblem-speci ficpreproce
s singmustt ak
ep la
cet o
T
abl 5 E
e3. xample3
.2:I
ni
ti
alT
abl
eP
has
e1
ide
ntifytheini
ti
alcanoni calform.Sincet heS implexme odi su s
edt ohandlelarge
problemswithsever
alv ariabl
esi
tismorec onveni e
ntt oapplytheS implexprocedu
x y S
I S
2 0
1 S
3 S
4 b
i
nac onsist
entway.T hisisa ccomplishedbya p plyingthesameS implextechniq
uein
atwo-partseque
nce.

o o o 2
000

va
l
r
iab
ef
le
1r
s
i
tp i
sd e
fin
sr
e
e
df
c
o
ogt
re
z
ac
e
da
hs
sP
ur
p
h
l
a
u
s
sv
e1
a
.H
ria
ereanewk
bleint h
indo
esamee
fv
q
u
a
a
r
t
i
i
a
b
o
l
n
e.ana
.Also
rt
ifi
ci
anew
al

l
o
640
800
14
40
o
i
b
si
j
ec
n
t
t
r
i
o
v
d
ef
uc
u
e
n
d
ct
ionc
.Thea r
a
l
t
l
i
f
e
l
da
cia
na
lob
r
t
j
i
e
f
i
c
t
c
i
i
a
v
lc
ei
os
sd
tf
e
u
f
i
n
n
c
t
e
iollo r a
d asumo
r
ti
fa
f
Jl
i
ci
t
a
h
lo
ea
b
r
j
t
i
e
f
c
i
c
t
i
i
v
a
ef
lv
u
a
n
r
i
c
a
t
b
i
l
o
n
e
s
14
. f- o 1
912
0
i
nt
Sim
h
ep
plc
ro
xp
bl
r
o
e
c
m
.I
edu
nP
re
hase1
.Whent
ea
hi
r
t
si
if
l
sa
c
c
i
a
c
lo
omp
b
j
l
e
i
c
s
tiv
he
ei
dP
s d
has
uce
e1i
dt
sc
oz
o m
e
p
r
l
ou
et
e
singth
.Ifea
est
r
a
t
i
n
f
i
d
c
ar
d
ia
J
o A f
b
-EV L F iji E
1
28 lN
L E
ARP
ROG
RAM
MIN
G 3
.4 A
DDI
TIO
NALE
XAM
PLE
S 1
29

T
abl
e3.
6Ex
amp
le3
.2
:Sl
mpl
exT
abl
e1
Phn
se(
Can
onl
IF
orm
) T
abl
e3.
8Ex
ump
le3
.:m
2 ple
xTa
bl
e1Ph
ases(
Can
oni
IF
orm
)


x y $
1 $2 a
l $) $4 b x y $2 $) $4 b


1lull-

AU'anu u

nuhunu'
-shununuhunu

hunu-anunuhu

-EAUAununu

nun'anunu

nununu'a

u
'
2
000 0 1
360

aU
640 0

nunU
8
00 1
60
o

nunu
O 1
440 1440

-

-
1.4 o f-1
912
0 0
.4 -
1.4 o f-18224
o Af-640


SimplexMethodPhase1
1
:Thec
olu
mnw
itht
heg
r t
es
tne
gat
ivec
oef
fic
ien
t
(
1 )i
.4 ss
2l
i
si ss
seEBV.TheLBVi 3l
ei
rdrowi
sth
ere
for
eth
epi
votr
ow.
l
sf
ee
dfr
omt
healc
olu
mnt
oth
exc
olu
mn.C
ons
tru
cti
ono
fTa
ble3
.7s
tt
swi
th Theu n
itvect
or[0010O ]Tm u
stb ea n
sfer
redfromtheS3columnto S2column
t
hesec
ondrowinT
able3.6
whichi
salsoth
eseco
ndrowofTab
le3.7bec
auseoft
he
throug
hr owmanip
ulat
ionsu si
ngt h
ep iv
otrow.se x
erci
seresu
ltsinTa
b l
e3 .
9.
c
oeic
ien
tof1inth
esecondrowunde
rt exc
h olumn(nos
cal
ingi
snece
ssa
ry).Thi
s
Thenega
tivecoe
ffi
cien
tu ndertheyc olu
mns u
ggest
swea renotfmis
hedy et
.For
i
sthepiv
otrow
.Too bta
ina0i nthefir
strowintexc
h olumt
n hepiv
otrowis
thenextit
era
tio
nEBVi sy.LBVi sSI'Thefir
strowisep i
votrow.Theunitvec
tor
s
ubt
rc
tedfro
m rs
trowinTabl
e3.6.Thenewfi
rs
trowis
[10000] Tm us
tb econs
tructedundertheyc o
lumnu s
ingro wmani
pula
tionu s
ing
-
1 0 0 1
360
th
ep i
Th
v
o
e
r
tr
ea
o
r
w.Thi
enon
sr
eg
a
e
t
s
u
i
v
lt
si
ec o
nT
ef
f
a
i
b
c
i
l
e
e3.
nt
si
10
.
nthela
strow
.Thes olu
tionhasbeenrell
che
d.
Fromi ns
pect
ionofTable3.10th
es olu
tio
nis
Too b
taina0inthexc olumninth
ethi
rdr o
w.thepiv
otrowissubt
racte
df ro
mthe
th
irdrowofTabl
e3 .
6.Thefour
throwhasa0inplac
eandhen
cciscopied'OmTable
3.
6.Thcfif
throwisobt
ainc
db yad
dinga1.4mul
tip
leofth
epiv
otro wtothefit
r
1 ow x=8
0 Y=
0 1
20.S2=
0 1
36.S4=
0 240f=1
680
0 (
3.3
6)
i
nT able3.
6.Thelas
trowistheadd
iti
ono ft
hepiv
otrowtothela
strowf ro mTab
le
3.
6.Table3.7i
scompile
dasf o
llo
ws: Inthi
se xnplethes ameSimplexmethodwasr e
peate
dlya p
plie
da lt
houg
ht he
probl
e mwassolvedusing ophas
es.Thef i
rs
tphasewa saprepro
cess
ingph e
movet hesur
plusvariab
lesawayf rom ini
tia
ls e
tofb as
icv a
ria
ble
s.l i
sw as
ach
ievedb yi n
troducin
ga ddi
tio
nnlvaria
blesfore ac
hs ul u
sv ar
iab
lea ndan
T
abl
e3.
7Ex
amp
le3
.2
:Sl
mpl
eT
abl
e2
Ph 1(
Can
onl
colF
orm
) ad
diti
onalcos
tfunctionth
atdroveeitera
tio
nsofthefr
rtp
hase.
Tos ummariz
e fo
r~ a nd=c o
nst
rai
ntsar
tif
ic
ialvar
iabl
esa nd art
ifi
ci
alcos
t
x y $
1 $2 a
l $) $4 b fu
ncti
on eind u dint
ot heprob
lemf o
rc o
nvenie
nce.l eSimple
xm ethodi
s
-
0 1 1 0 0

app
liedintwophases
.l efir
stphas
eistermin
atedwhent h
earti
fic
ia
lv a
ria
ble
scll
n
-

nunuhu'a
nu'AUnununu

'anununununu

'a'E'anu-a

u
nu'anununu

1
360
6
40 beeli
m i
nate
df rom proble
m.
1
60
O 1440
T
abl
e3.
9Ex
amp
le3
.:S
2 l
mpl
exT
abl
e2
Pha
sn n
(Caon
lca
lFo
rm)
a

o
a

-
1.4 f-18224
o Af x y $ $2 $) $4 b

'anusaE E

'Enunununu
u o

nu'anunu
1
2

--

o 8
AUAUnu

o 160
FromTab
le3.
7.eval
ueofAfi
sO.an
dali
sno
tabas
icvar
iabl
eThi
side
nti
fie
s 0 1
440
t
heendofPh
ase1
.Thea1c
olu
m nan
d l
as
tro
war
edi
scar
dedandPha
se11i
ssta
rte
d 3 A

a .4
1 o f-180
w
ithTable3
.8
.


3
130 UNEARPROGRAMMING 3
.4A
DOI
TIO
NAlEXAMPLES 1
31

T
abl
e3.
10Example3
.:S
2 l
mpl
exT
abl
e3(
Fio
al
)Ph
ascD Maximize j
{xl :2
X2) x1

x y SI S2 S) S4 b Thec
ons
tra
int
sca
nber
eco
gni
zedfromt
hes
tat
eme
nto
fep
rob
lemd
ire
ctl
yas



1
2




1
o 8
0
1
0
3
60
g
.: xl+ Xz ~5

2
40 g
2:2
x 2=
.+x 4
0
.4 f-16800 g
3:x1+X2~ 1
x1~ 0 x
2isu
nre
str
ict
edi
nsi
gn

3
.42 Example3 -EqualltyConst
. i
ntsandU
nre
str
ict
edVarlables F
igure3.8
usingth
edrawLine.mm
-fi
lei
sagr
aphi
cald
escr
iptio
no ft
heprobl
emand
t
hesolu
tion
.1 esol
uti
oni
satxl 3a=
n =
dX2 -2in f
igu
rewhereconv
eni
ently e
Example3 .3wil1i nc
1udeane qu
alit
yc on
strai
nta ndiJlus
tra
testhet ech
niquefor o
bje
ctivefunc
tionisal
sopa
ssingt
hro
ugh
.
han
d lingvariab
les a reunresict
edinsign(canh a
ven egat
ivevalue
s).Varia
bles
li
kep rof
i
tt emperatureandn e tincomecanben e
gativequiteof
l1.The u al
ity StandardFormat:Ast h
estan
dar
dforma
tex
pe on
lynonn
ega
tiv
eva
ria
ble
s.t
he
cons intishandledbyi n ducing i fi
cia
lv a
riabl
ea ndapplyin
getw o
-phase va
ria
blex2i
srepla
cedbyapai
rofva
ria
ble
sint
hefo
rmu
lat
ion
:
Simplexlt i qu il
lus tedi nExample3 ..Wh
2 enth i
sc or
respond
i c i
al
va
ria b
leisz er
o(n do fPha se1)const
rain
th asbeenme t
.Then egati
vev a
luefor
avariableissimulatedt hroughed if
fl
rencebetweentwop osit
ivevari
able
s.Once 6
aga
i nthes
ec hangs p
r es
er v
et heSimple
xmethodi nit
so ri
gina
lf o
rm.Th efollo
wing
i
sa ni m
agin a
ryp roble millus
t r
ateadd
itio
nalfeatu
ressosomeiLbertyi
st a
keninthe

10

fo
rmu l
ation.

0o
a
TheProblem:Today afu
ll-
tir
nestuden
toncampusi sa l
waysd rive
nt omaximize

!
gra
des.As tronginfl
uencefo
raf av
orableoutcomeiseamounto finve
s t made

Z ;
inhit
ting booksversusetimespentplayin
gp i
nbal
l.Inatypicaldayatlea
stone
hourisd ef
inite
lye xt
endedtot h
ep ur
suitofl ea
rningorp r
essingt h
es idesoft h
e
coin
-operatedm a
chine.Notmoret h
anf i
veh our
si sava
ilab
lf orsuchd ispe
rsio
n.
Overey e safat
igueth
reshol
do ffouruni
ts.basedonac ombinationo f two
act
ivi
tish
e a
sb eene s
tab
lish
eda s a norm f ora cce
ptabl
ep erform ce
.T h
is
combinationisthesumo fth
ehourss p
entatthepinb
allmachineandt wict heho
urs
spen
tonhomework anacknowledgmenttha
thitti
ngeb ooksisstre
ssf
ul.An egati
ve
houro fpinballplayigwi
n 1
lgot oincrea
set hetimes p
ents tudyigwhichw
n il
l
con
tributep o
sitiv
elytot h
eg rad
es.Theo ve
rallg ra
deisd etermineda sal inea
r
combin
at io
no ftwic
et hetimespentacademica
llya ndsubtrac
tinget imes pe
nt
pla
ying.Thep robleme r
eforeistod is
trib
utet h
et imetomaximizet heg rad
es
obt
ained.

ProblemF or
mulation:Therearetwoorig
ina
ldesi
gnva
riab
lesinthep
roble
m.XI
4 5 6
i
sthenumberofhour
sspen
ts t
udyinga
ndX2isthet
imespe
ntenjoyi
ngthegameof
pi
nba
llwhenthsameti
mecanbeadvantag
eousl
yspe
ntma
intai
ninghighg
rad
es.
'he
ob
j t
ivefu
ncti
oncanbeexp
resse
da s F
lgu
re3
.8G
rap
hlc
als
olu
tio
nE
xam
ple3
.3
.
1
32 lN
L E
ARP
ROG
RAM
MIN
G 3
.4 A
DDI
TIO
NALE
XAM
PLE
S 1
33

x2=x 1- X22
2 (
3.3
7) Phase"T abe2
l :Table313i
. s1heseco
ndtab
leunderP
hase.1ThevJu
a eofth
e
Thestan
dar
df o
mlata
ft
ercon
ver
tingtoamininuza
tionpr
oblm
e i
ntr
odu
cin
gslack a
rti
fi
ci
alfun
cti
oni
s2soPha
se1isnoty
etove
r.TheEBVisX22
TheLBVisal
The
sur
plu
sda r
ti
fi
ci
alva
ria
ble
san
di n
clu
dingEquatio
n(3.
37)r
esu
ltsi
n se
condrowis1
hep
ivo
tr o
w.Thi
sr owwi
IIbeuse
dforrowm
anipul
ati
onsyi
eldth
e
ne
xttab
le
.
Mi
nr
ie f-2x1+x21-X22
z (
3.38
)
T
abl
e3.
13E
xam
ple3
.:T
3 a
bl
c2Ph
ascI
Su
je
ctt
o: gl:X1+X21-X22+
81=5
X
) X
2) X22 $) U) 8
2 a2 b
g
l
g
3
:2x1+X21-X +at=4
:X1+X
21-X22- 8
2+a2=1

2 4
-
2 2
l
Thea
rt
if
ic
iaJf
unc
tio
ntob
edr
ive
ntoz
eroi
s

3 -3
--22 2 /+2
Af=al+~ (
3.3
9) 3 Ar-2

S
imp
lexT
abl
e0:T
abl
e3.
11 p1h
es d
ardf
O t
m18 i
nat
ab
le
.Iti
sca
I
IedT
abl
e Phase"T
abe3
l :T
abl
e3.
14i
sth
enewt
abl
eaf
te
rth
erowo
per
ati
ons
.Thev
alu
eof
o
toa
I
Iowf
orp
rep
roc
ess
ingw
i1hr
esp
ect
th
ear
ti
fi
cia
1va
ria
ble
ssot
ha
tac
ano
nic
a1f
OlID a
rt
if
ic
iaJfu
nconis0a sbohala
1 nda2 enon
bas
icvar
iab
leswi
thava Jueof0
nbeob
rv
ed.A
ddi
nge
sec
onddir
dro
w ds
ubt
rac ge
res
ultomel
as
t fo
risit
era
ti
on.lIssi
gfie
seendofPhase1
.Phaenw
s i
llst
ar
twiththela
strow
rowa
ndr
epl
aci
ngt
hel
as
troww
i1ht
hi
sco
mpu
tat
ionwil
1yiel
dth
enextt
ab
le
. (a
rt
if
ic
ia1
n ct
ion)andth
et w
ocolu
mnsth
atrepr
ese
ntth
ear
tic
ia
lvar
iabl
esr e
moved
f
romt
hec
urr
entt
ab
le
.
T
abl
c3.
11 Exam
plc3
.3
:Ta
ble0
Pha
scI
Tb
lc3
.14 Ex
mp
lc3
.3
:Ta
bl
e3Ph
aseI
10
111
)
X
) 8
) b

X
2) X
22 a
) S
2 a2

1


5
X
)

X
2) X
22 $) 1 8
2 o
z b

2 I
o -
1
4
1
o

l

o
2 2
4
2

1


o 3

-2 I
o l f
A
r

o
3

4 4 /+8
1 A
r
Phase1 Tabl
e1:T a
ble3.12provid
eses t
ar
tofeSimpl
exmetho
d.I nPha
se1
th
motivati
onistodri
vethear
tif
ic
ialfun
ctio
nto0w
hic
hhasaval
ueof5.TheEBV Phase1 Table1:Table3.
15repr
esen
tsetab
ltost
artt
heite
mtio
nsforP
hase1
1
.
iS
XlTheLBVi sa2'Theth
irdrowisthepi
votro
w.Rowman
ipul
ati
onswithth
epivo
t Howevert
herear
enonegat
ivecoe
ffi
cie
ntsi
n la
strow(rowcorr
espo
ndin
gtoth
e
rowleadtoTabl
e3.13. obj
ect
ivefun
ctio
n).Sca
nningthe lefuh
er1
hecano
nica
lf o
rmc a
nb eob
ser
ved
.
lere
for
etheso
luti
onhasbee
no b
tai
ned.leso
lut
ioni
s
T
llb
lc3
.12E
xam
plc3
.3
:Ta
bl
e1Ph
sc
l
T
abl
c3.
15E
xam
plc3
.3
:Ta
bl
e1Ph
asc1
1
X X
2' X22 $ a) $
2 a2 b
$
x


8
2 b
12123


o
o 5
4
4
o
f 2 2




--

o o 3

'Aq

-1
2 Ar-5 4 /+8
1
34 L
JNE
ARP
ROG
RAM
MIN
G 3
.4 ADDITIONALE
XAM
PLE
S 1
35

xl
=3;
x2 22=2
1=0;x ;sl=4;s2=0;/=-8 g
l:4
xI+9x
2+73+I
x Ox4S6
00

Thev
alu
eofX2i
s T
hea
vai
lai
b1
it
yoft
hel
ith
ogr
aph
icm
ach
inec
anb
ede
vel
ope
das

g
2:xl+x2+3x
3+8
x4s
;420
2=(X21-x
X 22)=(0-2
)=-2
J
epa
cka
gin
gco
nst
rai
nti
s
w
hichw aside
nti
fie
dear
lie
rg r
aph
ica
lly.
leaboveexampl
eillu
st
rate
dtheSimplexmethodfo
rha
ndli
ngnega
tiveva
riab
les g
3:3
0 +40
xI +20x3+I
. Ox4S8
00
a
ndequal
itycon
str
ain
ts.Not app
licat
ionoftheSim
ple
xt e
chni
queit
sel
fdidnot A
lldesig
nv a
riabl
esar p t
edtob eg a
ter zer
o.Asf ormula
teda b
ovee
c
hang
e.Ani nt
ere
sti
ngfeat
ureofep ro
bJemwast ha
tPhas
eIIw asimmedia
tly p
roblemsug
gestsade
greeofincom
pleten
es s
.nerearef
ourdesig
nvaria
blesandonl
y
o
btai
nedaft'P
el hase1wit
houtanyfur
therit
era
tin
o whic
hsug
gest
s thesear
chfor t
hre
econst
rai
nts.len umberofvar
iabl
esint hebas
isc a
no nl
yb ee.H encea
t
t
heop t
im u
mist ak
ingplac
ei nPhas 1eventhoughefocu
siso nthear
tif
ic
ial l
ea
sto neofev ar
iabl
esm us
th aveav al
ueo fz e
ro.S ev
ra
lu se
fula d
diti
ona
l
v
ari
abl
es. c
ons
tra
intscansti
Ubeinclu
dedtodef
ineav a
lidoptim
izati
onproblemwithanonzer
o
s
olu
tio
n.lisisnowam ode
lingiss
ue.Forproblemswithalimi
tednumberofdesig
n
3
.43 Ex
. .4-
ample3 AFo
ur-
Var
lab
leProblem v
ari
abl
espayingatt
enti
on10thep robl
emd evelopmentallow
sa nt
ici
patio
no fth
e
s
olu
tio
na swell t h
eo ppo
rtuni
tyt o o u
blesho
otd ecis
ionsf romp r
act
ica
l
E
xam
ple3
.4p
res
ent
saprob
lemwi
thfou
rva
ria
ble
s.Thepr
oce
dur
eisid
ent
ica
ltot
he c
ons
ider
atio
ns.Iti
slef
ttoes tud
enttoexplo th
isproblemfu
rth
er.
o
nei
nExa
mpl
e3.1e
xce
ptater
eisnog
rap
hica
lsol
uti
ont
othepr
oble
m.
StandardFormat: The o
bje
cti
v f
unc
tio
nre
qui
res a minimum f
orm
ula
tio
n.
TheProblem: TheRITs
tud
ent
-ru
nmi
cro
ele
ctr
oni
cfa
bri
cat
ionf
ac
il
it
yist
aki
ng Henc

ord
ersforf ou
ri ndigenousl
yd evelopedASICc hi
psa tc anbeu s in(1)t o
uch M
ini
miz
e f
.-6x1-1O~ -9x3- 20x4
sen
sors(2) LCD( 3)p re
ssures e
nsorsa nd(4)c on
trol
lers
.The r
ea reseve
ral
co
nstra
intsont heproductionbase
do ns paceequi
pm e
nta v
aila
bil
itystu
denthour
s Thes ym
bol/hasbee
nretai
nedfo
rc o
n v
enie
nceeve
nt ho
ught h
edIIct
ionof
andt h
efacta tep r im
arym is
siono fef a
cil
ityiss t
udenttrai
nin
g.Firs
te opt
imi
zat
ionh
asc
han
ge. l
d econs
int
sarese
tupus
ings
lac
kvar
iab
le I
sS a
S2nds3

han
d l
ingt im
ec ons intoutsi
deo fprocessin
gforallchipsis6 00hours
.T ouch
sen
sorsrequi
re4h o sLCD9h ourspre
ss '
esensors7h ours
an dconol
ler
s1 0 g
.:4
xI+9x
2+73+1
x 0x4+S
.=6
00
ho
urs.Sec on
d th
et imea v
ailab
leo nthel i
t h
ogr
aphi
cm achinesisa bo
ut4 20hou
rs.
TouchsensorsandLCDr u i
re1h ourpressu
res e
nsors3h ous
r andco
ntrol
ler
s8 g
2 .+~ +3x
:x 3+8
x4+s2=420
ho
urs.P a
c k
agi n
gc onsider
ation
sp lacethemaximuma t800v olumeu n
its
.T ouch g
3:3
0x.+40x
2+2 3+l
0x Ox4+S3=8
00
se
nsorsrequ
ire3 0voJurneunit
sLCD40v ol um
eu n
itspre
ss'csen
sors20unit
sand
conol
ler
10u nit
sb e
c aus
eo fe i
rc o m
pa ctsiz
e.A llec o
nsa i
nt
sa boveare lv
Al a
ria
ble
sar
e~ O
. l
efo
rmu
lat
iona
bov
esu
gge
stst
hes
tan
dar
dSi
mpl
exm
eth
od.
in
di te
dp e
rweeko fo pera
tionofthefac
ili
ty. enetr eve
nueis$6$10$9d$20
fo
rt h
et o
uchs enso
rLCDp ssur
es ensorandcon
trolle
rresp
ecti
vely
.l efac
ili
ty S '
P1xTable1
e :Tabl
e3.1
6isei
ni t
abl
efo
rExamp
le3..Thec
4 ano
nicIf
a orm
i
sintere
stedinm axi
m izingr e
venueperweeka ndwo u
l di
ketod e
te r
minetherig
ht i
sobse
rvab
lefro
mth
etab
leandt
hei
ni
ti
alb
asi
cfe
asi
bles
olu
tio
ncanb
edete
rmin
ed.
mixof f o
urd e
vices.

ProblemFormulation: The fo
rmu
lat
ioniss t
rai
ght
for
war
db as
edo nthe T
abl
e3.
16E
xam
plc3
.4
:Si
mpl
exT
abl
e1
st
ate
ment
sabov.L
e etx( r
eps
entt
henumbe
roft
ouc
hsens
orchi
psp
erw k
X2E
nu
mberofLCDx3th
enumb
ero
fpr
ess
ures
ens
or
san
dX4en
umb
ero
fco
no
ll
er
s. X
I X2 X
J X4 8
1 J
"2 S
J b
o
bje
cti
vef
uncti
onis
4 9 7 1
0
6

M
axi
miz
e: f
.6x.+lOx2+9x3+20x4 3
0 4
0
3
2
0
8
1
0 42
8
0
0
0

Theh
and
lin
gti
mec
ons
tra
intc
anb
eex
pre
sse
d
-
6 -
10 -
9 -
20 f
136 lN
L E
ARP
ROG
RAM
MIN
G 3
.4A
DDI
TIO
NALE
XAM
PLE
S 137

T
abl
e3.
17E
xam
ple3
.4
:Si
mpl
exT
abl
e2 UsingM
ATL
AB

x X2 X3 X4
s 8
2 8
J b Thisi
sasta
ndardLPprobl
em.Thissec
tionuse
sMATLABinanint
erac
tiv
es e
ssiont
o

2.7
5 7.7
5 3.2
5
l -
1.25
7525.5
s
e
o
I
x
ve ep
np
le.N
r
o
t
ob
l
et
em
h
.l efo
ll
ewamingf
o
r
w
i
o
ngisad
mMATL
AB
ia
.a
ryf
swe
i
lefo
rtheMATLABs
Iles u
bsequ
en
e
tu
s
s
s
io
eo
nfo
ft
ri
h
s
eLP
0.1
25 0.1
25 0.3
75
012
.
25
5
2
7 5
progr
amusin
gb oundsoned esig
nv a
riab
les
:l ebo
ldital
ici
zedstat
ement
sa r
e



1.

2
8.7
5 3
8.7
5 1
6.2
5 commandsuse
dt oo
btai
ntheso
lut
ion.TheMATLABprompti
sedit
edou.
t
-
3.5 -
7.5 -
1.5 2
.5 f+1050 he
lplp
LP Linear programming.
X=LP(fAb) solves the linear programming problem:
I
S S2.a
nd$3ar
et h
ebasi
cvari
abl
es.TheEBVisX4a
nd eLBVi
s$2w
hic
hisE min f 'x subject to: Ax <= b
minlumof{60.5258
. 0}.Thep i
votrowi
sthesec
ondrowu
sedf
ortherow X=LP(fAbVLBVUB) defines a set of lower and upper
man
ipul
ati
onst
ol e
adtoTab
le3.1
7. bounds on the designvariablesXso that the solution
is always in the range VLB <= X <= VUB.
S
imp
lexT
abe2
l :Usingt
hep
ivo
trowi
den
tif
iedi
nel
as
tta
bleeu
nilv
ect
or[
0 X=LP(fAbVLBVUBXO) sets the initial starting point
o1O]Tunderthe$2columnneedstobetransferredtoeX4 columnthrough to XO.
e
lemen
taryrowope
rati
ons
.T a
ble3.17showsec a
nonica
lforma
fte
rcompl
etio
nof
a
llth
eopera
tio
ns.Thebasi
cvaria
ble
sareX4.$" dS3TheEBVisX2andeLBV X=LP(fAbVLB
VUBXO
N) indicates that the first N
i
sS3lepivo
trowist h
ei r
dr ow
.Theo bje
cti
veoft h
erowmanipu
lat
ionsi
sto constraintsdefinedbyA andb areequalityconstraints.
t
ran
sfe
rtheuni
tvect
or[001O ]Tfromth
e$3columnto exz
colu
mn.
X=LP(fAbVLBVUBXONDISPLAY) controls the level of
warning messages displayed. Warning messages can be
SimplexTable3:T a
ble3.18d
enotesth
ered
ucedta
blewithecano
nicaJformaf
ter turned off with DISPLAY -1.
th
er e
qui
redrowope
ratio
nsarec
o m
plete
d.Theba
sisva
riab
l eX2.x4a
n dS
IThere [xLAMBDAJ= LP(fAb) returns the se of Lagrangian
m none
gativ
ecoef
fic
ient
sinthela
strowsu
gges
tingthes
olu
tionhasbeenobtai
ned
. multipliers
Fromet ab
le s
oluti
onis LAMBDAat the solution.
XJ=0x2=7.09
6x3=0
x4=51.6
1/=1103
.22
[XLAMBDAHOW] LP(f
Ab) also returns a string how
Thesol
utio
na bo
veisn
otsat
isf
act
orybe
causet
heact
uald
eci
sio
nwiI
linv
olveint
ege
r that indicates error conditions at the final iteration.
val
uesfo
rthedesi
gnva
ria
ble
s.Atth
istiei
m nte
ger
p r
ogramm
ingisn
ota
no p
tio
n.The LPproduceswarningmessageswhenthe solutioniseither
ad
juste
dsolut
ionis unbounded or infeasible.
c= [ -6 -10 -9 -20];
X1=O
x2=7
x3=O
X4=52/=1
110 A= [ 4 9 7 10; 1 1 3 8; 30 40 20 10];
Whileisc
hoi
cesati
sfi
esec
onst
rai
ntsg
3.g
2howevernee
dsaIit
tl
eel
ast
ici
ty(l
imi
t b = [600 420 800];
i
s4 23)t
obesa
tis
fie
d.Nota
tsJisabas
icv
ari
abl
es oc
onst
rai
ntgJsho
uldnotbea x=[cAb]
probl
em. x =lp(cAb)
Warning: The solution is unbounded and at infinity;
T
abl
e3.
18E
xam
ple3
.4
:Si
mpl
cxT
nbl
e3 the constraints are not restricive enough.
x
x X2 X
J X4 $ 8
2 $
) b 1.0e+015 *

-
3 -
0.2 20
-0.0000
3.7067
0
.
0
.
0
7
3
2
4
1
2
9
5
80 0
3
.
51 0
.
3
4
2
2
1
9
5
3
8
1
5
5 .032258 0.025806 7.019269774
o 02 90322 -
-0
0
.
1.0
033 56
2 1
. 8.8391

2
.06
451
60 1
.64
516
1 2.25806451 0
.19
358 f+1
4 103
.22
2.8513

138 L
lNEARPROGRAMMING 3
.5A
DDI
TIO
NALT
OPI
CSI
NLlNEARPROGRAMMING 139

vlb= [0 0 0]; T
hisi
sal
sorefe
rre 0 an
d1 or
ma lmaximump
rob
lem
.
=
vub [100100100]; l
edualo
ft h
eabovepr
oblemisde
fine
das
x= lp(cAbvlbvub) Minimize 3.43

;
:
w:b
lYI+blY
2+.
..+b
"Jr
n
' ( )
x
0.0000
S
ubj
ect1
0: a
llI+a
Y 21Y
2+..
.+a
rnl
Ym~ c
J (
3.4
4)
7.0968
o
a
l2Y1+a
222+.
Y ..+a
m2m~ c
Y 2
51.6129

T
hisi
sth
cso
lut
iono
bta
ine
dbyw
ork
ingt
hro
ught
heS
imp
lexm
eth
od.
a
lJ .a
'1.
. 2
"Y2+.
..+atuJ'" C"
YI~O i=1
2...m (
3.4
5)
3
.5 ADDITIONALTOPICSINL
lNEARPROGRAMMING

Thissec
tio
nl o
oksbrief
lyataddit
iona
Jideasassocia
tedwit heLPp r
oblem
.F i
rst Rela
tions(3.
43)(3.
45)d e
scr
ibeanormalminimumproblem.Therei
salsoani
nvers
e
edualproblema rel
ations
hipb etween def
ini
tionoft he two pr
oblems above a
sf aras
erei
impo
sad
ant
i
i
scu
s
n d
si
i
o
s
no
cu
s
ft
si
h
onofse
nsi
tivi
t
ssoci
atedwi
yanalysis-var
tha
io
nLPp
ninop
r
t
i
o
m
b
l
i
e
z
a
m
t
.D
io
u
ns
a
o
l
l
i
t
u
yi
ti
o
s
n
ide
ntifi
cati
ono ftheprimalandd u
alproblem
.I f lat
teriscons
ideredaprima
l
duetov ar
iat
ionint f
teorig
il
1parametersoft l
teprobl
em.Followingisisa problement hefor
me ri
sec orre
spo
n d
ingdualprobl
em.
dis
cuss
ionofsever
alpiecesofinfor
m onthatcanb eex ct
edfromef i
naJtab
l e l ef o
llowingobserva
tio
nsc bemadew i spect10thepairofprobl
e m
s
oftheSimp
lexm e
thod. esta
blishe
da b
ove:

1
.Thenumbero
fdu
alv
ari
abl
esi
s same enumbero
fpr
ima
lco
nst
rai
nts
.
3
.5.
1 PrlmalandDualProblem
2
.Thenumbero
fdu
alc
ons
tra
int
sist
hcsamea
sth
enumbero
fpr
ima
lva
ria
ble
s.
Associ
ate dwie ve ryLPp r oblemwhichwillberefer
redtoap rim alproblem 3
. Thecoef
fici
entmat
rixA oft
hepri
malproblemi
str
ans
pos
edt
opr
ovi
deE
the
rei s ac orr
espo nd ingd i 1 pr
o b
lem.I nm y waysedua J pl'Oblemi sa coe
ffi
cien
tm a
tri
xo ft
hed
ualpro
ble
m.
spositio
nofthep r im aJprobJem.lIsismeanttoimpJytha
tift heprim alprobJem 4 u
.Thein a
lit
ies'Cr
eve
rse
dind
ire
cti
on.
isaminimizati
onprobJemedua Jproblemwillbeam ax
imizat
io none.l ft heprima
J 5
.ThemaximizationprobJemoft
hep
rima
Jproblembecomesam
ini
miz
ati
on
problemh as11variab lest hed ua
lp roblemw i
llh av
enc o
nst
raints.l ft h
ep rima
l
probJemi
nth
du
alp
rob
lem
.
problemh asmconstrai ntstheduaJp roble
mw i
llhavemv ar
iab
les.Fort hed isc
ussio
n
ofd u
alityes tan da rdp ri mC
llpr o
blemi sgener
allydefine
da sam a ximizati
on .Th
6 eco
stcoef
fi c
ient
so ft
hcprim
alpro
blembecomet
her
igh
t-h
andsi
deva
Jue
s
problemw ith~ in
u alitie
s( thoughes ta
ndardproblemintheLPprogramming o
ft h
eduaJpl'Oble
m.Ther i
ght-
han
dsid
evaJu
esofth
epr
ima
lbecometh
ecos
t
disc
ussion was am in im iz
at i
on problem [sEq ua
tions(3.
10 )-(3.12) ] d e c
oeff
icie
ntsoft h
ed u
alprobl
em.
ns Intswere ualities).Thes rdprimaJprobleminthissectionisde finedas[3
] 7
.Thep
rim
alanddua
Jva
ria
ble
sbo
ths
af
yth
eno
nne
gat
ivi
tyc
ond
iti
on.

Example3.5l ef ol
lowigexamplea
n dapte
dandmod
ifiedfromRefer
ence3i
s
Maximize z
:CIXI+CIX2+...+c
x
3.
( 4
0) usedtoi
I
Iust
rat
etheprim
al/d
ualver
sionsoft
hesamep
roble
m.Theproblemiss
olv
ed

S
ubj
ect1
0: a
lll+a
x l2x
2+.
.. l
+a.x
n~ b 3.
( 41
)
usi
n gte
chn
iquesd
e v
elopedinth
ischa
pter
.

a
21I+a2~2 +.
x ..+az"xn~ b2 eP roblem:Thel o
calcoll
ege'sSchoolofAm e
ricanCraftsmanhasd ec
ided10
par
tici
pateser
iou
slyina10ca
Jchari
tyeventbymanufac
t ur
ingspec
ialcommemorative
dess
k t
abls
e andcha
irs.Each1ypeoff um
iturere
qui slumberasweIlastwot yp
es
a
"I
I+a
X 2+ +a
naX n"
xn~bm ofski
lledlab
or:fmi
shing dc'Pent
ry.Table3.
19documentst heres
ourcesneed
ed.
The10caJlumbercoop
erativ
eh a
sd onate
d48b oardfee
to flumbr
.F a
cultyandstaf
f
O
j=1
2.....n (
3.4
2) havevolunt
d2 0finis
hinghour
sand8c a
rpen
tryhours.Thed es
kw i
llb esol
df o
r
140 l
lNE
ARPROGAAMM1NG 3
.5A
DD1
T10
NAlT
OP1
CSI
NUNEAAPAOGAAMM1NG 1
41
l
i
l1

l

T
nbl
c3.
19 Example3
.5
:Rources

T
abl 21 Examplc3
c3. .5
:Pr
bna
lPr
obl
cmSi
mpl
cxT
abl
c2

R
eso
urc
es s
Dek T
abl
C
hai
r
d f
X X2 X3 $ $
2 $
3 $
4 b

8 6
S


o 1 4 1
6


L
umber(bd
o fe
et
}
4 2 .5
1 0
.5 -2 4

F
ini
shi
nghour
s(hou
rs)
C
arp
entr
y(hou
rs) 2 .5
1 0
.5
0
.75 0
.25 0
.5 4
5
o
1
5 -5 3
0 f+240

$60
et
abl
efo
r$30
and c
hai
rfo
r$2
0.Thes
cho
old
oesn
ote
xpe
ctt
ose
J1more
v
eta
ble
s.Thes
cho
olwouldl
iket
omaximiz
re
vnuec
oJ1e
cte
d.
o
pti
malnumbero
fch
air
st
obemadeis8
.Not
abl
esw
illbemade.l
eto
taJr
eve
nue
8
tan
dar
dForma P
rim
alP
rob
lem
:Defining X
l a
sth
e number o
fde
sks i
s$2
80.0
0.
p
rod
uced
X2asthenumberoft
abl
esmanu
fact
uredandX3ast
henumbero
fch
air
s
m
anu
fac
tured
thepr
imalpro
blemcanbeex
pre
sse
dins ta
nda
rdfor
mat 81ndardFormat
. D ualP roblem :Whil ethed uaJp roblemcanbx pres
sed d
setupm h i cly
a
1 itis c ul
ttoa sso
ciateed esignv aria
blesinadire
ctm n e
r
M
axi
miz
ez
:60x +30X2+20X3 (
3.4
6) aswasdone t heprim Jp
a robl
em.Usingy "Y2Y3andY4a sthedesignvar
iablesth
e
problemc anbef ormu
l a
te dasi nE quations(3.48)and( 3.
49)belowu si
n gt h
e
e
Su c
tt
:
: g 8x +6
o x
2+X3:
;4
:
: 8 3.
( 4
7a) def
initi
ona teb egi
nni n
go fthissect
ion.Somea s soc
i ati
onsarepossib
leinlighto f
tran
sposit
ionofec ostcoeffic
ient
sandt h
ec o
nst
ra i
nts.Forexample thevari
abley
g
2
:4x +2x
2+1 ;2
.5X3:
:
: 0 3.
( 4
7b) canbea ssocia
tedw i
tht hel umberc o
nstra
intb ecausei nt h
ed ualproblemitsc os
t
coe
fficie
ntisthel u
mb erconstr
aintofep rim
alp roble m.Inas im
ilarmannerY2is
g
3 +1
:2
x .5x2+0.5X3:
;8 (
3.4
7c)
:
asso
ciatedwiththefi
nishinghoursY3with car
pe ntryh o
ursandY4wilhthespecia
J
tab
lec o
nstrai
nt. objectivefunctio
no fthedualproblemi se xpr
essedinEquat io
n
1
!
4:X2::;5 3.
( 4
7d)
(3.
48).Inviewofeformoft hee xp
ressionofth eobj ec
tivefuncti
onw E isa
pos
sibil
ityt h
ated esi V iabl int hedu Jp
a roblemc anhave e co
n o
r ni
c
>X2
Xl x3~O impl
icationasfol
1ows:

Thesolu
tiontothepri
maJproble
mi savai
1abl
ei nTa
bles3.20-
3.22
.T a
ble3.20ist
h y unitpriceforaboardfootoflumber

in
it
iaJta
ble.TheEBVi sx a n
dt heLBVi s$3Thepivo
trowi stheirdrow.The Y
2 un
itpric
ef o
raf i
nish
inghour
subs
equentrowoper
ation
sdetermi
n eTable3.
2 1
.Inthi
stabl
eeEBVisx3'theLBV Y
3 un
itpric
ef ora
nhouro fcarp
ntr
y
i
sszzmdthepiv
otrowistheSEcondEow.Table322ist h
eanaltabl
eesta
bli
shingE y
4 iscannotbeeu n
itpric
eased es
kh a
sapr
icedefmedi
nth
epr
ima
J
opti
malvaluesforth
ev a
ria
ble
s.xteoptimaJnumberofdesksequals2.~e problem-maybeas pecia
Jpric
eforth
edeskr
esou
rce

T
abl
e3.
20 Exnmple3
.:P
5 r
ima
lPr
obl
cm
Si
mpl
exT
abl
e1 l
1
T
abl
e3.
22 Example3
.5:P
rim
a
lProblemSi
mpl
exT
abl
e3

x X2 X) $ $
2 S) $
4 b E X X2 X3 $ $
2 .
1
'3 $
4 b




B 6 o 4
8 -2 o 2 -8 2
4
4

2
2
.5
1

.5
1
0
.5


o 2
8
0 o -2
.2
1 5 -
0
2
.5
4
.5
1
8
2
5 o o o

1 5
-60 -
30 -20 f+O 5 o o 1
0 1
0 o f+280
1
42 lN
L E
ARP
ROG
RAM
MIN
G 3
.
5AO
OIT
ION
ALT
OPI
CSI
NLlN
EARP
ROG
RAM
MIN
G 1
43

Thed
ualc
anb
eex
pre
sse
das T
abl
e3.
24E
xam
ple3
.5
:Du
alP
rob
le
mPb
as
e1Ta
ble2

Min
imi
zew
:48
YI+2
0Y2+8
Y3+5
Y4 (
3.48
) Y
1 Y
2 Y
) Y
4 5
1 5
2 S
) a
1 a
2 a
) b
3333 0 3333
6 5
S
ubj
ectt
o: hl8I+4
Y 2+23+O460 (
3.9a)
1
. -
1.3
331 .3
1 33
3 -
1. 20

: Y Y Y 4
03
330.25
.3 0.16
66 o -0.
166 o
6 0.166
h
2:6
YI+2
Y2+1
.53+l
Y Y4~ 3
0 (
3.9
4b) 4
o 6
6
1
.60
1 .2
5
4
-
0
-
3
.16
67
0
8
.
166
6-1
oo -8.1666 o w-152
-0

2.5 A-35

o-
2.5 .
-025 .5
1
1.5
h
3:l
YI+1
.52+0
Y .53+O
Y Y4~ 2
0 (
3.4
9c)

YI>Y
23~ 0
Y (
3.5
0)
rowc o
ntainsther ninimumo f([20
/1.333][510
.3333][15
/1.66
67]})
. lepivotr owis
l
ntr
oduc
ings
urp
lusva
ria
ble
s(SI>S
2S
3)anda
rti
fi
ci
alv
ari
abl
s(
al 2
'a3

)ed
ual row3.T abl
e3 .25rep s
entsthnex
tt a
ble
. leEBViss 2Noteinth
isc t
herearet wo
p
roble
misex
pre
sseda
sas t
and
ardLPpro
blem
: can
didatesforEBV( S2S
3)
'S2isc h
os e
na rbi
tra
ri
ly.l eLBVi sal'Thep iv
otr owisE
M
ini
rni
zew
:48
YI+2
0Y2+8
Y3+5
Y4 (
3.48
) trow.A f
te rthe[u i
redrowmanipulationsT
able3 .2
6isgenera
ted.Scannin
gt hela
st
rowthe a
reo nlyposit
ivecoef
fic
ien
ts.P hase1isnowc omplet
e.Th eart
if
ici
alvariab
les
S
ubj
ect
to: hl
:8l+4
Y Y2+2
Y I+a
3-S l=60 (
3.5
1a) and ti
fic
ialcostfunc
tioncanber emo vedfromt h
eLPp roblem.
Elirnin
atingea rti
fic
ialvari
able
sa n
dt hear
tif
icia
lcostfuncti
onf romtheproblem
h
2:6
)
'1+2
Y2+1
.53+l
Y Y 2+a
4-S 2=3
0 (
3.5
Ib) PhaseIIisstartedwithTab l
e3 .
27.N ott h
atTable3 .2
7c onta
insn oinfo
rmationthat
i
sn ota lreadya vai
lableinT able3 .2.I
6 to nlyp rov
idesa nu nc
1utter
edt ab
lef or
h
3:l
Yl+1
.52+0.
Y 5Y3+O
Y 3+a
4-S 3=2
0 (
3.5
1c) con
tinuingt h appli
cationo ftheS imp lexlechniqueandt here
foreisn otr ea
lly
nec
essary.InT able3.27theEBVi sS 3TheLBVi sYla ft
eratossb e
tweenYla ndsl'
[
nPhas
e1ofth
et w
o-ph
aseapp
roac
hear
tif
ic
ia
lva
ria
ble
sar
ere
mov
edf
romE Thepivotrowi sthesecondr ow
.T hisrowi su sedtoobtainTable3.28.Inthi
st abl
e
b
asi
susi
nga
narc
ialc
ostf
unc
tio
nAd e
fin
edas not
et hatthev alueo ftheb a
sicv a
r i
ableSIi sO.T hisisc a
lledad egene
r a
teb asic
var
iabl
e .Th eEBVf orthenexttab
leisY 3TheLBViss 3Thepivotrowises ond
M
ini
miz
eA: al+a2+a3 (
3.5
2) row( n
ote:t hep iv
otr owc anb eeroww i
tht hed e
g e
neratebasicsoluti
oni fthe
columno ftheEBVh asap osi
tivecoeffi
c i
entina trow).Table3.29isef in
alt a
ble
ThePhase[compu
tationsar
edisplaye
dinT a
bles3.23
-3.26
.T a
ble3.23isid
ent
ifi
ed andcontainstheo pti
m a
ls ol
utio
n.Thef in
alsoluti
ono fthedualpro b
lemis
asts
h imp
lexTab
le1 andi
tin
c1udessomep r
eproc
cssi
ngbyw hi
cha"a 2an
da3 e
madeeb as
isvar
iabl
es.Asar eminderth
el a
strow pres
ent
sea r
tif
ic
ils
a t Y =
;=0 O
ly;=1
0
=0 w
s;=5 =280
fun
ctio
n.Fromi n
spe
ctionofTabl
e3 .23Y
IistheEBV.TheLBVi sa2and piv
ot
rowistheseco
ndrow.Follo
wingthestand
ardrowopera
tion
sTable3
.24isobt
ain
ed. Tos
umm
ari
z t
ehes
olu
tio
noft
hep
rim
alp
rob
lemi
s
[nth
istabl
eth
eEBVi sY2(elarg
estn e
gati
vecoeff
icie
nt).
leLBVi sa3(
E ird
x
;=2xi=0
x
;=8s;
p=2
4p=5
z*=280

T
abl
e3.
23 Examp
le3
.:D
5 u
alProb
le
mPh
os
e1Ta
ble1
fh
esu
bsc
rit
p p
"isa
dde
dtoa
sso
cia
tet
hes
lac
kva
ria
blew
ithep
rim
alp
rob
lem
.
Thes
olu
tio
noft
hed
ualp
rob
lemi
s
b
Y
1 Y
2 Y
3 Y
4 5
1 5
2 S)

l Q2 a)
=1 =1 ;
Y
4=0 W

Y
;=0 0 0 Y si=5 =280
8 4 2
6
0
6 2
1
.5
1
.
0
.
5
5 2003 SomeFormalObservations

4
8 2
0 8 5 o w Thes
eobse
rvati
onsarej
ust
ifi
edmorcfor
mall
yinmanybooksonli
nea
rprog
rammi
ng
-
15 7
.5 4
o 110 A- someo
th
ef o
r
fw
ma
h
lr
ic
e
s
hh
ul
t
av
sa
eb
r
e
ee
e
l
ni
ab
o
n
r
1u
c
a
le
de
di
dus
nt
in
gt
h
er
h
e
es
f
o
e
l
r
e
u
n
t
i
c
o
e
sa
n1
tt
0t
h
h
ee
ee
n
x
do
a
m
ft
p
l
h
ed
i
sc
is
h
a
c
u
p
s
t
e
s
e
r.H
di
e
r
nt
e
h
is
-

Table3
.25 Example3.
5
:DualProblemPhase1Table3

y Y
2 Y
3 Y
4 $ S
3 a a2

$2 a
3 b


o -0.
0.
1
2
8
7
5
8
7
6
-
1.
0
.
14
2
2
1
9
4
3

114
.
-0.2
29
1
43
114
. 29
02857

-
1.
0
14
.
21
29
4
3
-l
.429
-0.2
857
2
0
.
.
8
5
7
1
7
4
1
3
o 0.
2143 -0.
142
9

0.1
429 -
0 .
8571

-
0.142
9 0.85
71 1
2.857

-4
0
.
.
2
8
8
5
5
7
7
1 2

1
.
.4
14
2
86
29 -
1
7.
.
42
14
86
29
3.
-
1
4
.
28
6
14
29
7

2
.
.
1
4
4
2
2
8
9
6 -
3.4
286
2.
1429
w-291
A-2
.8
.43
5
7

T
abl
e3.
26 Example3.
5:DualP
rob
le
m Phase1Table4
y Y
2 Y
3 Y
4 $ $2 S
3
a ~ a
3 b


o -
0.25 -0.
875 0.
875 2.4999
0
.125 -
6 E
-O -0.1
875 6E-06 0
.5 0.
1875 -6E
-0.
5 1.25


0
.25 4E-0
5 0.
125 -4E-05 -
0.125 4E
-05 1
2.5


6
.49
98

-
3.0
001 4
.99
98 0
.00
02 -
3.9
998 -
6.4
998 -
0.02 3
.99
98 w-3IO
o A

146 lN
L EARPROGRAMMING :
1
1 3
.5A
DDI
TIO
NAlT
OPI
CSI
NLlNEARPROGRAMMING 147

T
ab1
e3.
27 Exomp1e3.
5:D
uo1P
rob
1em
Ph
ascD
Tab
1c1 T
ab1
e3.
2 :Du
9 Examp1e3.
5 a1P
rob
1em
Ph
ose1
1T
ob1
e3

Y
I Y2 Y3 Y4 S
I S2 S
3 b Y
I Y2 Y
.l Y4 .
f
l S
2 SJ b


-
0.
0
.
2
1
5
2
5

-0
.
0
8
.
1
7
8
5
7
5
0
.5
2.5
.2
1 5
2
8 -
1
-
1
.2
5
.5 2
4
5
1
0
2 o o

0
.25 0
.5 -2 1
0

0.
125 1
2.5
O -
3 5 6
.5 4 w-31
O
~i
2
4 5 2 8 .
f-280

c
ons
tra
int(
3.5
1b)i
ssat
isf
ieda
sanin
equ
ali
ty.T
heref
o t
hes
eco
ndp
rim
al
se
cti
on.Nopro
ofs '
egiv
en.A
lofth
eobse
rva
tionsmaynotb
ere
lev
antt
oExample
v
ari
abl
ex2isn
onba
sic disi
sev
iden
tinTable3.
22.
3.
5discu
sse
dabovebutar
einc
Iud
edher
eforcom
plete
nes
s.
(
i)I
i ftheithdua1var
iab
leisbasct
i h
entheithpri
malcons
trai
ntisast
ri
ct
eq
ual
ity
.FromT a
ble3.29
Y2a n
dY3a r
eb a
sicvari
abl
esth
eref
ore(
3.4
7b)
1
. Theprimalan
ddua
lp ro
blem
sh av
et hesamvalu
efort
heopt
ima
lo b
ject
ive
d(3.
47c)mustbeeq
ual
iti
es.Thisisi
ndecdtr
uc
.
func
tion
7"=w"=2
. 80
.Thisi
str
uehowever
onl
yifth
epr
obl
emshaveopt
imal
sol
utio
ns. Thescr
ela
tio
nsc
ana
lsob
ccs
tab
lis
hcdbyv
alu
cso
fsl
ackv
ari
abl
es.
2
.(fxisan
yf e
asi
blesol
utio
ntotheprimalpro
blcm.andyis yfeas
ibl
esolu
lio
n 6
.Rccoverin
gp rima
ls ol
utionfromf i
naldualtab
le: Whenl heprima
la nddual
t
othcdualpro
blcm. w(y)~ 7
.(
x)
.T h
isfeat
urepro
videsanestim
atcofth
e p
roble
rnsareint hestan
dardf o
rmthev alu
eo fth
cithprim
nlv a
riabl
ee q
uals
bo
undsofthedua1optim
alv a
lueifaf c
asi
b1eprim
alsolu
tionisknown.Thi
s t
hereducedcoeff
icie
nt(tha
tisthecoef
fici
entinthela
strowofthefin
altab
lc)
r
csu
ltal
soholdsfo
rt h
erevers
ec a
sewhenaf ea
sib
ldualisknown. o
ft h
es l
ackls
urplusvari
ableassoci
atedw i
tht hei
thdualcons
trai
nt
.I nTable
3
.29thevaluesoft h
er educ
edc os
tc oef
fici
entcorre
spond
ingtot hesur
plus
.I
3 f
eprima 1problemi su nbounded
.t hed u
alp roble
mi si n
feas
ibl
e.The
v
aria
blesSIS'a
2 ndS3 ar
e20and8r e
spec
tive
ly.Th eareprecie
sythe
unboundedproblemimp
lies t h
eobject
ivefunc
tionva
1uecanbepushedt o o
ptimalvalu
eso ftheprima
lv a
riabl
es.
in
fin
itelim
its
. lishappen
si fthefea
sibl
edomaini snotc1ose
d.Ofc ourc
s
pr
acti
calcon
sidera
tio
nswillli
mitthcob
jecti
vefunct
ionvalu
et ocorr
cspon
ding 7
.lfei t
hdualvar
iabl
eisnonba
sicthevalueofi
tsredu
cedc ostc o
effi
cien
tis
im
I it
sont hedesignvar
iabl
es.Thei nve
rserela
tion
shiphol
d sto.I
o fthedua1 thevalueo
f slackl
sur
plu
sv a
riabl
eo fth
ecorres
pondi
n gpr ima
1c o
nstra
in.
t
proble sunbounded
mi theprima
lisinfe
asib
le. InTable3.
29YIandY4ar
enonbas
icv a
riab
leswi re
ducedcostc o
effi
cien
tsof
24and5resp
tivel
y.Thesear
ct h
ev a
luesofS
I(Sl
p)andS4(S4p)inTable3.2
2.
4
.Ifth
ei hp
t r
imalcon
str
aintisanequa
1it
yc o
nstr
aintt
heithdua
lvaria
bleis
u
nre
slr
icte
dinsig
n.Thercver
sehol
dsto
o.Ifthepri
malvar
iabl
eisun
rcs
tric
ted 8
.Obtain
ingdua Is olu
tionf romp ri
mals olut
ion
: Whent hepri m
a landd ua
l
i
nsig
n.e nth
cdualcon
stra
inti
sanequ
alit
y. p
roble
rnsa r
ei nthestan
dardform thevalueoftheithdualvar
iableequalsth
e
r
educcdcoeffi
c i
ent( isthecoef
ficien
tint h
elastrowo fthefina
lt a
ble
)o f
5
.Ob
tai
nin
gpr
ima
lso
lut
ionf
romd
uals
olu
tio
n: t
heslackl
s u
rplusvaria
blea ssoc
iatedw i
thei t
hp rim
alc on
straint
.lnT abl
e
)I
(
i fth
eit
hdu
alcon
stra
inti
sastr
icti
neq
ual
ityt
heneiprim
alvar
iabl
eis 3
.22thev a
lueso fthereducedc o
stc oef
fici
entcorrespond
ingt ot h
es u
rplu
s
n
onb
asi
c(f
oroptimumso
lut
ionson
ly)
.Fromt hed
uals
olu
tin
o t
hes e
cond v
aria
blesSIS'S3
2 andS4 010
0a nd0r e
spec
tivel
y.T he
s eareprec
isel
y
t
heoptima
lv aluesofthed u
alv ar
iablesinTable3.2
9.

T
obl
e3.
28 Example3
.5:D
ualP
rob
lem
Pho
s 1
e1 T
nbl
e2 9
.Ifth
eithprimalvaria
bleisnonbasc
i t
hevalu
eo fit
sr e
ducedcostco
effic
in
ti s
t
heval
u eofthes l
ackl
surplu
sv a
riabl
eo ft
hec or
respondi
ngdua1c o
nstra
in.
tI n
T
able3.22X2i
san onbasicvar
iabl
ew ithr
educcdcostcoe
ffici
entsof5.Thi
si s
Y
I Y2 Y
.l Y4 S
I S2 5
J b

-
2
-
0.5
-
0.5

t
h
c
o
ev
ef
f
a
i
l
c
i
u
e
eo
n
fS2i
tofO
nT
e
a
c
b
o
l
r
e3.
s
p
29
o
n
.S
di
i
n
nc
gs
eXIandX3a
lack
lsu
rplu
r
eb
sS
Ia
as
icw
ndS3v
i
a
t
r
i
ht
ab
h
l
er
e
sw
c
i
d
l
uc
lb
edc
ze
o
s
r
t
o
2
2
0
0
.
.
2
5
5 0
.37
5
2.5 a
sobservedinT le3.29.


-
0.2
5 1
5
8 -
2 5 5 IV-3
00 Thea
l
is
tc
b
a
o
nb
v
el
co
i
s
b
t
tr
ai
n
e
f
e
er
r
df
e
o
dt
rn
o
ot
n
h
s
t
ep
an
d
r
a
i
m
r
alandd
dfo
rm
u
.T
h
a
e
lp
r
r
o
ew
i
b
l
le
lb
m
ea
si
p
p
ns
r
t
o
p
a
r
n
d
i
a
a
t
rdf
emo
d
o
i
r
m
f
.As
ic
ati
o
i
n
m
il
sf
a
r
o
r
1
48 lN
L E
ARP
ROG
RAM
MIN
G 35 A
ODlT
ION
ALT
OPI
CSI
NLlN
EARP
ROG
RAM
MIN
G 1
49

n
ega
tiv
evalu
esofvar
iab
les w
ellase
qua
lit
yco
nst
rai
nts
.Th
eli
st
edr
efe
ren
cesc
an n
Sesl
tl
vl
ty1
0Co
stC
oef
flc
len
t
b
econs
ult
edforf
urt
herin
for
mal
ion
. 2
0 2
5
?

.- -
- -----
1
61
50
3
.5.
2 S
ens
ltl
vit
yAnalysls

Thesolution10theLPp roblemisd ependenlo nthevalue


sf orec o
effi
cien
tscb
andA( alsotermedparamete
rs )inv
o lv
edint heproblem
.I nmanyp r
act
icalsitu
ati
ons 5
-
.

-16150

3
0
the
sep a
r neler
sa reo nl
yknowna pproximatelya n
dmayc hangef romit
sc urr
ent -


valu
ef o
ra nynumbero fr e
aso n
spartic
ularlyafle
ras oluli
onh asb eenesta
blish
ed.
Ins
teadofr ecomp
utinganews o
luti
onitispossibletoobta
inaf reshoneb ase
dont he
g s
exi
stin
go nea ndit
sfinalSimplext a
ble
.T hisissueissig
nific
antinp r
acti
calproblems
wit
ht housandsofvariabl
esan dcons
train
ts.Thea daptat
iono fan wsolutio
nw it
hout 1
re-
solvi
ngt hep roblemi scalledsensi
ti
vi.a nalys
is.InLPp r o
blemssensi
tiv
ity -
16
15
0
an
alys
isr efe
rstodeterminingt h
er angeofpara m
etersforw h
i cht h
eoptimalsolut
ion -
15
st
i
llhasthesamev ariab
lesinthb a
siseventho ug
hv al
uesalIheso l
ulio
nmayc h
ange.
Examp le3 .
1isusedf o
ri sdiscu
ssion.Figuresare edfori1
Iu s
trat
ionrath
erthan -
20
aformalp roof
.Figuresaren otusefulformoret h
ant wov a
riabl
e s
.G en
erallymosl
compulerc odesthats ol
veIinearp rogramm ingp roble
msa lsop erformsensi
tiv
ily 1
c =200-optlmumchanged1
0A
an
alys
is.R e
visit
ing Example 3 .1it w n ecessa
ry1 0i den
tifyt he numbero f
-
30 1
0 1
5
componentp lncemcntm a
chine sofl yp
eA a n dB.Theo b
jectiveistom aximizee 0 5
numbero fboart obem anu
fac tu
red.C o
nstraintgI re
pres
entsthea cq
uisit
iondoll
ars M
ach
lne
sofT
ypeA
av
aila
ble.Cons 'a
in
tg 2repr
esentsthef l
oorspacec on
stra
in.C
t onstra
inlg3repres
ents
g
uro3
.9 S
en
si
ti
vi
tya
nal
ysi
sc
han
gin
gco
slc
i
ci
en
.t
th
enumbero fo per
atorsa vaila
ble
. Th ep r oblems t
atementa ndther es
ult
sa re
repr
oducedb elow(note X 3
'X 4andX sarethcs l
ackvariab
les)
Cha
ngin
gt hccos
tc o
eff
ici
entch
angesth
esl
opeofthel
inerep
rese
nti
nge
o
bje
ctiv
efunc
tionatmayleadt
oac h
angei
n so
lut
ion
.Fo
re x
ampleEqu
ati
on
Mi
nim
ize j
(X:-99O
) xI-9 1
X
2-5250 (
3.5
) (
3.)c
5 anbewri
tten

s
ubj
ecIt
o
: g
l(X
):O
.4x
l
+-0
.6X 3=
2+X 8
.5 (
3.6
) 2
x ={990/900)XI([5250+j
]/9
00)

IfCIw eretob emade-1900e nt h


es lopeofel i
newillbe(1900/90
0).Th e
g
2(X
) 4=
:3xI-X2+X 2
5 (
3.7
) sen
siti
vityd uetoC Icanb ee xpe
riencedb yr u
nningS en
sltlvlty_cos
t.m.1The
changew i
l hrespe
ct10t heori
gina
lo bj
ectivefunct
ionisshowni nanimati
on.The
g
3(X
) 2+X5=
:3xI+6x 70 (
3.8
) orig
ina
ls olu
tioni
sm arkedonthefig
urebyac ir
cl
e.Theo r
igi
nalsol
uli
onisunchanged
whenthema i t
udeoftheslo
peisrais
edforinst
anceCI= -
1900.Ont heoth
erh an
d
x1~O; x2ox3~ 0 x4~ 0 Xs~ 0 (
3.9
) i
fCIw ere10b emade-200 Ih
ed o
ttedlin
ei ndi
cat
esthenewc os
tlin
ea ndinthi
scase
thesolut
ionwi 1
lchangetop o
intA.Thi sisshowni nFigur
e3 .
9 i sE sultof
Thes
olu
tio
nis runningthem-fi
Ie.Thef lo
orcons
trai
ntisn olong
erb i
ndin
g.Itcunbeestabl
ishe
db y
simplecacul
ation
s i n
fin
ite
lymanys olut
ion
sa reposs
ibleifC
Ih asav alueof
;
x=10.4762X ;
x=0.4524]=-21437.14
;=6.4285 -450.InI h
iscascthecostfunc
tionispar
alleltoth
eb ind
ingcons i
nt83'Fromt h
is
discu
ssioniti
sa ppar
ent 10k eepthelocati
onoftheorig
inalsol
uti
onu nchange
d
CI mustb eg rea
lert h
an- 450.S ucha n
ulysisisp os
sibl
ef oral
lI heotherc o
sl
ChangingCostC o
e f
ficlentValues(c)
:F ir
stcon
sidertheeectofchangi
n g coef
ficie
nlsin v
olvedini sprobl
em.Inp arti
cul
artheana
lysissho
uldi n
dica
tefor
th
ecos
tcoef
fic
ien
lsofth
ed c
signva
ria
blc
s.IfCI
Othec
oeff
ici
cntofde
signva
ria
bleXI
i
schange
df ro
m-990wil
ltheseto
fbasi
sv ar
iab
lesrc
mainthesame? l
Fi
le
s10b
cdo
wnl
ond
edf
ro
mtew
1
l e
bsi
l
cnr
cin
di
cn
le
dbyb
ol
df
ac
e f
ty
pe
1
50 1N
L E
ARP
ROG
RAM
MIN
G R
EFE
REN
CES 1
51

w
hatrang
eo fco
stcoe
ffic
ien
tst h
eso
lut
ionwou
ldsti
llre
mai
nwh
erei
tis
.Th
isi
s S
ens
iti
vit
ytoc
ons
tra
intc
oel
fic
ien
ts(
a11
)
r
efe
rre
dtoasde
term
iningsen
sit
ivi
tyt
ocos
tco
eff
ici
ent
s. 2
0r
lIil~O
-

ChangeI
si
dechangc
nth
st
eResourceL
h
ec on
str
aiti
n Ine
l
s
mlts(
lpla
n
bV
/bo
e
u
c
t
n
or
r
)
i
:Whent
e
sa r
h
ev
emovedp
a
lu
a
S
m
ll
o
c
nt
lt
h
cr
ot h
i
e
g
m
s
h
t
e
-
l
h
a
v
e
n
s
d
.
-.
- ...
":----
li
schangesthefeas
ibl
eregion.Thr ef
oret
heopti
malvaIue
smaya I
soc h gedueto

th
echangesine f
l s
ib
l :g
ion.Oncea gainth
ec h
angescanbei l
lu
st edb yrunn
ing
5
Se nsv s
i .m.Figu
r e3 .
10iIu
I s te
sthechang
eintheright
-handsideva
Iueof
efrr
stn st
rnt
.b..mi t
sv a
Iueo f8.5to6.5
.Th i
schangcaus t ob ecomean @

a
t
c
t
h
i
eo
v
ec
ri
gi
on
s
na
a
Ip
i
r
n
o
tI
.
b
le
nth
mg1
i
sc
w
a
as
sn
e
o
t
ta
heo
c
t i
v
p
e
t
i
.I
maIsolut
i
nenewf
onh
or
a
m
u
smovedf
lati
oni
tis
romAt oB
.However
.N
i
o
ns
t
e
et
n
si
h
t
i
a
ti
vi
t
n
y ~

an
aly
sisep rob
lcmistodiscoverthcrangeofb.so thesolut
ionst
il
lh asesame
va
ria
blesineb a
sis
.lfblwe tor e
ma i
na bov
e8 .
0475th
enthesolu
tionwo uldst
i
llbe
atA dglw i
llnotbeanactiv
ec o
nsaint
-
15
ChangeIntheC
oef
flcl
entM
atrlxA: A c
hang
ei nth
ec oe
ffici
entma
trixis
s
imi
lari
neff
ectt
otha
tduetoth
ec ha
ngeinth
ec o
stc
oeff
ici
entw
hi
ledir
ect
ly
-
20

a
1':
0.6-o
ptl
mumc
han
ged
m y
Sen
sl
tl
vl
tyt
ore
sou
rceI
Im
lt
s
2
0 s 1
0 1
5

1
5 M
ach
ine
sofT
ypeA

F
lgu
re3
.1
1Se
ns
il
lv
il
yan
aly
sisc
han
gin
gco
slc
oe
ff
lc
le
n.
l
1
0

5 i
mpacti
ng problcmbyc ha
ngingthefea
sib
lereg
ion.Thesec han
gesals
od ependon
w
hetherthev a
riab
lei nt h
ec olumni sab ns
icv a
rinbl
c01 ' anonba
sicv ari
ublc
.

Se
nsltlvlty_
coeff.mi ll
ust
rat
est h
er es
ultofc hangingthec oef
fic
ienta l
l' An
i
ncre
aseinthev a
Iuemovest heoptimaIsol
uti
ontoBw h
ilead e
creas
el eav
est h
e
o -5 s
olut
ionuncha
nged.Inbo t
hs i
tua
tion
sXIandx2aresti
l
lp a
rto feb a
sis
.I nthefi
rs
t

E c
aseg.b ecomesab i
ndingc o
nstrai
nt
.T hisisillus
trat
edi nF ig
ure3 .11
.T hc
1
0 c
oeff
ici
entisintheflf
t colum
nw hichcorr
espon
dst oab a
s icvar
iab
le.C ha
n gi
ng
c
oeff
ici
entv a
luesi nt hefir
st column ino t
herc on
stra
ints wi1
y iel
ds i
mila
r
-
15 i
nform
atio
n.Th erea
derisencour
agedtotryoth
erchangesinthecoef
fic
ientusingc
m
-fil
esavai
labl
eint h
ec odesec
tionofthi
schap
ter
.

b
1:6
.5-o
pti
mumchanged-a
cti
vec
ons
tra
int
REFERENCES
-
30
0 5 r
o 1
5 .D
1 an
tzigG.B.Lin
earProgrammingandEx t
ensi
o P
rin
cet
onUni
ver
sit
yP r
ess
M
ach
lne
s01T
ypeA Pin
r ce
ton
.NJ.196
3.
2
.Luen
bergrD
e .G.Lin
earandN o
nlin
earProgrammiJg
l Add
ison-
Wes
ley.Rea
din
g.
1g
F u
re3
.10S
en
si
ll
vi
tya
nal
ysi
sc
han
gln
gri
gh
th
a
nds
id
e. MA.1984.
152 L
lNEARPROGRAMMING PROBLEMS 153

3
.Winsto nW. L.
l nt
rod
uct
iont oMathemati
calPro
gramm
ing
.A ppli
c a
tio
ns and
AIg
or ithmsDuxb
uryP s
sBcl
montCA1995. S
ub: 3xI-X2S3

4
.AroraJ.S.ln
trod
uct
ionOptimalDe
sig
ll.McGraw-Hi NewY

I or
k.1989. XI+2x2~5
5
.Wilia
1 msG..Line
arAIge
brawithAp
plic
atio
ns.Wm.C.BrownPubl
ish
ersDub
uque. XI+x2~4
IA1 9
91 .
6
.No
b1c
.B.. dD
ani
el
J.W.
App
lie
dLi
nea
rAI
geb
ra. e
nti
-H
al En
l g
1ew
oodC
li
ff
s. !0;X2u c
XI2 di
nsi
gn
NJ
.197
7.
3
.6 Theloca
lb o
oksto
remustd e
terminehowmanyo fea chofthef o
urnewb ooks
onphoto
nicsi
tmustordertosatis
fythencwi nt
erestg e
n e
ratedinthed
isci
plin
e.
PROBLEMS Book1c os
ts$75 wi
IIprovideap r
ofi
to f$13 and q uir
es2i nche
so fshel
f
spa
cc.Book2c os
ts$85 wi1
lp ro
videap r
ofitof$10 andrequ
ires3i n
chesof
(
Foral
ltwo
-va
ria
blep
rob
lesp
m rov
ide ag
rap
hic
ald
efi
nit
ion
lso
lut
iono
fth
c sh
elfspa
ce.Book3c o $ 65wi
llprovideaprof
i tof$8 andrequi
r1i
n
chof
p
rob
lem
.) she
lfspa
ce.Book4c o
sts$100 w
illprov
ideap r
ofito f$15andr eq
uire
s4i nch
es
ofshe
lfspac
e.Findthenumbero feachty p
et h
atmustbeo rderedtom i z
e
3
.1 S
olv
eth
efo
llo
wigi
n In
earprogrammingp
rob
lem
: pr
ofi.
tTota
ls h
elfspacei
s1 00inch
es.Totalamounta v
aila
bleforordcri
ngis
Min f
t
.xl
X:
z
}:XI+X2 $5000
.Ithasbeendecide
dt oorderat1e
astat o
o f0o fBook2andBook4 .
S
ub: 3xI-X2~ 3 3
.7 Th elocalcommunityc olle
gei sp1anningtogrow b iote
chno10gyo ffe
ring
throughnewf c
dera
lands tategrant
s.Ana mbiti
ousprogrami sbci ngp1anncd
XI+2x2~5

XI+X2S 4
forrccruit
ingatlea
st2 s tude fromi nandouto fst
ate
.Theya retorecr
uit
atlea
st40o ut-o
f-st
atcstud
ents.Th eywi 1
1attemp
tto rui
tatleas
t30s tud
ents
XI~O;X2~O whoa rei nthetop20%o ftheirgraduatinghighschoolc1as
s.Curre ntfigu
S

3
.2 S
olv
cth
efo
llo
win
gli
nea
rprogrammingp
rob
lem
: indic
ate a bout8%o ft h
ea ppl
icantsfromi nst
ateand6%o ft heapplic
ts
fromo utofsta
tebelongtoispooLTheya l
soplantorecr
uita
tleast40s tud
ents
Max f
(x)ox
z):XI+
whoh av eAPcoursesinbio10gy.Th edatasugges
tthat10%and15%o fin-st
ate
S
ub: 3xI-xz~ 3 ando ut-o
f-st
aleapplic
antsrespec
tive1ybclongtoi lTh
spoo. eya nt
icip
alc
XI+2x
2S5 tha
tt headditi
onalcos
tp erstudentis$800f orcachin-s
tatcslu
denta nd$1200
foreacho ut-
of-s
tat
cs tudentF in
dt hc
ira ct
ualenrollme
ntn ecdedtom inimize
XI+X2S 4
costandt he
iractu
alcost
.
!0
XI2 ;X22
!0
3
.8 Figure
3.12re
psent
sanoptim
izati
onproblemt
odele
rminethema.
ximumtOl
a1
3
.3 S
olv
ethf
oll
owi
ngl
inc
arp
rog
ram
min
gpr
obl
cm: numbero f smaI
1errect
ang1
esa twilfi
twithinthcl a
rge
rone.The
Min f
(x"X2
):XI-X2 dime
nsionsareind
icat
edonef ig
"C.nenumbero fth
e1 ar
gerr
ctan
g1e
S
ub: 3xI-X2~ 3 shou
ldb eat1ea
st5morct h
ant h
esma
1eron
cs.Thcr ec
tangl
escann
otb e
ro
late
d.Nof r
act
ion
alrcl
angl
esareal
1owed.
XI+2x
2S5

XI+X2S4 (
Opt
ion
al:c
onf
irma
Ils
olu
tio
nsu
sin
gth
eOp
tim
iza
lio .
nToolboxfromMATI.AB
.)
XI2
!0;X22
!O
3
.4 S
olv
eth
efo
llo
wigi
n Inearprogrammingproblem: 100


M f
(x"X2
):XI+X2
1
.5
S
ub: 3xI-X22
XI+2x
!3 t
2S5
2
.5 70
XI+X2S 4

XI2
!0;X22
!0
3
.5 S
olv
eef
oll
owi
ngi
Inearprogrammingproblcm:
'A
':
_ 1
'1.
.
u
.
. Rguro3
.12P
rob
lm
3.8
.
4
.1 PROBLEMD
EFI
NIT
ION 155

num
eric
alt ec
hni
quesess
ent
ial10t
hedevel
opmen
tofNLP[ 1
2)
.Theb ooksfamil
iar

4
totherendershoul
d do admi
rab
ly. Thi
schnpte
rals
oi ntr
odu
cest hesymbolic
computi
ol
l(computeralge
bra
)r e
sou
rceava
iln
bleinMATLABnamelySymbolic
MathToolbox[3
).

4
.1 PROBLEMDEFINmON

InNLPi ti snotess
entia
la tal
lt hefuncti
onsi nvo
lvedben onlin
car.Itissufficie
ntif
ju
stonco fthemisn on
linear.T h
er aremanye xamplesi ne n
gineeringinwhicho nly
eo bjectivefunct
ionisn onlinearwh
iet h
ec on
strai
n tsa relin
ea.l
r finthisc asethe

NONLINEAR o
p
b
r
j
o
e
c
b
t
l
i
e
v
m
ef unct
ionisaq uadrati
cf unct
io
s(LQP).Optimizationproblemsf
nthe
o
seproble
r mostp
m saret
r
er
e
l
medl
yone
il
le
x
a
rq
per
u
a
i
d
e
r
n
a
c
l
et
ic
o

PROGRAMMING i
c
d
o
e
n
n
s
t
t
i
r
f
a
yt
i
nl
h
s
em athe
maticalmodelc
. A knowledge o fe n
o
g
m
i
p
n
r
e
i
e
s
r
i
i
ngo
go
n
fth
rt
ed
h
es
ea
ig
p
nv
pr
a
o
p
r
r
i
i
a
a
b
t
l
es
ed
o
i
b
s
j
c
i
e
p
c
l
t
i
i
v
n
e
ei
andt
sa l
h
s
e
o
essen
tialtoc st
abli
sham at l
lematicalmode .
lP ri
marilythisi n
volvesd e
term iningthe
funct
ionalr elat
ions
hipsamongt hcdesignv ar
iabl
es.Thcr emainingtaskt h
eni s10
est
ablishthes o
luti
on.
Howd oesonee s
tablishthes o
lutiontothen on
linearo ptimizat
ionp robl em?
I
nm athematics( n
fternlla tthiss ta
gcL hereisam athematicalmodel f orthe
Optimiz a
tionp roblemswhosem athematicalmodelsa recharacteriz
e dbyn onlinear problem)t hesol
uti
ollisob t
ainedbys atis
fyingthenecess aandSI c
{ ientc ondi
tions
equationsa recalledNonlinearP rogramming LP)p roblems
.I nCh aptr3i tw rel
atedtot h
ec l
assofproble~. Then ecess
aryc ond
i tionsar thoserela
ti on
st ha
ta
noteda tthesep roblemsalsofel
li nt
ot h
ec atego
ryofm athemat icalpro gramming C didatefortheoptimums olut
ionm l
lstsa
ti.
.Ifitd oese nandt h
isisi mportant
problems.Engineeringdesignproblemsa rem ostlynonli
near.I nChap r2s evera
l tmaybea
i no pt
imalsolution.Toq uali
fyad esignvectorXP( Xrepres
entst hedesign
probl emswereexaminedg raph
icall
ynnditwase vident
thatcurvaturea ndthegradien
t vecto
r)a sa n optimumi tmusts nti
sfya ddit
ionnlr elation
sc nlledt es
h uj
Jici
ent
oft hef u
nctionsi n
volvedhadas igni
fica
nti n
fluenceont hesolution
.I ns ubsequen
t condi
tions.T he
refore optimums oluti
onmusts ati
sfybo n ec
essarya nds u
fficie
nt
chapterswew illc ontinuet ocentered iscu
ssiono foptimalityc onditio
nsand condi
tions.T hischaptere st
ablishestheseconditio
nsf ort heo pti
m i
zationp roblem.
numericalt cchniquesarou ndtwo-vari
ablep roblemsbecauseei d
e a
scana lsobe Example4 .1isestabl
ishedn extandi susedi nsever
a lwaysi nther emaind e
ro fE
expressedg rap
hically
.E xtensiontomoret hantwov ari
ablesisquites tra
i g
htforwar
d chapter1 0d evclopt h
ec ondi
tionsm entioneda bove. Once 1hec ondil ion
sa re
andi smosts implewhent hep senta
tionismadet h
rought h
eu seo fvectora1gebra
. avail
able th
en um
ericalt echniq
uesi noptimi
zationwi Ui ncorpor
atethemt oe stabl
ish
MA Bw
TI.A illbeu ti
lize
df oral
lg ra
phicneeds. thesolut
i o
n.
Tradit
ionallyt he
rei s ab ottom-upp re
sentati
on of m ateria
lf orn onlinea
r
optimizat
ion.U nconstrainedproblemsa red isc
ussedfirs
tf ollowdb yc onstrain
ed 4
.1. n-
1 ProblemFormulatlo Example4
.1
problems.Forc onstr
ainedp roblemsee q
ualityconstrai
nedproblemi sd iscuss
ed
fi
rst
.A s i l
arp rogr
essioniso bservedwith gardt othenumberofv ariabl
es.A
Theproblemi
s st
ric
tedtotwovari
ablestodrawg r
aphi
calsupp
ortforsomeofE
single-
variableproblemi si nt
roducedfollowedbytwov ariable
swhichi sen
di
scu
ssion
s.Ther
earetwoconst
rai
ntswhichdur
ingthedev
elopmen
tofthischa
pter
extendedt oag enernlproblemi nvolvin
g"v a
rinb
les.Thiso rd
e ra l
lowsi ncrement
al
mayswitchbe
twccnequa
lityandine
qualit
yc o
nstr
ain
tstoi
lus
tra
te l
ate
df e
atu
res
.
introduct
ionofnewc on
cep s
t b
utp ri
marilyallowsthecreati
veu seofe xistingrule
s
toestablis
hs olu
t i
onstothee xtendedprob
lerns
.
Ana naly
ticalfoundationisess
entia
ltou nd
erstandande s
tablishtheconditionsat Problem: Findt
hcr
ect
ang
leo
fth
cla
rge
sta
r (
in p
osi
tiv
equ
adr
ant
)a
tca
nbe
theo ptimalsolutionwillhavet os at
isf
y. lisisnotf o
rt hes akeo fm a
t hem
a ti
cal a
nsc
rib
edw i
nag
ive
nel
lip
seands
ati
sfyap
res
cri
bedl
ine
arc
ons
tra
int
.
cur
iosityb utis e ss
entinlcomponentoft hen umeri
calt echnique:n otablyt h
e Fromcp rob
lemspec
ifi
cat
iont
heell
ips
ewillpro
videaninc
qua
lit
yc o
nst
rai
nt
stoppingc rit
eri
n. Th en ecessarym nthe
mnticald efin
itions and i ll
ustra
tionsa r
e w
hileel i
nea
rrela
tio
namongt h
cvari
abl
cswil
lp r
ovide cq
ual
itycon
str
ain
tfor
introducedinthischapt
er.R efer
encesarnvailnb
leforrefresh
ingt hecalculusandt h
e t
bi
sc x
amp
le.
154
156 NONL
lNEARPROGRAMMING
4
.
1 PROBLEMDEFINITION 157

3 M
ini
rni
ze f
{ l
X
) n (
4.5
)

S
ubj
ectt
o: [
h(X
)]=0 (
4.
6)
2
.5
[
g(X
)]m$
;0 (
4.7
)
x
z
X1
0w$
;X$
;Xup (
4.8
)

F
ort hesp
ecif
icproblemb e
ingd i
scusseandrefeningt
d oFig
ure41t
. h
ede
sig
n
v
aria
blesareth d
ecool
' i
natevaluesxl dX2 a
la llowth
cc om
putat
ionofth
e
r
eclIa
t rare.Th
a eoptirn
izat
ionproblemis

Min
irn
ize j{XI X~: -
XIX2 (
4.9
)

S
ubj
ect
to: h
l( .
x xz
:2
} 0
xI+1
5X2- 30 0 = (
4.1
0)
//
Jff

. (
/f
0
.5
// x
T/4)+(~) 1$;0
81(X X2): (
4.1
1)
//
O
$;x
l$;
3; O$;x2$;3 (
4.1
2)


0
.5 1
.5
Thes
idec
ons
tra
int
sin(
4.1
2)c
ana
lsob
epo
stu
lat
eda
son
e-s
ide
dandc
anbew
rit
ten
2 2
.5 3
as
X
1

F
lgu
re4
.1 C
ons
lra
inl
sofExa
mpl
e4.
1. X1~O; x2~0 4.
( 13
)

MathematlcalModel: Figur
e4 .1capt
urcsth
ees o ft h
ep l c
m.Codefil
cs
Ex4L1.mlandcreate_elllpse.ma refi
lcsncssa
ryf rMA
o T
I.ABtocre
atethe 4
.1.
2 DlscussionofConstraints
f
igur
e.'
herea
retwovar
iable
sXI andX2le
reares
tand
ardmathem
a ti
calex
press
ions
free
o l
lip
seandt
hestra
ightli
neisnoproblcmaft
erChap
ter3. Using t
here
lat
ion
s( 4
.9)(
4.1
2)s e
ver
ala dd
itio
nalc
1ass
cso fproble
msc a
nbe
descr
ibe
dbyinc
ludi
ngonlyasubs
etofth e
cr1at
ion
s.The
yareexaminedbel
ow.
StandardFormat:The s
tan
dar
dfo
rma
t oft
he NLP i
sre
pro
duc
edh
eref
or
convemence: UnconstralnedProblem:Thcrea
renof u
nctio
nalc
onst
rai
ntsalth
oug
hth
esi
de
co
nst
rain
tsarcne
cess
arytokeept
hes
olu
tio
nfini
te
.Forthi
scxample
Mi
nir
niz
e f
(xtX2'
t Xn) (
4.1
)
M
ini
rni
ze j
{
XI ~): -
x1~ (
4.9
)
S
ubj
ect h
k(x h

. .
)=0
x

k=12 .
L (
4.2
)
I
nthisproblemi
f desig
nv a
ria
blcsa
reunboundedatcuppe
rl im
itt
he
ne
X2
(XI
..
Xn ;0
)$ j=
12
..
m 4.
( 3
) s
olu
tionwouldbeatthelar
gestp
osi
tivev
alu
ofXIandX2Atwo
-side
dl i
mitfort
he
d
csig
nv a
riab
lesisus
uall
yagoodi de
a.Thedes
ignerdoe
shavet
heponsib
ili
tyof
x
l$; Xj $
;xl
'
;=12
...
n 4.
( 4
)
d
efi
ninganaccept
abl
ed e
signspa
ce.

I
nve
cto
rno
tat
ion Equal
ityConstralnedProblem1: Thefunc
tio
nalco
nstr
ain
tsi
nth
ispro
ble
m
o
nlyequa
lit
ies
.Withrefer
ence1
0Example4.
1cf o
llow
ingprob
lemca
nbesclup
I
FI
i 1
0bed
own
loa
dedf
romI
hew
ebs
i
lc ci
nd
ic
ll
le
dbyb
old
fnc
e r
if
ly
pe
. (
aft
erchang
ingcinequ
alit
ytoancq
ual
ity
):
158 NONL
1NEAAPAOGAAMMING 4
.2 M
ATH
EMA
TIC
ALC
ONC
EPT
S 159

Minimize f
t
..
x X
2):-
x.x
2 som
eco
nstra
intsa
reac
tive(e
qua
lit
y)a
tth
eop
tim
als
olu
tio
naso
the
rwi
sei
twould
S
ubj
ectt
o: 1
1)
(x
..X
2) .+1
:20x 5X2-30 0 = beanunc
onstr
aineds
olu
tio
n.

h2
(x.
X
2):(~/4) +(4) 1=0
4
.2 MATHEMATICALCONCEPTS
O~XI :
:
;;
3; 0~x2::;;3
LikeLP somemathematicald efi
nit
ionsa r
en saryb e
foret hen sarya nd
I
ntui
tive
lysuchaproblemmayn otb optimi
zeds in
cet hetwoc ons
trai
ntsby s
uffic
ien
tc ondi
tionsforth
eNLPc anbeestabl
ished
.D e
finit
ionsaren e
e dedforboth
th
emselvesshou
lde st
ablis
ht h
ev al
uesfortheIwod es
ignvaria
ble.Th
s eargumenl
s ea nal
ytica
ld iscuss
iona sw e
lla sn umeri
calt ech
nique
s. MATLAB p rovidesa
us
edinLPf oraccepla
b l
ep robl
emd e
fini
lio
na r
ea l
sovali
dh .Thereisalwaysth
e SymbolicMathToolbox whichp ermit
ss ymbolicc omp
utationi nte
graledinc
p
ossi
bili
tyofmultip
les oluti
ons-whichisastron
gf e
alur
eo fnon
lina
rp r
oblems.I
n num
ericale nviro
nm e
nto fMATLAB.Thi sa llo
wsI heuser10e xplo pro b
lemsi n
s
ucha neven
tt h
eseto fvar
iabl
esthatyie
ldelow slvalu
ef o
rtheobje
ctivewil
lbe ca
lculsl
u i
nearalgeb
rasolu
tion
so fsystemo fequati
onsando the
ra re
as.Inf ac
t
t
heoptimalso
luti
on.NOle s uchas o
luti
onisobtain
edbys cann
ingtheaccep
tabl
e usi
ngs ym
bolicc om
p ut
ationstud
entscaneasil
yr eco
verep r qu
isit
ei nfor
mation
s
olut
ionsrat
her anthroughappl
icati
onofanyr i
gorouscon
ditio
ns. f
orthecourse.As hor
th an
ds-onexerc
isetos ymb
oliccomputationisprovide
d.1'he
prim
arydefinit
ion
swen eedareder
ivat
ivespa
rti
alderiv
ativs
e ma
trics
e d
erivat
ives
E
qua
llyConstralnedProblem2
t :If
thep
rob
lemwe
0i
1 nc
Iudeo
nlyoneo
flh
e ofmatr
icesandsolut
ionsofnonli
nearequat
ions.
c
ons
tra
ins
t f
orexample
4
.2.
1 SymbollcComputatlonUslngMATLA
Minimize f
t
.l
x X
2):-
XIX
2
Oneoft
hebes
lwaystog lfami
e 1i
arwithsym
bolicco
mputati
oni
stotak
ethequi
ck
S
ubj
ecl
lo: h
2(x
"X2
):(~/4) +(~) )=0 on
lin
eint
rod
ucti
on10theSymb
olicMathToolboxav
ailab
leint
heMATLABDemos
0
:
:;
;XI:
;3; 0
:
:;
;X2
::
;;3 di
alo
gbox[4
].Thefol
lowings
equ
enceloc
ate
st h
elu
tor
ial
:

>> demos
T
hisisava
lidopt
imi
zat
ionp
rob
lem
.As
imi
larp
rob
lemc
anb
ede
fin
edw
ilht
hef
ir
st Symbolic Math - > Introduction
c
ons
trai
ntbyit
se
lf
.
Thec o
mputalionale ng
inee xecu
l ing s ymbolicop e
rationsi nMAT 1.ABist h
c
kemelo fMaplem arkeledan dsuppo db yW aterlooMaple In
c.l fE a de
ris
Ine
qualltyConstrainedProblem: I
nthi
scaset
heco
nst
rain
tsa
rcal
lin
equ
ali
tie
s.
alr
eadyf am
iliarw ithMaple enMA T
1.ABp r
ovidesahookt hroughwhichMaple
Avaria
tio
nonE xarn
ple4.1wouldbe(theeq
ual
ityco
nsain
tistra
nsfo
rmedtoan
e
qual
ityco
nstr
ain
t) commandsc anb ee x ut
edi nMATLAB.Th es y
m b
olicc omput ati
oni nMATLABi s
performedusingas ymbolicobjec
to rs ym.Thisisa n
otherd atatypeiIkethenumber
andstri
ngd at
at y
p esusedin rli
erexercise
s.Th eS ym
bol icMathToolboxu sessym
Minimize f
tx.x
. 2
l
:-XIXz obj
ectsto prese
n tsymbolicvari
ablese x
pressio
nsandm atric
e s
.
S
ubj
cctt
o: g.(x"X
2) I+1
:20X 5X2-3
0:
:;
;0 Int h
ee xer
ciset ha
tf o
llowsafunctiono fonev a
riabe
l andtwof unct
ionso fIwo
var
iables(cons
traintsfromExample4. 1)a u
t
1 sedf ri
o IIustr
alion
.Drawingont h
e
g
2(X
"XZ
):(
xt/
4)+(4) 1
::
;;
0 auor'sc1assroomex n cei spreliminarydiscuss
ioni sint ermsofv a
r ia
blesX
O
::
;;
XI:
:
;;
3; 0
::;
;x2
::;
;3 andyf o
ri mprovedc om
prehension.Inl a
tersect
ionssu
bscriptsonxa reusedt odefi
ne
mul
tiplevariab
less otha
tet r
ans
itiontot h
eg en
eralproblemc a nbef a
cil
ita
t e
du si
ng
L
ikei
t
sco
unt
eti
nli
nea
rprogramming i
sisav
ali
dop
lim
iza
tio
npr
obl
em. vect
ordescrip
tion.Thef unct
i o
nsint hcscexeaisesare
E
qua
llyv
ali
dwouldb
eaproblemt
hati
ncIudedj
ustoneo
flh
eco
nst
rai
ntso
ran
y
numberofin ual
itycons
tra
ints
. ftx)=12+(x-I)2(x-2)(x-3)
Itise s
senl
ialtou nd
erstandboththenatureandt henumbero fconstr
aint sas g
.(
xy 5y-30
:20x+1
)
wel
la showt he
ya f
fecttheproblem.Ing e
neralequ
alityco
nstrai
ntsa r
ee as y10
handle
m athe
matICallyd
iffic
ultt
osati
sfynumerically.an
dmoreres
tr i
ctiv eonthe g
2(X
y
):x
24+
/ l-1
sea
rch f ort hes olut
ion. Ineq
ualit
y c onst
rain
ts a rediffi
cultt o r esolve
math
ema t
icallyanda remoref le
xib
lew ithrespe
ctt othesear
chf ortheo ptimal I
TOOr
cl
ca
sco
f10n
0 e
wSwdentEdillolli
nc
lu
dc
sIh
csy
mbo
licl
ool
bOu
l l
ongw
il
hIh
eba
si
cMA
TLA
D
so
lutionastheydefi
neal ar
gerfea
sibl
er e
gion.Aw ell-p
osedproblemrequir~s th
at sortw t
1
60 NONL
lNEARPROGRAMMING 4
.2 MATHEMATICAlCONCEPTS 1
61



'E=
da
fS5
sadiar
yf

g
lefoll
owingMATLABs
ess
ionwascapr
eda i
lea
ndedit
edinate
xt

Y
nl
S

-
E.
ed
ito
r.The f
o eMATLAB prom
ptd o
esnotap
pe.lebold
fac
ew o
r d
sare
commandsater e
ade
rwi
lltyp
eatth
ecommandl
ine
.
x sym('x') definingx as a single symbolic object l
jl
" [gl;g2) 9 column vector based on gl
"
J
'
g2
"
9'
x
9
x [20*x+15*y-30]
syms y f g1 g2 g definitionof multiple objects 1/4*x+y-1]
whos % types of variables in the workspace
Name Size Bytes Class 9 can be the constraint vector in optimization
f 1X1 126 sym object problems
g 1x1 126 sym object thepartial derivatives of 9 with respect to design
gl 1X1 128 sym object variables is called the Jacobian matrix
92 1x1 128 sym obje'ct theproperties of this matrix are important for
x 1X1 126 sym object numerical techniques
y 1X1 126 snobject
xy . [x y]; rowvector of variables
Grand total is 14 elements using 760 bytes
J'" jacobian(gxy) calculating the Jacobian
f
.. 12 + (x1)*(x-1)*(x2)*(x3
) constructing f
f J
12+(x-1)"2*(x2)*(x-3) 20 1
5]
[1/4 1]
diff(} first derivative
aos ezp10t(f) a plot of f for -2 pi x 2 pi (default)
2*(x-1)*(x-2)*(x-3)+(x-1)^2*(x-3)+(x-1)"2*(x-2) ezp10t(f[
04)) plot between 0 <= x <= 4
note the chain rule for derivatives df diff(f);

% note the independent variable is assumed to be x
3 h01d 00
x2
diff( ) the second derivative wrt x 5 ezp10t(df[041) plotting function and derivative
ans combine with MATLAB graphics - draw a line
2*(x-2)*(x3)+4*(x-1)*(x-3)+4*(x-1)*(x2)+2*(x-1)"'2
1ioe([0 4][00 )'C010r'r')
fn4
1a2
d

g
fg*
(x

}
aL=


X2

a

.ZO:~
the third derivative wrt x
'nHE


9
[20*x+15*y30]

3 1/4*x+y-1]
2x

y
0+

ATY
gg

X5

-wnuw

nu
qd

2
Ed
--
Enu
t-14

define 9
=*

to evaluate 9 at x 1Y 2.5
*

subs(g{xy}{12.5})
3


a

ans
g2 '
" 0.2S*x + Y 1
; define g2 27.5000
glg2 can only have partial derivatives 1.7500
-
id an 2

independent variables have to be identified


'8t=

A
ddit
iona
lsymbo i
1cco
mput
ati
onswi
llbeintr
oduc
edthrou
ghc od
ea sapp
rop
ria
te.
g

}
x
t-
aEMnu

partial derivative No
tet h
ater e
sul
tofbothnum
ericandsymbo
licc o
mput
a t
ionsc a
nb eeas
ily
c
ombineda10ngwit
hgr
aph
icst
oprov
ideapo
werfu
lc o
mputingenvi
ronmen.
t
162 N
ONL
lNE
AAP
AOG
AAM
MIN
G 4
.2 M
ATH
EMA
TIC
ALC
ONC
EPT
S 163

4
.22 B
. asicMathematicalConcepts T
abl
e4.
1 C
alc
ula
tio
norDer
iva
Uve

Thebasicmathe
m a
ticale1emen
tsint hedis
cus
sionofNLPa r
ederiv
ati
vespar
ti x dx x+dx d
fld
x D
eri
vat
ive
M
de
riva
tive
svect
o r
smatr
icesJac
obianandHes
sian
.Weh a
vcusedtheS y
m b
olic
MathT o
olboxint h
ep r
eviousscc
tio
nt ocal
cul
atesomeofthe
sequa
nti
tie
sw ithou
t 3 4 1
8 1
8 4
dcf
inin
gt he
m.Th esetop
icsw i
llhaveb ee
ne x
tens
ive
lycover
edinthefoundatio
n 3 0
.1 3.
1 0.48
51 4.8
51 4
cou
rsesonmathematic
sinm ostdis
cip
line
s.Ab r
iefrev
iewi
soffe
rediniss e
ctio
n 3 0
.01 3
.01 0.04
08 4.0
805 4
usi
ngM A
TLAB.l i
so p
port
u n
itywil
lal s
obeutil
ize
dtoinc
rea
sefam
ili
ari
tyw i th
e 3 0
.00
1 3
.001 O.4 4.0
08 4
Symbo
licMathT ool
boxa ndinco
rpor
a t
itwitheMATLABcommandst hatwere
use
din earl
iercha
pter
.

Functlono'OneV
ari
abl
e:f
t
.)i
x d
ent
ifi
esaf
unc
tio
nofo
nev
ari
abl
e:
o
fth
echa
ngeint
hefunc
tionv
alu
e4
f
10echa
n g
ein di
spl
ace
men
la
x.F
orE
f
(x =2+(x-li(x-2
) 1 )(x-3) e
xam
pJe
thed
eri
val
iveatx=3withax=0.
001isobt
ain
eda
s

i
susedasas
pec
ifi
cexam
pleo
fsu
chaf
unc
tio
n.Thed
eri
val
iveo
fef
unc
tio
nate
l
oca
tionxi
swri
tte
nas lI_
E f
.
:(3+0
.00
1)1
(32
-.11nnSl (
4.1
5)
d
x
l.rc3 0
.00
1

- 1 kx+ax)- .f(
x) (4.1
4)
dx-ilm Ax =ll
fI1-L
axo ax ax-
>oax Theder
ivati
vcfo
rlhesin
gJe
-va
ria
blefu
nctio
nalanyval
ucxisaJ
socaJ
ledlh
eslop
e
xisthep o
inta b
outw h
i ch d e
riva
tiveiscompud.ri st h
cd i
stametua orth
egrad
ietto
l flh
cf u
nct
ion alpo
in.
tIfalin
eisdraw
ntang
enl10th
efunc
tio
n
n
eighbor
ingpoin
twhosl o
cat
i o
nthere
forew
illbex+a .Th
x eva
lueofth
ederivat
ive a
lthevaluexth
etang
entofE gleth
atisJin
emakeswi t
hex-
axi
sw i
llhav
e
i
sobtain
edasal i
mitofthcra
tioofed iff
ere
n intheval
ueofthefun
ctionate th
esnev al
ucasth
ederi
vat
ive
.Ifisang
leis9en
twopoin
ts( ed i
s s epa
rati
ngthet wopo
ints() thi
ssep t i
onis
re
d u
cedzero.Thecomputa
ti o
nofthcderi
vati
vefo
rthespec
ifi
cexnpleisusua
lly
o
btaidu
n s
ingthepro
ductrul
e.R e
sult
sf romth
ee x
e i
seons y
mbol
icco m
p u
t a
tion =tan9
p
rovideth
cresu
Jt
F
igu
re4
.2i
ll
us
tr
at
eset
ang
enc
ypr
ope
rtyo
fth
ede
riv
ati
ve.
= 3)+(x-1
) ) + )^ 2
1 )
MATLABCode:F
igu
re4
.2w
asc
rea
ledb
yth
eco
det
ang
ent
.m.I
nth
esa
med
ire
cto
ry
Ta
ble4.1illu
str
ate
sel i
miti
ngproc
essf o
rthcd eri
vat
iveofthefunc
tio
nc ho
senas ec
oded
erl
vat
ive
.mp
rov
ide
sth
eil
lus
tra
tio
noft
ang
enc
yth
rou
ghaf
i r
e
ecxampJe.Thed er
iva
tiveisbein
ge val
uatedatp o
int3.Ast h
ed i
spJac
ement
sare an
ima
tioninMAT
LAB.Inef ig
urewindowbot
hthef
unct
ion(dr
awna
sthecurv
e)as
re
duced va
lueoftherat
ioa p
proac
hcs v alueof4w hi
chistheaCl
ualval
ueof we
lla
sthelin
erep
rese
ntig4
n f a
ndaxaredra
wn.Asth
eneigh
bori
ngpo
int
sarcclo
ser
t
hederi
vati
ve.Wh enaxislarg
e(wit
hav alu
eo f1)crati
ois1.T
8 hisissi
gni
fic
ant
ly i
tisev
ide omt h
ef i
gur
ethatth
ec ur
vecanbeappr
oxima
tedbyastra
igh
tlin
e.
d
iffe
rentfromthevalu
eo f4.Withaxo f01t
. hevalueisaroun
d4.851
.W ithfu
rer Whenax=0.001ederi
vati
veistan
gentt
othec
urv
eas eyar
eind
ist
ing
uis
habl
e.
re
duct
iontoO
. 1t herati
oh a
sav al
ueo f4.00
8.F romt h
esecomp
utalio
nsitCanbc
ex
pected asaxa ppr
oaches0therat
iowillreachtheexac
tvalueof4.
0. HherDeri
vat
ive
s:Thederi
vat
iveo
fth
edc
riv
ati
vei
sth
eca
lle
desecond
d
eri
val
iv.F
e orm
all
yiti
sdc
fin
ed
NumericalD
eri
vat
iveCompu
'i
o: Manyn
n umc
ric
alt
ech
niq
ucsi
nNLP(1 u
i
ec
omp
uta
tio
nofd
eri
vat
ive
s.Mosts
oft
war
eim
ple
men
tin
gth
eset
ech
niq
uesd
ono
t
u
sesym
boliccompu
tati
on.Automat
ionand seofuse q
ui r
eate sede
riv
ativ
es
-!
!..
(-li"L
!;
rn .
1
.
-4yalx
b
ecompute
dn um
eric
all.l
y ere
sul
tsinT
able4.1ju
stif
yen um
ericalco
mputat
ion t
Ji-d
l xl
dx)
-
-1
0 ax
:
ax (
4.
16)
o
fader
iva
tivethr
oughatec
hniq
uecall
edth
efirsl
forwadd
r r
ence[5
].Usi
ngav e
ry
s
mal
lpeurbat
ionaxlh
deriv
ati
veatapoin
lisn u
merica
llyc a
lcul
ateda
st h
erat
io S
imi
lar
lyt
hel
hir
dde
riv
ali
vei
sde
fin
eda
s
164 NONL
lNEARPROGRAMMING 4
.2 MATHEMATICALCONCEPTS 165

t
ang
ent-s
lo
pe-d
er
lv
at
iv
eatx
=3 4.19
24 d
fl _I;~~(x +ax
y)-f
(x
y) ( )
d
xl1
(.
< ^

.)1)
/
:u

22
Thcaboverela
tio
ne xpre
ssesthepar
tia
lderiv
ativeofthefunc
tionfwithresp
ecttoE
l
o12
+(x
t
)(x
-l
)(
x-1
2
(x
-3)
va
riab
lex.G ra
phicallythi
ss ug
gcststha
tt h
ctwop o
intsaredisplace
dh or
izonta
lly
2
01-" (as
sumingthex-a
x i
sisb or
izont
a1)
.Int h
eabovee xpr
ession(an
dp rio
ro ne
st o
o)the
su
bscr
ipta
fte
rtheverti
call
inees
tabl
isbe
stbepoi
ntau twhicheparti
alder
ivati
vewith
pec
ttoxisbeingeva
luatc
d.(x
y) s e any
/allpo
ints
.As im
ilarexpr
essio
nc be
1
8
wr
itte
nforthepa
ralderiv
ativ
eo ff
with sp
ecttoy.Forthi
sexamp
le :

[-~.f
x-
d
-2'd
y:"=2y

F
ort
hep
oin
tx 2 = =
y 1
:

df d
f
1
2 f
(2
I)=1
; =1 =2
dx-" d
y
U
nti
lt h
ispoi
ntwc have madeuseofsymbolsrep
rcs
ent
ingc
han
gesi
nva
lue
s
1
0 (
fun
cti
ons
var
iab
les
)wi
thoutafor
rna
lde
fin
iti
on.Ini
sbook

a s(): p
res
ent
sfi
nit
els
ign
ifi
can
tch
ang
esi
nth
equ
ant
ity()
o 0
.5 1
.5 2 .5
2 3 3
.5 4
x d(
)o():r
epr
ese
ntsd
ie
rcn
tia
l/i
nfi
nit
esi
malc
han
gesi
n()
F
lgu
re4
.2l
Iu
slr
all
on0
1th
ela
nge
n.
t Changesinfunc
tio
nsoccurduetoc
h a
ngesinthevar
iab
les
.Fromc
alcu
lus[1
]t hc
di re
nti
alchan
geinjx
{y
)( duetothed
iff
ere
nti
alchangei
n va
riab
lesx(dx)
andy(dy)ise
xpres
sedas

=) (
4.1
7)
d
jd
-
:
J
df=d
"
J
L"

x_.
.d
x+
fdv
-
:
J
.d
y-J (
4.2
0)
T
hiscangoonpro
vid
edef
unc
tio
nha
ssu
ffi
cie
nth
igh
er-
ord
erd
epe
nde
nceonE
i
ndep
ende
ntva
ria
blex
. Forc onv
cnienc
eands i
mpli
citythes ub
scr
iptr e
prese
ntin
gep ointwhcret he
expr
cssioni
se val
uate
disn otindic
ate
d.Thed e
fin
itio
no fthepar
tia
ld e
rivat
ivei
s
appar
entintheaboveexp
ressio
na shold
i gya
n tacons
tantvalu
eimpliesat=0.
F
unc
tio
nofTwoV
Bri
Bbl
es:Thel
wo-
var
iab
lef
unc
tio
n
Anotherint
erpr
etat
ionforthep a
rti
alderiva
tivecanb eobserve
dfromt h
ca bov
e
def
init
io:c
n ltan
geo ft
l
tefun
ctionperunitcit
angeintl
t
ev a
ria
bles
.
j
{x:
x
214+y2-1 (
4.1
8)
Gradient01th eFunction
:I nthefuncti
ono fas i
nglevariabet
l hederi
valivcwas
i
sc hosentoiI
lus
tra
tetherequir
edm at
h cm
at ic
alconcepts.Thefir
stimportantfcatur
e a
ssocia
tedwi thes l
op. I
ntwoo rmorev ariab
lesthes lopeisequi
valent10e
oftwoo rmorevariab
lesis thederivat
ivesdefinedforasing
lev a
riab
l e(ordina
ry g
radien.
tTh egradie
ntisav ector
anda tanypointrep se
ntsthedire
ctio
ni nw h
ich
der
ivat
ives)donotapply
. eequi
valentco n
cepthereisthepa
rtialde
riva
tive.Parti
al t
hefuncti
onwillincre
asemo strapi
d
E xa
rniningtheconven
t i
onalobj
ectiv
eo fNLP
der
ivati
vesaredcfmedforcachindependcntvar
iab
le.l epar
tia
lderiva
tiveisd e
n o
ted m
inimizatio
no fo b
jecti
vem ctionsthegradien
th asan atura
lp a
rttop la
yi nt h
e
byt esymbold
h .The sed c
riva
tiv
e sareo btai
nedint hesamewaya st heo rdina
ry dev
el opmen
to fmethodstosolvetheproblem
.Theg radien
tiscomposedo fthepar
tia
l
der
ivati
vee x
ceptthcoth
ervaria
blesareheldataconstantval
ue.Inthecx np
l ewhen d
crivat
ivesorganiz
edasav cclo
r.Vectorsin i
sbooka recolumnvecto
rsunlessothc
r
compulingep tia
ld e
rivat
iveofxt hcvalueofyisn otallowe
dt ochan
g e. n
oted.Theg ra
d i
enthasas tanda
rdm at
hematicalsymbo.lltisdcfi
nedas
166 NONL
lNEARPROGRAMMING 4
.2M
ATH
EMA
TIC
ALC
ONC
EPT
S 167


=

3
Dco
nlo
urf
or(
f =x
1 2
/4+I-l

(
4.2
1) 3
Vf
2

Atthisstageitisa pp
ropriatetoconsolid
atei si nform
ationu singg ra
phics.The
gr
aphicIds
a cript
iono fee xnpled efi
nedi nE quation( 4.
18)h astobet hre
e 0
.
dim
ensionalaswen eedonea xi
sf rx
o anoerforyandt heth i
rdforj{x
y)
.C hapte
r 3
2
.5 3
2i
th
n
ep
tr
r
o
o
b
d
l
u
cedt
mist
hr
e
ou
e
-
s
di
ec
m
o
e
n
n
t
s
i
o
o
u
na
rp
lp
lo
l
t
s
ot
.C
ti
n
o
n
gu
t o
s
i
u
n
rp
gMATLAB.Amoreu
l
otsaredrawnf ors
s
p
e
e
c
f
u
i
ld
fi
cv
es
c
a
r
l
i
u
e
pt
so
io
no
fth
e
f
2

fu
nctio
n.IntheiIIus
trat
ionthev a
luesforthecontoursoffare01 2d3 .I nFigur
e x
43twok
. indsofc ontou
rp lo
tsa r
es hown.Int h
et oph a
lfat h r
ee-dimens
ional( 3D
) 2
Dco
nlo
ur
con
tourplotisshown whileon l owerhal
f samei nfo
rma tio
nisp res
en a 3
two-
dimensional(2D)c on
to u
rplot(th
isisconside dthstandardcontourplot
).Thc 2
.5 g
ll
ld
le
nl0
1S
2Dc o
ntourplotismoreu se
fulforgraphicIs
a u
pporto fsomeo ftheideasinNLP.Th e
3Dc on
tourwillbed ispe
nsdw ithiner emaindero fth
cb ook.

MATLABCode:Flg4_3.m. Thea nnota


t i
oninFigur
e4.3(inclu
dingtheta
ngentli
nc
andthegrad
ient ow)wasdone roughthep
lot it
ingcommandsa v
aila
bleone

- longenl815
menub srinthefig
urewindow(MATLADv ers
ion5.2andlate
r)
.Am01 "pO"t
l i
onuf
cpl
otsa gene
ratedt
hrought
hestat
cmentsintem-f
h i
Iei n
dica
tedabove
.Thec odc
mixesn umer
icand s y
mboliccomp
utation.Itallowsm u
ltipl
ep lo
tsandt a
rge
ts 2 3
x
grap
hiccommandst ospec
ifi
cplo
ts.
F
lgu
r4
.
3Gr
adi
enla
ndl
ang
en!I
I
na
!ap
oin
.t
Discu
ssiono(F igur
e4 .
3:I nFig
ure4.3poin
tPi soncontourf=O.PointQ i
son
th
econtourf=2.PoitSi
n sontecontourf=1
h .Poi
ntRh asesameyv alucasp
oint From f ig
uret
hevaleoffw
u i
I
lchangea
longgra
dientdi
rec
tio
n.Ifd
fre
pre
sen
tsa
P d esamexvaJucaspoin
tQ.Forev al
uesinthef
igu
ret h
econ
t o
urvaluei
s0.75 di
ffe
ren
tia
JmoveaJong gentl
ine
en(dX ar
em e
asuredaong g
J e
ntli
ne)
(
thi
svalueshou
l dbedis
playedi
nMATLABwindowwhcnt h ecodFlg4_3.misru
n).
(
4.2
3)
df=~dX+ =0
l
in sameasure4
ePQi f eJ y

l
inePRr
epr
ese
ntsc
han
gesi
ndfwhcnd
.yi
s0 E
qua
tio
n(4
.23
)sh
oul
dbcz
erob
eca
usemovingt
ang
cnt
ial
ly(
asm
alla
mou
nt)t
he
v
a o
Ju f
fisn
otc
han
ged
.
lineRQ p
res
ent
sch
ang
e ndfwhend
si .xi
s0
Th
~acobian: eJac
obin[
a J]def
ine
sause
fulwayt oorga
niz
eth
eg r
adi
ent
sofse
vcra
J
Mathe
maticall
yfcanonlybeestimatedbyaddingthechangcsalongthelinesPR
f
unc
tio
ns.Usin
gthrecv
ari
abl
esandtwofunc!
ion
sj x
{ y
z)a
ndg(x
y
z)th
ede
fin
iti
on
andRQsincecd efi
niti
onoft h
epar
tia
lderiva
tiv
esonlypcrm
itscal
cula
tingchangc
s
o
fthcJac
obi
anis
alon
gt h
ec o
ordinatedir
ecti
ons.
tSt
(p
Atp
c
rpcn
o
d
i
i
n
cula
r
h
)t
edott
oct
edl
.
I
i
n
n
ei
ge
st
n
h
et
t di
ang
sd
e
i
n
r
.Theg
t
t
edt
ra
o
w
d
a
i
e
r
nta
di
tt
n
cr
h
e
csamcp
as
ingth
oin
eva
ti
Ju
sn
eo
orma
l
fe
I
e
Jf
fun
ction(ind
icatedbyea rr
ow).Byd ef
init
ion
ifdfre
presen
tsadiff
erent
iaJmove J=
[
J 1~x ~ ~~ 1 (
4.2
4)
Jongt
a h
eg r
adientatanyp o
inten(dxP measu
reda lo
ngthegra
dientvect
or) I~|

df=
+ dy (
4.2
2)
168 NONL
lNEARPROGRAMMING 4
. AlCONCEPTS
2 MATHEMATIC 1
69

nEq
I uat
ion(
4.2
4)t
heg
rad
ien
tso
fth
efu
nct
iona
pp i
nesamer
ow.Thef
ir
strow Eq
uat
ios(
n 4
.27
)and(
4.2
8)w
illapp
rq
uit
eof
teni
nsu
cce
edi
ngc
hap
ter
s.A f
ew
s eg
i rad
ientoffwhilethesecondrowisthegr
adi
entofg.lfth
etwof u
nct
ionsar
e m
inu
teso
ffa
mil
iar
iza
tio
nwi
llp
rov
ides
ust
ain
edcompreh
ns
ionl
at
er
.
c
oUectedint
oacolumnv ect
or.thedif
fer
ent
ialch
anges[dfdg]
Tinef u
ncti
onsdu
e
t
oed iffe
rent
ialchangeinthcv a
riab
les[dxdyd]
z c
anb eexpre
sse
da sam a
tri
x 4
.2.
3 Taylor'sTheorern/Serles
mu
ltip
ucationusin
gtheJacobian


SlngleV a
r lab
le:Th eT
aylors
eri
esi
saus
efu
lmechanismt
oappr
oxima
teeva
lue

rill--L

4
p+

rBEE-EEEL
oft hef u
nctionf
t
..
x)at poin
t(x )ifefun
cti
oniscom
ple
telyknowna
tpo
int

lEE E

]4
[
=
-J
(
4.2
5)


xp le exp sio
nis(f
orfi
ni
tcn)

I
d
whichi
ssi
mil
a oE
rt qu
ati
on(
4.2
0). +))+
I~
() I~ (2+


He
ssian:TheHessi
anmatrx[
i H]i
sthesamea
sth
ema
tri
xofs
eco
ndd
eri
vat
ive
sof Theser
iesiswidelyusedinmostdis
cip
lin
estoest
abl
ishcon
tin
uousmodel.I
s tisE
afu
nct
ionofs
eve
ralvar
iab
le.Forf
s t
.
.x
y) mai
nstayofmanyn um
ericaltech
niqusi
e nc
Iud
ingt h
oseinop
tim
izatio
n.E q
uati
on
(4
.29)isusua
llytrun
catedthefirs
ttwoo r term
swi eu n
dersta
nding
Ida app
roximatio
nw i
llsuff
ersomee r
rorwhoseord
erd e
pendson t erm tisbein
g
tr
unca
ted:
I
=
1 (
4.2
6)
[

JL
i[ i
J[I
L
I
dy
dx [(Xp+A
t + {AY.
1
.1
.I
)f(XJ&Jh)+21dlJ
)
f
l
2+O( )
3l (
4.3
0)

Th
eHe
ssi m
atr
ixi
ssymm
i
c
.Fo
r exampled
efi
nedbyEqui
on(
4.1
8). l
fthefi
rs
tte
rmi
sbr
oug
htt
oel
ef
t ee
qua
tio
n.d
isc
ard
ingt
hee
rro
rte
rmc
anb
e
w
rit
tenas

n

v &
fAU
h

M f

(
=
xp+)
f

(
x


:


X
/

))

)=

=
d
x
L()+
1d
2


X
-1

(
4.31
)

-Ab-xh
FunctlonofnV
arl
abl
es: Forf
t
.
.X.where]=
) [XI
X.... x
2
.
rr
.eg
rad
ien
tis
I
nEquation(
4.3
1)
thef
ir
stt
ermoner
igh
tisc
all
edt
hef
irs
t-o
rde
r/l
ine
arv
ari
ati
on
whilethesecondt er ses
mi econd-
o rder
/quadraticvari
atio
n.
(
4.2
7) F
igure4.4demonstratestheapproximationsusingTaylo
r'sser
iesofv ar
iousord
ers
a
tp oit2.
n 5withr es
pectto orig
inalf u
nction(re
d).Theprinc
ipalideaistodea
lwi
theapproxima
tin gcurvewhichh asknownp ropee sinst
eadoft h
eo rig
inalcur
ve.
Th
eHe
ssi
ani
s lCc onst
antT aylors e
riesisw oefullyi n
a d
equat
e .l eline
are xpansionisonly
margin
allybet
ter.Theq uadr
a t
icexpansionap pro
ximatestherig
htsideo ft
hefunct
ion
d'
i

d comp
de
fini
t
t
elya
ot
c
ce
h
p
el
ta
e
b
f
ts
lei
id
nt
ewhichi
her an
si
ges
ns
ho
i
w
g
n
n
ific
a
.Tos
nte
e
o
r. l
ehowt
ef
h
i
eT
f
t
a
h
y
o
lo
rd
e
rs
re
er
x
i
e
pa
si
ns
i
su
oni
se
s
d
d
x1 x
~
i
J 2 x
i
J1a
xn
cons
i d
ertheq u
ad r
aticc urveaboutcp ointx=2 .
5.Att hi
sp o
i n
t v alueofthe
~ a '
i func
tionf
t
..
2.5 =
) 1 1.4375thevalu
eo fthfi
rstderi
vativf
e'(2.
5=
)- 0.75d thc
valuc
(
4.2
8)
=
1dX
2ax1 ~ oftheseconddcrivativ
eisf" (2
.5=
) 4 .UsingE quation(4.3
1)

(
4.3
2)
f
t
.
.2.
5+ =1 5+(
-0)+
~
a
x
i
Jnd
x .
c
d
F
ord
iff
ere
ntv
alu
e fA
so t
.bo p
osi
tiv
candn
cga
tie
v t
hev
alu
eof
j(x
)ca
nbeo
bta
ine
d.
l
epl
o fE
to q
uat
io 4.
n( 32
)sh
oul
dbet
hesamea
s o
nel
abe
ledq
uad
rat
ici
nFi
gue4.
r 4
.
1
70 NONL
lNEARPROGRAMMING 4
.3 GRAPHICALSOLUTIONS 1
71

A
pp
ro
xl
ma
t!
onu
s
!r
tgT
ay
lo
rse
rl
es

f(xp+dx+)=f(xp')++ I~YI

22

iMyPyp)][~] (
4.3
4)

-0
2
0

a
1
t
1

Fornv
ab
le
swi
tht
hec
urr
entp
oin
tadd
n .
Xth
edi
spl
ace
men
tve
cto
r

4.35
18 p+
f I
l p)+
X)=f(X +jmTm ( )

i f
i
fh-
t or
de
ra~d o
r
lg
!n
a
l

4
.3 GRAPHICALSOLUTIONS
E l
egr
aph
ica
1so
lut
ion
sar
epr
ese
nte
dfo
rth
reek
ind
sofp
rob
lem
s:u
nco
nsa
ine
de
q
ual
ity
c
ons
tra
ine
da
ndi
neq
ual
ityc
ons
in
ed
bas
edo
nth
efu
nct
ion
sinE
xam
ple4
.1
.

4
.3.
1 UnconstralnedProblem
12
M
ini
mie J
z tXI
x2
):-XIX2 (
4.3
6)

D 0
.5 1
.5 2 2
.5 3 3
.5 4
x o~xl ~ 3
; 0~x2 ~ 3 4.
( 37
)
F
igu
re4
.4T
ayl
ors
er
ie
sap
pro
xim
ali
on. Thes id cons
train
t ss rvetol imitt h
ed esigns pa
ce.C onsideringtheo b
ject
ive
functionin( 4.
36)itisc lea
rt hattheminimumv al
ueo ffwi 1
lb eraliz
edifthe
MATLABCode:Fig
ure4.
4isc
omple
tel
ycrea
tedu
sin
gthecod
eFlg4_4.
m.1
tus
esth
e variabl
esa reatt hemaximum( Xi=3 =3 ).Thev alueo fthef u
nctio
ni s-9.
MATLAB
-prov
idedsym
bolc
i t
ayl
o"f
c un
cti
ontogene
rat
et hev
ari
ousex
pan
sio
ns Figure4 .
5i l
1ustr
atest hep r
o bl
e m.Thes olu
tionisatt heb ounda
r yoft h
ed es
ign
abou
tp o
int2
.5
. space.Fig4_5.mi stheMATLABc odea tw i
llp roduceFigure4.5.Themaximum
valueo fthefuncti
o nis0( basedont hesidecons
traint
s).InF igue4.
r 5thetange
nt
andt heg radienttot h eobjectivef uncti
ona tt hesolutionaredrawni nu s
ing
TwoorMoreV ari
ables:Theseri
es o n
lyexpandedto qu 'a
t
icte
rms
.The MATLABp lote
ditc ommands.l Di sp artic
ulare xamplethes i
dec on
strai
ntsare
t
runc
atio
nerr
ori
signo
red
.'hetw
o-var
iabl
efunc
tionexpa
nsioni
sshownind
eti
a1a
nd necessarytod e
termin ethesolutio
n.I fthedesigns p
acew ereincrease
dt h
esoluti
on
a
lsoorga
niz
edinter
msofvec
tor
sa n
dm a
tri
ces
.Thef i
rs
t-or
derex
pan
sioni
sexpr
ess
ed wou ldc o
r r
espondinglyc hange.
i
ntermsoft
hegra
dien.
tThesec
ond-o
rderexp
ansio
nw i
llbeexpr
ess
edinter
msoftb
e Thex amplechose ntoillus
trat
eeu nconstr
ainedpro blemdefi
nedb y(4.
36)and
H
essianmaix (4.
3 )i
7 sn otusuallye m p
l o
y edtod eveloptheo ptim
alityc on
dition
sf orgener
al
unconstraine
dp roblems.Twor equirementsa r
ee xpectedtob es at
isti
edb ysuch
f
(x
' +
J Y
/J+I
l) J
y tx
'
J =
)+1
'y
(
Q
I
+
1}MP
I
+
.
I
"p
p

a
r

p
o

p
b

l
l
b au
i
e

c
a
m

t
s
n
i
:(
i
o
q
n
1
u
)t
es
sth
h

e
es
o
s
l
u
ec
o
t
l
i
o
u
o
n
t

d
i

i
o
no
t
nm

i
ustb
rep
o
nsmayn
ei
r
nt
o
o
b
h
l
te
ei
e
x
i
nt
mi
s
e
riorofthed
s unimoda
.Mosts
t o f
tw
e
.
a
s
lN
r
ig
e
ea
ns
v
r
e
p
r
ed
a
t
e
c
h
v
ea
e
l
e
e
l
n
s
o
d(
s
pe
2
i
)t
np
dt
h

oa
e
r
r
p
em
a
p
c
t
l
u
i
yt
s
c
a
h
t
l
e
r

2
fI
(w-Y+
1 e
) optimal
ityc on
ditionsa ndt h
e yrarel
yv erif
ye ser equire
mentsa r
eb ein
gme .I
t tis
pY
/
2 q
2
1)~I (x
I
t 4.
( 33
) usua1
lyt hedesi
gner'sre s
pons
i b
ilitytoensuretheserequirem
entsareme .Tod
t eve
lop
eo ptimali
tyc o
nditionsa naItemateu nco
nstrain
e dproblemispresen
ted:
If di
spl
ace
ment
sa r
eorg
ani
zedasacol
umnve
cto
r[]
Tt
hee
xpa
nsi
oni
n
(4
.33
)ca
nbeexpr
esse
dinacon
dens
edma
nnera
s M
ini
mie J
z tXI
x2
):(XI-1
)2+(X2- 1
)2-XIX2 (
4.3
8)
72 NONL
lNEARPROGRAMMING 4
.3 GRAPHICALSOLUnONS 173

3
.5

2
.5

N 2

1
.5

0
.5


0
.5 1
.5 2 2
.5 3 3
.5 4
x x
' t

F
lgu
re4.
5 U
nco
nsl
rai
neds
ol
ut
io
n. g
ure4.6 U
nco
nst
rai
nedp
rob
lem
:in
te
ri
or 1
l
Il
lo
n.

o$XI$ 3
; O$X2$ 3 (
4.3
7) OSX1$3; OSx
2S3 (
4.3
7)

Fi
gure4.6disp
laystheproblemandit
ssoluti
on.Flg4_.
6.mprovi
desthecod
e.t
hatwiI
I
F
iu"e 4
.7(
ro
ug
hFIg47.m) i
1
Ius
tra
test
hep
rob
lem
.Thed
ash
edl
inei
se
ge
nerale most ofF igu
re4 .6.Iti sc e
Jar att hes olut
iona ppea
rst ob eot
nsain.
tSi
ncei
ti
sanequa
Jit
yco
nst
rai
nt
thes
olu
tio
nmustb
eap
oin
tont
hed
ash
ed
li
ne
.Thec o
nt ouroff= 1a ppear
st ojustgr ec o
nstra
inta n
dt here
foreisthe
i=2a
x ndxi=2.Theo ptim
alv al
ueo feo bjec
tivef u
ncti
onis- 2.Inthecont
our
minimump os
s ib
leva Jueofthefunc
tionwithoutviola
tingthecon
strai
n tI
. nFigure4
.7
p
loteo ptimumisapointmakingitdif
ficJt
u todrawt h
eg r
adient
.Ifisi
sthecase

eninthreedimcns
ionsattheoptimumcg ra
dientwil
Iieinaplanetan
gen
ttothe
eg r
adien
to fth eobject
ivef u
nctionaswe I
las eg radi
entof econstra
intsatthe
fu
nctio
ns ur
face
.Movingi n i
splaneshouldnotc hangethevalueoftheob
ject
ivc so
lutio
narilIustra
ted.Itappearsa tatisp o
intt hes
eg ra
dien
lsa repar
allelcvcn
fu
ncti
on.Th i
sobserva
tionisuscdtodevelopthen essa
ryconditi
onslat
er
. thoug
he ya red ire
c t
edo p
positetoc achoth
er.Byd e
fini
tionthegradien
ti sinthe
di
rect
ionofth cmostr apidincr
easeofthef u
nctionattheselec
tedpoi tT
n. hisi
sn o
ta
coi
nciden
c.T hisfactisusedtoestabl
ishthenecessarycondi
tionsfortheproblem
.
4
.3.
2 EqualltyConstrainedProblem

F
orat wo
-var
iabl
cp ro
ble
mwec
ano
nlyu
til
izeonec
ons
tra
intf
oram
ean
ing
ful 4
.3.
3 I
neq
ual
lt I
yConst nedProblem
o
pti
miz
ationpr
oblem
:
Thenumberofin
qu
alit
ycons
tra
int
sisn
otdep
enden
tont
henumberofv
ari
abl
es.For
i
1I
us n bo co
nsin
tfunc
tion
sofExample4.
1ar
f
ormula
tedasine
qual
ity
Min z
Imie j
{XI
x2
):'
XIX2 4.
( 36
)
con
samts
.
S
ubj
ect hl
(XI
x2
): / X
!
4+~ -1 (
4.3
9) Minimize j
{x) X2):-XIX2 4.
( 36
)
174 NONL
lNEARPROGRAMMING 4
.4 ANAlYTICAlCONDITIONS 175

4 4

3
.5 3
.5

3 3

2
.5

.5
1 1
.5

0
.5 0
.5

0
.5 1
.5 2 2
.5 3 4
0
.5 1
.5 2 2
.5 3 3
.5 4
X xt
1

F
lgu
re4.7 E
qua
liyn
t str
aln
edp
rob
lem
. F
lgu
re4.8 I
neq
ual
ityc
ons
tra
lne
dpr
obl
em.

M
ini
rni
ze j
{X
x2
):-
xlx2 (
4.
9)
S
ubj
ect
to: gl(XI
x2
):20xI+15x2-30S0 (
4.4
0)
S
ubj
ect1
0: hl
(XI
x2
):20X 5X2-30=
I+1 0 (
4.1
0)
g2(Xl
>X2
) x
I
: /4+ ISO (
4.41
)
g
l(I
X x
: (
x
I/)+(~) IS0
4 (
4.1
1)
OSXIS3; OSX2S3 (
4.3
7)
Figure4
.8il
Iustra
testhegr
aphica
l s
olution
.Thesoluti
onisatth
einte
rsect
ionofth
e oSXIS3; 0SX2S3 (
4.1
2)
do
tt e
dl i
nes
.Thecodei savai
lableinFlg4_8.m. l
eg r
adie
ntsaredrawnusingth
e
p
loted
itf u
nctio
nsont h
emenubari nthewindow.A l
sof o
ntsty
leandfontsiz
eh a
ve Thegra
phi
calsolu
tionofS
ectin4.
o 3
.3sugg
estst
hatt
heineq
ual
itycon
str
aintwil
lbe
becnadju
stedusingtep
h lote
ditcommands.Theo p
timalsol
utio
nmustlieonortoE ac
tiv
eatthesol
uti
on.If i
sthec
ase
thenFigu
re4.8wi
llonceaga
inrepr
e s
ente
l
ef
to fthed ashedlin
e.S imi
larlyit must i
Iebelow oron t hedashedcurve
. gr
aph
icalsol
uti
ontothi
ssect
ions
o.Thiswil
lbevcr
ifi
edinthcnc
xtsccl
Ion
.
Si
multaneousl
yi tshoulda1sodecrea
set heobje
ctiv
ef unc
tionvalu
ea smucha s
p
ossibl
e.
4
.4 ANAL
YTICALCONDITIONS

4
.3.
4 E
qua
lit
yandl
neq
ual
ltyConstralnts Analy
tic
alcon
dit
ionsrcf
erto n e
ssar
yandsuf
fic
ien
tco
ndi
tion
s twillperm
it
th
er eco
gni
tionoft h
es ol
utio
ntot h
eo pt
imaldesi
gnprob
lcm.Thcc ondi
tio
ns
Example4
.1i
sde
vel
ope
dwi
thb
otht
ype
sonc
ons
tra
int
spr
esetI
n.li
s p
rod
uce
dhe
re: deve
lopedhcre empower th
en u
meric
alt ec
hni
questofoll
owl a
te
r. They a
re
176 NONL
lNEARPROGRAMMING 4
.4 ANAlYTICALCONDIT10NS n
1

i
ntroduc
edi n sames eq
uenceasi nep re
vioussect
ion
.l nste
adoff onn
al
ma
thematic
ald eta
ilsthec on
ditio
nsa ree st
abli
shedl e
ssf onn
ally from th
e
ge
ometri
caldescr
iptio
no

f p roblemand
lorr oughini
tivereaso
ning
.F o
nnal
1
0

dcve
lopmento fthcanaly
tic
alc o
nditio
nsc a
nb ef oundinR ef
ercnces6-8.For
e
stabl
ishi
ngt h
econditi
onsitisexpec
tedthatthesolu
tionisintheinte
rio
rofe B
f
easi
blregin
o andther
eisonlyoneminimum.


4
.4.
1 UnconstrainedProblem

H FHX
Thep
rob
lemu
sedf
ori
llu
str
ati
oni
s


M
ini
miz
e J
(x
. X
2):(
X )2+(X2- 1
I- 1 )2-XIX2 (
4.3
8)
2
OSxIS3; OSX2S3 (
4.3
7)
F
i
t
h
g
r
u
e
r
e
c4
-di
m
.
e
6p
nsio
r
n
o
a
v
i
lp
de
l
o
dac
tofth
ontourp
esamep r
l
o
o
to
blem
ft
.I
h
ti
ep rob
sameshp
lem
l
.F
ot
igu
re4 .9p r
.Thecommandst
ovi
oc
d
e
re
sa
ate

F
igure4.9area vaila
bleinFlg4_9.m.Thef ig
ureneedst oberota
tedintemc
tivclyto
ap
pearasillu
s ted
.At angentplanei
sdmwn minimumf o
re m
phasis.Figure -2 4
4
4
.9wil1beu sdtoi de
ntifythep r
opee so f
thefunctionJ(l
x x
z)attheminimum.
Theminimumi si d
entitie
dbyas upe cri
ptaste
risk(X orl i
x X2J
T).Studying

F
igure4.9thef unctio
nh asaminimumv alueof-2 whilex=
j 2andx =
22 .I fe
X
2

v
aluesofX1an dlo
rX2we tochangeevenbyas l
igh
tamountfrom o ptim
alva l
ue 1g
F u
re4
.9 Thr
ee-
dim
ens
ion
alp
lo
t01F
igu
re4
.6
.
i
na n
yd ir
ecti
o nthevalueofthefuncti
onwi l
1certa
inlyincrea
sesinceX'isthelowest
p
ointo ft hec oncaves u
rfacer epsenting e f uncti
onf R eprc
senting E
d
isplacemcn
tf romtheoptimumv al
ueso fthevari
ablesasdX andt h
cc hangci
nt he S
inc
eth
iss
hou
ldh
oldf
o l
ra1p
oin
tsi
nep
lae
n dx11
-0a
: nddx
21-O
: .The
ref
ore
f
unctio
nv alucf romt h
eoptimuma slf
fromd i
rectob s
ervati
onitiscleartha
tt he
o
ptimalsolu
ti onmustb eap ointatsat
isfie
s df-fl -fl
dX - v dX2- v
1
4
f>0 f
o 1dX
ral
o
rth
egr
adi
entof
fatt
heoptimumm
ustbez
ero
. a
tis

Flr
st-OrderC
ondltl
ons: Thesameidcacanbcap
pli
edinthelim
itt
ha sf
ti or
i
nfin
ite
sim
ald i
spl
acem
ent dx1 a
nd dx
2 ab
out X The .

f
unc
tio
n i
ts
el
f ca
n be
Vf(x~x;) =0 (
4.4
3)
app
roximate
dbyap l
anetang
enttothefunct
ionatthesolut
ion(showninFire4.
9)
Eq
uat
ion(
4.4
3)e
xpr
ess
est
hen
ece
ssa
ryc
ond
iti
ono
rfi
rst
or
derc
ond
iti
on OC)
s(F
(c
onsid
cris af i
rst
-or
drTay
l o
rs er
iesexpa
nsion).Movingt oanypoin
tint h
e forunconstrai
nedoptimiz
ation.Iti
st ermedthefr
rs
tor
derconditionbecau
seE quati
on
pl
anefromt h
eoptimum(seeFig
ure4 .
9)willnotch a
n g
et heval
ucoft h
efunc
tion (4.4
3)u scseg radi
ento rthefir
stderiva
tiv
e.E qua
tion(4.43)isu s
edtoidentif
yt h
c
E f
or =
edf O.Movingawayf romoptimumi mpl
ies dx1a nddx 2ar
enotzer
o. possi
bles o
luti
onstotheo pt
imizationproblem
.If functi
onw eretofli
po versoat
Re
writingEquat
ion(
4.2
0)intcnnsofX1andX2 thesamef u
nctio
nwc tomaximizet hevalueofef unctionthesolu
tionf o
rt h
e
vari
ablsw i
llbea tthesamev alueo fthedesignvar
iabl
c.Iti sclea
rt h
atEq uati
on

df= 1+ =0
(
d
t
4
e
.
t
oe
3
4
e
n
)appliesthemaximump
r
s
m
u
i
r
net
ea
heminimumv
tthesolu
t i
o
a
ne
l
ueo
s
tab
ft
li
h
s
r
ef
h
e
o
u
b
n
l
e
c
ti
ma
on
l
.A
dby f
s
o.E
d
i
r
d
i
s
t
t
-
q
i
o
u
o
r
a
t
n
d
e
i
a
o
lc
rc
n(
o
o
n
n
s
d
4.
i
i
d
t
4
e
i
3
r
o
)b
a
n
t
si
i
o
yi
n
so
t
sa
p
t
s
elfw
n

ima
e
i
c
l
e
li
ln
ss
o
a
r
ni
t
y
s

df=
][
:
J=
O 4.
( 42
) ca
Eq
scaminimum.F
u
ation(4.43
)c a
orag
nbes t
a
e
t
n
e
e
ra
da
lu
s
nconst
rainedproblcmth
en e c
essarycondi
t i
onsof
4.
4 A
NAL
YTI
CALC
OND
ITI
ONS 1
79
178 NONL
lNEARPROGRAMMING

Vf(
X')
=0 (
4.4
4) -1)-x1=
=2 4.
( 4
7b)

whichispr
ima
ril
yav ecto
re x
press
ionoft
herel
ati
oninEqu
ati
on(4.
43
).Equat
ion
(4.
44)i
susedtoest
abl
ishtheval
ueo ft
hed
esi
gnv a
ria
ble
sX'botha
nal
yti
cal
lyand EQua
tions(4.
47a
)an 4.
d( 47b
)r e
pre
sentapairof
lin
earequ
ati
onswhi
chcanbes o
lve
d
nume
ric
all
y. as-X1=2I2=2.Thevalueoft h
et -u
ncti
onfis-2.Sof aronlytheneces
sar
y
con
diti
o n
shavebeens
ati
sfi
ed.Thevaluesabovec
ana l
sore
fert
oap o
intwherethe
nctioni
samaximumorwherether
eisas ad
dlepoi
n.
t
Second-DrderC o
n d
it i
o n
s:The s eco
n d
-ordercond
itio
ns (SOC) areu sua
l1y
rega
rdedassuf
fic
ien
tc o
nditi
ons.Itcanbei n
fe'e
d a
tthes
ec o
ndit
ionswillinv
olve
secondder
ivat
ivesofth fu
nct
ion.TheSOCi soft
enobtain
edt h
roughtheTaylor SDC:Fori
spr
obl
em[
seeE
qua
tio
n(4
.26
)]

blr

expan
sionofthefun
ctiontoscc
o n
do rd
er.IfX i
s so
luti
onandd.Xrep
rese
ntse

-

H
changeof va
riab
lcsfrom op t
imalvaluewhichwi
llyiel
dac hane
g f
i
dt hen

(
4.4
5) I
sitp
osi
tiv
ede
fin
ite
?
+ t a h r
+6X))=(X
(
i
) Notp
oss
ibl
e10t
es
tald
l .
X
Thisi
ssirn
ila
rtoE qua
tion(4.35
)e x
cep
tee xpa
nsionisab
o u
tcs o
lut
io.6
n f (
i
i)TocaJcula~ the e
ige
nva
ue
sofH
mustbegrc
atertha
nz e
ro.Employingthene
cess
arycon
diti
ons(4.
44)th
efir
stter
m
ontheri
ght-
handsid
eo fEqu
ation4.45i
szero
.ThisI
cavcsefollowi
ngineq
ual
ity
1= ~I=\
-1 2- l
= -3

)
-
-

)

)

af=jaTH 4.
( 46
)

'ee
h i
gen
val
uesa
r =
=3andt
hem
atr
ixi
spo
sit
ived
efi
nit
e.
(
ui)Toc a
lcu
at
edete
rrn
ina
ntsofal
lord
er alinJu
c deth
emaind
iag
ona
lan
d
whereH(X
)i
sth
eHe
ssi
anm
atr
ix(
thema
ixo
fse
con
dde
riv
ati
ves
)oft
hef
unc
tio
n
fa
tth
cpo
ssi
bloptimumv
aleXF
u orer
ela
tio
nsi
nEq
uat
ion(
4.4
6)t
oho
ld
the i
ncudet
J heele
menti
n efr
rs
trowandfi
rstcolumn
m
atri
xH(X mustbep
osi
tiv
ede
fin
ite
.Th
erea
ret
hre
ewayst
os
tab
lis
hth
eH i
s
p
osi
tived
efi
nit
e. 1
21>
0

-
-
'a
T


(
i
) F
ora
llp
oss
ibe.
l 6
X
d.
X .
H(X')6X>O
.

nu

qJ
d



(
i)Thee
i ige
nva
lue
sofH(X')a
rea
llp
osi
tiv
c.



(
iu)Thed
ete
rmi
nan
tso
f]l
owe
ror
der
s(s
ubm
atr
ice
s)o
fH(
X')t
hati
ncl
udet
h
maind
iag
ona
lar
eaI
lpo
sit
ive
. Them
atr
ixi
spo
sit
ived
efi
nit
e.
Ofther
ee
onl
y(i
i)and(
ii
i)c
anb
epr
act
ica
llya
ppl
ied
whichi
sil
lus
tra
tedb
elo
w. Sec_4_
4-1.mprov
ide
sec o
nfi
rma
tionofth
enumer
ica
lva
lue
sfo
rth
ise
xam
ple
u
singSy
mboli
cToolboxandb
asi
cMATLABcommands.
Example
4
.4.
2 EqualityConstrainedProblem
M
ini
rni
ze j
(
XIx2
):(
XI-1
)2+(
X2-1
)2-X
IX2 4.
( 38
)
Th
cpr
obl
em:
O~XI ~3; O S; x2~3 4.
( 37
)
M
ini
rni
ze f
(XI
x2
):-
XIX
2 (
4.36
)

FDC Suect hl(xl x2):xt/4+~-1 4.


( 39
)

=2(xl-2)-x2=O 4.
( 4
7a) O~xl~3; O!:>x2~3 4.
( 37
)
180 NONL
lNE
ARPROGRAMMING 4
.4 A
NAL
YTI
CALC
ONO
ITI
ONS 1
81

F
igure4.7illu
str
ate
deg r
aphicaJsol
utio
n.Itw n ot
iceda tatthesol
utionth
e Eq
uat
ion
s(4.
51)e
xpr
esseFOCorn
S
yc
ond
iti
onsf
or q
ual
ityc
ons
tra
ine
d
g
radie
ntof o bjec
tivefun
ction dthcgrad
ientofthecons
train
twe p
aral
leland p
rob
lemi
ntwov
ari
abl
es.Th
cla
ste
qua
tio
nint
hca
bov
ese
tist
heC
Ons
in
teq
uat
ion
.
o
pposi
telyd i
rected.E
xaminin
go t
herfeas
ibl
ep oi
ntsinFistIm4.7(ont heda sh
ed i
sen
sur
est
hes
olu
tio
nisf
eas
ibl
e.Thef
ir
sttwoe
qua
tio
nsc
anb
eas
sem
ble
din
c
urve)i
tc anbeasce
rtnedthatthespec
ialgeom
etrica
lr e
latio
nshi
pisonlypossibl
c v
cct
orformtoyicl
dthesameinfo
rmati
onexpre
sse
dbyEqua
tio
n(4.48
)wh
ichwas
a
tthesol
utio
n.Atthcsolu
tionapropor
tiona
lrelat
ions
hipcx
istsbetweenth
egradien
ts o
bn edgra
phi
call
y.leIeft
-ha
ndexp s
sio
nsinefi
rs
tlwoequ
ation
sabov
care
a
tthes olu
tio
n.U singthcc o
n s
t a
nto fprop
ortio
nali
tyA I( aposit
ivevalue)t h
c t
hegr
adie
ntoftheLag
rangi
anfunc
tio
n:
r
ela
tions
hipbetweenthegr
adic
n t
sc anbeexpre
ssedas

VF= +IVh.=0
=IVhl or Vf+ =0 (
4.
48
)
E
qua
tion(
4.48
)isu s
ual
lyo
bta
ine
dinamoref
orm
alwayu
sin
gth
cmethodo
f A
ppl
yigEq
n u
ati
ons(
4.5
1)t
oth
cexampleo
fi
sse
cti
on:
L
agran
gem
ult
ipl
ier
s.
aFIX 1
MethodofLagrange: I nl h
ismethodt
hep r
oblemistrans
form
edbyi ntro
duci
ng ? =-x.+ =0
oX1 L
anaugmentedfunc
tionc
alle
dt eLa
h gran
gian.asth
eo b
jecti
vefunc
tionsub
jecttot
he
same ualit
yc onsnt
s.TheLa gr
angi
ani sdef
ineda sthesumo ft h
eo ri
gin
al
aF (
4.5
2)
ob
ject
ivcf u
ncti
onan dali
nearcomb
inati
ono fth
econ
strai
nts
. leco
cffi
cicn
tsoflh
is ?
"
.:

_=
--

_-x
"
"2+
. '2

"
'
""
x
ol2.=o
A

li
nca
rc ombina
tion known Lagrangemultlie
rs
.Withr cfcr
ence10thc VA2
exam
plci nisscct
i o
n

Minimize F
( 2
x A
I)=
f(l
x u+A
x Ihl
(I
X x
2) 4.
( 4
9) h144-l=o
bec
omp
let
epr
obl
emi
sde
vel
ope
das
Equ
ati
ons(
4.5
2) p
res
ent e
qua
tio
nsi
n v
ari
abl
eswhichs
hou
ldd
ete
rmi
ne
thevaluesf orxj.xij. Note E quations(4.52
)o nlyd efi
net hen ec
e s
sary
Minimize F
(XI
x2
A)=-XIX2+
I 1(
./4+4-1) (
4.5
0) con
ditios
n whichmeanst h
es o
luti
onc o
uldbeamaximuma ls
o.
Th cr
eisonep ro b
lemw ithresp
ecttothesetofEquatio
ns( 4
.52
).Th equat
ionsare
S
ubj
eclt
o: hl
(I
X x
2:4/4+4-1
) 4.
( 39
) anonlinca
rs e.
tMostp re
r e
quis
itecoursesonn umcric
alm ethodsdon otattemptto
sol
v anonlinea
rs ystemofequati
ons.Usual
ly.l h
cyonlyh a
ndleasingleoneth r
ough
O
::
;;
XI:
:
;;
3; 0
::
;;
x2
::
;;
3 (
4.3
7) Newton-Raphsono rtheb iscc
tionmethod.I nfac
tNLPo rdesignoptimi
zationis
pri
marilyab outtcchniqu
e sforsolvingas ystemo fnonli
near uationa
s l
beitof
Ises ol
utiont
ot h
e l sfor
medproblcm[Equalion
s(4.5)
0 (4.
39)
(4.3
7)]thesame spi
ficf o
rm .Th
s ismeansE quat
ions(4.52
)ca nn
otbes ol
vcdunti
lwea dvanccr th
er
asthesol
utiontoth
eorig
inalproblem[Equ
ations(436)(
4.39
)(437
)]?Ifth
ed e
sign inisc ou
rse.F ortu
natelyhavingat o
olIikeMA ABo bv
iatesthi
sd if
fic
ultyand
i
sif s
ible
enmostd efi
nite
lyyes.F o
rf eas
ibledesi
gnshl("X2)=0
x d prov
idesas n gjust
ific
ationofusingan umerica
l/sy
mbolictoolforsuppo
rting
ot iv
ef unct
ionsinEq uat
ions(4.3
6)and( 4
.50)arethesame.Ifdesig
ni snol developmentoft h
ec ou
rse.2
fea
sibe
l thcnbydefin
iti
ontherei
snos ol
utionanyway.
beFOCa reobtai
nedbyc o
nside
ringF(x"X21)as uncons
train
edmctio
llin
ev ar
iabl
csXIX2
l'Thisprovi
desr e
er e
lati
onstosolv
eforxjx
i MAA BCode: InMATLAB.t herearetwowayso fs o
lvingE q
uation
s( 4.
52)usi
ng
symboli
cs u
ppor
tf u
ncti
onsorusingthcnumeri
c a
ls u
pportfunc
tion
s.Bothprocedur
cs
dF i)f ah havclim
itat
ion
swhena ppli
cdtohighlynonlin
earfunct
ion.Th
s esymbolicfun
ctio
nis
=+.-!.=o

ax ixl '.'. ax
)
s
a
o
n
lv
dr
e
e
a
q
n
d
ui
re
nume
syout
ri
oc
c
a
h
lf
oo
u
s
nc
ea
ti
o
ni
ni
ni
s
t
i
f
a
so
l
lg
v
u
e
c
.Then
sstost
u
a
r
me
r
tt
i
h
ca
ep
lt
ro
c
c
c
e
h
d
u
n
r
i
e
q
uei
.Qu
sa
it
ni
eo
t
f
e
t
e
r
at
ns
i
v
e
eo
vc
n
r
a
e
l
d
iffer
entg u
essesmayb c quir
edt of i
ndcs olut
ion
.S olutio
nso fsystcmsof
aF af." ahl (
4.5
1) eq
uationsarefun
damentaltotheres
to feb ook.Thef ollo
wingcodeisinclu
ded
= + =0
ahands-onexe
rcis
e.Itisavai
IableasSec4_ 4_2.m.Itrequire
seqns4_ 4_2.mt o
aA
2 ax2" '
.aX2
exe
c u
teo l
vecommand.Thcco o fef il
csarelis
tcdbclow

aF
1
11C
n
rco
lh
er1
00
18b
es
ld
csM
ATL
ADs
uch M
Ulh
cnd I
d c
c
l.
=h.=O
1
82 N
ONl
lNE
ARP
ROG
RAM
MIN
G
4
.4A
NAL
YTI
CALC
OND
ITI
ONS 1
83
S 4_4_2.m
define initial values
N ecessary/Sufficient conditions for
xinit=[l 1 0.5]'; initial guess for x1x21am1
E qualityconstrained problem
the equations to be solved are available in
Optimizationwith MATLABSection 4.4.2 eqns4_4_2.m
% Dr. P.Venkataraman
xfina1 ~ fso1ve('eqns4_4_2'
xinit);
Minimize f(X1
x2) -x1 fprintf('Thenumericalsolution (x1*
x2*
lam1*):n')

disp(xfina1);
-------
symbolic procedure eqns
4_4_2.m
--"--' function ret eqns4_4_2(x)
define symbolic variables

x is a vector
format compact . x(l) x1x(2) x2x(3) lam1
syms x1 x2 lam1 h1 F ret=[(-x(2) + 0.5*x(1)*x(3))
define F (-x(l) + 2*x(2) x(3))
F -x1*x2 + lam1*(X1*X1/4 + x2*x2 1
); (0.25*x(1)*x(1) + x(2)*x(2) -1)];
h1 x1*x1/4 +x2*x2 - 1;
he gradient of F OutputI
nMA
TLA
BCommandWlndow
grad1 ~ diff(F X1);
grad2 = diff(F X2); The solution (x1*x2*lam1* f*):
1.4142 0.7071 1.0000 -1.0000
optimalvalues
-1.4142 -0.7071 1.0000 -1.0000
saisfaction of necessary conditions -1.4142 0.7071 -1.0000 1.0000
[lams1 xs1 xs2] sOlve(grad1grad2h1'X1
x2lam1'); 1.4142 -0.7071 -1.0000 1.0000
the solution is returned as a vector of Optimization terminated successful1y:
the three unknowns in case of multiple solutions Relative function va1ue changing by 1ess than
lams1 is the solution vector for lam1 etc. OPTIONS.TolFun
;mORmT:the results are sorted habeti ly The numerica1 solution (x1*x2*lam*):
1.4141
fprintf is used to print a string in the 0.7071
commandwindow 0.9997
disp is used to print values of matrix Thesymboliccomputa
tiong e
nerat
esfoursol
uti
ons.Onlyt h
efir
stoneisva
lidfort
his
f -xs1.*xs2; probl
em.Thisisdecide
db yes ideco
nstr
aint
sexpressedbyEq ua
tion(4.
37
).Thisis
fprintf('The solution (x1*x2
lam
* f*)n') iIIust
rat
ionoftheaprio
rimannerbyw hichthesidecons
trai
ntsaff
ectth
ep r
oblem.
disp(double([xs1 xs2 lams1 f]))
Ont h
eo t
herhand
.en umericaltech
nique
sp r
ovideonlyonesolut
ion10th
eproblem.
---------- lIsisaf u
ncti
ono fthein
itia
lg u
ess.Gen
erally
.n umeri
calt hniq
ueswil
ld eli
ver
% Numerical procedure sol
ution
sclose
sttolhepointtheysta
rte
dfrom.Thes ol
utioni
s
----
solution to non-linear system using fsolve x;=1
.41
41;x
;=0
.70
71;=1
.0
see help fsolve

'es
h o
ho
nsf
orX
I dX2C
beve
rifi
edf r
omt h
egraph
icalsol
utio
ninFigur
e4.7.
the unknowns have to be defined as a vector Thesol
uti
onscana
lsobeve
rif
iedthr
oughthehan
d-heldca
lcu
lat
or.Thevalu
eandsign
the functions have to be set up in an m-file fr
o areu s
ual
lyimmat
eria
lforest
abli
shin
gt h
eo pt
imum.Foraw el
l-po
sedproblem
i
tshoul
dbeposi
tiv
esincci
ncasi
ngthecon
stra
intvalu
cisuse
fulonl
yifwcaretry
ing
t
oi d
ent
ifyalowervalu
eforeminimum.Th i
sforcsha
e ndftomovci nopp
osite
4.
4 A
NAL
YTI
CAlC
OND
ITI
ONS 185
184 NONUNEARPROGRAMMING

d
ire
cti
ons(
gra
die
nts
).Inc
rea
singc
ons
trai
ntval
ueca
nbea
sso
cia
tedw
ithe
nla
rgi
ngt
he S
ubj
ectt
o: [
h(X
)]=0 (
4.6
)
f
eas
ibl
edomainwhichmayyie
ldabet
terde
sig
n.
X1
0wSXSXup (
4.8
)
LagrangeMult l
ler
s:TheL agrangemulti
plie
rmethodi sanl e
gantfo
rmulat
ion
t
oo bt
ainthesol
ut iontoaconstrain
edp r
oblem.Inoverviewitseemsstran
geatwe
0E
1 qu
ati
on(
4.5
3)
thr
eee
qui
val
entr
epr
ese
nta
tio
nsf
ort
heL
agr
ang
iana
res
how
n.The
havetoint
roducea na d
diti
onalunknown(
1)tosolvetheconstra
inedprobl
em.T hi
s
vi
olat
esec on
ve ntiona
lr ul
ef orNLP t h
ef ewerthev ar
iabls
e t
hebette
rt h
e FOCare
c
L
h
a
a
n
g
r
ce
a
n
s ofo
gianal
b
l
t
a
o
i
w
n
st
in
h
g es
eansf
o
o
l
r
m
ut
a
i
o
t
i
n
o
. As i
nofac
n
o
d
n
i
s
t
c
r
a
t
a
e
i
di
ne
dp
nt
r
o
h
ed
ble
i
s
mi
c
n
u
t
ss
oa
i
one
nunc
a
r
o
n
l
s
i
t
e
r
r
E
aine
d
dF h" (
4.5
4)
"~'.k =0; i=
=+) A
. 12
pr
oblem.TheL agra ngemult
iplirals
oh asaphysic
alsignif
icance
.Att hesolu
tioni
t a
J
E
i axizkh'
ex
presseser atioo f c hangei ntheo bj
ectiv
ef un
c t
iont ot h
ec hangein
c
onstra
intval
ue.Toi ll
ust
rat
ei sconsi
der:
S
ubj
ect
: (
X)]=o (
4)

F=f+
Ihl X1
0w~X~Xup (
4.8
)

Idl
dF=df+ 1 E
qua
tio
ns(
4.5
4)a
nd(
4)p
rov
idet
h 1+1
e1 rel
ati
onst
ode
ter
mie n+1
n unknowns
x
.E
qua
tio
n(4
.8)
isu
seda
fte
rth
eso
lut
ioni
sob
tai
ned
-ifn
ece
ssa
ly.
Equ
ati
on
dF. dF. dF (
4.5
4)i
sal
soe
xpr
ess
eda
s
dF= ~dx+
dX _.. .+
dX :
:
-
2-'2 d a
A
.

.


-
1

-

nt


Attheso
luti
o h
eFOCdeemst
hatdF=0(
whi
chc
ana
lsob
ese
eni
nth
eab
ove

V

V

V
+
'

n
n


V
(
4.5
5)

u
H
v
EE

-hH
.Hence

r
de
tai
ledex
pansi
on)


L

L
1- d
h 6
11
Theabovedependencedosnota
ffe
ctt
heesta
blis
hme
ntofth
eoptima
lde
sig
n.I
t Second -Ord e
rC ondition
s:At s olut
iond eterminedby FOCt hefunction
does hav animp
ortan
tr ol
ei nthedi
scu
ssionofdes
ignsen
sit
ivi
tyinNLP sh
ouldi ncreas
ef o
rc hangesi n6X.Changesi nX a ren otarbi
trary.Theyh a
v eto
pro
ble m
s. sa
tis
fyel ine
arize
de q
ualityconsain
tatthes o
lution.1tistakenforg r da tthe
su
ffi
c i
entcon d
itionsMeu sual
lyapplie
di nas malln ei g
h bo
r hoodo ft heopt imum.
GeneralEqualltyC
ons
tra
lne
clProblem: Rememberingn-1>0 Alsochangesa r
ec ontemplatedonlywithreSPECtt oX andn otw ithr es
pectt othE
Lagrangemul tip
lie r
- TKLagrangemet
hodisobnc alledthemetho dqfu n
d et
e rmined
M
ini
mi J
e f(X)
z '
I (
4.5
) co
eff
icie
nt.i ndic
atingiti
so otavari
able
.1nt he a
l

yc der
iv
a
6o
noftheFOCfor
:
p e
l
Subject[I(
X)]=0 (
4.6
) prev
i ouss

m

c
m



l L

0n(
ag

c
ra
o
n
n
s
g
t
i
r
a

a

i
I
w
n
e
asc
dmin

on
1
i

za
t
io
u
n

nc
on
) SOCc
s
i B
b
0 r

eexpec
r
dt

ngf
osa
m

ti
m

s
f
nt
yt
h

h
e
e
foll
o w
ingr ela
tio
ns:
X1
0wSXSXup (
4.8
)

Theaugmentedp
rob
lemw
itht
heL
agr
ang
ian
: X*+

=F( )
-

F'(
X
.
)=VF
) (
'(
X'
) d[v(
T



z
2
F


(


X
X
'
'
)

]
) O

Minim
')=f(X)+
F(X L(X) VhTAX=O
k=l
I
nth
eab
ov l
e[V2F(X i
sth
eHe
ssi
ano
fth
eLa
gra
ngi
anw
ithr
esp
ectt
oth
ede
SIg
n
=f(X)+A'h
; v
ari
abl
esonl
yeva
luatdatt
hesol
uti
on.A
lsoth
eF0CmquimthatVF(X)=0.With
+lTh
=f( (
4.5
3) r
efe
renc
etotwov
ari
abl
esandoneco
nst
rait
n:
4.
4 A
NAL
YTI
CALC
OND
ITI
ONS 87
186 NONL
lNE
ARPROGRAMMING

t
:
.F=

)+
+2
T
ran
sfo
rma
tlo
ntosnE
qua
lit
yCo
ns

Minimize
t
rai
nedP

j
(
r

X
ob
l

I
X
e

2
)
m

:-
XIX
2 (
4.3
6)



M=i )+

+2tL
(
4.5
7)
S
ubj
ect
lo: g
l(X
I'z
X

g
2
}+

(XX
2.
z
i
:20xI+15~ -30+z
)+ :xi/4+x~-1 +z~=0
i=0 4.
(

(
4.
59

6
0
)

)
t
:
.
.
xl dh/ox
2 (
4.5
8)
t
:
.
.
x dh1/dx1 OSXIS3; OSX2S3 (
4.3
7)
2

S
ubsti
tuteEqu
ation(4.
58)inEq ua
tion(4.
57)andtheSOCr e
quire
sthattheexpre
ssion Th
erearefou
rvar
iabl
es(X
I.X
2.ZI
.Z2)andtwoequ
ali
tycOl
lst
rai
nts
.Iti
sav
ali
dequa
1it
y
i
n bramustbep osit
iv. d
e e
riva
tive
si nEq ua
tion
s( 4.5
7) d( 4.58
) co
ns ine
dp rob
lem. TheL ag
rangem ulti
pli
er mth
odc anb eapp
lie
dtot h
is
e
valuate
datthemimum. mau--Tod n guis
hem ul
t i
p o c
iat
edw i i
i t
ycons

Applyingt
hes ec
o n
d-ordercondi
tiontotheexampleofi ssecti
oni s1f
t esymbol~ i
suse.Th
d i
sissct1
yf orcIty
.
e
xerci
sef o
rthe ader
.Compar dt oeSOCf orth
eu n
constr
ainedm ini
m i
zation
pro
blemEqua
tions(4.5
7)and( 4.
58) not syapplye
speci
allythesubst
itu
tion M
eth
odo
fLsg
rsn
ge:TheaugmentcdfunctionortheLagrangiani
s
:
fE
o quati
on(4
.58
).Fromap rac
tic
alp e
rspe
ctiv SOCisn o
ti mposedfor ual
ity
c
onstra
inedprob
lems.Itisl e
fttot hedcsig
ncrtoe n
surebyo the
rmeans e
M
ini
miz
e
s
oluti
onisaminimums o
lut
ion.
F(x 1 ~ ZI Z2 I'2) =f(xl
.X)+s1
2 [gI
(
X1x2
)+z
il+s2
[C2
(X')+z~] (
I 4.61
)

4
.4.
3 I
neq
ual
ltyConstrainedOptlmization I
ftheLag
rangi
ani sco
nsi
der
ed a
nun
con
str
ain
edo
bje
cti
vef
unc
tio
n.t
heFOC
(
nec
ess
aryco
nditi
ons)a
re
Theproblem
dF df./l o
gl ./l dg2 (
4.6
2a)
+s =0
=axlaX12axl
-41
a
xl
Minimize f
(XI
Xz
}:
XIX
2 4.
( 36
)

dF of./l o
gl ./l ~g2 (
4.6
2b)
S
ubj
ectt
o: g
l(I
X x
2:20X
) I+1
5X2-30S0 4.
( 4
0) = +I~Ul +s
2 =0
dX dX2' .dx .r~x
I
"'
2
2
g2(xl xz):x114+~-1 SO 4.
( 41
)
dF (
4.6
2c)

=2s
z=0
_n

OSXIS3; OSX2S3 (
4.3
7)
11
;
aZ1

Thenumbero fvariab
les(n=2 ) dt henumbero finequa
litycons
trin
ts(m=2 )do
notdependone achothe
r.I nf a
ct.a ninequ
alit
yc onsainedproblemi nas in
gle dF . n (
4.6
2d)
?=2s.z.=0
va
riabl
ec anb eu se
fullyd es
ig n
eda nds olv
ed.S ec
tion4.4 .
2s olv
edt he ual
ity aZ
2
con
strain
edp roblem.Ift heabovep roblemc anb e n sf
o rmedtoa nequiva
lent
cq
ualit
yc onstr
ainedp roblem. e n we havef oundt hes o
luti
on.1 es tan
dard
1sform
ationreqresas la
ckv a
riabl
ezjforeachineq
ualit
yc ons ntg UnlikeLP dF ? (
4.6
2e)
j =
g.+zf=O
proble
mstheslackvar
iableforNLPi snotrest
rict
edinsign.ber
eforet
hesquareof d
PI ul

th
enewv a
riabl
ei saddedtot heleft
-handsid
eo fthecor
r pondingconsain
.tThls
addsaposi
tivevaluetothelef
t-h dsidetobrin
gt h
ec on
si ntuptozero.Ofcourse i
JF ? (
4.6
2t)
=g.+z~=O
azerovaluewi
llb eaddedifthec o
nst
rll
intisalr
ell
dyzero. d
s2
U "
188 NONL
lNE
ARPROGRAMMING 4
.4 A
NAL
YT'
CALCONOtnONS 189

Eq
uat
ion
s(4
.62
e)and(
4.6
2t)a
re u
ali
tyc
ons
tra
int
s.Eq
uat
ions
et(
4.6
2)p
rov
ide
ssi
x Eq
uat
ion(
4.6
4)
theLa
gra
ngi
ani
sre
for
mul
ate
dwi
tho
utt
hes
lac
kva
ria
ble
s (
wea
re
u
ati
ons
tos
olv
efo
rx
1x
Ez;
Z5.
91.
.Bysimplerecombination
Equ
on
s(4
.62
c) g
oin
gtop
ret
endZn
eve
rex
ist
ed)
to(4.6
20canbec o
llaps
edtotwoequ
atios
n whi
lethes
lac
kva
ria
ble
sZIandZ2canbe
eli
F
m
i
i
n
r
s
at
tm
e
d
u
f
l
r
t
i
o
p
mt
l
l
yE
z
ep
qu
r
a
o
t
b
i
l
o
em
.
n(4.
62c
)byZIReplace by-8t
z
1fromEqu
atio
n( 4
.62e
).
Minimize F
(x.
x2.
s.1
32
)=.
f
{.
x x
2)+s
.[g
.(x
..x
2)]+s
2 .
[8TX
2)
] (4.65)
Droptheneg
ativesig
naswellthec o
eff
ici
ent2toob
tai
n


whichisthesameformulati
oninE qu
ation(4.
53)
.Thes l
ackvaria
blewasi ntrod
uced
t
op rovide tran
sformati
ont oane quit
yc ons i tI
n. tisa l
soev id
ent e
18.=0 (
4.6
3a) co
ns c t
ionofLa grangianfunc
tionisin
sens
itiveto typeofconstra
intSince
1
32
82=0 (
4.6
3b) emultip
lierst
iedtotheinequ
alit
yconstr
ain
tarer e
quire
dtob cposi
tivewhil
ethose
co
rrespondin
gtotheequal
itycons
trai
ntsareno
tth
isbookw i
llcontinuetodis
tingu
ish
Equ
ati
on(
4.6
3b)i
sob
tai
nedbyc
arr
yin
gou
tsi
mil
arm
ani
pul
ati
onsw
ithE
qua
tio
ns bet
we n m
e ul
tip
lier
s.Th iswil
ls e
rvetoenfor
ccc la
rit
yo fpres
ent
ation.TheFOC
(
4.6
2d)and(
4.6
20.TheFOCc
anb
ere
sta
teda
s f
orthep r
oblem:

dF df. d 8
.. d 82 (
4.6
2a) e
)F dr ~d
8I ~ d
8 (
4.6
2a)
=;
J =L4144H=o
n n

d
x. d
x
+I~+ 132 =0
. r1dx.'r~x. d '
x d
x ' O
Xt.ZI
"d
x
". I
""

dF d

d=:
X d
2 2
:
X
r ~d
L+r
8I ~ d
I~+ 1
1
dx2
3
8
2 =0
r~X2
(
4.6
2b) dF df.n d

dz=d
X
x2'1
"
"' d
g
.
X
. .n d
+ I"\~I +1
z .
32
Z
g
2
=0
d
I
".
X
z
"
(
4.6
2b)

1
31
8.=0 (
4.6
3a) : =0[
Casea gl<
0];
2=0[
g2<0
]

1
32
82=0 (
4.6
3b) Caseb
:1
3 =0[
8.<0
];>0[
g2=0
]
(
4.6
4)

Thesefourequati
onshavetobes o
lvedforxjx
i
j
2
sNote tziZ 2a reootbei
ng C
asec
:s.>0[
g.=0
];s
2=0[g2<0]
determincd-whichs u
ggesse
t ycanbediscardedfrom p roblcma1t
ogcer
. Cased
:s.>0[
8.=0
];>0[
82=0
]
I
twouldbeu s
efultopret
cndz'
sncvcre xi
stcdinthefir
stplac
e.
Equations(4.
63)layoutadcf
init
ef e
atur
ef o
ran o
ntrivi
alsolu
tio
n:cit
h e
rsjisze
ro
(and8/ 0)or8/i
sz eo().S
r inces i
multaneo
usc qua
tions b e
ings ol
vede
Equat
io nset(4.62)anda nysing
lec a
seinE qua
tion(4.64)provid
esfourequat
ionsto
con
ditiosonem
n ul
tipl
iersandconstr
aintsmustbes ati
sfie
ds i
mul
taneous
ly.For sol
vf ort h
cf ourunknownso fthep ro
b l
em.A llfoursctsm us
tb esolvedforthe
Equatio
ns( 4
.63
)is s l
asint
o ef ol
lowingfourcas
es.Thcinfor
mationon8in so
luti
on.Th ebestdesig
nisd ecid
cdbys canningthesev
erals o
lut
ions
.
brac
ketsistocmphasizeanaccompanyingconsequen
c e. Thcs igno fthem u
ltipli
erint hesolutio
ni snotas j
uJic
ien
tc ond
itionforthe
ualityconstrai
nedproblemTh cval
ueisun po
rtantforopti
mizat
ionbutmayb e
rel
evantfors c
nsit
ivit
yanalys
is.Generallyapositi
vevalueo f
m u
ltip
lierin
dica
tcs
Casea
:s.=0[
8.<0
];1
3
2=0[
82<O
J thes o
lutionisnotal o
calmaximum.F ormall
yv erif
yingaminimums olut
ion
:=0[8.<0];*0[
Caseb 82=0
] resc
q onside
rationo fthes ccondd cri
vativ
eo ft hcLa gran
gia.I
n np ra
cti
cal
si
tuat
ions.ifthcp roblemiswelldefine
d t
hcpositi
vevalueo fcm u
ltipl
ierusua
lly
Casec:1
31*0[
8.=
0];1
32=0[82<0)

l

sug
gcstsaminimums ol
utio.Th
n isisus e
dc xte
nsivc
lyi nt h
cbookt oident
ifythe
optimums oluti
on.
:
C d I 0
[8.=
0);*0[
82=0
] (
4.6
4)

In Eq u
atio
n( 4.
64)ifsj*0 ( o
rc orr
espondin
g8 /=0)thent hecorre
spondin
g S
olu
tlo
noft
heEx
ample:ThcLa
gra
ngi
anf
ort
hep
rob
lemi
sde
fin
cda
s
consaIn
tisanequa
lit
y.Intheprcvi
ousscct
ionas i
mplerea
soningwasusedshow
cs
Whi l
et h
ig
no
esi
g
fem
nofth
t
emu
i
l
t
p
l
i
i
p
e
rmustbep
l
ierwasi g
n
o
o
si
tiv
df
e(>0
o
)f
ree
o
q
u
raw
al
it
el
yc
l
o
-
n
f
o
s
r
t
m
r
a
u
i
l
a
n
e
te
dp
dp
r
r
o
o
b
l
b
e
l
m
e

m
.
i
t
F
(x.
x2.
s.s
2
)=
-x.
.X
z+s(
2Ck
.+1
5X
z-30)+(0.i~+ .s -l)
i
sin clu
dedaspar
toftheFOCf or i
nequ
alit
yc o
nstra
ine
dp ro
blem.Befo
reresta
tin
g TheFOCare
1
90 N
ONL
INE
ARP
ROG
RAM
MIN
G
4
.4 A
NAL
YTI
CAL
CON
DIT
lONS 1
91

dF (
4.66
a) Thesolu
tinf
o orCaseawasd iscu
ssede
arl
ierandisconr
trmedabo
ve.
Z;=42+2ORI+05h=0 Casebhnsfoursolu
tion
s.Thefir
stonei
su na
ccep
tablebeca
useco
nstr
nintgli
snot
s
ati
sfi
ed.Thesecondsolut
ionisfea
sibl
ensfarasth
ef u
ncti
ona
1cons
trai
nt
sg andg2
dF (
4.6
6b) a
reconcemedb utt heydon otsati
sfythesidecon
stra
int
s.Th ethi
rda ndfour
th
55=41+15Pl+2h=0 s
olut
ionsareunacceptab
lef o
rt hesamer e
ason
.T hu.C
s asebisn otn nopti
mnl
s
olut
ion
.
Cnsecisunac
ce p
tablebeca
useconst
rai
ntg2isinvio
lat
ion
.
(
s12O
xI+15X
z-30)=0 (
4.6
6c) Cnsedhnstwos o
luti
onsth
ef i
rs
tofwhichi
sn o
taccep
tabl
eforse
vera
lrenso
ns.The
s
econdsolu
tio
ns n
tisf
iesnl
lofthereqremen
ts
(
s20 +4-1)=0 (
4.6
6d)
I
tsnt
isf
iesth
econ
str
ain
ts.80thcon
stm
ints n
cti
ve.
es
Th i
dec
ons
tra
int
s
Themul
tipl
ies ep
r o
siti
ve(maybeasu
ffi
cientcon
diti
on)
.
Itsat
isf
iesth
esid
econs
tra
int
s.
OSX1S3; x
.
z
O S S3 (
4.37
)
es
l o
lut
ioni
s
Casea:sl=0
;s2=0
:Thes
olu
tio
nisi
vi
ala
ndbyi
nsp
ect
iono
fEq
uat
ion
s(4
.66
n)
an
d(4.
66b
).
x1=
0.8
151
; 2=0
X .
9132
; = 0.
043
9; =0.0856;
X1=0; x 2=0; 1=0; gJ=3 0; g2= (4.
67)
1=0
.74
43; g
l= 0
; g
2 0=
Thei nequ
a1it
yc on
t saresati
sfi
ed.Thes id
ec on ai
ntsa re isf
ied
.Thev al
ues Thi
sisnlmostconfir
m dby n
e umeri
cnlsolu
tio
nw hichnpp
earstohnveap r
oblem
inE quation(4.
67)r e
p sentapossiblesol
uti
on. wiconvergen .I
tisalm
ostattheso
luti
on.1
tmustb enoldh
e e
reth
att h
eMATLAD
Thes olut
ionsfo
rt heothercase
s'co bta
inedusingMA 11.ABlecodeisav
aila
ble fu
ncti
onu s
edtos ol
ve problemispa
rtofthestan
dardpack
age.Thefu n
cti
onsin
i
nSec4_4_3 m.F
orC asesba ndct heappro
priatem ult
iplierissettozeroandthe th
eO pt
imizati
onT oolboxwil
lc er
tai
n1ydob et
ter
.N eve
rth
eless
.t ei
h ncompl
ete
r
es ultin
gt h
rEeEquationsint h
reeunbEownsa res olved.Forc asEdt hecompl
eteset so
lut
ionisrepo
rtedbelowbutwilbei
l gn
oredduetoes ymb
olicsol
utionava
ilab
le
off ourequat
ionsinf o
urunknownsi ss olved.casedi salsoSOlvednumeri
call
y.l e i
nC a
sed.
MA TI.ABcodewil
la1 s
or uncodeFlg4_8.mw hichconta i
nsthc ommandst odrawe
f
igure.Th eoutputfromt heCommandwindowi
The solution *** Case a ***(x1*
spa tchedbe10w .

x =0.8187; x
2=0.9085; 3
s =O. 5; =0.0913
x2*f*9192)
o 0 0 30 1 T
herearenowt woc and
idat
esf res
o o
lut
ion
:et ri
vi
nlsol
utio
ninCaseaandth
e
The solution **Case ( b) ** (x1*
b2* f*9192): s
olut
ioninCnsed
.Thes olu
tioninCndi
s sfav
orednsi
thsal
n o
werobj
ect
ivef
unc
tio
n
???E

x2
1.4142 0.7071 1.0000 -1.0000 8.8909 0 va
1ue
.A llofthec n
sesa b
ovec anbeexpl
oredwi spec
ttoF ig
ure4.
8.Iti
san
-1.4142 -0.7071 1.0000 -1.0000 6.8909 0 e
xcel
lentfa
cil
ita
torforcompr
e h
e n
dingt
hecase
sa n
d sol
uti
on.
-1.4142 0.7071 -1.0000 1.0000 -47.6777 0
n

1.4142 -0.7071 -1.0000


s

1.0000 -12.3223 0 4
.44 GeneralOptimlzatlonProblem
.

The solution * Case (c)*** (x1* X2*b1* f*9192):


o.75001.oooo

o.0500-o.7500o o.14o6 'eg


h e
ner
a1o
pti
miz
ati
onp
rob
le sd
mi e
scr
ibe
dint
hes
eto
fEq
uat
ion
s(4
.1)(
4.
8)
.l
e
Thesolution***Case(d}***{xl* x2*bl*b2*f*glg2): s
pec
ifi
cpr
obl
emi
nth
isc
hap
terdf
ine
dinS
ect
ion4
.3i
s
1.8150 0.4200 0.0426 1.4007 0.7624 0 0
0.8151 0.9132 0.0439 0.0856 -0.7443 0 -0.0 M
ini
miz
e j
(X X
l):' X
2 (
4.9
)
Maximum nu of function evaluations exceeded;


lncrease options.MaxFu nEvals
Optimizer is stuck at a minimum that is not a
S
ubj
ectt
o: h
1(l
X x
V:20x+15X2-30=0 4.
(10
)
root
Try a9ain with a new startin9 guess
g
l(X

xV:<4/4)+(~) IS0 (11
4. )
The numerical solution ( x1
X2
b1* b2*):
0.8187 0.9085 0.0435 0.0913 OSXlS3; OSX2S3 (
4.1
2)
i111114I11Jjq
192 NONUNEARPROGRAMMING
4
.4 ANAL
YTICALCONOITIONS 1
93

Z
A
ii
l ;
;
35
5 ;
(
oX2
XI ..
.x

JSO
.j=1
..... m
2 (
4.3
)

; M
u/ od:Theproblcm
i s
f
i ym
ini
miz
ingt
hc
TheL
agr
ang
ian
:

Minimize
~~X
I~.xl' =1.2.... n
j 4.
( 4
)

M
ini
miz
e X.
F
(XJ 2
A..
.s 2+1
U=-X.
X (20
x.+1
5x2-3
0)+s
.(0
.25
x?+xi-1) F
(
x1

X
nA.
..
.
/.s
I'....s
r
n)=
S
ubj
ect1
0: "
1(X
JX
2)
:20
xI+1
5x2-30=0
f
(x
..
Xn)+
h+
+
+s.g
+ +sr
n
Cm (
4.7
0)
OSXIS3; OSX2S3
Th
erearen+1+munk.n
own.Th
s esar
nenumbero
fcqua
t io
nsare.
ruire
dtos
olv
e
TheFOC epro
b1em.
es
e "
epro
vid
edbyt
heFOCo reKuhn-Tuckerco
ndi
tio
ns:

1c
1 q
uat
ion
sar
eob
tai
neda
s
aF
I+O.
Z;=-X2+2 5s =0 (
4.6
8a)
h
dF df.~ d " .dhl.n dg
. . n dg
m (
4.71
=+ A.-:;

+ +PI--++sm-
: )
aF d dx
x "
'
- d
x ---
'd
x-rax -rmax=0; i=1.2.....n
~ =-x.+x (
4.6
8b)
2=o
l u
ati
onsa
ro
bta
ine
ddi
rcc
tlyr
uug
hecqu
it
yco
nst
rai
nts

aF
-=2 1+15~-30=0 (
4.6
8c) n)=
hk (xI' X2 .. .X 0; k=1
.2..
. .
.1 (
4.7
2)

mcquat
ionsareappi
1edthrou
gh 2m c
ases
.T hi
si m
plie
s ereare2mp os
sib
1e
Casea
:
s=0; l<0
g (
4.6
9a)
s
olu
tio
ns.Thescsol
utio
nsmustincl
udeEquat
ions(4.7
1)and(4.
72)
.Eachc as
setsth
e
m
ult
ipli
ero r corresp
ondin
ginequ
alit
yc0
n
s
tma
int
t
oze
I f
theml
t
Caseb
:
s>O; .=0
g (
4.6
9b) s
ettozero
.e nec orresp
ondin
gc ons
in

tmustbef eas
ib1

efo

rana ccc
ptab
le

3
2
;:
;;zzuyf a uirthesoluuo
s
yst
em
s
o
m
u
l
l
u
t
t
i
i
p
o
n
l
.I
i
e
fec
rmustb
o
n
ep
st
o
s
r
a
i
i
t
n
i
v
ti
ef
ss
o
e
ttoz e
ro(acti
vec
raminimum.Withi
o
nst
r
si
ai
nt)
.t he
nt
nmindcme
h
ec
qu
o
a
r
t
i
r
o
e
s
n
po
sc
n
a
di
n
nb
g

i 1
22
3;
-
2
32
22
!
e
xpres
sedas



--=
u
nu

e
U
.

U
nu
oJ
t
he j<0
ng

dd

npu

>0 (
4.7
3)

;:
Mi
nim
ize f
(X.
x
2.
..x
J
I
fcon onsi
i
m
c
q
t
h
p
u
l
a
l
cs
e
i
i
m
t
i
d
e
e
n

ec
t

o
i

n
s
n

t
gE

ra
nE
q

i
n
u
smustbea
l
a
q
t
s
s
Sh
u
i
i
a
a
t
o

v
i
n(
gn
o

e
d
ct
n
4
s(
.
7

ob
3)
4
.

ec
7
.f
.Oncet
h
3
o

e
)a
re
h
c
e
k
e
r
a
s
en
chc
o
tm
a
eFOCc
d.Asc
s

v
e

o
n
i
t
eas
d
d
.edigni

i
e
i
t
n
m
i
o
c
e
u
n
1
ta
sd
di
n
e
e
t
o
e
u
r
nce
st
mi
x
sn

n
a
o
o o
eap
mp1
ta

o
e
s
c

s
i
se
c

b
a
e
p
fm v
l

r
t
a
a

es
ier
b
1u
o
1
e
l
u
.t
e

t
h
.I
sa
i
i
n
o
n
si
n
d
.
s
(
4.1
) n
otb u
iltinto FOC. l tiso n
1yc onftrm
eda ft
erap os
sib1
es olut
ionh a
sb een

Su l
to: i
den
tif
ied.Equa
tions(4.7
1)(4.7
3)areref
erre
dtoastheKuhnTu
c k
ercondi
t io
ns[ s
ee
"
k(
XI
X2.
...
.xn
)=O
.k=1
.2.
...
.1 (
4.2
) E
xarnple4.
3( S
ectio
n4.5.2
)foraddit
iona
ldiscuss
ionofth
eKuhn- Tuc
kercondi
tions
].
194 NONl
INE
ARPROGRAMMING 4
.
5EX
AMP
LES 195

4
.5 EXAMPLES Ex
p d
ingt
hee
xpr
ess
ion
sint
heb
rac
ket
san
dre
org
ani
zin
gasal
ine
ma
ix
equ
on

Twoexarnpl
esarepre
sent
edint
hisse
cti
on.Thefi
rs
tisanuncons
trainedprob
lem
"
1
1 1
1

h
f
i
a
ss
tt
in
i
g
go
nif
i
rr
c
e
a
n
g
r
tu
es
s
s
i
i
o
nd
.Th
n
atar
ese
e
d
c
o
u
n
c
li
di
on
.S
sth
p
e
cb
c
e
i
f
a
r
ic
a
nd
l
e
y
l
si
g
iti
np
l
l
r
o
u
b
s
t
l
r
e
a
te
me
st
x
p
h
l
ep
o
rob
di
lc
mo
nCha
fc
pt
e
u
r
r
ve
s1
yf2Y;I~ IL
Z;
Y;

iz
;
and2
.
L
Y; L11
/
=1

I
=J
I ;
=1
4
.5.
1 Example4
.2
Notth
att
hem
atri
cescanbes
etupeas
ilya
nds
olvedusi
ngMATLAB.TheHess
ian
Problem: A s
e fy
to Zd
atai
sgi
ven
.Iti
sne
ccs
sar
ytof
indt
heb
ests
tra
igh
tli
ne mat
rixi
sth
esq em
u at
rixont
hel
eftTheSOCr
equ
iresati
tbeposi
tiv
ede
fin
ite
.
ro
u ghth
edat
a.T h
i se
xerc
iseister
medcvefit
tin
gordat
a duc
tio
norregr
essi
on.
Tok Pth
ise
xarnplesim
pletheda
tapoi
ntsar
egene
rate
dusingth
epar
abo
licequa
tion
Code:Sec4_5_1.m: E xarnp
le4.2issolve
dusingMATLAB dt h
er e
sult
sfro me
Z=O.5y
2.Thedataaregen
eratedi
narbi
tra
ryord
erandnonunormin
ter
val
s.
Commandwindowa reshownb elow
.Comparet hi
sc o
dewitha tinChapter1.The
re
sul
tsaredis
playe
donap lo
t(notinclu
dedin bo
ok).Newf ea
ture
sin c odear
e
LeastSquaredE
rro
r:Theo
bje
cti
vef
unc
tio
n d
riv
esal
arg
enumbero
fcu
rve th
eu seofrandomnu mbersusin
gth esumcommand andwriti
ngtot h
eCommand
fi
ttin
glreg
ress
ionm ethodsist hem i
n i mi z ati
ono fthel ea
sts q
ua r
ede rr
or. l e window.Fromthepl
ota nd tab
ularva
Iuesi
tiscle
arth
ataline
arfi
tisnotacce
ptabl
e
co
nstruct
iono ft heo b
jecti
ve i res two e nt
iti-t
hed ataa nd t yp eo f fo
ri sexa
mple.ThequaIityofthefiti
snotundcrdis
cuss
ioninisx arn
pleasiti
s
mathe
malicalr e
lati
onshi
pb etw nt hed a ta.Int h
isxar
npleitisas tra
ightl in
e. appa
rent anonlinea
rfitshouldhavebcenchos
en.Thisisle
flasane x
erci
sc.Thc
Gene
rallyitcanb eanyp o
lynomi al ora n yf un
ctionro
ra tmanne
r.T hisisusu ally foll
owingwi
llappearineCommandwindowwhcnec odeisru
n.
th
ewayc orrcl
atio
ne q
uationsared e t crm i ne dine x
.pe
rim
cntalfl
uiddynamicsandh eat
tr
ans
fer.Forthisexnpleed ataa ret hec oll
ectio
nofpoint
s(Y
;
Z /)i=12
n Results from Linear fit
T
h
e
1 e
.
x
pecdstra
igtI
h inc b c
ha
ra
C~
.er
i
zedby objective function: 16.5827
design variables x1x2:
2.3458
Z=X1Y+X
z -1.5305
yi Zl
. Zp diff
wherexli
stheslopeandX2i sei nterc
ept
.Usingopti
mizin
gterm
inolo
gyth
erear
e 1.6514
4.7427 11.2465 9.5951
twodesig
nv a
ria
ble. F
o rac u
bicp oly
nomi
I
at he
rewilbefou
rdesi
gnvari
abl
es.
3.7230 6.9304 7.2031 -0.2727
Z
pjisfitt
edvalu
ef orei ndep
endcntvar
iab
leY;eobje
cti
vefun
ctin
o whichi
s
4.3420 9.4266 8.6552 0.7714
theminimumofthcsq u eoftheerr
orovcra
Iloftheda
tapoi
nts
.canbcxpsseda
s 0.7179
0.3766 0.0709 0.6470
2.4040 2.8895 4.1089 -1.2193
n 1
1
8.1002 0.3270
4.1054 8.4272
M
ini
miz
e f
(x1 L
)= [Z/-zpi= [
Z X +
/( X
2)]
2 L (
4.7
4) 4.1329 8.5404 8.1646 0.3757
;
=1 >1
1
= 3.3369 5.5674 6.2973 0.7299
2.7835 3.8739 4.9991 -1.1253
I
tispos
sib
letoc
omp
le te f
orm
ula
tio
nwi
si
dec
ons
n
tsa
Iough i
sno
t 4.2032 8.8334 8.3296 0.5039
n
eces
sy.leFOCar 3.1131 4.8456 5.7723 -0.9267
3.1164 4.8561 5.7802 -0.9241
0.8199


=

3.2415 5.2538 6.0737
(
4.7
5a) 0.1954 0.0191 -1.0720 1.0911
2[Zj-(x
0.7284 0.2653 0.1781 0.0871
4.5082 10.1619 9.0450 1.1168

=;2IZi- i
(
4.7
5b)
1.9070
0.4974
1.8183
0.1237
2.9430
-0.3638
-1.1247
0.4874
196 NON
lINEAAPAOGAAMMING
4
.5E
XAM
PLE
S 197
1.9025 1.8098 2.9325 -1.1227
0.1749 I~I whereX=[
X 2]a
oX nds=[
1
31
12
3s
4]T
.l
eKuhn-
Tuc
kerc
ond
iti
onsr
equ
iretwo
0.0153 -1.1203 1.1356

429

e

-
u
ati
onsu
sin
gth
egr
adi
ent
sofI
heL
agr
ang
ianwi s
pec
tlo ed
esi
gnv
ari
abl
es
e2
10

-
954
n45
a72
V04

a
u
e
s


r
M

EpdpfJSEJ
A
F

X
4FEq4

l
F _a
a F
=0:2=0
(
4.8
0)


a
X a
X
r
4
.5.
2 Example4
.3
Thea ca Ie xpress
io nf or eg radientsob tainedfromE quation( 4.80)isleftas
cxercis
ef o
rt hestudent .leKuhn- Tuckerc o n
ditionsa r
ea ppliedbyi den
t i
fyingthe
T
hisexmnplci
sth
esamea
sExample23.thef
lag
pol
epmMem.Iti
squ
ited
iff
icu
ltt
o

3 315
variousc ase
sb asedont hea c
t ive
nesso fvariouss et
so fcons
traints.


Fort hispr oblemn=2a ndm =4 .T hc rea re2 4 6c
=2 = 1 asesthatm ustb e
inves
tig atc
d p arto f Kuhn
Tuckerc o nditionsgivenbyE q uatio n(4.
73).While
l

i
tz
i
someo ft hesecasesa retrivia ne
verthelessitisaf o r
midabletask.T hisp roblemwas

F z
c
solvedg raphi
c a
llyi nC hapter2andt hesameg raphicalsoluti
o nc anb eexploited10
ident
ifyt hep ticu
larc ase n eedstobes olvedforthesolution.V i
s it
ingCh apter2
ands c n in
gF igure2 .9itc b ei denti
fied a tco n
s ints81and8 3area c
tive( a
s
confirm edby ezoomeds olut
ioni nF igu 2 .
10).Thes olu
tioni sx T=0 .68m a nd
Minimize f
(xl)=6
.05
59E05(x~ -x~) xi=0 .65m.
(
4.7
6) l
f8 1a nd8Ja reactivec ons En emLu
l

S
ubj
ectt
o: Byt hcs a
mer easoningt hemu lt
ip
l
ie
rsassoci at
edwi i n
activec onstr
aints82 d
E
4
't iS
1
3
2and1 34mustbcs ettoz er
o.Th i
si nformationont h
ea ctiveconstr
aints
g
l(X
)
:7.
496 .
x
9E057+40000x1- 9.7418E06(x1-x~) s0 (
4.7
7a)
canbeu sedtos olveforx jxi i sisas y moftwo u ationsi ntwou nknowns.
Thisd no
t however co mplete s factiono f eKuhn-T kerc on
dition
s.1 3
1
ands Jmustbes olveda ndverifiedthattheya re v e.82a nd8 4mustb ee v
aluated
g
2( ')
XI :(
5 +1
.4994E05xr
).
(7+X) 17083E07(Xi-x~) S0(4.77b)
x andv er
i fie
dt hte
a yarel esst ha
nz ero
.
Sec4_5_2.mi sthec od es egmenta tisu sedtos o
lve particularcased i
scusscd
g
3(Xl
'x2
) .909IE-03xl+6.1116E- -0.05(x1-xi
:1 )S0 abovc.Thcp roblemi ss olvcds ymbo
l i
cally.Twov crsio
nsoft hep r oblemares o
lvcd:
(
4.7
7c)
theoriginalpr oblemandas caledve r
sion.1 o bjectiv
ef unct
i on( 4.76
)islJlod
ified
g4(XI'~) :X2 -x1+0
.00
1S0 tohaveac oe
fficien
to fu nit
y.T hiss houldnotc h g ethevalueo fthed esignvari
ables
(
4.7
7d)
(why?).Youc anexper imentw ith c odea ndv e
rifyif isisi ndeed e .Notec
0
.02Sx1S1
.0
; 0
.02Sx S1
.0 (
4.7
8) . valueso ftheL agrangem ultiplier
sd uringi sc xercis
ea ndinfert herelat
ionb etween
2
them t ipli
ersa ndt hes calingo f o bj
e ctivefunctio.Th
n ef ollowingd isc
ussion

K
'uhn

u

i
7
-'
t
u
y

c
k
c
e.

o t


r'
r n
o
n
t

di
i
Non:

s dt

sF
heLa
g
ou
r
ran
La



g
g
ia
r
a
ni
n
s
g
cmL
t
p
li
e
r
sa
r i
n


n
I
r
r

assu
R
m
e
e
fe
st
rri
h
a
n
tt
gt
h
ec o
oes
deh
ol
a
u
sb
tio
ee
no
nru
ft
na
hcc
ndv
as
a
l
ca
u
b
esa
ov
v
e
ai
t
l
h
ab
l
eo
e.
ptimalv a)uesf or d esign
dxi=0.6443m.Thisi
eU
varia
blesa rex j::0.67 73m a n sv eryc loset ot heg ra
phical

}
sol
ution.B eforewec on clude t hesolut
i onisachievedtakeno teoft h
em ul
tipl
iers:

F(Xs)=6.0559E0
5(f-~) +
x =5.2622e-010 d=- 0.
12 70.Ifth em u
ltiplier
sa renega tivee nitisnota
minimum.Thev al
ueso fec onstr
aintsatt heo ptimalvalueso ft hed e
signa r
e8 2=
s p.
4969E0
5x
OXr-9.7418E06(x1-xi))+
f+40 -4. 5
55 3e+ 007a nd8 4= 0.0320.Bothvaluessuggestthatthecons ntsare
ina
ctive.Atl ea
stes olutioni sf e
a s
ible-al lco ns in
tsa r
es atisfi
ed.Thev al
ueo f
1
32(
(50 +1
.
4994E05x
l)(
xf+x+~) 1.7083E07(x1-4)) + stiszer oanditisa1soa na ctivecon
(
1 l16E- 0.05(x1-4
.9091E-03x.+6.1 )+
s
4(X
2- .
x
+0.001)
(
4.7
9)
198 NONL
lNEARPROGRAMMING
4
.5 EXAMPLES 199

c
onsideredact
ive.1es o
lution
however vi
olat
t h
es i
deconsaint
s.'hegrap
hical chi ter
atio
nu suallyegr i en
to fthefuncti
onsatthcc ur
rentvalueoft h
ed e
s ig
n
s
oluti
o ni
sr at
herexp
lici
ti nident
ifyingtheminimuma tepoin e stabl
ishedinthe var
iabl
esisi nvolvedinthecalc
ulat
ions.Thisgradi
entexp ss
ed am atrixi
sca1led
f
ir
stsolut
ion.1e via
lc aseofthemulti
plierbei
ngz er
owhent hec o
nstra
inti
sa c
tive eJ acobi m atrixors impl
yt heJacob
iall.Sophis
ticate
ds cal
ingt ec
hniques[78
]
i
sobse rv
cdw ithresp
ecttot hefir
sttwoc onst
rain
ts e xpr
esss t
res
sr e
lat
ions
.l n employthed iagon
alen e softhi
sm at
r i
xa smetr
icstoscaletherespe
ctivefun
ctions
.
g
eneralct crmsintheseinequ
aliti
esh avelarg
eo rd
ersofmagn itudees
pecia
llyif Theseenaree valua
tedatthestart
ingvaluesofthedesignvari
able
s.Th efunction
t
hereareothrequa
tionsa texpresscon
strain
tsond ispl
acem
en tsasortheli
ke. canalsobes ca
1edi nesamemannera sEq ua
tions(4.8
1)and( 4.
82).Fort h
ef ormer
L
argev alue
se x
ertal a
rgei nf
luenceont h
ep roblemsomucha stoc auselowervalue anexpectedl owerandu ppervaluesofthec o
nstr
aintsar
n ece
ssary.Inthisexer
c i
sc
c
onstr
aintstohavelitt
leornos ign
ifi nccfor eproblem
.Th isisu s
uallyasevere ec onst
raintsw i
llbes c
aledu s
ingr el
ation
ss im
ilartot herela
tionsexpresse
dby
pro
b leminnumerica
li nv
estig
atio
ns.Th eremedyf orisissc
alin gofthefun
ction
s. u a
lit
ies( 4
.82).Th escalin
gf a
ctorforeachc on
sn twillbed etermi
nedu si
ngE
sta
rti
ngv alueort heini
tia
lg uessfort h
ev ar
iabl
es.A s t
arti
ngv a
lueo f0.6forb oth
desig
nv ar
iablesisselect
edtocomputeev a
luesncessa
ryf o
rs c
alingthefunc
tions.
Scallng:C onsid
creo rdero fm agn
itudei nE quati
ons( 4
.77 a
) and ( 4
.77c
). Thes c
alingc o
nstantsfortheeq onsa r
ec al
culate
d
Nume
rica lcalc
ulat
ionsare i v
enbyl arge
rm a
gnitud
e s.lneq
uality( 4.
77c)willbe
ig
noredinrelat
iontotheothcrfunct
ionseventhoughthegrap
hicalsolutio
ni n
dicat
es
isa ct
ive
. sisaf r
equent curr
en ina
llkindsofnumeri
ca lt hniqu.The g
O=293888.
4; g
20=102561
. ; g
12 30
=1 70E-03; g
40
=1
s
tandardapproachtom i
nim i
z e eimpactoflarg
ev a
riati
onsinm agnitudesamong
d
iffe
1tequat
ionsistonormalizeer e
lat
ion
s.Inprac
ticethi
sisalsoe xten
dedt oe 1
efi
rs
tth
reec
ons
tra
int
sar
edi
vid
edt
hro
ughbyt
hei
rsc
ali
ngc
ons
tan
ts.Thel
as
t
v
aria
bles. isisref
erre
dt oasscalin
gl h
evaria
blesands c
alingthefuncli
ons.Many u
ati
oni
sun
cha
nge
d. 1
eob
j t
ivef
unc
tio
nha
sac
oef
fic
ien
tofo
ne.Thes
cal
ed
c
urren
ts oft
warewi1
1s ca
let h
ep rob
lmw itho
utuserinter
vent
ion. p
rob
lemi
s

S lin
gVariab
les:1eprcs
enccofsid
econs
trai
ntsinpr
oblemfo
rmul
ati
ona l
10ws Minimize 1 -
4 (
4.8
3)
anat
ura
1dcfi
niti
onofsc
ale
dvari
abJ
es.Theuser
-defi
n e
duppe
randlow
erboundsare
us
edtosca
leeachvar
lab
lebetwe
en0 d1 .There
fore 8
.
:2.5509~+0.136lx.-33.148( -xj) O (
4.8
4a)

-X~ I
f2:(
0.
88+1
.46
19x
)+x+) 166.
( (
5641i-x~) ~ 0 (
x 4.8
4b)
=--'; x
:=scaledithvariable (
4.8
1a)
Xi-Xi

-x
:
)+ 1(x1-x~) ~ 0 (
4.8

=
x
X;
(. X: (
48
Ib)
:1.086
8x.+0
.34
82-28.
464 4c)

I
ntheori
gina
lp ro
blemEquat
ion(4.
81b)isu
sedt
osub
sti
tut
eforth
eorig
ina
lvar
iabl
es C4:X2-XI+0.001~O (
4.8
4d)
a
fte
rwhicht heprobl
emc beexpre
ssedinte
rmsofsca
ledvar
iab
le.Analtem
ate
f
ormul
ationistouseon1
yt heup
perv a
lueofth
esid
econst
rai
nttosca
1ethcdes
ign 0
.02~ XI~ 1
.0
; 0
.0 ;x2~ 1
25 .0 (
4.7
9)
v
ari
abl
e:

s
i=x
i/4
e (
4.8
2a) Sec4_5_2_scaled.m: The c ode( couldh av
eb ecn par
to fS ec 4
_5_2.m)
in
vesti
gate
st hes cal
e dproblemi n sameway tt h
eo ri
gina
lp roblemwas
x
j=x
j (
4.8
2b) in
vestig
a .P ri
marilyisexpl
o i
ts inf o
rmatio
nfromt h
egraphi
calsoIo n.1
tis
expe
ctedtt hesolutio
nf o
rt h
ed esig
nv aria
b1eswil
lbet hesamca lth
ought h
e
While i
slim
its h
ighersc
aldva
e 1ueto1i
tdo
esnotse
tel owersc
aledvalu
eto mu1ti
pli
erv a
1uesareexpecte
dt obed if
fere
n .
tFromt h
einform
ationineWorkspace
zer
o.F reexampleo
o fissect
ionth
erei
snon e
ces
sityforsca
lingthedesig
n windowt heoptimalvaluesforthed es
ignv ar
iabl
esarex =
i 0 .677
4a ndx =
i 0.6445.
var
iabl
essinc
ethei
rorde
J'ofm
agnitud sone
ci whichi
sexa
ctlywhatsca
1in
ga t
lempt
s AI
lo f c ons
trai
ntsa r
efeas
ible.Theo ptima
1v a
luesofemu1ti
plier
sh avechang
ed.
toach
ieve. The isnol oogeraz e
rom ultipIie
r-ith astumedp osi
tive
.Th e
reiss t
il
lo ne
mu1tip
lie
rw ithan egativesigni mplyin
gt hep o
inthasn o
tmet Kuhn- T
u c
ker
Sca
lin
gt h
eC on
strai
nts:Sca
lingoft
hefun
cti
onsineprob
lemisu
sua
llycri
tic
al con
ditio
DS.Actuallyi
tshouldha vebeenantici
pateds
incechang
ingo flh
es i
gl
lo ft
he
f
orasuc
cess
fulsol
uti
on.Nu
meric
altech
niq
ucsusedino
pti
miz
ati
onarei
ter
ati
ve.In mul
tipli
erisnotp o
ssiblewithscalin
g.
200 NONL
lNEARPROGRAMMING PROBLEMS 2
01

Th er
eiss il
tIt hematte
ro finconsisten
cyb et
w nthegra phic
a ls ol
utionandthe 4
.MATLAB
Demos S
ymb
oli
cTo
olB
ox-
Int
rod
uct
io.o
n n
lin
ere
sou
rcei
n MATLAB.
dis
sati
sfac
tionoftheKuhn- Tuckerconditi
ons.Explo
ringthisp a
rticularexamplehas M athWork sIn.
c MA.
beenveryto r
turo
usbuthasp rovid
edeo ppor
tunit
ytoexplorei mpor ta
ntbutrela
ted 5
.B u
r denR.L .andF a
irs
e J.0.Numerical ' si
s
.4 t
he d
..PWS_KENTP ub
lish
ing
qua
ntit
iesI ikcs c
alin
g.A n otheri mporta
ntc ons
ider
ationi s e s co
pco fthe Company Bost
on.( 1
989)
Kuhn-Tuckerc o
nditi
ons.Theseconditionsapponlyatreglllarpoints. 6
.F oxR.L..OptimiwtionMethodsforElg
I i
neerin
gD e
sig.A
n ddison-W
esleyR
eadig
n
MA.( 1971)
RegularP oln
ts:Regularp o
ints[8]ari
sewhene q.
uali
tycon
str
ainsh
t (X)ar
e 7
.V d erpl
aatsG.N .N/lmeri
calO p
timi w
t i
onT ec
hlli
quesforElIgin
eer
ingDes
igl
l.
P s
ent eprob1e
m .le
yara1s
oe x
tende
dtoac
tivein
Iityconsnts(
pseu
do McGmw- Hi11NewY or
k.( 1
984)
equa
1itycon
s n
ts)
.Kuhn-Tuckcrcond
iti
onsar
cv a
lidon1yf
orregu
1arpo
ints
. l
e 8
.A ror
J
a .S.lntrod
ucti
ontoO p
timaIDes
ig .Mc
n Gmw- H
il NewY o
rk.(19
89)
twocsscn
tia
1feat
uresofare
gularpo
intX.are .Kuhn
9 H.W.a n dTuckc
rA.W. Nonlu
l earProgram
ming.P r
oceedin
gs01th
eS e
cond
Be
r k
el e
ySymposiumonM athem
aticalS t
atis
tic
sa l
ldProbabi/
i
.J.Ncyman( c
d.
)

ThcpointX i
sfe
asi
ble(
sat
isf
ie l
saIc
ons
tra
int
s). Un
i v
crsityofCalifo
rni
aP r
css195
1.

. Th
cgr
adi
ent
soft
he ua
1i
tyn
str
in
t l
s wcIa
sth
eac
tiv
ein
l
it
y
c
ons
tra
int
satX.mustf
ormal
in i
e nde
pen
den
tse
tofv
ect
ors
. PROBLEMS

Int h
es ca1edproblemo fExamp1c4. 3t h
cc on
strain
tsgIand8 3a reactiv
e.The (
In many o
fth
epr
obl
ems be
1owyou a
rer
equ
ire
dtoo
bta
int
hen
ume
ric
al
solutinx
o j=0 .6774andxi=0 .6445i sfeas
ible. The gradien
to fgI is Vg.= s
olu
tion
.)
[-37.631435.454T.Thegradi
e ntofg2i =
sVg1 [ -34.3
11 930.47
86]T.lta p
pear
s
thatthetwog radi
cntsarca1mos
tp aral
1cltoeachothr
.T hisisalsocvidentinth
e 4.
1 Defin
ctwon onli
nearfu
nct
ion
si ntwovari
abl
es.Findth
cirs
olut
iont
hrou
gh
graphic
als olutio
n. The gradi
e ntst h
erefo
rca ren otI ine
arly indepcndcnt- cont
ourplo
ts.
Kuhn-Tuckcrc o
nditio
nscannotb ca p
pliedatthi
sp oin.
tT hisdoesn otmeant h
e 4.
2 Forthcfunc
tion
si nPr
oblem4.
1o b
tainthegra
die
ntsofthefu
ncti
onandU
I
pointisnotal oca
lminimum.Th risgra
phicalevidencethati
tisi ndeedso. Jac
obian
.Confirmthemusi
ngtheSymb
o l
icMathT oo
lbox
.
KuhnTuckera r
et heon1yav ail
ableforma1condit
ionsf orrecogni
tiono fth
e
4.
3 D
efineth
edes
ignspace(cho
osessi
deco
nst
rai
nts
)forat
wo-
var
iablep
roblc
m.
optimum v a1
ues.Iti sunivc
rsa1lya pp
liedw i
thoutr ega
r dtor egu
lari Some
.
D
cfinetwonon1
in
earf u
ncti
onsintwovar
iab
lesth
atdonothav
eas ol
utio
n
addit
iona1con
sidcrat
ionssh
ouldb ckeptinmind[ 8
].
w
ith
inthi
sspa
ce.Gra
ph i
ca1l
yconf
irmthr
csu
l.
t
4
.4 D
efine ades
ignspa
cef o
rat wo
-var
iab1epro
blem.Def
inc two n
onli
nea
r
Ifequa
lityconstr
aint
sa represen
ta nda l
1o fei nequa
1it
yc ons'
ain
tsare f
unc
tionsi
ntwova
riab
les h
aveatle
asttwoso
lut
ion
swith
ines pa
cc.
ina
ctiee
v nt hep oin
tss at
isfy
ing cKuhn- Tucker condi
tions may be
4.
5 Defin
ean onl
inea
rf u
nctio
no ftwovar
iab
les.Chooseacontourv
alueanddraw
minimum maximum orasadd1epont
i .High
cr-orderconditi
onsareneccss
ary
thcco
ntour.Id
cnt
ifyapointonthccont
our.Calc
ulatet
hev a
1ucoftheg
radi
ent
toidc
ntif
yt h
ct y
peofs o
lut
ion.
atth
atpoint
.Drawthegrdie
ntatth
epointusi
ngthecomputedval
ueCa
lcul
atc
I
ft hemu1ti
plie
rso ftheactiv
ei neq
u a
1it
yconstrntsar eposi
tivt
e hep oi
nt
canno
tb ea10ca
lmaximum.I tmayn otbealocalminimume i
the
r.Ap oin
tmay
Hess
i ca bovepoin.
t
bcamaximumi f mul
tipl
icrofana c
tivci
nu alit
yc o
n s
trai
ntiszer
o. 4
.6 U
singth
erel
nti
oninEqua
tion(4
.2)
3 es
tab
lis
h tthegr
adi
enti
sno
rma
ltot
he
t
ang
ent[ap
hysi
calin
ter
pret
ati
onforE
quatio
n(4
.23
)].
4
.7 D
efineano
nli
nearfu
ncti
onof va
ria
ble
s.Chooseapoi
ntinth
ed e
sig
n
s
pac
e.Fideg
n rad
ientof f
unc
tionatthep
oin.
tCa1
cul
ateth
eH e
ssia
n
REFERENCES
m
atri
xatt
hesamcpont
i.
1
.Stcn
i S.K .Calcu
lusandAna
lytic
a lGe
omet
ry.McGmw-H
I
i NewY or
k.(19
87) 4
.8 Exp
rcssth
eTayl
orser
iesexpan
sion(qu
adra
tic
)o fth
efunc
tionf
tx) (2-3x+=
2
.Hoste
tle
r G.H .San
tinM.S
a .a ndMontnlvoP.0.Ana
lyti
cal
.N wn
eri
cal.and
x
2)sinxabou
t po
intx= 0.7
07.Confirmyourre
sul
tsthrou
ghtheS
y m
bol
ic
C
omputation
alMethodsforSci
enceandEngin
eering.Pre
nti-Ha
1I
.E n
glewoodCI
i
MathToo
lbox.P
lottheor
igi
nalfun
ctio
nandea p
prox
imati
on.
N
J.(1991) 4.
9 Expandth
efu
nctionf
tx.y)=10(1-x22+(
) y-2
)2qu
adra
tia
c1l
yabou
ttep~int
h
3
.MolcrC.andCosta.P
.J.
SymbolicMathToolbox-forewithMATUB-UsersGuide (1
1.Howwi
) l1youdisplaythein
for
mati
on?Drawthec
ont
ourso
ftheo
rig
ina1
Mat
hWor ksInc
..MA. fun
ctio
nandtheappr
oximati
on.
5
202 NONL
lNE
ARPROGRAMMING

4
.10O
btainth
esolut
iongr
aph
ical
lyforthe
c a
sewhenEqu
atio
n(4
.10
)isad
dedto
p
roblemdefin
edb yEqua
tion
s( 4.
36)(4.
39and(
) 4.3
7).O
btainesol
uti
on
u
sigeS
n y
mbolicMathToolbo
x.
4
.11O
bta
incs
olu
tio
ntot
hco
pti
miz
ati
onp
rob
lemi
nSc
cti
on4.
4.
4us
ingMATLAB.
4
.121
nSe
cti
on4
.51o
. bta
int
hec
oef
fic
ien
tsf
oraqua
Cf
i
ttoep
rob
lem
.
4
.13 Useanexampletoshow optimumvalue
sfort
hedes
ignva
ria
ble
sdonot
cb ge t
heobj
ecti
vef
unct
ionism
ult
ipl
iedbyaco
nst.Prov
ethesamei
fa
co
nstanti
sa d
dedtoefun
ctio
n.
4
.14 Howd o
esscaIi
ngoftheo
bje
ctiv
efunc
tio
naffc
ctth
evalu
cofem u
lti
plie
rs?
Usca
mu
lti
p
ncxamplct
li
s?
oi
Checkw
n
f
i
e
t
rt
h
ha
e s
nex
a
u
m
lt
p
.Howd
le
.
oe
sscal
ingt
hecon
str
ain
taffe
ctthe
NUMERICALTECHNIQUE8-
THEONE-DIMENSIONAL
PROBLEM

'
heo ne-dim
ensionalu ncon
straincdo pti
mizationp ro
bl emisofteni ntr
o d
uced d
sol
vedn umer
icallyinmostc o
u rse
sa td eaIwithn ume
ri c
ala n
alysis
Jtechni
ques.It
app
earsi nd
irec
tlynotablyasfi n
dingt h
er ootofan online
are q
ua t
ionwhichi se
samea ssat
isingeFOCf o
ra nu nconst
rainedoptimizatio
np roblem.Twoo fthe
popart ech
niquesareeNewton-Ra p h
sona ndeb iscct
ionte c
hnique
.' e
h y E
int
roducedi nS ect
ion5 .2t op rovide ac omparisonw itht h
em ethodsu sedi n
opt
imizati
on.I ne ngi
neeringd csign es i
ngle-v
ariab
leo ptimizati
onp roble mis
probl
ya vialiyb
t utone- dimensionaloptimizat
ioni sac r
itic
aIcomponento f
mt iva
riab
ledesi a ndisd iscussedinSon5. .M
3 eanwhilet hecIass
icalroot
fin
dingm ethodsi den
tifie
da bo vedon otp la
ya nys ignif
ican
tp artinn umerical
opt
imizatio
nt echniq
uesa stheya rec o
nsideredcomputationa
llye xpensiveandn ot
rob
ustenougho veralargecIas
so fproblems.Ani mportantcon
sidcratio
ninno n
Iinear
des
igno pt
imizat
ionisthatduringtheini
tia
litera
tion
s
whenyoua r
et yp
icall
yfaraway
omes olu
tionaccuracyc b cd edf orspeed.Int hes
ei tera
tion
sitisa lso
imp
ortanttomovet hr
oughtocn cxlitcr
atin
o instca
do ffal
teri
ngatec ur
rentone
.
These
.cri
teri
ah a
v e q
ui dthatthco ne
.dimensionaltechniq
uesb esimpleinconcept
asw ella se asil
yi mplem
cnta b
le. Two d iff
erentt echni
quest hep olynomial
approxlati
onandeg oldense c
tionprov
idep opu
l a
rs upp
ortform ostoptimi
zation
soft
w e.Veryo fte
nt hetwot echniquesarei mpl
em en
te dincombination.The yare
dis
cussedinSection5.2
.

203
204 NUME
IC
ALT
ECH
NIO
UE5-T
HEO
NE.
OIM
ENS
ION
ALP
ROB
LEM 5
.2 SOLUnONTOT
HEP
ROB
LEM 205

5
.1 PROBLEMDEF
lNITION Thesecon
dsolut
ionisus
efulo
nlyifex
pressi
on(5.3
)isanac
tiv
ec o
nstra
intOth
erwise
th
esolu
tiont
oExample5 1wi
. l
1preva1
i.lefin
alsolu
tio
nchosenensu
sex
press
ions
I
nordertocon
nectw it
hthed i
scu
ssionslat
erth
eone-
dime
nsio
n a
lv a
riab
lewil
lbe 5.
( 1
)(5.)a
3 resat
isf
ie.Ag
d ra
phic
a li
nves
tigat
ioninenexts
ectionsho
uldil
lus
tra
te
i
den
tif
iednsins
te a
do fX o
rXIInthefol
1owingch
apte
rsisisa1s
or e
fer
redton
s th
isfe
atuec
r 1ea
rly
.
t
heonc-
dime
nsionalste
psi
zec o
mpu
t a
tion.

Ex
ample5
.1 Thi
sexamplei
ssi
mil
art
oonei
nCh
apt
er4
: 5
.2 SOLUT
lONTOTHEPROBLEM

Thesol
uti
ont
oExamples5.1 d5.1ai
sexaminedgrp
hic
aII
y.Nex
tthec
1nssi
calr
oot
Minimize f
()=(_1
)2(
-2)(-3
) (
5.1
) fi
ndin
gteciq
ucsofNewton-Raphsonandebisec
tio
nmethodar
epres
ente
d.These
M f
ollow
edbythepoly
nomialapproxi
mati
ona ndeg o
ldens
ect
ionmcth
od.
S
ubj
ect
to: 0SS4 (
5.2
)
5
.2.
1 GraphlcalSolutlon
Theproblemdoesnotrepresentanyrealdesign.Itwasconstructedtohavemultiple
loc
al minimums w ithint hea reao finterst
e.E xpression(5.1
)r eprcsentsan Theexamplehasal
readymadei t
sappear
anc
einC ha
p t
er4.Figu 5
.1isapl
otofth
e
unconstrninedproblem.Thesideconstraintsac
c ompanyal
1problcmsinthisbookto ob
ject
ivefunct
ioninEx ample5 .I
.1 tals
oinclu
descs o
lut
ionExample5 .1
a.I
f
conveytheideath
attherea r
enotruIyunconstr
ain edproblems
.Sideconstraints
also ex
press
ion( 5
.3)rep
resentsani nc
qua
lityco
nstr
aintthefea
sibl
er e
gionforone
-
defi
neana cceptabledesignregionforallproblem s
.S ect
ion5.2w i
llexplorethis va
ria
blefunct
ionsi
sq u
ited if
fer
entfromth
et w
o-vruia
bleproblem
sencoun
teredi
n
problemthroughthcvariousmethodsmentionedcari
Ier.

5
.11 ConstralnedOne
. -DlmenslonalProblem

Theo n
lycons~raint t
hatExample51
. asin
gle-
vari
abl
eproblemca
naommodateis
i
c
n
o
e
q
n
u
s
ali
i

con
tAs
n.
s t
i
r
n
a
g
i
le
n
-
.
tFromt
va
riabl
ep
hcp
ro
bl
r
e
e
vi
mc
ou
n
n
sc
no
ha
th
p
t
a
c
v
rthe
rec
e ua
a
nb
l
it
emo
ycon
st
o

ra
int(Ch
a
ncs
pte
u
r4
c
)
h
.
" '
/
J

Inaconst
rnindm ultivar
iabl
eo p
timiza
tionproblemi
twil
lo f
tenbeneces
saryl
o.fi
nd
es tepsiz
e suchecons intj
ustbecomesac
tiv
e.Itispo
ssibl
etodefme 3
g
()
pro
blem.

{}()-

'h
Example5
.1a
c
ons
tra
lne
dminimum
Minimize f
(.
)= 1
( )2(
-2)(-3
) (
5.1
)

S
ubj
ectt
o: g(
):0
.75
2-1
.5
IS0 5.
( 3
)

OSS4 (
5.2
)

I
na c
tualappl
icat
ionsi
tismoreiI k
elyatcxp
ress
ions(5.
1)(5.
3)e
sta
bli
shtwo feiI~ .r~"
1 .

p
roblemsth
atprovid
edi
ffer
entsol
utio
nstocste
psiz
c.Thefir
sti
sesolu
tiont
o
-

.
e
xpre
ssion
s( 5
.1)and(5.
2)whichisthesamcasExnmplc5.1
.Thesecondisth
e H J " ' l g l o b a l~Inlmum
s
olu
tionto
;
.
. unco
nstr
ainedminimum
-
2

g
(.
):0
.75
2-1
.5
1=0
0
.5 .6
1 2
a
3
.5 4
5.
( 3
)
OSS4 (
5.2
) g
ure5
.1 G
rap
hic
als
ol
ul
io
n:E
xam
ple5
.1
.
2
06 N
UME
AIC
ALT
ECH
NIQ
UE
S T
HEO
NE.
OIM
ENS
ION
ALP
AOB
LEM
5
.
2SO
LUT
10NTOT
HEP
AOB
LEM 2
07

:
:
t
z;
;:;3
21
i2
22
21
1;


Theaboves e
quen isf a
irl
ys tand
ardinitera
tiv
et ech
nique
sf ormanyc la
sse
so f

1FZZ;itmt p
r
S
l
o
e
ble
m
p1i
s.I
n
di
ta
ca
t
l
e
s
oc
st
a
h
pl
ep
u
r
r
i
e
st
mar
h
ee
yi
f
ss
e

ncef
rco
o
rm
fite
r
o
a
s
to
t
iv
ft
eme
h
et
o
e
chniq
uest
ds-thes
of
t
ar
o
t
l
i
n
lo
wi
gsol
nt
ut
h
i
i
sb
o
n
ook
.Thi
.
s
i
sani n
it
ia
lg uessp r
ovidedb ytheuser10slar
tthei t
era
tiv
ep r
ocess
.Thei ter
ati
ve
E
xam
ple
5.1 p
roces
sisc o
ntinued10thesolut
ionbycalcu
latin
gc han
gesinthevaria
b le(.
1
.)
.The
v
alueofth
ev a
riab
leisupdate
d.C onv
ergenceischec
ked.IfEquat
ion(5.
5 )issa
tis
fid
e
t
henthesolut
ionhasb eenfound.Ifconver
ge n
ceisn o
ta ch
ieved t h
eu pd
ated

=2.6484; f*=0
.61
95 (
5.4a
) v
alueprovid
esthev alu
et op r
oceedwith n ex
ti t
era
tio
n.Ofc ourse .
1canb e
Exa
mpl
e5.
1a c
alcu
late
dinmanyw aysandN ewton-R
a p
hsonisjustoneofthewayse stabl
ishthe
I c
hangeinthevar
iable
.

*=2
.52
75; f
.=-0.5815 j
l

(
5.4b
) Calc
ulatlon01A (Newton-Raphson):L et be t hec urrentvalu
eo ft he
v
ari
able
.Iti
sa s
s u
medtha
tE q
uati
on(5.5
)isnotsati
sfiedat isvalueo
fthevar
i a
ble
e a
( s
onforustoit
er
at
e).Letabeaneighboringvalue.Ideallywewouldlike10
5
.2.
2 Newton-RaphsonTechnique a
chieveconv
ergencea
tthisval
u( ev
en wea reawa rei
tr nig
httak
eu sse
v e
ral
i
tcr
ati
ons10ach
ievcconve
r g
nc
e).UsingTaylo
r'st heoreme xp a
ndedtothelin
ear
TheN
cwt
on-
Rap
hso
nte
chn
iqu
ea
lsor
cf
er
rdt
oasN
cwt
on'
ste
chn
iqe
u i
sag
rad
ien
t- t
err
nonly
b
asdnt
c ofi
ndi
ngcr
ooto
fas
ing
lcn
onl
ine
are
q o
n.R
ootf
ind
ing
l
l itU122ZZ;::rh ee
qua
ti ;

a :
;
L (
)=c
t(
d
+)=()+25A=0 (
5.
6)

()=0 (
5.
5)
A=1=-' c b
(o

.
)I (
5.7
)
w
her
()i
sanon
lin
eareq
uati
onintheva
ria
ble
. Id
l
l
ete
chn
iqu
ehasad
dit
ion
alfea
tur
cs:

Ithasag m
etricu
ndeinn
ing
. F
orEqua
tion(5
.7)tobceff
cct
ive
egr
adie
nto fth
ef u
nctio
nshoul
dn o
tb ez
cro
.lt
I
tustheTayl
orser
iese
xpand
edi
In
ear
Iy
. i
sa1
soin
evit
abl
ea tcha
ngesinwillbela
rgew he
rectisfl
at
andsmal1whe
rethe
I
ti
site
rat
iv
e. s
l
a
v
o
o
p
ei
i
sl
d g
a
r
i
o
g
n
e
.F
sw
o
h
rt
er
heN
eth
e
es
w
l
t
o
o
p
n-
ei
R
ss
a
m
p
h
a
s
l
onm
lT
. h
e
i
th
si
odt
sas c
ob
ri
o
ee
u
f
sd
f
c
i
c
s
t
a
d
i
v
v
et
an
h
t
a
ei
g
t
e
eo
ra
ti
fi
o
nss
smc
h
t
o
h
o
u
l
d
d
.
th
I a
sth
epr
ope
rtyo
fqu
adr
ati
cco
nve
rge
nce
. F
igu
re5.
2iIu
l st
rat
esth
egeomet
rica
lcons
truc
tionoftbetech
niqu
catthepoi
nt =3.

Anyi
te
ra
ti
vct
cch
niq
uea
ddr
css
ingE
qua
tio
n(5
.5)c
anb
esu
mma
riz
eda
s Example5.
1 TheNewt
on-
Rap
hso
ntc
chn
iqu
eisa
ppl
iedt
oth
efi
rst
-or
derc
ond
iti
ons
(FOC)o .1
fExample5.
G
enericAlg
oritl
rm(A5
.1)
St
ep1.Assum

S
tep2.C a
lcul
ate.
1 M
ini
miz
c
f()=
( 1)2
(
2)(-3
) (
5.
1)
S
tep3.U pd
ata
e =+.
1
I
fconverge
d(()=
:0)e ne
xi
t S
ubj
ectt
o
: 0SS4 (
5.
2)
I
fnotconver
ged((
: :0
;
f )en a
TheFOCis
gotoStep2
p1
Ii
I 0b
edo
wnl
oad
edf
wmt
h
cwe
bsi
l
e i
nd
ic
al
edb
ybo
ld
fn
ccs
nn
sse
r
ifI
yp
e.

{ ==

l
-2
2



)



(
-

)
3
)+(



1
)
3)
+(


)
l r
-
2
(5
.8
)
208 N
UME
RIC
ALT
ECH
NIQ
UES-T
HEO
NE.
OIM
ENS
ION
ALPROBLEM
5
.2S
OLUTlONTOTHEP
ROB
LEM 209
1
0
'
hec
odeSe c5_2_2.mrui
resf
iveit
erat
ion
st oco
nverg
et h
ev a
1ueoft
Ito
1
.0E8(co
nsi
dere
dz e
rohe
re.Tsva
) Iueof1.0E08i
sterm
edthecon
verge
nce(
or
stopp
ing)c ri
terio
n.Thca ccc
lerationo fconvergenceo rrat
eo fconvergencet othc
8 solut
ionisf o
r m
allyd e
fincdinmanyd iffe
rentways.Oneo fthcwaysi stomonitorthe
ra
tioo f (+6) 1
( ).Ano thcristrack6.l na ppl
yinga ndu nders
tanding
numericaIt e
chniquesitisimporta nttodevelopa nins
tinc
ta ndfeelforthenumbers
6
correspondingtovariousfuncti
on s ei tera
tio
nsp ro
gres
s.Thes peedo re q
uality
ofc onvergencecanbeg augedbyes hi
ftint hedccimaIp oi
ntint hequanti
tyo f
int
erestt hr
ought heitera
tio
ns.C o nside
rt hevaIueo ft
Ithrought hef i
vei te
rati
ons
[4.00000.8750 1040
0. 0.0023 0.00
00].Defin
itelyec hangcsina ren on
linea
r.
TheNewton-Raphsont e
chniq uecanb edirecUyappliedtoE quat
ion( 5.3
)-after
a
I lth
emeUlodi sdesignedtoo p
era teonthesekindsofproblems.I
tislef
tasa nexe
rcise
for r d
er.l ereisav eryi mportantfea
tureo fmosti tcr
ati
vet echn
iquesthat
2 exp!ore m tipl
es olutions-asi s ec aseo f Example 5 .1
. Rerun t hec ode
Sec5_Z2.mw ithas tart
ingvaIueof0 .5f ra
o .
.Afters ixitera
tio
nsconvergest o
ev aIueof1 .0whichi salocaIminimum.Whe rewouldi terat
ion
sl eadifthesta
rt
v
t
a
Iuei
wo-va
s1
ri
a
.
b
l
5?Thesea
ep ro
blem.I
nsw
nat
e
y
r
p
sa
ica
r
Ie
e s
ngin
yt
eer
os
i
n
g

gd e
si
r
g
ap
np
hi
r
c
a
o
Il
bl
yi
em
nao
s
igni
n
f
i
e
c
-o
an
te
rmaybea
xp
erience
andi ntu
itio
na rerequiredtor ecognizeUlescsitua
tion
swhenc yoccur.A h e
althy
S picio
no ft h
es o
lutionm ustaIwaysbei ntheb ackofone'smindwhene xp
loring
-2 multi
variablep roblems.I n summarym ostiterat
iven umericalt e
c hn
iquesa re
0 0
.5 1
.
5 2 2
.5 3 3
.5 4 designedtoc onvergetosolu
tio1Sthatarec/ose10wheret heystart
from.

F
lgu
re5
.2D
eve
lop
men
t01N
ewt
on.
Rap
hso
nte
chn
iqu
e.
5
.2.
3 BisectlonTechnique

JeT echnlque:Twoi te
rat
ion
sareshownhere.Thec o
mpleteappli
cati
onisdone Thisisanotherpopulartcch
niquetof in
d t ofafuncti
on.I
tisa lsoc a
Iledabinary
th
roughMA11ABcodesecs-2-2.m.Thecodeu sessym
boliccalc
ulatio
n.Inrumino searcho ri n
terva
Iha Ivingp roc
ed u
re.U nli
ket heNewton-Raphson method t h
is
codethefig
urewindowd
ispla
ys r na
tionoftheit
er
ati rave
l 60; proceduredoesn ot qui
ret heevaIuati
ono feg r
adientofef unctionwhoser o
ot
Al
soshowni sthec h
angein6withe achi t
era
tio
n. Thei t
era
tiveresu
ltsare i
sb eingsought.Oneo fthereasonsthemethodi sb e
ingi ncl
udedist ocomparei twith
summ
arizcdinat a
bl tec
e8 n
d.Theca1
cula
tionsreq
uircthegra
dientof()
: thegoldens c
ctionmethodd iscuss
e dla
tcr
.Then umericaltec
hn i
q uei nismethodi s
basedonthe o ning t her
l
t(orzero)ofafunctioni strappedo rboundb etween
'()=2(-2)(-3
)+4
*(1
)*
( 3
)+4
*( 1)*(-2
)+2
*(1
)^2 apositiveandan e
gativevaIueoft hefunction
.Th ea ctua
Is o
lutiona c
hievedbyE
methodisa nintcr
valinwhichez eroorthesolut
i o
nc anbelocat
e d
.Thcf ina
Iinte
r v
al
I
te
rat
ion1
: i
st yp
ilIyd ctcrminedtobeav crysma Iv
l alu
ecallcdthctolerance oftheordcrof
lOE-08.S c ei sisar ootf i
ndingp rocedurwhena
e ppliedtoo ptimi
zationitis
=3; f(
)=0.0; (
)=4 t
I
'()=16 6=-0.
25 applicdto g ra
dientof o tt iv
ewhichwei de
ntific
da s (
.)Eq uo n(5.5
).
Establis
hingtheminimumo ftheob j
ectiveisther
e b
yt ran
slat
cdtol ocatinger ootof
t
I(+L
1
.)=0.875-notc
onv
erg
ed
atl
eas
tan
oth
eri
ter
ati
onn
ecc
ssa
ry eg radientf un
ctio
n.I tisp os
siblct od evcl
opab isec
tiont cchniquef ordire
ctly
I
te
rat
ion2
: handlingtheminimizationproblem.
Themethodr uirestwop ointstos t
artsaynandbThev aIueo fItatE
point
s must b eo ppos
itei ns ig n.
' hescc an be t h
es idcc onstrai
ntso ft he
=
2.7
5; f
(1
.)=-
0.5
742
;
(.
)=0
.08
75;
.)=
9.2
5; = O
.4
6

one-dimensionaIoptimi
zationprob l
em.ltisassumed a tIcastones ol
utio
ne x
ists
in i
si n
iti
i nter
val.Duringe achitera
tionisinteva
r 1ishaIvedwithemidpoint
(+6)=0.1040
no
tco
nve
rgd
e a
tle
asta
not
hcri
ter
ati
onn
cce
ssa
ry
ofthei n
terv
alr epl
acingcit
her orb whilek c
c pi
ngt hcrootst
illt rappc
db ctween
210 N
UME
RIC
ALT
ECH
NIQ
UES-T
HEO
NE-
DIM
ENS
ION
ALP
ROB
LEM
5
.2S
OLU
TIO
NTOT
HEP
ROB
LEM 2
11

a
mct
ionv
alu
eso
fop
pos
ites
ign
.Th
eitemtiveMmiquei
sex
pre
sse
dast
hef
oll
owi
ng
a
Igorithm(
ase
tofp
roc
edu
res er
epe
ate
d). 5.
2.4 PolynomlalApproxlmatlon

A
lgo
rit
IJm
!orB
ise
cti
onM
etl
lod(
AS.
2) Theme odi ssimp
lcinc once pt
.Insteado fminimizingad iff
icu
ltf unc
tiono fone
vari
ableminimizeapolynomiala tappro xi
matesthefunctio
n.Thco ptimalvaIueof
S
tep1
: Choose a
nd t
ost
artL
. et
ev ariab
l m ini
mi z
e sthep olynomialist hcnconsidcredtoa pproximatcthe
S
tep2
:Se
t= + ( )
12 optim
alv aJucofev aria
blef ort
1Jeorigina
If un
ctio
n.Itisr a
ref o
rt1ed
J cgre
eo ft1
Je
S
tep3
:If(
.
)=0
.0-ConvergedS
olu
tio
n-e
xit approximatingpolynomia
Jt oe xcecdthrec.A q ua
dratica pp
roximationiss t
a nd
ard
les
sei rddegr
eeisw r ante
d.Itisc1eartha
tscriouserro
rsina pprox
imationare
se If(b-n)<l
OE04-t ol
era
ncemet-e
xit
expectedifep oly
nomialist osimulatet h
eb eh
aviorofeo ri
ginalfuncti
ono vcra
E
lse If(.
)*()
>0.0; en .
l g
er angeo fvaIu
eso f v ar
iabl
e.M a the
maticalt1Jeoremse x
ist j ustif
ya
Elseb quad
raticr ep
rese
nta
tiono ftJef
1 un
ction wit
hap rescri
b e
dd egreeofe r
rorwitJi
Ina
got oS
tep2 smaJln eighbor
hoodo ftJem
1 inimum.What i sensuresi s att1Jepolynomial
approxima
t iongetsbette
ra s eminimum i sb ein
ga pproach
. E xample5 .
1.
Wec
ons
ide
rExample5
.1whichi
sre
pro
duc
edh
ere repf
u cedforconv
eniepceisu s
edf ri
o I1ustr
atio
no ftheprocedur
e.

Example5.1
Minimize f
{)=(_1
)2(
-2)(-3
) (
5.1
)
M
ini
miz
e f
(.)=(_1
)2(
-2
)(
3
) (
5.1
)
S
ubj
ectt
o: 0S 4
(
5.2
)
ThcFOCis S
ubj
cctt
o: 0SS4 (
5.2
)

Aquad
rati
cp o
lyn
om JP
ia (
)i
sus
edf
ort
hea
ppr
oxi
mat
ion
.Th
isp
oly
nom
iali
s


(
e
xpr
essedas
(
5.
8)
P
()=bo+b+b2 (
5.9
)
2

S 5_.3.m
: This ABc oder u
nsth
eb i
sec
tionmethodon p l
e5 .1
.It Twoe lcmentsn dt o u nderstoodpriortot Jef
1 ol
1owingd iscus
sion.l efi
rst
i
I
lust
rat
est
hetrapp
ingofemullrnumbyth
etwov a
lue
sone it
hers
ideOfthemot. conccmsee va
luationoftJep
1 olynomi.andt Jes
1 econdc on
c ernsei nc
lusio
no f
le
1 7ite
rat
ion
sforatole
ranceo .0E04whicht
f1 e
rmi
nate
dt h
cp r
og r
am. expssion(5.2)i ned is
cussion
.Thcp olynomiaJisc omple telyd e
finedift he
Compa h iswith5i t
cra
tisf ortheNewton-Raphson1 hod.forab ett
crsoluti
on. co
effi
ciensbo b
t .andb 2arcknown.Tod etermine m.t 1Jreed atapoin
ts[ (
1'/
.)
U l owernumbero firatJon
sc be t o qu Ji
a t
yo fir' nnat
ion edt o (
.'!
2 z
).( 3
. 1
3)]arcgenerat
edf romEquation(5.
1).Thiss e
tsupai Incarsystemofthree
upd ed v ariab
lechangcncg radie
nt-ba
scdi n
forma tio
nu scdint hc equ
ationsineunknownsby q uiringt1Jeva Jucsoft 1Jef u
nctionandt he
Newton-RaPIEBontEChmquel smoresophist
icate
d.thou
ghcg radientcomputationis polynom Jm
ia ustb et hesamea tt Jet
1 1
Jrcep o
ints.Th es olutiont otJi
1 ssystemo f
anadditi
onaJw orkload. equ
ationsis v alueso ftJcc
1 o
effic
ients
. 1 co
ns i
derationo fe xpr
ession(5.2
)
T Kprobl emdescrib
edbyE quation(53)cmbeh andl
eddirect
l ybyt hE
bisection dependsont1
Jetypeo fone-dime
nsionaJprobl c
mb eings o
lved.Ift h
eo ne-dimc
nsiona
I
o d(
.)is same(
).InawaY.
th
e problemisag enuinesingl
e-var
iabledesignp robleme ne xp
r ession(5.2
)n ee
dsto
o
pp
o utYtor
ev
1
1
s


i
tp
r
iork nowlcdg
e.p a
rti arl
yw ithres
p d efininga nd bep resent
. I f e o ne-dime
n s
i na
o I problem i sas ubp r
o blem m e
s la
tingana lg
ori i n
toI UDngcode.Thereis
usu as t
rong
cor
re
s
po
nd
l
muJt
idimensiona
lo ptimi
zationproblemt
1Jenexpression(5.2)isn otava
ilabl
e.Inthat
betwecnes t
cp-by-st
cpdc ripti
onofen u
mericaJtec
hniqu
e( t
healgori
th
r

E ceas canningproccdureisusedtod ef
in 1a nd3
e
c
ode a
tw illi mplement e p s e ff
ectas o
lution( f
ore x ampl
e.

:
2
f
o
2
t
l
i
t
l
o
-
B
w
;
l
n
E
P;
52
11
11
:Z
Z2
20
:2
2L
gtwomethodsa
t
J
r
b
eu
r
e
s
edex
ten
sivel
yfo
ron
edi
men
sio
nalmim
iza
tio
n.They
ScannlngProcedure: l
ofz
eroforisvaJu
e b
ep
ej
us
r
t
i
i

fie
dsi
ss
nc
t
ei
a
rt
tr
e
e
df
fe
r
ro
st
m l
ova
Jue
owri
e Im
s c
itf
ur
o
r
r
e

n
.Ava
titer
at
Ju
i
on
e
.
Acons
tantin
tcrv
alfor6
.isalsoid
ent
ifi
ed.Forawel1-
scale
dp roblemt1
Jsva
i Iue
h
and
lcthem
inim
izationpro
blemd
ire
ctl
y.
i
susual
1y1.Sta
rtin
gatt1
Jelowri
e Imit
i nt
crva
Iisdoubl
edu n
tiltl
Jrep
e oi
ntsare
.
5
.2S
OLU
TO
NTOT
HEP
ROB
LEM 213
212 N
UME
RC
ALT
ECH
NQ
UES
-TH
EON
E.O
ME
NS
ONA
LPR
OBL
EM


dete
nnine
ds
Example5
1
.t
u
cha
es
h c
a
tt
nn
i
h
n
eminimumi sb rac
gproceduregenerat
ke
t
t
e
h
db
ef
o
e
l
t
w
l
e
o
w
e
i
nt
n
gv
h
e
a
l
m
u
.Wi r
e
s:
esp
ectt
o


1
0


=0
;j )=6
{O ;
=0; /
=6
.

=1
;j{
l)=0 ; =0
; =1 B

=2
;j )=0
(2 ; t
hi
sca
nno
tbe theminimumi
sn0
1ye
t pped


; =
4; 2=18
/

t

a
=4
;j(
4)=1
8


Ap rocesssuchasth
atil
lus
tr
atdisess
enti
alsSitisbothind
iffe
ren
ttothep r
oble
m


b
p
r
ei
o
c
ngs o
l
si
ve
st
dandc
oe n
s
anbeprogrammed s
u attheminimuml
il
y
i
e
.Thei
sbetwe
m
p
e
orta
neI
n
tr
i
e
m
q
i
t
ui
se
re
m
s
t
e
a
n
b
l
to
is
fanys
he
dbyt
uc
h
h
e

dasMA
p
roce
Th
du
r
es
e.l
e
to
isp
fiI
r
n
e
o
a
c
ed
re
u
q
r
ei
u
at
sd
io
e
n
v
st
elo
oe
p
e
stabI
isht
T
I
h
.Bm-
A
ecoef
f
i
f
i
)eU
cie
n
pperBound_1Var.m.
tsoft h
ep ol
ynomiali
n

Equation(5.
9)is 2


6= +b(O)+b2(0) (
5.1
08) r

bo

0
:::bo+b(
l)+b2(
l) (
5.l
Ob)

1
8=bo+b
()+b
4 (
216
) (
5.l
Oc) 0
.5 1
.5

2 3 3
.5 4

UsingMA
TI.ABesoh
ont
oee
qua
tio
nsi
s R
gur
e53p
. o
lyn
omi
ala
ppr
oma
1io
n.

h
o=6
.0;b
=-9; b2=3 5.
(11)
dedevelopmenti
ste
rme
dab
loc
kst
ruc
tur
eda
ppr
oac
h-I
nth
isw
ay-
lar
gc
ode
a
ndt
hep
oly
nom
iali
s d
eve
lop
men
tisp
oss
ibl
eus
mgs
mal
ler
pie
ceso
fex
ist
ingc
ode
.

P
(.}=6-9+32 upperBound1Var.m:Thiscodcsegmenti
mple
men
t sedetc
nni
nat
ionofe
upperboundoilhE
onofonev
ari
able
.Theinp
utt
othefu
nct
ioni
sth
e ncofthc
Theminimumf
ort
hep
oly
nom
iali
sth
eso
lut
iont
o


dP
=-9+6=0; :=
0 r
=1
.5
:
oE q cotZ Z3;42;;;22dEmusthaM Bm-f
i)e
inesamed
ire
cto
ry

t
ZT
ft
U3
23
1:
;:
;Z
?5
51
2-
ICa
ppr
oxi
mat
esolu
tio
nt uatio
n(5.
1)is1.
5.Fi
gu 5.
3dcribest
hepoly
nomia
l
ap
pr
Ont
o
xi
h
m
at
eo
i
o
t
np
he
ro
ced
ure
rhand
.l
i
ti
ft
sc
h
l
e
ed
a
a
ra
t
nf
tt
o
h
ea
rth
p
p
ep
r
o
o
l
y
x
im
n
a
o
m
t
i
i
a
o
nl
lc
e
o
a
e
v
e
f
f
smucht
icie
ntsw
obed
er
e
ea
s
r
i
r
o
e
u
d
.
ndas m
all
er
tw
hic
hth
cfu
nct
ion

regi
onnear=2 .6then re
sult
swouldbemorei mpr
essiv
e.Notea tra
m
5.
(12
)
p
uscah i
gher-ord
erp oly
nomialabett
erse
tofd at
aisp. U
sag
e: upperBound_1Var('EXam le5_1'
01
10)
Thes c a
nningprocedureandep ol
yn om
iala p
proximati
ontechni
queswillfi
nd
si
gnifi
cantu s
ee xp
l o
ringmultidim
ensio
na lopt
imizat
ionproble
ms.Th estegyfo
r cod se
gment i mpl
ements e po
lyno
mial
devcl
opingMATLABc odcfromnowonmusti nc
ludeep o
ssib
ili
tyofcodereus
e.le PolyApprox_1Var.m: li
s
fun
ct i
ono f one v
ari
abl
Th
isfu
nct
ionu s
cs
samec odesegmentscanbeusedinmanyd iere
ntnumeri
caltech
niqu
es.Suchgener
ic app
roxim
ation method f
ora
J
I
l'

5
.
2SO
LUT
IONT
OTH
EPR
OBL
EM 2
15
2
14 N
UME
AIC
ALT
ECH
NIQ
UE5-T
HEO
NE.
OIM
ENS
ION
ALP
AOB
LEM

UpperBound_1Var.mt od eten
ninether an
geo fev a
ria
ble
.Th einputtoe up/:
2;
1;12A
fun
ctio
ni sthenameo fthefunct
ion;theo r
der( 2o r3)o ftheappr
o xi
mation
; 1=(1-'
t)
ao
!w+ ;
/1=
/(
.)
lowbound-the sta
rtv alu
co ft h
es canp as
sedt o UpperBound_1Var.m;
in
tvl
stp s
e c
anningint
erva
lp asse
dt oUpperBound_1V ar.m;inia
ls
;
ri+1
GoToS
tep3

i
s
numberofs cann
ings t
epsp a
ssedtoUpperBound_1Var.m.Theo utputofe

iZ
progra
misav e
ctoroftwovalu
es.Thefir
steleme
nto fthev e
ctori
stheloc
ationofth
e

!
minimumo ftheappro
ximatin
gp oly
nomialandthes econdisthefun
ctionvaluea
t
th
isloc
ati
on.
Thefunct
ion fe
r e
ncedbyec od
em ustbeaMA Bmf
TI.A i
lei
nthesamedire
ctor
y
(Examp 5_1.m).1 einputforExample5_1ist hev alueatwhichthef un
ctio
n
nee
dstobec om
p u
ted.andit
so utp
utisthevalu
eo fthef un
cti
on. o
nlyc
allateevalues.Thealgo mi
sim
ple
men
tedi
nad
iff
ere
ntf
i
le
.

U
sag
c:Value PolyApprox_1Var('Example5_1'
20
11
0)5.
( 13
) ExampleS.l
Mi
nim
ize /()=(_1
)2(
-2
)(
-3) (
5.
1)
Thetw
oprog
r a
msuseswit
ch/
casean
dthe/
evals
tat
emen
tsf
romM
ATL
AB.T
he
cod
eal
s Iu
oi
l sat
esc
all
inga
ndretum
ingfro
mot
hernct
ion
s.
G
oldenS
ect ionMethod
5
.2.
5 GoldenS
ect
ionMethod
S
t 1 =
.(1.10" o.
o;lo
w 6;=
uP=4;!"'=1
8
L<X
j!n
o
l=0.00
1;E=(0
.00
1 1
4);N=17
T
hm ethodofgol
densec
tioni
sthcc rcamofthef
amil
yofinte
rva
l duci
ngmethods
(
forexa
mple.eb i
sec
tio
nm et
hod).Itreduc
esei n
ter
valbythcsamefra
cti
onwith S
te .5
p2..=1 2
79;
/.=0
.19
37; =2.
472
1;1
2=0
.54
01
e
achite
rat
ion
.Thei n
ter
val
s ederivedfromthegol
densec
lionra
tio
.1.618
03.This
r
ati
ohassigni
fic
ane a
c st
het
icsaswellasmathe
matic
s[34
].Themethodi
ss i
mple F
1gure
54i
lu
1 st
rat
est
hlay
outofinf
orm
ati
ona
tthissta
ge.
Itc
anbCVErinda
t
t
oi mp
le m
en.
tItisind
iff
ere
nttoes ha
pea ndco
nti
nuit
yp r
oper
tie
so fefunct
ion
..
2arelo
cat
edsymmi
ca
llyw
i t
hmspe
cttoo
ute
rb o
undsdO
"
p.
b
eingminimiz
ed.Mosti m
portan
t L
hen umberofit
era
tio
nstoachie
veap res
ibed
t
oler
ancecanbcest
abl
ishe
db e
foreLheiter
ati
onss
ta
rt
. S
tep3
.i=1
/
1>1
2
A
lgori
thmf
orGold
enSec
tio
llMethod(
AS.
3) (
1l
.o .5
lV=1 2
79;
low=0.
193
7; =2.
472
1;.=-0.
/ 540
1
S
tep1.Cho
oselo
w 2=3
.05
57;
12=0
.24
86
=0
.3819
7(fro
mG old
enRati
o) i=2
e=t
ole
ran
ce=(L
)
Ona
l/(
up_
low
) S
tep3
.co
ntin
ued
...
N=numbero
fite
rat
ion
s=- 2
.078lne 1
2>1
3
a
.up=3
.05
57; =
0.2
486
;2=2.
472
1;=-0
.54
01
Sp2.1=(1-
)lo w+
;fl=/(
1) 1=2
.11
15;
12=0
.12
24
dijjY35233:

=r i +(l
OW
) P
U ;
f2= ) i=3
ncp o
intsar
ee qdista
ntfrombo
und
s GoToS
tep3e
tc
St
ep3.If(i<N)
If/I>/2
Inea
chitcr
ati
onL
hereison
lyone ofc
allat
io
ntoeva
a evariableand
va
lueofth
ef u
nctio
n.There
stof
thECom
putauo
ntsmas
SIgn
snge
xts
tin
gi nfo
rmat
Ion
.
10" .;1 2;i1
f 2 Thedi
ffe
rcn
o u
b omdsisa
lsoch
ang
ingwi
the
achkmuon-hExmpleal
~=Iow +(1-)=/()
ii +1
S
ta
rt
: L
=4.0
GoToS tep3
I
fh>
/. I
ter
ati
on1
: L
=4
.0-1
.52
79=2.
472
1
2
16 N
UME
AIC
ALT
ECH
NIQ
UES-T
HEO
NE.
DIM
ENS
ION
ALP
AOB
LEM 5
.
3IM
POA
TAN
CEO
FTH
EON
E.D
IME
NSI
ONA
LPA
OBL
EM 2
17
2
0
v
ectoroffou
rpair
so fvaria
bleandfunc
tionvalu
esaft
erthefi
nalit
era
ti
on.Witha
1
8
s
malltole
ran
ce yoneofl h
esepa
irspr
ovide
s minimuml o
cat
ionofth
efunct
ion
.
I
tisr eco
mmendedatt hesecon
dp a
irbea cc
essedfo
rthi
sp uos
e.1 efunc
tio
n
1
8 r
eferen
cedb ythec o
dem ustb e a MATLAB m-f
ileint h
es a
med i c
tor
y
(E
x ample5_
1.m).Thei npu
lforExample5_1.mi sth
evaluea
lw h
ichthefunc
tio
n
1
4 n
eedstobecomputedandit
soutp
utistheval
ueofthefun
cti
on.

1
2 '
t U .
g
e:

1
0 Value 'ExampleS_1'
GoldSection_1Var( 0.001
01
10)(
5.1
4)
'
{6}h

E
8
The
rearenonewco m
mands.Thco r
gani
zin
ganddisp
lay
ingofinf
orm
atio
ninth
e
Commandwindowiswort
hn o
tin
g.Ifth
isco
deisp
artofala
rge
rp r
ogra
m th
e
pr
int
ingofin
for
mat
ioninthecommandwindowne
edstobeswit
chedo
ff
.Itc b
e
6 a
medo nfo
rdeb
uggi
ng.
4
'J
Compar/sonw lthPolynom/alApproxlmatlon:Thet wopopul
arm ethodsfor
2
miniou
z ingaf unctio
no fo nevariab
lea rep o
lynom
iala ppro
ximati
ono rg olde
n
s s
s
e
c
i
g
t
n
i
i
o
n
f
i
.Thea
cantdif
l
g
f
e
o
r
r
e
i
n
l
c
e
h
s
msforp
.Thef
o
o
l
r
y
m
n
e
oo
u
ri
ala
sao
pp
n
e
r
-
o
s
x
h
i
m
o
at
ta
i
p
o
na
pr
oa
n
c
d g
ha n
o
di
ld
sa
e
c
ns
co
e
m
c
p
t
a
i
o
n
nh
ie
a
db
v
y
e

si
gnif
icanter
rorintheestima
tionoftheminimum whichwil
li m
proveasthedatafor

up
-
2
-
1 2 3 4 5
appro
xi ma
tiongetbett
er.Implie
dint h
ei mpleme
ntati
ono fth
ep o
lynomialapproach
i
sthec ont
inu
ityo fef un
ctio
n.Theg oldensecti
onmethodontheothe
rh andi
s
F
lgu
r5
.4G
old
en5
ec
tl
on-s
tar
ti
ngv
al
ua
s. it
erat
ivetech
nique
.Then umberofite
ratio
nsdependsone to
leran
cexpectedine
fi
nl s
a ultandisknownp ri
orto st
artoftheiter
atio
n s
-asig
nif
i n
ti mprovement
re
lati
vet otheNew lon-Raph
s onmetho dwhere n umberofiter
ati
onsc a
nnotb e
I
ter
ati
on2
: d=3
.05
5 .5
7-15279=1 2
78 pr
edictedapr
ior
i.Thei mplement
ationissimpleandth
eresul
tsimpr
essiveasi
tisable
tohomeinon oun 1 u
m.Itisind
iffere
nttothenat
ureofthefunc
tio
n.
Thereisn oreasonwhyt het wocannotbec ombined.begolde
ns ect
ioncanb e
usedtoesta
blis
hf ourdat
ap o
intswithar e
asonabl
etole
ranc in
e( st
eadofal owvalue
)
Thef
in
ali
ter
ati
oni
sre
pro
duc
edb
yru
nni
ngt
hef
oll
owi
ngc
ode
: andac ubi
cp ol
y n
o o
ualc a
nb efi
t10identi
fytheapprox
i m
ateloca
tio
no fminimu m
.

i
ter
ati
on1
7
2.63
95 2
.639
9 2.
640
2 2.6
406 5
.3 IMPORTANCEOFTHEONE-DIMENSIONALPROBLEM
-
0.619
7 -0.61
97 -0.
619
7 -
0.6
197
1
o
ne-dim
ensio
nals ubpr
oblemin am ul
tiva
riab
leo pt
imiz
a t
ionp rob
lemis
l
elo
ler
anc
e2
Iint
hef
in
ali
ter
ati
oni
sab
out0
.00
1ase
xpe
cle
d. e
mployedfored ete
rmin
atio
no fth
es t
eps
izeaf
terthcse
archdirec
tio
nh a
sb e
en
i
den
tif
ied
.Iti
se a
sie
r10undc
rstan
dthes
el e
rmsbyrecog
nizi
ngthegener
icalg m
o
GoldSec
tion_
1Va
r.m
: Thec odcl s
r l
at
esealgor
ith
mforth
egold
enstio
n f
oruncons
trai
n o p
tio
uza
tion
.I norde
rt ofoc
ust h
ed i
scus
sionrat
hertha
ne
m od(A5.
3)i
nTLABcode.Theinput10t
hef
unc
tio
nisenameo
fthcf
unc
tio
n g
ener
alobjc
ctiv
efunct
ionrep
res
enta
tin
o aspe
cif
iconeExampl
e5 .2
isint
rod
uce
d.
tnCt
nam )w
e h
oseminimumi sbein
gs o
ught
;et ol
cra
nce(t
ol)o
ft heap
pro
xim
a ti
on;
te
h value( l
o
w und)o
bo fesc p
a e
dt

oU pp
er
B
ound_1Var
.
m
n

m

1
; Example5.2
s
c
a
nmn
g i
n
te
rv(
t
u 1)pa
5
5
e

dtoUp
perBou
md_1Var
'
.m;
the
mu
m
E
l )=(
x 2+2{~ -x3)2+3(x
l) (
5.1
5)
p
s

1 p
1 t oUpperBound_1V . m.Theo ut
putof p ro
gramis; M
ini
miz
e f
(x X2'X
3 3- 1
)2
218 219


NUMERICALTECHNIQUE5-
THEONE-DIMENSIONALPROBLEM 5
.4 AODITIONALEXAMPLES

Ac orygl
anceatExample5.2in
dic
ate
sa tth
esol
utioni
satxl=l;x2=I;X3=1
;
andtheminimumv a
lueoffsO
i .Threeva
ria
blesar
echosenbec
ausewearno
tgoin
g (
5.1
6)
touseanygr
aphic
sf ori
llu
str
ati
on(
iti
sesse
nti
altofoll
owthevect
ora
lge
bra
). Xl=lL

a
nds
oon
.
GenerlcAlgorlthm(A5.4
):Theg ene
ricalgor
ithmisanite
rat
iveoneandi
sa l
so
r
efe
rd toas ea
rchal
gori
thm
.astheite
rat
ion
stakpla
cebymovinga l
ongasea
rch
d
irec
tio
n.Thesesear
chdi
rec
tio
nscanbedeterm
inedinsev
era
lways( Cha
pter6
).The
5
.4 ADDITIONALEXAMPLES
al
gorit
hmwithou
tanyconve
rgenc
elst
oppingcr
ite
riaca
nb eex
pressedas
h i ssecti
ona dd
itio
nale xamplesofs in
gle-
varia
bleo ptim
izatio
np roblemsa rc
S
tep1
.ChooseXo exp
lored
.Thea v
ailab
lec odeforthepolynomi
ala pproximat
iona ndgoldens e
ction
S
tep2
.Fo
rea
chi
ter
ati
oni shoul
dh el
ps ol
vea nyandallsingle
-va
riab
leo p
timiza
t i
o nprobl
ems.Thisisl a
rgel
y
le
fttotheread
ertoexploi.
tInth
iss e
cti
ono n
lye x
tensionsmo
dificat
ionsorcre
ative
D
eterm
inese
archdi
rec
tio
nSJv
ect
or
appI
icat
ionso ftheo ne
-dimensiona
lo pti
mizat
ionp rob le
ma r con
sidered
.F irs
t
S
tep3
.Calc
ulaes
t X;=jSj
Example5.2isrevi
site
dtom od
if ythegol
densectio
nmethods oatitcanbeu sedto
N
ot:s
e X;i
snowaf
unc
tio
noft
hes
cal
arc
ja
l sS
jisknownfromS
tep2 lcula
te S ps
izeinmultidi
me n
siona
lp ro
blems.Example5. 3isas ol
utiontothe
ji
c
l sc
all
edt
hes
teps
izea
site
sta
bli
she
sth
ele
ngt
hofsX
j Blas
siusproblem. li
sisa ne xampleoft h
ee xac
ts olutio
nt oeN avier
Stokes
u at
ionforflowo v
eraf la
tplat
c.Example5. 4isane xaminatio
no ftheinequ
ality
X
j1=X/+sXi con
stra
intinExamplc5 .laby t hegoldens e
ction methods ot h
ate qu
alitya nd
i
sde
ter
min
edbyM
ini
miz
ingF
(Xi
+l
) ine
quali
tyconst
rain
tsc a
nb ehandled
.
Iisi
sre
fer
redt
oaso
ne-
dim
ns
ion
als
teps
izec
omp
uta
tio
n
ii+1
;00ToS
tep2 5
.41 Ex
. I
l
ample5.2- l
ust
rat
lonofGeneralGoldenSectlonMethod

A
ppl
ica
lin0
o /GenericA hm(A5.4)EXIlITlp
le5
.2
'ee
h x
amp
lef
romep
rev
iou
sse
cti
oni
svi
sit
eda
gai
ntom
odi
fyeg
old
ens
ect
ion
methodtod tcrmi
nees te
psi
zef o
rm ulti
dimensi
onalproblem. isbookisals
o

~[g} a
i
d
b

e
o
nd
v
u
e
e
tg
v
l
e
o
e
l
p
t
t
o
m
i
p
e
n
i
n
n
gMATLABt
gt
tw
hec
i
t
o
hr
d
e
sp
oworkf
c w
ec
i
tt
l
o
ls
ry
e
oep
o
ec
u
o
o
.I
n
l
s
i
y
nas
d
n
e
o
r
m
i
c
a
b
a
n
l
se ss
eu
la
s
p
ei
pr
u
nt
ox
i
b
h
m
se
en
at
c
t
e
i
i
x
o
oni
tc
sl
h
ap
a
t
e
r
r
ge
lyane
.An u
nmethodislef
x
i
e
r
v
ta
c
a
l
i
e
sa
s
e
n
n
t

exerci
seforthestud
en.
t
dJ
F1111111L=

'
heg oldc
ns ecti
on method requi
rest h
ee stab
lishme
nto ft h
eu ppe
rb ound
.
-
x
-
drllML
n

-
t
p

n .
-a

10
er

+
J

t
-



guAU

grill-L

n9uw
et

..

rJ

etwof swil
1n
U11111111

r e
for un
ction e edtob echangedtohandledcsig
nv e
cto
rsa n
dt h
e
LzrE
-

'
h

a
1Ill1
=
='J

eb

n
u
-n a

10
enr

searchdirec
tionvect
ors.Thec odeisa va
ilabl
e UpperBound_nVar.m d
MMM

.006.

EBEBEE--EEEJ
x

GoldSectlon_nVar.m.Them odif
icatio
nsa renOlv er
yc hal
lengi
nga ndcanbe
E -'EEEEEL

inferr
edbyc omp
aringt h
eusageofetwof un
ctio
ns.
3

Forthesin
glevar
iable
:

f(X1
)=f
(1
)=(
0-0
)2+2
(0-6
1)
2+3
(6
1 1
)2=72l+3(6J-1
)2 U
sag
e 'Example5_1'
:UpperBound_1Var( 01 5.
10) (12)

F
ormanyv
ari
abl
es:
M
inimi
zingj{1
)cva
lueo
f1=0
.1.T
hisi
sao
ne-
dim
ens
ion
al
o
pti
miza
tio
np r
oble
m.
U ge:UpperBound_nVar('Example5_2'
xs
Ol
0 5.
) (17
)
Whilethesol
utio
nabov
ewasobt
aineda
nal
ytic
all
yb e
causei
twasas i
mplel
ine
ar x: current position vector or design vector
e
xp ssi
onep ol
ynom
ialap
pro
ximat
ionorthegold
ens e
cti
onmethodcou
ldhave
b
eenu se
dinsa
t d. s
: prescribed search direction
220 N
UME
RIC
ALT
ECH
NIO
UE5--T
HEO
NE-
DIM
ENS
ION
ALP
ROB
LEM 5
.4 A
DDI
TIO
NALE
XAM
PLE
S 2
21

Ofc o
urseExample 5_2.mr etu
mst hevaluofef u
nctio
nc orre
spondi
ngt oa MathematlcalFormulatlon
ve
ctorofdesignva
riab
les.lisimp
lies thefunct
ionca
lltoExample5_2.mc an
on
lyt ak
ep lac
a f
terthedesignvaria
blesareeval
uatedfromev al
ueo fste
psiz
e
"+2f"=
f
f 0 (
5.2
0)
ap
pliedalongep re
scribe
ds e
archdi c
tio
nf ro
mt h
ecurren
tlocati
onofed esig
n.
Theu sageofG oldS
ec t
ion_nVar.mmustaccommodatef unct
ion(5.17)ande x=O; f
(O= 0
) ; f(O)=O (
5.2
1a)
needtodea
lw ithadesig
nv ec
tor
.Comparingw iththesi
ngle
-vari
ablecase
x= f( }=1
(
5.2
1b)
U g
e:
Th
eso
lut
ion
non
dim
ens
ion
alv
elo
cit
yint
heb
oun
dar
yla
ye
riso
bta
ine
das
Value GoldSection_1Var('Example5_1'
0.001
01
10)
(
5.1
4)
U g
e: =f(x) (
5.2
2)

Value GoldSection_nVar('Example5_2'
0.001
xs
01
10) Thes ol
utio
nt oE qua
tions(5.20
)t o( 5
.21)isl ar
gelyth r
o ughspe
cialiter
ativ
e
(
5.1
8) te
chniq
ucs. These tec
hniq
uesu se an umer
icali nte
gra
tionp r
oced
ure li~e
V
isi
t c
odetos
thed
1
5
. Runge
-Kuttamethodt oint
egr
atethesystembyg u
essinganda djus
tin
gt h
em iss
ing
boun
daryconditio
nsatthein
iia
t1p oi
ntsuch t h
ef i
nalpo
i ntbounda
ryc o
nditio
ns
Compar/sonw
/thS
ect
lon5
.3:Thec
odeGoldSectlon_nVar.mwasr
unf
rom aer
r ea1i
ze.Thi
d sisduetoef a
cttha
ttheinte
gra
tionprocedu susu
all
ys o
lveini
tia
l
eCommandwindowu
sin
gth
efol
1owingl
is
ti
ng
: va
lueproblemso n
ly.IntheBlass
iusproblem i
swouldi mpl yth
em i
ssingini
tia
l
va
luecanber egar
ded adesignvar
iab
le.
>>x [
000] ;
>>S [0 0 6]; ('(0)= (
5.2
3)
>> GoldSection_nVar('Example5_2'
0.001
xs
01
10) Theo
bje
cti
vef
unc
tio
nth
ere
for
ewi
llbe
A
fte
r11i
ter
ati
onst
hef
ina
lJin
eint
heCommandwindowwas M
ini
miz
e: () 1
)2 (
5.2
4)

ans CI Im
pli
edi
nth
efo
rmu
lat
ioni
s l
f()i
sob
tai
nedbyi
nte
gra
tin
gth
edi r
en
ti
al u
ati
ons
0.1000 1.2000 o o0.5973 (
5.2)(
0 ec anb ec ons
ideredasd i
ffe
ren
tia
lc ons'a
in).l e
reiso neoth
cr
c
onsi
derat
iontotakeintoaccount
.lein
tegr
atio
nm et
h odsrequ
iretheublemtobc
Th
eab
ovei
sin
ter
pre
teda
s: e
xpress
edins t
at
es pa formwhichr n -ord di
ffe
ren
tia1uat
ion10be
e
xpreedasas yst
emo fn l-
ordc
r u
ati
ons. l
econversi
onisfai
rl
ysta
ndarda
ndis

1=0
.10
00; f(
1)=1
.2 x1=0; A
2=0.0; x3=0.5973 (
5.1
9) don
et h
roughulSfo
rmatio
na ndinuuci
ngaddit
ion
alv les
.F o
rthi
sexam
ple:
whichm
atc
hesS
ect
ion5.
3adEq
n u
ati
on(
5.1
6).

y =f
5
.42 Ex
. .3-
ample5 Two-PolntBoundaryValueProblem
y~ =f=Y2
Ar ea
1exampleforone-v
ariab
leo p
timizati
onc anbefoundinen umer
icalsolut
ion
ofthelamin
arf l
owo ve
raf l
atplat
e[ 5
]. leproblemusua
llyattr
ibu
tdtoB l
assis
u
Y;=f
'=Y3
re
p r
esen
tsanexampleoftheexactsolu
tionoftheformid
ableNavier-Sto
kescquat
ion. Y;=f"='/2
lem ath
emati
calfom lUla
tin
o allowingforsimil
arit
ys olu
tios
n i
se xpssedbya
th
i r
d-or
dern o
nlinearordina
ryd iffe
ren
tia1e qua
tionw i
thb o u
ndaryc ondit
ions
Th
eop
tim
iza
tio
nca
nbef
orm
ula
ted:F
ind
sp i
fie
da ttwop oi -at wo-poi
ntb oundaryv aleproblemPBVP). Wh
u at
f
o l
Iowsisth
eessent
ia1math
ematicaldes
cripti
on.leinte tedreade
rc a
nf ol
lowthe M
ini
miz
e: [
Y2
()
lf (
5.2
5)
d
etail
sinmostbooksonf lui
dm e
c h
a n
icsinc1ud
ing su g
gestedref
e nce
.
u
sin
gth
eRu
nge
-Ku
ttamethod(
or yo
the
rme
tho
d)t
oin
teg
ral
e
222 N
UME
RIC
ALT
ECH
NIQ
UE8-T
HEO
NE.
DIM
ENS
ION
ALP
ROB
LEM 5
.4A
DDIT
lON
ALE
XAM
PLE
S 223

r
-

fwlw
-
i
r
JI11111J
-

o
-

n
(
) 1BEEt-EEEBEEEEJ
-
-EEEEEEEEEEE


Ther e
sulte xpectedis=0. 3320
6.Howevert h
et ole
rances
peci
fie
dwaso nl
y

o
vn

rEE E -E E -EL

EEEEEEaEEEEEJ
UJUJgJI
-


-
. 3

a
(
5.2
6)


(
)U4
I
0.001
. The i nit
ial bounding in
terv
al was onl
y 0.4
. Th egold
ens ec
tio
nh a
s



l
r


' (
)
-
produceda ni mpressiv
es olu
tiontoeTPBVP.A lson o
tetheconv
enienceof

vi
v

d3
AU


EJ


modular pl'Og
rummin g. No changes we madet o UpperBound_1Var.m or


GoldSectlon_1Var.mt orunth
isexa
rnpl
e.
Frompublis
hedwork[5Jthevalu
eo
f =0.33206.Insleadofenalpointat i
t
i
sconsid
ered10be5..Le
0 avin
gi svaluea
sav aria
blec andef
ineac o
rrespond
ing
tw
o-va
riabl
eo pt
imi
zatio
np ro
blem.Inei mplemen
tatio ntofo
llowepower d 5
.43 Example5
. .4-
RootFindlngwithGoldenSectlon
con
venien
ceo fMA Ba
1LA r
r ead
ilyappa
rent
Thea
ppli
catio
nofthegol
dens
ecti
onmethodtothero
otfin
dingproblemi
simp
ort
ant
t
oaccommodatecq
uali
tyandin
equ
ali
tycons
trai
nts.Con
siderExample5.
4:
Example5_3.m: Thism-f
ilei Is
sl edtoimplementexpr
ession(5.
25)
.Itcall
st h
e
MATLABbui
lt-
infuncti
onode451 0uset h
eRunge Ku
tta4 /
5o rdermetho
d.The
(
g )
:0.
75
2_1
.5
1=0 (
5.2
7)
fun
cti
onode45req
uire
st h
esta
teequati
onstob eav
aila
bleinanothe
rm-fi
le.Ita
1so
Euir
esedef
ini
tionofth
eint
erva
lofinte
grat
ionaswel
lastheini
ti
alcon
diti
on.The 0$$4 (
5.2
)
fol
lowi
ngli
nefromthecoddc
scrib
estheusage(ecodeiswelIcommentedtoo)
i
sisei
neq
ual
ityc
ons
i
nto
fEx
arn
ple5
.lae
xce
pt ti
tist
ran
sfo
rme
dtoa
n
[t y ] ode45('Ex5 3 state'
tintval
bcinit); e
qualit
yc onstm
i tI
n. ni
sformt hene
cessarytomakeitint
oana c
tiveco
nstr
ain
l
c
a nbeestabl
ishe
d.Th es
imple
stwaytoa cco
mplishth
isi
stoconv
erttheproble
mto
ti
sth
ein
dep
end
enlv
ari
abl
ean
dyt
hed
epe
nde
ntv
ect
or. am in
imizationp r
oblemforwhi en umer
icaltech
niqu
esh av
ea lre
adyb ce
n
c
stabl
ishe
d.S qua
ringEquat
ion(5.2
7)ensu
rcstha
ttheminimumvalu
ewouldb ezer
o
(
ifitex
ist
s).There
foreth
esoluti
on10Equa
tion(5.2
7)ist
hesameas
Ex
5_3_state.m: Thes
tat
eeq
uat
ion
sin(
5.2
6)a
rea
vai
lab
lei
ni
sfi
le
.
Mm
iz:
e ):[
0.7
5a2- 1
.5-1]2 (
5.2
8)
stst [ y(
2) y(3) 0.5*y(1)*y(3)]';
whichcanbehandldbyGoldSection_1Var.m.Wh
e il
eiswasquickandpain
les
s
R
efe
rt ol
hecod
eford
eta
ils
.GoldSectlon_1Var.mi
sus
edf
romt
hecommandl
ine there
ar someatte
nda
ntp ro
blemsusi
ngthisapp
roach
. t h
en o
nlin r
it
yh a
s
f
orisprob
lemas inc
reas
ed.Thisisusua
llynotencou
ragedinnumer
icalin
vcs
tig
ati
ons
.S econdth
e
numberofsolu
tio
nshassat
isfy
ingFOCincr
ease
d.Figu
re5.
5repsen
tsthefunc
tion
s
inEquat
ions(5.
27)and(5
.28)
.
U g
e: GoldSection_1Var('Example5_3'
0.001
00.1
10)
Sol
utlonUslngGoldSection_1Var.m:Thef ollowi
ngd is
cussi
onisb asedo n
S
tar
tit
era
tio
n: t
heexperi
enceofa tt
emptingtor u
nt h
cg o
ldens e
ctionmethodw i
ththelowerbound
a
tthev a
lueo f0ec asewi t
heo thc
re xamp
l e
s.The isap roblemsincethe
start s
olu
tioncannotbef ou
nd.Th ep roblemapp r
st obeint h
ec a
1cul
atio
no fth
eu pper
alphal(low) alpha() alpha(2) alpha(up)
' b
ound.lnmanyo ft h
enu m
e r
icalt e
chniqu
est h
ereisana s
sumptionattheobjec
tive
o 0.1528 0.2472 0.4000 f
unct
ionbeingdea1twithismodala tishasas in
gleminimumi ntheregionof
1.0000 0.1904 0.0378 0.0161 i
ate
res.F
t ort h
ist ohappen.itisassumeda tef u
nctionbeingminimizedwi1l
a
lwaysdecrea
sef romthel owerbound
.Takeal ookatef unct
ionfinFigur
e5 .
5.It
Thef
ina
lit
era
tio
n: si
i ncre
asingatthcva1ueofz e
ro.UpperBound_1Var.ma ssumestha
tei n
iia
t1
i
nte
rva
1ist o
ol a
rgeandc onti
n u
estobisec
tittofindan ctionva
1ue islessa n
iteration 12 "
4 t
heoneatthel o
wcrb ound.Thisdrive
st h
ei n
terva
Itoz e
roandt h
ef un
ctio
nise x
ited
alphal(low) alpha(l) alpha(2) alpha(up) w
iththelowerbounda ndw ithnosolut
ion
.
0.3359 0.3364 0.3367 0.3371
0.0000 0.0000 0.0000 0.0000 Remedy1: Theeas
ies
twayouto
fthedi
ffi
cul
tyi
stocha
ngctheva
lueofth
el o
wer
bounda
ndt
ryagai
n.Iti
sus
efu
ltound
crs
tandth
at p
roble
miswi
ththeca
lcu
lati
on
P
ROB
LEM
S 225
224 N
UME
RIC
ALT
ECH
NIQ
UE T
5- H
EON
E-D
IME
NSI
ONA
LPR
OBL
EM

1
8 U g
e:GoldSection_1Var('Example5_4'0.0010.
120)

-
E
--
-e
-
start

-a
1
6 alpha(l) alpha(2) alpha(up)

alphal(low)


'
2.6000

a
1.6069

-
0.9931

-a
0.0289


1
4 2.1720


3.0624

a
1.0000

-
-
iteration 16

'
-'
o
alpha(up)

-
alpha(2)

J-Mhe-e
1
2 alphal(low) alpha(l)
2.5270 2.5273 2.5278

a
2.5266

--
0.0000 0.0000

v
1
0 0.0000 0.0000
(

s'p-
t
(HM)

'--e
REFERENCES


1
.Burd
en R
.La
. ndF
air
esJ
.D .N
umer
ica
lAnal
ysi
s.4thed
.PWS_KENTPu b
lis
hin
g
CompanyBost
on1
989
.
4 s
olu
tlo
n 2
.Hos
lel
lerGH..samina-M.s..andMonta
IOU-p.D.A
nal
yti
cal
N w
nericd
d
c
ompu
tation
alMeth
odshrscienc
eandEng
inee
ring
prmti
cc-H
all-E
nslew
oodCl
if
fs
.
2
g 3
.V
N
J.


1991
.
1
G
.N.
.Nu
O
pli
l 1
101T
1 e
clm
iq f
orE
ngi
nee
rin
gDe
sig
ll
M cGr
aw-HillNewY ork
.1 98
4.
4
.H u
ntlc
y.H .E.
T heD l
vIl
leP r
opo
rli
on:A Slud
yi nMut
hem
ali
:
ralBea
ut.D
y o
ver
Publ
icau
onsNewY or
k.1 9
70.
0
.5 2
.
5 3 3
.5 4 5
.S ch
lich
ung.H.Bounda-LayrThe
e or
yMcGraw-Hi
U.NcwYo1 9
79.

F
lgu
re5
.5E
xam
pl5
.4
.
PROBLEMS
o
ft h
eu pp
erbound( bra
cket
ingtheminimum)raert h
anw it
h g old
ens e
cti
on 5
.1 E
xte
ndExample5.
1toi
ncl
udctwoi
neq
ual
ityc
ons
tra
int
sfo
rwh
ichas
olu
tio
n
m
ethod.Changingthelowerboundto1andr erun
ningthgoldensect
ionme od ex
ists-D
ispla
y f
ul(
p
rovid
esas u
cce
ssfu
l sul
twhichmatch
eseg rap
hicalsol
uti
on.Whilesucc
esswas 5.
2 ExtendExample5
.
1toi nc
Iudetwo
in u
al
it
ycon
stra
intsf
orwhich
t
her
l1
sno
r
eal
ize
d.suchapr edur
en ee
dsuserin
tcr
venti
onwella ssomeknowledgea bo
ut
so
luti
on.Displa
yt h
ef unctio
ngrap
hica
11y
.
t
hproblcm-inthi
sc a
sether
ewaseg raph
icalsol
utio
n_Thesearenotacce
ptab
le
q
ualiti
foranauto
maticprol
c ur
e.
5.
3 Reprogramec odeSec5_2_2.mobtainev alueso
ff
andc
't
t hr
o u
gh
MA
'1.ABfun
ctionprogra m
s dapplytoExample5.1
.
Remedy2
problem
.i
:S
tsh
i
o
o
u
c
l
et
db
h
ep
epos
o
s
i
s
b
i
t
l
iv
et
es
os
l
e
o
n
p
s
ea
eth
tt
i
sp
h
o
el
sit
o
i
v
we
es
rbouodi
ig
n01t h
si
es l
o
n
p
d
ic
ea
ati
veo ft
ndmovet
h
h
e
e
5
4 2
2J;
;1
32
22
:l
::
:Z
34
7t t

lowerboundt ot h
ep ointwheret heslope isn eg
ativ. Such ap
e ointcanbe 5
.5 Id
entif
yt hevalueofwhereec on
strnt(5.)bcomesa
3 c
tiv
eusin
g
disc
overedbyt h
esam scanningproced
ure.Thcs lopecomputationi
sn umer
ical Ncwton-Raphsootechni
que.
andisbasedonforwardfi
rs
td i
ffere
nce.Onccmorci schangeinthelowerbound 5
.6 Implemcntab is
ectio
np rocedu
reforth
er n
inimi
zati
ono fef
unc
tio
nofo n
c
i
so nlyneededfortheuppcrboundc a
lculat
ion.UpperBound_m1Var.mi sthe var
iabl
e.Applyittos ol
veExample5.1
.
modifiedupperboundcalcul
ationwhichr elo
catesthelow~r boundtot h
ep oi
nt 5.
7 Forthepolynor
nia1appr d
Ol m
ationimp
lementa
tioncxt
endccod
etodis
play
where theslopeisn ega
tive. The usage and informa
tion from runningthe eo ri
gina
lf un
co n dea pp
rox
imati
ngp o
lynomial
.
GoldSectlon_1Var.mi nco
rporat
ingt hechaogedu pperboundc al
culat
iooare
shownb elow
.Thesamcu sagewitht hcoldUpperBound_1Var.md oesoot
5
.8 F
orcg o
lde
ns e
cti
oni
mplcm
ent
ati
onex
tendt
hecodct
odi
spl
ayt
heo
rig
ina
l
produceanyusef
ulrcsu
lts
. f
unc
tio
nandthcana
lex
ter
nalbo
undsonth
evar
iab
le.
226 NUMERICALTECHNIQUE5-
THEONE.DIMENSIONALPROBLEM

6
5
.9 Verira
teb
oun
dsont
hev
ari
abl
ear
ede
cre
asi
ngbyesamer
at
io
.Wh
yis
t
hi
sbe
tte
ra
nth
ebi
sec
tio
nmethod?
5
.10 Howwouldyous
etupthegolde
nse
cti
onmethodt
ode
tr
min
etez
h e
roof
fu
nct
ioni
nst
eado
ftheminimum.
5
.11 Combineeg
old
ens e
cti
on dep
oly
nom
iala
ppr
oxi
mat
iont
ofi
ndt
he
mmimumofefu
nct
ion
.
5
.12 Imp
rov
thea
ccu
rac
yoft
hes
olu
tio
ntot
heB
I i
us 1o
vert
hatp
res
ent
ed
i
nthet
ex.
t
5
.13O
bta
in th
es o
luti
ont ot
heB
las
siu
s q
uat
lOn usmg t
hep
oly
nom
ial
NUMERICALTECHNIQUES
a
ppr
oxi
mat
ionme
thod.
FORUNCONSTRAINED
OPTIMIZATION

Thischapterilu
I satesmanyn umerica
1t echnique
sf o
rm uJt
ivariableu n
co n
straine
d
opti
mizat
ion.Whileu ncon s
trainedop a tio
ni sn otacommono c
cu r
rencin
engi
neeringdesignneve
rth e
lessthenumeri ca
1techniquesincIudedh eredemonstrat
e
in
tere
s i de
asanda lsoca p
turesomeo ftheearl
yi ntens
iveworki nea reaofdesig
n
opti
mi tio
n[1].Th eyaIsoprovidethemeanst osolveconstrainedproblemsa f
terthe
y
havebeent ransf
o r
medi n
toa nu n
constrai
ne done(indirec
tmo d
sC hapter7).
Thisbooki su niquefort hepres
entati
ono fno n
gra die
ntt echniques(Section6.2
)
which canb eempowered by t heu biq
ui to
usa vailab
ilityo fi n
crdibled eskto
p
computingp o
wer.U ntilv eryrecen
tly.applicat
iono fd esignop t
imizationr e
quire
d
mainframec o
m pu
t er
st hatrelie
donl argep rogramsw r
itteninFORTRAN.T oday'
s
deskt
opc anrunpr ograms atreqreonlyIimitedprogrammings k
ills
.Thed e
sirefor
globa
Io pt
i m
izationh asb roughtintof o
cu snumeri ca
It echniquesa ta rel ar
gel
y
heu
rist
ichavelimitednee dforsoph
istic
atedg r
adient-basedmeth odsrequ
i r
elimite
d
programming skiHs. and r eq
uirel i
mited programming r esource
s.U suallys uc
h
tech
niquesr e
quire t h esoluti
ons paceb es can nedu s
in gal a
rgenumbero f
it
erat
ion
s.Th esemeth odsc anide
allyberunonp ersona
Id esktopsforunlimitedtime
.
Thep r
ess ofl im
itedc omputingresourc
e sisnol o n
geras ignif
icantconstra
inton
the
set e
chnique
s.Whilet heymaycompromiseone l eg
anceands oph
isticati
oniti
s
impor
tantt or ecog
nize o pportun
ityt oe ngaged es
kt o
pr e s
ourcesf org re
ate
r
use
fulne
ss.

6
.1 PROBLEMDEF1NITION

Theunco
nsain
edo
pti
miza
tio
nprob
lemre
qui
reson
l ytheo
bje
cti
vefun
cti
on.The
bookh
aschos
entoe
mphas
izeana
ccomp
anyin
gsetofsi
deco
nst
rai
ntst
ores
tr
ict
227
228 AlTECHNIQUESFOAUNCONSTRAINEDOPTIMIZATION
NUMERIC
6
.
1 PAOBLEMOENI
lON 2
T 29
sol
utio
nt o acceptab
le i a ce
lgi
on.Mostn ume
rica
l i qu in S
chap
tEragpo e ?ns intsinI ngout method.I tisu
s
u
I
dy
P
on
s
i
bJi

i
t
y0f
th

1
e
de t
ov
er t
h
ed
cc
o

n
lIIn
tsaspa
rto
fhisexpl
orat
io
e
n
of op
timum. ischeck
ingofcsi
den sntcanbeea
sil
yprog
r a
mm e
dinthe
c
ode.Thust
heprob l
emforisch
apt
ercanbedefin
edas

'j
JTIl!ll
M
ini
miz
e f(X); ]"
(
6.
1)


'lli

44whHMl'I
S
ubj
ect
to: x
f$;XI$;x
r
; i
=1
2
n
(
6.
2)

t
a
-
-
6
.1.
1 Examp'e6
.1

r
;;2312::zz;222Z2;2JZem p
oss
ibl
e h
ica
Jde
scr
ipt
ior

M
ini
miz
e f(X)=f(xl X2)=3+(XI- 1
.52
xl2+(X2_ 2
)2 (
6.3
)
S
ubj
ectt
o
: OSX(S5; OSx2S5
(
6.4
)
0
.5 1
.5 2 2
.5 3 3
.5 4 4
.5 5
F
igu
re6
.1p
rov
ide
sth
eco
nto
urso
fep
rob
lema
nd l
uti
onc
anb
elo
cat
eda
t
f
J
e
)

adratic
X
1
iZL2;arvalueisf=3 n h
eso
lut
ion
F
lgu
ro6
.
1Ex
amp
le6
.1
.

6
.1.
2 NecessaryandS
uff
lcl
entCondltlons
TheHessia
nisposi
tiv
ed ef
ini
tecon
side
ringthedetennan
tsa l
one
.Sec6_1_1.m'

2
;t
rz
z;
::
2j
r2
z
s ;t
t
:!
s
Z pro
vid
esEd eforth
es y
mboli
ccal
cul
atio
na n
dalsodi
spla
ys gphi
ldcr
ipt
ion

c
ond
iti
ons
)ar

eeg
ra
;
:
d
l
?

e

n
tsm
ustv
ani
sha
tth
eso
lut
ion
thep
sa
tis
fa
r
c
t
o
i
b
o
l
e
no
m.Ther
fth
e
s
eSOCi
u
lt
d
so
en
t
fec
if
ie
al
cul
at
s s
i
ona
o
lu
r
t
cd
i
o
i
nf
s
p
o
la
rt
y
e
h
di
ed
nt
e
si
h
g
ecommandw
nisam ini
mu
i
m
.
n
dow.le

6
.1.
3 Elementso
faNumerlcalTechnlque
21=2(Xt-15
)=0 (
6.5
a)

'
hee
lem
ent
sofat
yp
i1num
1t
ech
niq
uco
ral
gor
ith
mc
anbca
sso
cia
tedw
itht
he
1)+2
(X )=
2-2 0 (
6.5
b)
g
o
e
n
n
e
e
r
-
d
i
i
ca
men
s
o
io
r
n
i
a
ni
1opn
nd
i
zat
u
i
c
o
e
nf
dd
orm
u
u
r
l
i
n
t
i
g e d
varia
bl
i
ep
s
r
c
o
b
u
s
l
s
e
i
m
ono
s( C
ft
hap
t
er
h
5)
elev
.usa
anc
eo
lg
or
ft
it
h
h
mi
e
s
it
era
ti
veandisalsore
fer
redtoa
sas ea
rchalgo
rit
lv
nastheiter
ati
onsta
keplacebymoving
ons(6.5)c bevedt
Equ oob
tai
nxj=3x
i=2
.Thi
sma
tch
e
seg
rap
h alo
ngasearc
hd irec
tio
noras e
archvect
ordurin
ganite
rati
on.Thes h d
irec
tio
nscan

2
ilj
itM
223 :
i
C t ;sz
bedetem
p
a
r
i
l
g
m
o
a
r
i
r
il
m
.
ydi
f
e
e
f
x
di
e
nmanyw
r howt
ptfo
a
h
y

r c
s
cs
o
.Th
e
n
a
r
v
e
c
rg
ed
hd
e
i
r
n
i
f

c
c
f

J
e
r
t
s
e
i
o
t
o
nt h
ni
p
s
p
i

n
t
n
a
b
gc
i
l
r
i
q
u
i
t
e
s
h
e
r
sa
e
i
d

a
ta
. l
a
ret
reps

e m
hes
a
a
i
n
m
e
n
i
t
n
ef
edi
ge
o
nt
l
e
ra
m
l
h
i
e
m
sc
n
o
t
h
so
s
ta
ap
t
ft
l
e
h
lo
r
e
f
th
em et
hods.Thea Jgori
t h
mc a
nb eexpr
l sc
dasfoll
ows.


=l (
6.6
)
I
Fi
le
sl
Obed
own
lon
dedr
ro
mIh
cwe
bsi n
r
ein
di
ca
le
dbyb
ol
dr
ac
eso
nss
e
ri
rIy
p
e.
Hil
6
2 N
UME
RIC
A.T
I E
CHN
IOU
E O
-N N
GAA
OIE
NTMETHOOS 2
31
230 N
UME
RIC
AlT
ECH
NIO
UESFO
UN
CON
STR
AIN
EOO
PTI
MIZ
ATI
ON

GeneralAlgorithma Aorlt
hm:RandomWalk( A6.
2)
S
te .ChooseXoN(numbero
p1 fi
ter
atl
ons
)
Stp1
e . ChseXo
Stc
p2.F oreachi
ter
ati
oni Se
ti=1
Det
erminese
archdi
rect
ionvec
tor8j S
tep2
.F ore
achit
era
tio
nI
(
ltwouldbenic
eiftheobj
ect
ivedec
r e
ase
dal
ongt
hi
sdi
rec
tio
n)
=
81 Randomvecto
r

S
tcp3
.Calc
ula
tesX =si S
tep3
.Xj+ 1=Xj+S
j
N
ote: aX ji
snowafun
cti
onofthes
caIa
r<<
jasSi
sknownfromS
tep2
'
jisde
term
inedbym
ini
miz
ingj
{Xi+I
)

iscl
a1e
des te
psi
zeasit
tab
lish
esel en
gthofAXj i
i +1
ji
sdterm
inedbyMinimizing
f( whcreX '+ =
I Xj+X1 l <N00ToS
fi tep2
Heret
heconv
e r
gcncecri
ter
ia(FOC/SOC)andthesto
ppi
ngcri
tcr
ia(
Is e
lscSP(
ir
ati
onse
xce
ede
d)

s
zz
:;
12
rz
::
;;i
de
signcha
nging?Ex
ce e
dingite
rat
ionco
unt?etc
.)mustbech
eck
ed.
ii
+1; E
Z22
22z
te
l
o
nt
ne
-
h
d
i
sc
im
h
e
a
n
s
p
i
OoToS

t
o
e
r
n
t
a
t

h
i
lo
e

p
t
p2

sa
i
l
m
i
g
z
o
r
a
i
t
t
i
hmi
cs
nwi
o l
t
ruc
tur
ew il
lb eus
1beimplementedu
c
s
df
i
n
o
gt
ra
h
Ilo
egol
ft
de
h
ns
em
e
c
e
t
t
i
o
ho
d
nm
s.
e
t
'
bo
d
e
h
.
l
;
f
s
ignb
a

s
:
e
;

donat
es
tofrandomn
umb
er.
Example6.1wil
beusedtodcvelo
pthcdiff
ercntnu
meric
alm e
thods.
RandomWalk
m:Tlmrandomwalka
lgo
rit
hmtA62)is i
mpi
eme
ntc
dint
his

6
. s-N
2 NUMERICALTECHNIQUE ONGRAOIENTMETHOOS

'
hesemethodsareaJsocaJldz
e e r
o-ord
erm et
hods.'heorde
rrefcr
stoeo rdcrofth
c 1
'
der
ivati
veo ftheobjcc
tivefunctinn
o ecdedt oesta
blis
ht h
es e
archdirec
tiondurin
g
anyitera
tio
n.Ze roorders i
gni
fiestha
tnod eriv
ative
s u sed[2]whichi ntum
imp
lies o n
lyf unc
tionv a
luesareu sedtoS bli
shtbes e
archvecto
r.T herei
s I~

anoth
er i mporta
nt s ig
n i
ficanc
e t h
at a ccompanies t b
e m issing deriv
ativ
e
computation-the FOCs houldn otbea pplie
di nt he
sem ethods.Ifwc were
OP6miadon-TMcodeoft
herandomwalkf
unc
tio
nal
soi
ncl
ude
sth
Efo
llo
win
g
computingderiv
ativc
swem ightaswellinc
udet h
isinform
ationforest
abli
shingth
e
sear
chv e
ctor
.Onlyt hech a
ngesin eo b
j e
ctivcfunc
tionorthedesignvar
iable
sc a
n
prov
id conve
rgenced/o rstoppin
gcrit
eria
. ec
ontourofthcobj
ecti
vei
sdraw
n .
et cc
hniquesareinclu
dedinthissect
ion.Thef i
rs
tisaheuri
sticonebasedon
Fortwo
-varia
bleproblemstn
Fortwov
a
riablEpr
o bl
e m
st hesuc
cessf
uliter
ati
onsMetra
ckedonthec
ontou
r
randoms e
archdire
ctio
ns.Thes ccondonec yc
lest h
roughasearchdir
ccti
onbasedon
eachvarla
blc.l elastisP ow
cll'smethodw hichh astbcpropert
yo fq u
adratic dt h
eiter
ati
on"numberi d
ent
ifi
ed.
conve
rgence. .2;:u16vm d1 0 C df or
th
eone-
dimensi
onals t
epsizecom
putatio
n.


. Themu
ltiva
riab
leup rboundcalcu
latio
n( d
evelop
edi
nchaptcr5
)isuse
dfor
6
.2.
1 RandomWalk

Ez
: r
1
;
z;
;
~t

Thesear
chdir
ectio
nduri
ngeachite
rat
ioni
sarandomd i
rec
tio
n.Randomnumbersand .;
?

::
;:

:
2: 1
i I
n
1 h
ere
0
hd
di

i


I1
e

cr

.
:

::

;
:

se
tsofrandomnumbersareusu
alavai1a
blethroug
hsoftw
are.MATLABincl
ude
sthe
abtyt og ene
rates e
verJt
a ypcso f random numbers and matr
ice
s. Most i:: e L i
gnv
ari
abl
esand c
tio
nsf
ora
llo
f
comp
uter-g
enerat
edrandomnumbersar
c a
lldp
e seudorandomnumbersasth
eycyc
le
t
hci
tcr
ati
onsa
rcp
rin
ted
.
af
terasuff
jci
entnumberofthemhav beencrea
ted.Theonedim
ensio
nalstc
psi
ze
compu
tationi
sdoncbyt cGoldSectlon_nVar.m n
h cti
on( C
hapter5
).
i1j
1J
Lii
6
.2N
UME
RIC
ALT
ECH
NIO
UES-N
ONG
RAD
IEN
TMETHODS 233

ll
232 N
UME
RIC
AlT
ECH
NIO
UESF
ORUNCONST
RAlNEDo
pnM
IZA
TIO
N

l i--
Useofpr
eviou
sc o
deiI
Iusat
escoder
euseandm
odula
rp ro
grammi
ng.Oncemore 3.0804 2.0350 3.0020
r
de
rsarstr
ong
lyencour
ag e
d10vis
itth
ec o
detoun
derst
andth
ans
lat
iono
fthe 3.0804 2.0350 3.0020
Jg
a o
ril
Jlmandsubs
equen
tapplic
ati
on. 3.0804 2.0350 3.0020


3.0804 2.0350 3.0020 20 iterations
U g
e: ans

3.0804 2.0350 3.0020
Z
RandomWalk('Example6_1' [0.5 0.5]
20
0.001
01
20) (
6.7
) .~

Compare v aIuto e a ct
ual u tiono fx i=3 xi=2j*=3 .T sis
Inpu
t:(
The
yar
eth
it
cmse
ncl
ose
dwi
thi
nth
eou
ter
mos
tpa
ren
the
sisi
nex
pre
ssi
on remarkh
leforamethoda thasnos ens
eo fpref
erreddirec
tio
n.Iftheexecut
ion15
(
6.7
).) a resatedwithMe n
uca l
i npu
tme ntimnewsolu
tionwillbeobtaine
d.Figure6
2tracks
th; I gesofthed nv a
ri so ntheco lfp lot
.Themovem ntofi
li
e sign
'Examp
le6
_1
: lCfieEx
l ampl e6_1.mw herelleo
J b
jectiv
eisdesc
rib
ed varia
blesarep air
edw itht hecorzespon
dingi t
era
tionnumber.Therandomw alk
[0.5
0.5
] st
arti
ngdcsignveclor(dvar
O) funct
ionc anb EExECUtedf o
rs eve
raldiff
Erentsta
rtingsetsofd e
signvaria
bles.
It
20 numberofi t
erat
ion
so fthemethod( n
ite
r) shouldnotdisappoi .Th
nt eGoldSection_nVar.mi ses arn
eonea sinChapler5
0.
001 tol
eran
ceforeg o
l de
ns ec
tionproced e(t
ol
) except ili
ep r
intinghasb e
ens up
press
ed.
0 in
it
ialste
psiz
ef orscannin
gu pperbound(Iowbound) Whilee xec
utingeRandomWalk.mt heprintin
go f i te
rat
ionmb?
sl
epinte
rvalforscanning(in
tvI
) cmatesamessa syoua p
proachthesolution
. Y
ouc answitchi
toffbycommenttqgme
20 numberofs c
anningsteps(n aI
s) ( ) statement-ThgeodeinRandomwalk-ma lsoseIv
esasat e
mplat
eforother
a
lgor
iili
ms.ltisworthe x
ploringindet
ail
.
Out
pu t
:
Avectorofn+1v Ju
a e
sofd e
signva
ria
ble
satt
helas
tit
era
tio
nandt
hevJu
a eofth
e
o
bje
ctivcfun
cti
on.
E
xecutingf u
nct
ion(6.7
)i nlle Command w
J indow p
roduc
esthefoll
owi
ng
i
nfo
rmation(
ecommentsa readd
e dl
at
er
):
k

- The design vector and function during the iterations


a
m0000000023333333
=RJRd 'uu Jnunvnununununu
0099998803000000
0011112288444444

....
u
nunununununn3nEnononunDnD

0.5000 5.3125 start


0.5000 5.3125 did not move
1.0440 4.6481 decreased function
1.0440 4.6481 didnot move
1.0440 4.6481 didnot move
1.0440 4.6481 didnot move
4

0.9756 4.6349 decreased function


0.9756 4.6349 etc
2.1093 3.0663
2.0481 3.0025
2.0350 3.0020
2.0350 3.0020
2.0350 3.0020
2.0350 3.0020
2.0350 3.0020 0
.
5 1
.5

2.0350 3.0020
F
lgu
re6
.2 Randomw
al
k:Exam
ple6
.1
.

234 N
UME
AIC
AlT
ECH
NIO
UESF
OUNCONSTA
AlNEDO
PTI
MIZ
ATI
ON 6
.2N
UME
AIC
AlT
ECH
NIO
UES
-O
NGA
AOI
ENTMETHODS 235

6
.2.
2 P
att
ernSearch

j j+l
TheP attemS e
archmethodi sam i normodi
fication10lheUtliv
ari
atemethodwitha GoToStep2
maJ orI mpac.
tAst heP atte mSear chusest h
eU niv
aria
temethodt h
el a
tt
erisnot
d iscusseds e
para
tel
y.I nt heU n
ivariatemethoda1soknown t heCyc
licCoordi
nale TheP
atternSearchmetho
dhas a
fcwadd
itionalstopp in
g c
ritcria
.Thcscar
eb a
sedon
D esc enlmethode achd esignv a
r iab
le(considere
dac oordina)provi
desas ea
rch howmucht hefunc
tioni s
decreasi
ngforeachcyc l
e andhowmuchchangei stakin
g
dir ect
ion.T hi
sisa1sor efee dtoa sac oordina
ted i
rec
tion diseas
ilyexpre
ssed pl
aceinthc
designvaria
blei
tsel
f.Forth
elatt
erthisI
l1format
ionisba
sedontheleng
th
t hroughth
1
e
un
1 ofth
echangeinthed
e s
ignvectorfo
rthecy
cle.Onceagaintheapproachissimple
and
n
u mbr
ofva
r
i
a
bl
es
s th
ei mplemen
t a
tionisd irect
.Programmings uc hat echn
iquewillnotbct o
o
d
e
s
ig
nv a
riabl
es)
ite
rat
ion
son efora
c
hofthens
earchd
irect
ions.I
tcanbeshownbv fo
rbiddi
ng.
app ic
I at i
on tf orprobl emsw it
hc on
sider
ablen o
nline t
a h
eUnivadatem
et130J
ten dstog e
tl o
ck i n
toa z
igz
agp
att

E
emofs
mm

a PatternSearch.m: Toc o In
nl ueee xposu
r e10MA Tu.Bprogrammingi s
meth o
d
solu
J

t
11
0n
. i
si mpleme
ntedv erydif
fere1
ntyfromt heotheralgorit
hmsthathavebcentrans
lated
llePatmSearchprc
dur
ea t
tem
ptstodisru
ptt h
iszigzagb e
bavio
rbyexe
cuti
ngone in
toc od
es of
i .I
tisas ta
nd-a1oneprogra
m.T hercarep ro
mptsf o
r erinpu
tsw i
add
iti
o n
aliter
ati
onforea
chcy
cle.Ine
achcycleatee ndof11Univ
aria
tedi
rec
tio
nsth
e app
ropri
ated efau
ltv al
uesi nc as th
eu serd ecid
esn ott oentera valu
e.The
n+lsea hdir
ecti
onisass
embl1asaIn

I
I
1


a
rc

o

m
1
1
b one-
dimensio
na lstep
sizecomp u
tationisimpl e
m e
ntedbyem ul
tivar
iab
leg olde
n
d

c
on
sd eoptimum u
eof
th
l
e
p
zefo a
td i
rectio
n
. o ne
-dim io
nal se
ctionmctho
d .Thei n
tere
sti
n gfeat
u sar
ea sfol
1ows.
opt
imalsteps
izeisenm p
uted dthenextc y
cleo fi
ter
ationbeg
Il
1s
.
.I
tisaf
ree
sta
ndi
ngp
rog
ram
.
Ao
rit
hm:P
att
ernSearch6
.3) l
efi
lec
ont
aI
l1i
ngt
heo
bje
cti
vef
unc
tio
niss
ele
cte
dth
rou
ghal
is
tbo
x.
S
tep1
.ChooseX1Nc(
nu m
bero
fcy
cIe
s) S
cver
alprogramcon
tro
lparnete
rsareen
ter
edf
romt
hek
eyb
oar
daf
tera
j()=j(X Xc(
1
;
)
1)=X s
uit
abl
epromptin
dic
ati
ngd
efl
lul
tvalu
es.
E
E
2:tol
eranc
eforsto
p p
ingcr
ite
ria Dcf
aul
tv a
lue
sa r
cini
tia
liz
edi
fth
eu s
erchoo
scsno
t10en
tcrt
heva
lue
s.
S
etj=I( i
nit
ial
izec
yclecou
nt) Thcdes
ignvcct
oristr
acke
dandpri
ntcda
ftc
rthcp
rogr
amisst
opp
ed.
S
tep2
.Foreac
hc yc
lej S
incetheupp
erboundcal
cula
tio
nsarcb ase
donposi
tivcv
alu
csofs
tep
siz
eth
c

Fori=111 s
earc
hd ir
ect
ioni
s vcr
s if tumedst
eps
izeisesameasthelow
cr
b
ound.
S;=(u
niv
ari
ate p
)
X
+ =X;+
;
I
t
F
o
er
a
rt
w
t
o
i
o
-
v
nc
ar
i
o
a
u
b
l
nt
sa
ep
ro
r
b
l
er
e
e
c
mt
h
or
eo
b
d
j
e
d
e
c
.
ti
vef
unc
tio
nco
nto
ursa
rep
lot
ted
.

/isdet
ermi
nedb ym
i n
imizi
ngj
(X;
+)
(
sto
reva
lue
so f
.iandS/)
. Thef
ir
stnin
eo rI
cssi
ter
ati
onsaret
rac
edon c
ont
our
pl.
otThcU
niv
ari
ate
and
th
epatte
ms t
epsarec
o)orcodc
d.
cndofForl
oop
n
U g
e: PatternSearch (
6.
8)
=:;S;aX

-X (Pattcm Thep
rob
)emi
sExample6.
1.l
efi
] sEx
ei ample6_1.m.

Xj=X
n+ +C
i
S
j
v
ec
Output(MAT
tor[43
]th
l
ef
o
.
l
BCommandw
A
low
inga
rew
rit
t
i
e
n
do
nt
w)
:Withed
ot
h
e
faul
tv a
)
eCommandwindow.
ue
sandt
hes
tar
tin
g

X+1 )Xs J "


+1 )(
)=j( sto
rc
yclev
alu
es)
S
tep
3. 6j=1
r U+1)-1rAX=X I)-X
.
u
c
+ >> PatternSearch
Ifl
.
1j
lSE"s t
op The function for which the minimum is sought must be a
IfAX T.1xS~. s
top MATwa functionM - File. Given a vectordependentvariable
I
fj=N s
to
"
p it must return a scalar value. This is the function to be
MINIMIZED. Please select function name in the dialog box
X ~
and hit return:
236 N
UME
AIC
ALT
ECH
NIO
UESF
OAU
NCO
NST
AAI
NEDO
PTI
MIZ
ATI
ON 6
.2N
UME
AIC
ALT
ECH
NIO
UE9-NO
NGA
ADI
ENTMETHODS 237

The function you have chosen is ::Example6_1 2.9998 1.9999 3.0000 0.0000
maximum number of cycles [1000]: 2.9998 1.9999 3.0000 0.3398
convergence tolerance for difference in f[le8]: 2.9998 1.9999 3.0000 0.0000
convergence tolerance on change in design x [le-8]: 2.9998 1.9999 3.0000 0.0000

itill--
Input the starting design vector. This is mandatorv as 2.9998 1.9999 3.0000 0.2020
there is no default vector setup. The length of our Toverify eprogrami se xe
cutingthea1gorihm
ts c thedesignveclo
rs E
vector indicates the number of unknowns. Please enter it
now and hit return: f
irs
tlWoc olu
mns.Theu ni
vari
a l
es te
psc a
nbr ecognizedwhno necomponento fth
e
[
4 3] vec
10rc ha
ngesw hile o therm ai
ntainsitsvalue
.Thep atte
rnd ir
ectio
nsc anbe
. r
;
1 eco
gnizedwhenb othc ompo
n entsc ha
nge.
The initial design vector [4.00 3.00] ~: Thenumbero fiter
atio
nsisas ign
ific
antamoun.tOner eas
onisthatthetole
rance
s
Convergence in f : 3.999E 009 reached in 10 iterations
ar
emuchs m
aller
.I tcanben otedthat differe
nceb elwe
enlwoi lera
tion
sch ge
s
Number of useful calls to the Golden Section Search i
Inea
rly.Suchm eth odsaree xpec1edtor unf o
ral ar
genumbero fiter
ati
ons
.The
Method: 31 1 p
: rogr
amcon01p a
r t e
rscontroltheacc cyofer e
sul
tsasw el
la senumber
Total number of calls to the Golden Section Search ofite
rat
ion
s.Thes olutio
nismorea ccu
ratthantheRandomWa 1 kme od.
Method: 40 Figure6.3iI
Iu s
tralsea
e 1gorithmg r
aphica
lly.Theu nivar
iatea ndthep aUer
n
The values for x and f are dir
ecti
onsarequite d
isti
ngui
shable. Wh e
n executedon yourmachine t
h stepsare
ex
plic
itlycol
orc oded.Readersaree ncoura
g ed10goo verthecode.andmodifyi 1t
o
4.0000 3.0000 4.2500 0
4.4992 3.0000 4.0000 0.4996
4.4992 2.6924 3.6916 0.3081
4.3868 2.7616 3.6398 0.2254 E

4.1432 2.7616 3.5801 0.2446


4.1432 2.5287 3.4022 0.2339 4.
5
3.8229 2.2224 3.2890 1.3148
3.3338 2.2224 3.0494 0.4896
3.3338 2.1543 3.0343 0.0681
3.1750 2.1321 3.0180 0.3248
3.1980 2.1321 3.0175 0.0234
3.1980 2.0916 3.0121 0.0405
3.1944 2.0980 3.0118 0.1579
3.1473 2.0980 3.0096 0.0471
3.1473 2.0682 3.0067 0.0298
3.0346 1.9969 3.0016 2.3916
2.9958 1.9969 3.0000 0.0391
2.9958 1.9981 3.0000 0.0013
2.9971 1.9981 3.0000 0.0322
2.9972 1.9981 3.0000 0.0001
2.9972 1.9986 3.0000 0.0005
2.9972 1.9988 3.0000 0.4563
2.9977 1.9988 3.0000 0.0005
2.9977 1.9990 3.0000 0.0002
2.9999 1.9999 3.0000 4.9305 0
.5 1.
5 3
2.9998 1.9999 3.0000 0.0002
Rgure6
.3P
all
ems
ear
ch:Exam
ple6
.1
.
111 f H {
62 N
UME
AIC
ALT
ECH
NIQ
UEO
NGR
ADI
ENTMETHODS 239
238 N
UME
AIC
ALT
ECH
NIQ
UESFOAU
NCO
NST
AAI
NEDO
PTI
MIZ
ATI
ON

r
ef
l tt
hi
rpref
erenc
e.Thenumbero
fli
nesi
sar
oun
d25
0.Wea
t r
tin
gtog
eti
nto Xf=X
n++j
s
enousprogrammmg. Xc
U )Xf; fcU+ f(
+1 Xj)(
s yc
c I
e
S
te .!
p3 :
i
f=fcU+1
)
U
);d1{ XcU+1
)-Xc(
j=
)
6
.2.
3 Powell'sM
e' od l
fld
flSE"st
op
fd1{TdXSE
l 2.st
op
lft he
rew ereo nly one z e
ro- or
der method must be p rogranunedt he
overwhelmingc h
oicewouldbePowe l
1'smethod[ 3
].Thep r
incipa
lr easonf o
re If j=Nc sp
dec
isionwouldb et h
atith a
st hep rop
e r
t yofq l
ladr
aticc onvergenc
e namelyfora X
XJ
quad
raticproblemwithnv ari
ablesc on
v ergencwil
lb each i
evedinlessthano requ
a l jj+l
tonPowe l
1cy c
I e
s.A q uadra
ti cp roblemi sa nuncon s
i nedminimizationo fa GoToStep2
func
tionthatisexpressedasaq l.draticpolynomial-ap o
lynomialw ithnot e
r m
having ad egr
eeg reat
ert hant wo. Example6 .1i sa n example ofaq u
adratic APPMeattonofpoweII'sMethod:Thetra
nsl
ati
onofth
ealgo
rit
hmintoMATLAB
polynomia
li ntwov aria
bles
.E ng in
eerin gdesignoptimizatio
np roblemsa rerrely COd
eisle
ftasm exe
rcisefo
rth
estud
ent
.St
ep-by
-ste
papp
lica
GontoExample6.
1is
desc
ribedbyaq ua
draticpolynomi al
.sd oesnotimplythatyouc an
notu sePowe l
1
's
shownh
ere
.Example6
.1i
sre
sdas
method.Wh a
tthismeansi sthatt hes o
l ut
ions ho
uldn otbee xpe
ctedt oc onver
g e
qu
adrati
call
y.F ornonquadrat
icp r o
b l
e msast h
es o
lutionisa pproa
che diter
ativ
ely
eo bje
ctivecanbea pprox
imate dveryw ellbyaq uad
raticf u
nctio
n.Itisati sstage Exam
ple
6.1
att h
Thea
eq
c
u
a
t
d
ua
r
cc
laJgo
o
r
n
v
it
e
h
rg
encp

m(A6.
r
)i
4
oper
sas
tyi
i
sr
mp
e
l
aJi
e(
z
e
t
h
dinthec
ewordi
om
sn
pu
o
ta
t
tb
i
e
o
i
n
n
s.
gu sedIightly) Minimize f
(X)=f(x"X2)=3+(
x
-1
.5X
2)2+(
x
2 (
6.3
)
modifi
cationtothePattemS earc halgorithm.lneachc ycJe(aeref irs
t)inste
a d
6.
( 4
)
ofus i
ngu niva
riatedirect
ionsi nt hefirstni ter
atio
ns.t hes e
archd irect
ionsa re
obtaine
dfromt h
ep reviou
sc ycJe.Thenews earchdirection
sa reobtainedbyI
sh
iftin
gt hedirec
tionsoft h
ep reviouscy cJe
.I niswayah isto
ryo fthep revi
ous X=[g:~lfl 5.3125; E
=
sear
chd ir
ection
sisu sedtoestablisht h
en x.
e tWitht h
isc hange.Powell'smethod
shouldconvergeatmosti nthreec ycJesf orExamplc6 .1r athe
rt hant hesever
al
=[~]

li
stedinthep r
evioussectio
n. S =[6]; S
2

Aorit
hm:P owe l
l'sMethod 6 .4) j=l
S
te .ChooseX" Nc(numberofc
p1 ycle
s) S
tep2
.j=1
J
tl)=j {X1);Xc{l)=X X2431+l =??l
E
S
E

et
2:t
j=1(
ol
er
i
n
a
i
n
t
c
i
ef
a
li
o
z
rs
eP
t
o
w
o
e
p
l
p
in
lc
gc
yc
r
l
i
te
ec
r
i
o
a
un
t) 2
. =1
/4; X2= l
Fori=1 n
;=~; (
X3 =+[o.~1
S univa
riat
es t
ep)
S
tep2
.F ore achyc
.clej i 2
:=
Fori=l.n
Ifj2 S;S ;+ 444615;X4zj;)=4.5576

+)[~]=[5]
X;+ =X;+ISI
;isdet e
n nin
edbym inim
izingJtXi
+'
) i=3: S
)=0
.25[
6]
endo fForl


o
o

Sj=S;+=I;
S
p

;=Xn
+ XJ

- a
(ptt
ems
tep
)
X4=[03251
i
5]
2
40 N
UME
RIC
ALT
ECH
NIQ
UESF
ORU
NCO
NST
RAI
NEDOP
TlM
IZA
TlON
6
.3 N
UME
RIC
ALT
ECH
NIQ
UEs-GR
ADI
ENT
.BA
SEDM
ETH
ODS 2
41

;=0.
423
5;
L
=
11
:5
7
0; f(X
4)=4.
4843
6
. s-GRADIENT-BASEDMETHODS
3 NUMERICALTECHNIQUE
Ste
p3.l.
dfl=1
.353>EI
'cont
inu
e
I
nl i
gh
tofthepre
viou
sdefin
iti
on.the
sewouldbere
fer
redtoasf
irst
.ord
ermods.
T
l
dX dXl=1.89
92>Ez.co
nti
nue Thesea
rchdi
rec
tio
nswil
lb eco
nstru
ctedus
ingt
hegra
dien
toftheobje
cti
vefun
cti
on.
}=2:Onecyc
leove
r Sin
ceg ra
die
ntsareb ei
ngc ompute
d. eK uhn-T
uckerc on
diti
ons (F
OC) for
GoToStep2 unc
onst
nedprob
lem.V
s f=O.c a
nb eus
edtoche
ckforconv
ergen
ce.TheSOCa re
har
dlyeverappl
ied.Oneo fthereas
onsisa titw ou ldinvolvethec omputa
t ionofan
-
S
tep2:}=2
- nX1s econdderiva
tivem atrixwhichi sc o
n sidredcompu t io
nall
ye xpensiv
e.


M
xJ0.855 gu par
tic
ular
lyifee valua
tionoft h
e0t i
vef unction quiresacalltoaf i
ni
tee lemen
t
J=1
11
11c'7n:
.
l57 1
0'
l =-0 .
14111'

'Y .85581 methodforgenera
t i
ngr equir
i nf
ormali
on.A noth erreasonf ornotc a
lculatin
gt h
e
.2
1- ..l ~OO; 1
=1.0
1 1
041;f(X)=4.
2 414
5
Hessi
anisa ttheexislenceofes econdd erivativeinar eald esignproblemisn o
t
c
ertai
ne venthoughitiscomputatio
nallyp ossibleo rfeasi
ble.Fo rproblemsthatcan

1
1
1i
Z
];





2

S2=[0 25J =
0


0


3
4

5
b
o
ed
fs
W
e
e
i
s
c
t
c
o
h
r
i
n
o
be
dd
u
db
er
i
ys
va
tSOCt
t
i
y
v
mb
a
he
ol
tt
s
i

em
cc
h
a
ep
et
l
o
h
c
s
o
u
l
s
d
a
i
t
b
l
sr
i
on
es
eq
s
.MA
o
u
l
i
r
ut
i
eu
o
11.ABs
na
ser
n
'
di
sv
h o
u
e
igi
l
i
l
db
g
a
e
n
c
ea
nv
et
a
b
l
l
u
oe
et
es
n
oh
.
s
u r
andl
ec

e t
o
m

h
es
pu

o
t

l
a

u
t

t
i
o

i
o
n

n
i=3
:_
v _
10.
956
71 ~ r
0.
10
11 rll
obtai
nedisaminimumr athe
ra namaximumo ras ad d
lep oin.As
t impl way10
.1966J~3 =.0396/:3=20~ =/

ilillit---
'

U 2
/
;f(X =3 ver
ifyisi stope r
turbt heobjct
ivef un
c tio
nt hroughp eu r
bationint hd esi
gn


- 4)
var
iabl
esatthesoluti
ona ndverif
yitisalocalm i nim um.Thisb ringsupani mportan
t


::
i;;32!emd C
u
tat
ion
sini e
rci
se s
top
ped
p
t
r
ot
op
h
o
e
de
f
s
t
i
h
g
es
nw
em
he
e
r
ods-theyo
et hei tera
ti
n
1
o
n
yf
sa
in
r
dl
eb
oc
e
a
g
lo
un
pt
.B
im
e
u
f
m
o
s
r
.U
ec
s u
o
a
l
n
c
l
l
yt
ud
h
i
i
sw
n
i
gt
l
h
lb
ed
ec
e
10
si
g
s
e
n
itE:27 ;:Jr:atJ;;::::wouldit h
ere
?You a
gedt
o
e
d
x
i
p
l
s
o
c
r
o
v
a
e
t
io
ri
n.i
fo
ti
th
sn
e
ecess Yt
rminimumsx
oexe
i
c
s
ut
ta
et
n
hem
ds e
e
l
e
t
c
ho
tt
df
h
r
eb
oms
es
e
to
ve
n
r
als
eb
ta
yh
rt
i
e
n
a
gp
dt
oi
oh
n
tst
e
a
o
d
compa
rison.Theb ulko fe xisti
ngu nconstra ineda ndc on st
ra in
edo ptimizati
on
-lem
eth
odo
nlyt
ookt
woc
ycl
est
oco
nve
rge(
ase
xpe
cte
d) methodsbelongtoi sc ateg
ory.
Thee
xte
nto
fcompu o
nis s
amea
sth
ePa
tte
mS c
hb l
enumberof Fourm cthod
sa represente
d.Thef ir
stist hcSt e
e pe
stD escentm ethod.W hil t
hi
s
i
ter
ati
onsi
ssi
gni
fic
ant
lysma1
l
er
. methodisnotusedinp r
actic
e.itprov
idesa ne x
c e
l l
ente xampl eforunderstandingth
c

2:;;212S22;:rsecondmleiS
alg
orith
micprinc
iplesfor g r
adie
nt-basedt echni
q ue
s.Thes econdistheConjugate
t
iv
e.H
E
nc

e
Gradi
enttechniq
uew hichisac la
ssic
alw orkhor sepa cu l
arlyini ndus usage.The
t
hirdandfourt
hb elongtothec a
tegor
yo fVar iableM etr
i cmethods.o rQuasi-Newton
Thest
eps
izefo
rthel
as
ti t
cra
tio
nis20.Thes up
por
tin
gal g
ori
thmfo
r meo dstheya realsocall
ed.Thesem ethodsh a vcbeenp op f o
rsomet ime. d
;;:
::!
1gandg
olde
nse
cuonmustbeab
let pt
O t h
eminimum
at elar w
illpossib
lys t
aythatwayf oral on
gt imetoc o me.


Thcg cn
eralproblema nds pe
cif
ice xamplear p roducedf o
rc onveni
en c
e

z r
Wh
iil
enot
ilh
uslm
tdhmer
E
.t
h el
sa
x
i
mlu
1 nm
mIl
umb
?
e
r'0fc
y

c1e

st
o
co
nv
e
r
:gen
1c
e
fl
or
:
L :
:
z2

I



3




1;
a

::

:
f
:
:f gp
oin
tY
. M
ini
miz
e j
(X)
; [
X]" 6.
( 1
)
S
ubj
ect
XI~Xj~xlt; i=I.2.....n (
6.2
)

2
m
a

c
t
ou
n
.
j
z
r
i
g
a


:
3
x
2
i
fi
:
.l
c


5
1
3
fs
ya
r
2
t
e
a
c
i
:;
d

ire
cti
ons
Sj
. adao
n n~u
gate d
i
e
c

o
n
E
M
i

S
u
n

b
i
m

j
e
i

c
z
e j

tt
o
(X)=f
(X

: OSXIS
.X2)=3+(
I

5:
XI- 1
.5x
2)2+(X2- 2

oSX2S5
)2 (
6.3
)

(
6.4
)

SJ
[U]Sj=0 6
.3.
1 SteepestDescentMethod
(
6.9
)
V
eri i
fi
ti
str
ucf
ort
hce
xam
ple
. Thi
smethodp
rov
ide
san a
tur
alevo
luti
onfo
rthegra
die
ntbas
edtec
hni
que
s[ 4
].
Thegr
adi
ento
fafun
cti
onatapo
intisth
edi
rec
tio
nofthem
ostra
pidin
cre
asein
242 N
UME
RIC
AlT
ECH
NIQ
UESF
ORU
NCO
NST
RAI
NEDO
PTI
MIZ
ATI
ON 6
.3N
UME
RICAlT
ECH
NIQ
UEs-GR
ADI
ENT
-BA
SEDMETHODS 243

t
hevalueoft
hefunct
ionattl
la
tpoint
.Thede
scentd
ircti
oncanbeobt
ainedre
versi
nl!
Output(wri
tte
ntoeCommandw ind
ow):A c o
upl
eofi
ter
ati
onsa
tes
ta
rtanda
t
t
hegradie
nt(ormultip
lyingi
tby- 1
).Thenextstepwouldbetorega
rdtl
1edesce
nt EE nd(o
utof20i
terat
ion
s)M
e c
opiedb-
l o
w.
v
eclo
ra sas ear
chd i
rect
ionaf
teral
lwea reaUempting10decr
easetl
1efuncti
on
5.3
125 5.296
9
t
a
l
h
r
g
o
o
u
r
i
g
t
hs
h
u
m
cce
ssiveite
rat
ions
.Thisser
iesofst
epsgiveris
etoeS te
epestDes
cent
j 0
0
.
.
5
5
0
9
0
9
0
6
0
0
.
.
0
.
5
9
8
0
0
4
8
4
0
3
2
9
4
4
.
.
7
3
8
3
7
2
6
6
2.
3.
84
11
1379
1
.0701
A'ori
thm
:Stl P t Descent6 .
0
.0507
S
tepJ.ChooseXJ N( numbero
fit
era
tio
ns) I~ 2
.690
1 1
.8659 3
.029
8
0.0
462
2
.7455 1.
8502 3.
023
3
!
.()=j
l {X1
)
;X.(
l)=X1(
sto
rev
alu
es) 1
.8960 3.
018
1 0.031
6
2.
7585
E

S
e
JE
2
ti
'E
J
=1(
:(
in
i
to
ia
t
l
e
1i
r
z
a
n
ei
c
t
e
ef
r
o
a
t
rs
i
t
o
o
nc
p
p
o
u
i
n
n
gc
t
er
r
i
)
te
ria
)
jFigure6.4rep sentsthegraphicalrnotionofthedesignvariablesfor20itErations.

Thegrap
hica
lp i
ctu
reandthechangesinthedesignarEnotimPEE
SSiETheS
V tee
pest
S
te .S
p2 j=-
Vf(
X/)
(i
siscomputedi
nSt
ep3
)
Desce
ntmEthodiSWOE
ful
lyMadequatECompazedt oPowe
ll-smethodeveni
fth
elatt
er
X
;+l=X;+~; isazero-
orde
rme t
l
1od.MO[1verisconclusioni
sdrawnw ithrpectl
oa n sy
i
sde
ter
min
edbym
ini
miz
ing
f(X
;+I
) problem(qu
adra
tic
)Example6 .1.i sp erforman
cej us
tif
iestl
1elac
ko fseri
ous
X
s(i+1)X 1
; (
i+1
)=f(X+
il)(
sto
reva
1ue
s) int
ere
stinth
eS t
ecpe
stDcsc
e n
tmet h
o d
.
S
tep
3.a
J =!
.(i+
l)aX=X s
(i+1)-Xs(i
)
I
flaJ
l~EI; p (
func
tionn
otc
han
ging)
T
faX aX~ E
I 2
; stop(de
sig
nno
tchan
ging)
[
fi+1=N; s t
op 5

I
fVf
(X;
+ll
Vf(
Xi )~ E
+l 3; c
onv
erg
ed
ii+1
4
.5

GoToStep2

t
SteepestDescen.m: Thisisanm-f
ilea1e x
ecua
t 1go
rithmA6.
5.Itusese
gol
densec
tinandt
o l1eu
ppe rbounds
canni
ngPI1e
ss.learesof
thi
sprogramar
e
asfo
llo
ws.

Fortwov
ari
abl
esi Id
twi
J rawt
l
1ec
ont
ourp
lo.
t
Fortwova
ria
ble
sthedesi
gnvectorc
han
gesc
anb
ese
eng
rap
hic
all
yins
low
moti
onwit
l
1step
sindi
ffe
rentc
olo
r.
Thedesi
gnv a
ria
bls
e ef un
ctinva
o 1ueandeS q
Uaroft
l
1elegt
n l
1of
gr
adie
ntvec
tor(c
a11
edKTv
al u
e)ateachit
era
tionare
disp
lay
edint
l
1eCommand
windowatcom
pleti
onoft
l1enumberofit
erat
ions
.
Thegra
dien
1oft
l
1efun
cti
oni
snume
ric
allycomput usi
ngfir
stf
orw
ardf
is
Ite
di
ffe
ren
ce.Theg
rad
icn
tcomp
uta
tio st
ni l
1er
efo a
utom
atic.
Fromaprogrammingp
ers
pec
tiv
eb
asi
cst
rin
gha
ndl
ingt
och
ang
eli
nec
olo
ris
in
tro
clu
ced
.
0
.5

Usage: SteepestDescent('Example6_1'(0.5 0.5]


200.00010120) (
6.1
0) g
ure6
.4 S
lep
estdesn
:tExa
mpl
e6.
1.
244 N
UME
AIC
LTE
CHN
IQU
ESF
OAU
NCO
NST
AAI
NEDOPT1M
IZA ON
Tl
6
.3N
UME
RIC
ALT
ECH
NQUEs-GR
AD'
ENT
.BA
SEDMETHODS 245

rJ
xp

;
e
c

?
t
1
e
2
:
dt
:
J
I:
241
2
oovercom
EZ
t


hi
spattem.I
nt h
ecaseofth
eU n
ivar
iat
em odt h
iswas
c
i
o
n
m
c
o
p
r
u
p
t
o
a
t
r
i
a
o
ti
n
n
--
s
gt
. and th succes5ive adjustment of search direction
h
isv a
lue.~ rep
rese
ntstherat
ioofthesquareofthecurrentgradie
nt
vec
tortoth esquareofthepreviou
sg ra
dien
tv e
ctor
.Thef ir
stthingtonOliceisat

ac
hEe y
edthro
ughp atF
rnS e
ar c
hmethodint h
ezero-
orde
rfamily.Anit
era
tio
n
adegreeo frobustnes
sisb ui
ltintothemethodbyc arryin
gi nfo
r m
ationfromt h
e
br
eaki 0o ft h
ez igz
agp a m (o
rp r
even
tin
gg et
tin
gl oc
kedint
ooIn
EPi5
:

:

::rro:l
i
z

:
:
::

22
: e
me
o
d Suc
h

p

z
r

e
e

r
v
i
onei
oa
o
t
u
e
si
r
a
tt
t
h
t
i
e
o
es
r
n
at
.S
o
lu
i
o
i
t
n
n
i
o
.T
c
n
h
et
isi
h
sIikem
eFOCi
. isP ti
a
sb
c
ul
i
a
a
n
s
t
e
ain
in
dont
rfonno
gah
h
fi
el
nc
i
s
e
o
t
n
r
p
o
g
o
r
yo
t
r
ho
at
ft
ft
io
h
h
no
emethoda
eg r
ad
f~ i
i
si
en
n
l
ta
ge
n
b
p
i
e
p
o
i
tf

u
r
o
s
o
a
c
.I
rj
h
i
ft
u
n
s
t
g
h
e
pre
viousilerati
onisclosetothesolu
tion
.thens i
sl ar
geand p revi
o u
si te
rati
on
6
.3.
2 ConJugateGradient(
Fle
tch
er-
Ree
ves
)Method pla
ysas ignific
antr o
leint hecurr
entiter
ati
on.Ont heo th
erhandi fsi slarg
e.

z z
sug
gestingt hesoluti
oniss t
il
lf rawayt
a henthec urr
entv a
lueo ftheg radie
nt

5;
5
TheCou
gat
eGr
adi
entmethod
ori
gin
al
Iydue F
1et
che
ran
dRe
eve
s[]
5 sasma
i Il dete
rminest henews earchdir
ecti
on.

c
i
onv

e


e

;
i
r


g
?
:
en


;
c

be
c




a


2
5
g:
;
:
us
2
et

;
q
i
h


es

:
e
a
?

r

:
1
i
c

i
5
;
hdl
I
r
.e
;

c
t
u1o3
n
Esa
M
rc

0
1
j

Ij wi
ugate t
h s
pt
t
oth
eHe
ssi
an
A
w
p
a
r
p
r
l
l
an
ca
tw
tl
o
o
r
'
0
n ConJugateGradlentMethod:Thi
k
ingt hro
ught h
ei te
rat
ion
s.Th esecaIcu
l
s method i
atio
nss i
mi
si
l
art
mp
or
oP
t
o
a
n
w
tt
el
l'
o
s
a
Ic
:

:
?xi
:
E:

:
:

l
u


on
.Aq
ul
a
mt
i
ts
e
h
lf
odc
.Thea
anb
ut
edoneu
h
o
singahandc
rrecommendstheca
Icu
u
l
l
a
a
t
t
o
o
r.u
ra
sin
sep
gas
ro
ce
p
a

ssi
ds
ss
h
lo
o
t
wen
rusingMATLAB
oughtodev
elop
anintu
itio
nw orkin
gw iththep a
ltemo fnumb r
s.Int hef oll
owin
ga ndunli
ke
Po
well'smt ho
don1ythereleva
ntc a
Icu
1atio
nsa rereco
rded.Ther eade
rs h
ould
A'o
r/
l m:C onJuga Gra
df t
j a fo
llowaIoogveri
fyi
ngthenumbersareiod
e e
dcorrect
.
S
tep1. ChooseX" N (
numbe
rofi
ter
ati
on
)
10.
51
!
s()=j(X
l )
;X.(
l)=X
(st
orev
alu
es) S
tep1
.X1=1 o
:
sl
; f
(X
)=5
.31
25
E
E 2E
3:(tol
eran
ceforstop
pingc
rit
eri
a)
S
eli =I(ini
lia
liz
eiter
ati
oncou
nte
r)
10.5 1 _._ _
_ ...
. ._ _
_. __ 1 0
.59
961
S
tep
2.I
fi=I Sj=-Vj(X )
j S
te
.S =12~i51;i =0
p2 .19
93;f
(i)=4
.78
31; X2=
1O:94
841
Elses= '(xjfVj(Xj
)
Vj
(Xj
_)TVj
l (Xi
_'
) t=2-1.64591
:s 1;)=IO~36571
)+s
Si=-Vj( Sj_ S
tep2 =0
.53
5
11
.91351 131
X
' I=X/+t I
2= O:83831;i

+ =1.
254
4;f
()=
3.0
; X3=121

Iisd
ete
rmi
nedbym
ini
miz
ing
j(Xi
+
)

S 3
.!
X
.
j
J
.
I
f
(

l
i+1
=
f
!
J
s(
.
j
)X;+;(i+1)=j
i+l)1); X=X.

lsE
I

; f
(

u
m


n
J
E

c


n


t
i


i
o
(X
(i+1
nnE

X
)% (
s
.
(
V s
) Con)ugateGradlent.m: Thi
Fortwo a
pro
gressi
r
nt
i
h
ab
l
ed
ep
esi
rob
s
l
e
p
m
a
st
cei
h
e
sr
sm
r
e
-
ew
c
o
f

r
i
l
i
l
d
ew
lb
ed
ille
eac
.Thep
xec
o
r
u
n
o
t
t
o
p
e
et
u
rt
h
rp
eC

yo
l
o
on
to
j

fqua
u
v
e
g
a

8
t
rw
eG

t
i
h
r
i
Cc
a
c
o
d

n
i

v
e

e
n
hei
r
tm

ge
e
t
n
c
t
e
r
h
a
ec
o
t
i
d
.
v
a
e
n
beo bs
erved t hesolut
ioniso btai
neda ftertwoi te
rat
ion
s. Thisisd e
fini
tely
I
f!
.X
J '!
J
.X:$E2
st
op(
des
ignn
otc
han
gin
g) imp
ressivec omparedwith S tpestD escentm od.K pi nminda tt he
Ifi+I=N; 5t
op mod
ificati
ont otheaIg
orithmisminor
.Asev ariou
sc od
esa r
er u
ni nord
er.some
I
fVj
(X+
i
fVj(X):
$E3
; c
onv
erg
d chan
gesint hefig
urecanbeobserve
d.The searelar
glyduetotheuseofsomes t
ring
i~i+1 pro
cessingfunct
ions
.Youa reencourage
dt os eehowe ya r
ei mp
lemented.The
aut
horiscertai
nthereareingsyouwoulddod iffe
ren
tly
.Don othe
sita
ttoy a
s
GoToS
tep2
istheon1ywayt olear
ntou s
eMATLABe f
fc
ti
vel
y.

c ;::P22Jt::2JUlz;ittrtt;123tzr:rn;
;
;
:
; 20
Example6_1'[0.5 0.5]
U ge:ConjugateGradient(
0.00010120);
6.
( 11
)
246 N
UME
RIC
ALT
ECH
NIQ
UESFO
UN
CON
STR
AIN
EDO
PTI
MA
TIO
N
6
.3N
UME
RIC
ALT
ECH
NIQ
UE-GR
ADI
ENT
BASEDMETHODS 247
Output(Commandwindow)
th
isfarlyo fmethodsgobeyondt hat
.Ast hesolu
tionisapproachedtheybehavelik
e
Theprobl
em:Example6_1
Newton'smethod( Secti
on6. 4
).Theq ua
d raticconvergenceo fNewton'smethodi s
Thedesi
gnvect
orfun
ctio
nva
luea
ndKTv
alu
edu
rin
gth
eit
era
tio
ns qui
lei mpressive-itwilllocate s o
lut io
nt oaq u
adraticproblemi nolleite
rat
ion
.
ThisNewton- i
Ikebehavioro ft
h eVMM a sthesolu
tionisapproa c
hedhasgiventhem
0.
5000 0.
5000 5.
3125 0.2
490 anothernam termedQ uasi-Ne
w tollorNe wton-li
kem ethods
.
0.
5996 0.
9483 4.
7832 2.
8411 TheDFPmethodi spresentedh er
ef o
rh is
tor
icalinter
est db ecauseitisalit
tl
e
2.
9995 1.9
982 3.
0000 0
.0001 eas
iertou nd
e rs
tandthan o t
hers.InfactHuang( 7)documentsag e
nericprocedur
e
fromwhichmosto fep opularmethodsc anbeo bta
i n
edandfromwhichyouc oul
d
Keepinmindthesolut
ionisdepend
entont hetol
era
ncefortheo
ne-
dimen
siona
I als
od eriveyourown.
st
eps
izes
earcha
ndt h
attheder
ivat
ive
sa r
ecomputednur
ner
ica
lly
.Theexe
cutio
no f Th eCo nj
u g
ateGradien
tm ethod'sirnpr
o vementovertheStee
peslDescentmethodwas
ecodesho
ulddis
playFigu
re6.5inthefi
gur
ewindow.
pos
sibleb ecauseoft heinclus
i onoft h
eh ist
orym t hepreviousiter
ati
on.lnt h
e
quasi-Newtonm ethodst h histo
ryfrom a I
lp reviousi t
era
tionsisa vai
lab
le.T hi
s
6
.3.
3 Davldon-Fletcher-PowellMethod infor
m oni scoll
ectedina nnXnm i xc a
lledem etr
ic.Them e
tricisupdate
dwi
eacbite
r a
tio
n disu sedtoesta
blishthes hd ire
ctio
n.Ani nit
ialchoic
ef o
rthemetric
TheD a
vidon-
Fletc
her-P
owell(DFP)[ 6
]methodbelongstoef amil
yo fVaria
ble i
sa lo u d
s .Itmustbea t e
t'
cp o
sitiv
ed ef
tnit
em atr
ix.F ort h
em odt o
Metr
icMethods(VMM).Itwasn rs
tintrodu
cedbyDavidonands e
VEralyEMBlat
er convergeth
emet Icm
l usth oldont oit
sp o
s it
ivedefi
niteproper
tyt hrou
ght h
eiter
ati
ons
.
wasd eve
lopedinitscurr
entf ormbyF let
chr dPowel
e I
. Bingawareo fthe heDFPmethodt h
em et
ri capproac
hes i nvers
eo ftheHessianatUlesol
uti
on.
Conj
ugateGradi
entmethodth
esemethodswouldnotmerti
I ncIu
sioninth
isbookif
th
eyd i
dn othaveth
eproper
tyo fqu
.ad
raticcon
ver
ge n
cewhichtheydo.Gene
rally Aorithm:Davidon-
F '
che
r-P
owe
l A6
l(
.
x
.
.[A1l(initialmeic}N


S
tep1
.Choos

Ehe
2'e
J:(
tol
era
ncef
ors
top
pin
gcr
i i
a)
S
eti=1(
ini
tia
liz
it
era
tio
nco
unt
er)
S
te .8=
p2
[Aj]Vf(Xj
)
Xi+1= Xi+s
u AX=jS
iisde
t e
r m
indbym
e ini
miz
ing
f(X
i+l
)
S
te .I
p3 fV
f(X
i+I
)TVf(X
i+1
)e
3; c
onv
erg
ed
ff
I!(X
i )f
+l (Xj
)1:
;el; stop (fu
ncti
onnotcha
ngi
ng)
I T
fAX AX~e2 stop (des
ignnotchan
ging
)
fi+1=N s
I top (it
era
tini
o I
mil)
E
ls

Y=Vf(Xj
+l j
)-Vf(X}
z=[A;]Y
AXaX T
[
B]
=-
--
:-
:::
:;
::
:
AX'Y

ZZT
[q= --~-
V'Z
2 3
.5 4 4
.5 5 [Ai
+
J +[
l=[A] B]+[q

i i+1
F
lgu
re6
.5C
oni
uga
teg
rad
len
tme
tho
d:E
xam
ple6
.1
. GoToS
tep2
Hjil--J41JHAHill-J
248 N
UME
RIC
ALT
ECH
NIO
UESF
ORU
NCO
NST
RAI
NEDO
PTI
MIZ
ATI
ON 6
.3N
UME
RIC
ALT
ECH
NIQ
UE3
RAD
IEN
T.B
ASE
DMETHODS 249

I
nthea
bov
e em a
tri
cesar
ee n
clos
edb
ys qu
areb
rac
ket
s.Thein
it
ialch
oic
eoft
he iteration number: 1
m
etr
ici
sapos
iti
vedef
ini
tema
trix
.Thei
den
tiym
t at
rixi
sasafec
hoi
ce. s
0.4990 2.2467
DFP.m: TheDFPa lgo
rith
m(A6.
7)iscode
dinism-f
ile
.Simil
ar10thepr
evio
us delx =
0.0996
programsfo
rtwovar
iab
lesedesi
gncha
ngesar
etrac
kedonab a
ckgro
un dc
onto
ur
0.4483
pl
ot F
igure6.6.Thedef
aul
tin
it
ialme
tri
cisIheid
ent
itymat
rixgen
eratedus
inga y
MATLABb ui
lt-
infu
nct
ion
.
-1.1458
2.6153
U
sag
e:DFP('Example6_1'[0.5 0.51
40.0001
01 6.
20); (12) z
-1.1458
Output: The ou
tputfromtheabov
ei nvoc
atio
n( c
o p
iedf r
omt he Command 2.6153
window)canbeob
tain
edbyrem
ovi
ngthcscm
i-col
onaf
terthes
tatem
en.
tThevari
abl
e B
de
fini
tio
nsm a
tchtho
sede
fine
dinth
ealgo
rith
m.ForExample6.1 0.0094 0.0422
0.0422 0.1899
=
A

c
01

0.1610 0.3676
nU

0.3676 -0.8390
A
0.8483 0.4097
0.4097 0.3509
iteration number: 2
s
1.2443 0.5446
The problem: Example6_1
The design vectorfunction value and KT value
during the ite ations
0.5000 0.5000 5.3125 5.2969
0.5996 0.9483 4.7832 2.8411
2.9996 1.9987 3.0000 0.0000

6
.3.
4 Broydon-Fletcher-Goldfart
ShannoMethod

Ifyou weretoprogramo nl
yoneg rad
ient-bas
cdmt hod
.t hent hcBroydon-
Fletcher-Goldfarb-Shanno(BFGS)181method would be t he one.It isa
quasi-Nc
wtonmethodandc u
rren
tlyist h
emostp opu
larofthV aria
bleMctric
method
s.Itenjoyslhepropcr
lyo fquud
raticconvcrgenccandh a
sr obu
stnes
sb y
car
ryingforwa
rdinformat
ionfromI13
Epreviou
si ter
ation
s.Th
ed iffe
rencEb
Etween
DFPa ndBFGSi sthewayt hemelri
cisu p
d a
led.Thef orme
rc onver
gestothe
4 4
.5 5
inve
rseoftheHessia
n.w hi
lethelatt
erconvergestotheHessianit
sel
f.Inas e
nse
eBFGS i s morc dir
ect
. The BFGS h asr eplace
dt heC onju
gateG radi
enl
F
Jgu
re6
.6 DFPM
elh
od:E
xam
ple6
.1
. techn
iquesasaw o
rkhorseinsolvin
gn on
linearequat
ions
.
250 N
UME
RIC
ALT
ECH
NIQ
UESFORU
NCO
NST
RAI
NEDOP
TlM
IZAT
lON 6.
4 N
UME
RIC
ALT
ECH
NIQ
UEs-5ECONDORDER 2
51


Forc onve
rgencetheme
tricmustb ep
osi
tivedef
ini
te.Ani ni
ti
alc h
oic
eo f


p
ositi
ved e
finI
m
l atr
ixfo
rthemetr
icisus
ual
Jysuff
icien
lloens
urethi
sprop
ert
y


RU
f
orquadr
aticprob
lems
.Theide
nti
tymat
rixi
susu
allyadef
aultc
hoi
ce.

A
lgorit
hm:BroF er-Goldfarb-Shanno(BFGS)Method(
A6.
S
tep1
. ChoeX"[
Atl(
in
it
ia
lme
tri)
c N
2
E"E E
3:(
tol
era
ncef
ors
top
pin
gcr
ite
ria
)
S
cti=1(
ini
tia
liz
eit
era
tio
nco
unt
er)
S
tep2
. These
arc
hdir
ect
ioni
sob
tai
neda
sas
olu
tio
nto
[A;
]S=-Vf(X)

S
tep3
.I
x=~+

ii
sd
fV
e
t
f(X
en
n
)
i
n
TV
e

l
CS;
dJ(=
dbyMin
f(X) E
3
S
z
ing
f(X)
converged
i
E cl=2m-3 21
-3
.04
29 6
.50
95

fr
II(Xi
+l)f(X) Isp (
1~ E fun
cti
onn
otc
hun
gin
g)
I
f!1
T
X dJ(~ E
2; s
top (de
signn
otc
han
gin
g) S24221; =1 4
4; X3=[H =
3.; )
0 =[g]
fi+1=Ns
I t
op(i
ter
ati
onl
imi
t)
Converged
E
lse
Y= Vf(Xi
+l)- Vf(X
) Thet ra
nsla
tionoftheBFGSa lg
oril
hmi n
tocodci sle
ftasa ne xe
rciseforthe
yyT stud
ent
.Itisrecommcndedt h
atUlecalc
ulat
ionofthesear
chd i
rect
ioninStcp2be
[
B
)= accompli
shedasasol
utiontoasetofli
nea
requat
ions(asl
ist
ed)raU
lerthanin
vert
ing
y
'dJ( th
em atri
xA .Oneo th
ert hin
gt onoteforExample6.1ist h
atift h
ep oly
nomial
appro
ximationwasu se
df ort h
eo ne
-dimen
sionulproce
ssthec a
lcula
tionof -
)
Vf(XVf(X
? wouldhaveb ecne
xuc
t( why
?).
[C]=
Vf
(X;
)'Sj
[A
j d=
+ [A
;]+[
B)+[
c]
if
i
- +1 6
.4 NUMERICALTECHNIQUES-
SECONDORDER
GoToS
tep2
Scond-
ordermethodsforuncons
traine
do pt
imizat
iona r
enotu sc
dbc ausv
al
ualio
n

A
p
c
s
p
s
l
i
e
n
c
t
t
i
a
lo
lc
om
'
0
n BFGSMethod:Themethodi
p
uta
tio
nsa
res
how
n.
sap
pli
cdt
oExample6
.1.Only
o
c
c
ft
o
o
m
p
n
h

v
eH
u
t
e
a
r
t
g
e
e
s
i
n
s
o
c
i
n
a
a
l
ei
nm
l
sv
a
ye
e
t
x
r
r
p
i
e
yi
xd
n
m
s
p
u
i
r
r
v
e
s
i
e
s
n

i
ge
.A s
ve
a
e
c
hi
co
.Ann
n
t
d
-
e
r
-
o
v
a
a
r
r
t
i
d
i
o
e
a
ntheH cs
s
rmethodw
bl
ep robl
i

e
a
nm
i
mc
atr
h ep
t
ancon
i
xi

v
r
e
o
r
sc
pe
g
r
ci
o
n
t
si
yo
no
de
fq
n
r

ei
e
u
t
dt
a
d
e
r
r
a
ob
a
t
i
t
o
e
i
c
n
.

c
pI XI=lsl; )=5
1 .31 =[~ ~l
; 1 l

Vf(X1)
Asm

der
iv
e

a
n

t
t
madeonU
i
v
ion
l
e

e n
db
ed
o
i
e
s
tt
f
o
c
r
r
e
om
ef
ten
en
o

t
rr
a
i
t
u
o
e
r
a

ns
ld
eo
e
e

c
s

o
i

n
gnp
fsomeo
dd
r

e
o

r
b

i
v
l

a
e

t
m

i
s
f ev
v
e
whered
a
ria
s i
b
sq
le
ec
isi
s e
u
estio
o

n
a
n
x
b
sa
i
l
s
e
r
t
er
en
c
e
q
eo
uir
ft
edt
h
ef
ob
i
r
. Moreovcr U
e
s
t
l
e
quasi-Newt
onm ethodso f las
ttwos ec
tionsarea b
let oeffcct
ivel
yf unct
ionas

WSl=lzl; =0.19 X2=ltzzl;Vf'~] s


e
e
s
c
t
i
o
m
n
d
a
-
t
o
i
r
o
d
no
erm
fs
e
e
t
c
h
o
o
n
dsa
dder
i
se
vati
v
ya
es
ppro
.Ones
ac
e
h solution-andt
cond
-ordermethodi sp
h
r
eyd
ls
en
on
te
o
dh
tn
er
e
ef
edt
o
rt
h
e
h
e
sakeofcomplete
nss.
I n
deedt h
ereiso n
lyo neb as
ics econd-or
dert echniquef oru ncon
straine
d
step3Y=12Jri;m=ltml opt
imizat
ion.Itisb asedont h
ee xten
siono ftheNewton-Raphsont ech
niqueto
mul
tivari
ableproblcm.Manyd if
fcre
ntc xt
ension
sa reavailab
leb u
ti nthi
st eta
x
3 33
252 N
UME
RIC
ALT
ECH
NIQ
UESF
OU
NCO
NST
RAI
NEOO
PTI
MlZ
ATI
ON 6
.5A
DDI
TIO
NALE
XAM
PLE
S 253

d
ire
ctext
ens
ionre
castinege
nera
la l
gorit
hmicsu
ct (
A6.1)i
spr
ese
nte
d.Once fi+1= N
I st
op (
ite
rat
ioni
Im
it)
a
gaint
hegen
eralpro
b l
e ma
ndsp
eci
ficexamplear
easfol
1ows.
E
lse

3
M
ini
mie f
z (X)
; [X]n (
6
.1) i i +1
GoToSt
p2
S
ubj
ectt
o: x
lXixjt
i=12
...
11 (
6.2
)

3341131411ffits?hititi--1
M
ini
rni
ze f
(X)=
f(
XI'X
2)=3+(
XI-1
.5x
2)2+(
X2-2
)2 (
6.3
) ApplicationofModifiedNewtonMethod: A
lgori
thm(
A6.
9)i
sus
edt
oso
lve
Example6.1.Onlye
sse
nti
alcom
put
ati
onsarei
ncl
ude
d:
S
ubj
ectt
o: O
::
;;
XI
:5
;0:
:;
;x
2:
:;
;5 (
6.4
)
Step1431; f(Xt
)=5.
312
5


i
z
l

0
-EEE E -E


ModifledNewton'sMethod:TheNewton-Raphsonmethodu

nU

se
dforas
ing
le


QU

M
5
va
riab
lesol
vestheproblm(
e )=O
X .Thisequ
atio
ncan p
resen
teFOCforan

&


unc
onstr
ainedproble
mi nonevar
iab
le( Ch
apte
r5).Theiter
ati
vecha
ngei
ne
va
riab
leiscomputedthr
ough
s


=
11~.;~~~
7'~~;;;;
1.5000 ;
:
1
l
'
u1
t=
=1
-
Uo
.0
;
:
X?
J.v
=
-
1~1
1;
2
1 f(X
2)=3
"~2
.0; c
onv
erg
ed
(
6.1
3)
d
x=L
= Asexpectedon
l yasi
nglei
tera
tionwasnecessarytoo
btaint
hes
olut
ion
.Tr
ans
lat
ion
'
(
X) f
"(x
)
ofthealgor
ithmintoMATLABcodeisonceagainle
ftasanex
erc
ise
.
wherefisth
si
ngl
e-v
aria
bleo
bje
cliv
ef u
nct
ion
.Them
ult
iva
ria
blee
xte
nsi
onl
o
comput
ingasi
mil
archan
geinevar
iabl
evecl
oris
6
.5 ADDITIONALEXAMPLES
X= [ '~f(X) (
6.1
4)
Threeaddi
tiona
le xamplesa r
ep re
sentedin issec
tion
.Withmanyo fthenumerical
tec
hniquesalready programmedo btaini
ngt hesolutionisam a
ttero fj ud
ic i
ous
Theo ri
gina
INewton-Raphsonisn otknown foritsr o
bus
tnessors ta
bil
itya n
d
app
licat
ionoft h
en umerica
Ip roc
edur
es.T hissecti
onalsop rese
ntssomec re
ativ
eu se
Equat
ion( 6
.14)sh
arest
hesamedi
s a
dvanta
g e
.Tocont
rolthedes
ignvaria
blechange
s
oft h
e methods a nde x
p l
oresn onq
uad r
aticp roble
ms.l ef rrs
l examplei s e
andtobringitundereschemofa1g
orit m(A6.
h l
)theleft
-han
ds i
deisdefin
ed
Rosenbrockproblem[ 9]
.lIsexamplewasamongt hosec re
atedtoc ha
11eng
e
thesearc
hd i
rec
tionvct
orS followed by ast
andar
do ne-dim
ensiona
Is te
psiz
e
numeri
caltechniquesfo
ru nconst
rainedminimiza
tion.Itisalsosometi mesref
errdto
comp
utation.Thi
sister
rne
dthemo
d i
fiedNewtonmethod.Thecompletealgo
rithmi
s
asthebanana
f u
nction.Ifyouhaveacopyo fthOptim
i<.ationToolboxfromMATLAB
asfol
lows.
youwi 1
ls e
ei sa sparto f toolboxdemo.Youwi 1a
J lsonotea tthetoolbox
i

cont
ainsmanyo f technique
sd ev
el opedinthi
ss e
ction.Thes ec
on dexamplei sa
Algorim :ModlfledNewtonMe od{A6.9) yvau
iftJ

sol
utio
ntoan on
lineartwo
- p
o i
ntboundar eproblemthati
sd ue10eN avier-
St o
kes
Step1. ChooseXJN u at
ionsdescr
ibingflowd uet oas p
i nn
ingd i
sk.1 lastisa nunus ua
d at
afing
E"E2'E
3:(tol
eran
cef o
rs t
oppin
gcrit
eri
a) exampleusingBeziercu
rves.Oncea ga
i ntheOp t
irn
iza
tionT o
o lboxpresent
sit
sv ersi
on
Seti=1(ini
ti
ali
7.
ei te
rat
ioncou
ntr
) ofthedat
afitt
ingexamplewhenr unnigo
n ptdemoattheMA T LABprompt
Step2.Thes ear
chdirec
tio
ni sobtai
nedasasolut
iont
o
[H(X
j)]
Si=-Vf(X 1; [
) i seH e
ssian 6
.51 Example6.2-RosenbrockProblem
.
Xi =Xi+
/Si;
AX=.SI
i
"isd
ete
rrn
inedbyM
ini
miz
ingJ(
Xi )
+l
TheR
ose
nbr
ockproblemi
s
S
te .I
p3 fVf(X
)TVf(Xi
+I)E
3' c
onv
erg
ed
r
I
f (X
I )f
1 (Xi
)1:
;EI
' s top (func
tionn otcha
ngi
ng) Minimize f
(xl
X2
)=1
00(
x2-x
T2+(
) 1-X
I)2 (
6.1
5)
TsX:
IfAX :
;
;E
2SlOp (designnotchanging) ; -
2:
:;
;X
2:
:;
;5
S
ubj
ectt
o: -
2::
;;x
l::
;
;5
254 N
UME
RIC
ALT
ECH
NIQ
UESFORU
NCO
NST
RAI
NEDO
PTI
MIZ
ATI
ON 6
.5A
ODI
TIO
NALE
XAM
PLE
S 255

Thes
idec
ons
tra
int
sar
eus
edf
ord
raw
ingc
ont
our
s.Thes
olu
tio
ntot
hisp
rob
lemi
s
> RandomWalk('Example6_2'[
> 32 ]200l
.Oe-08 0l20)
;
x=1.0; ;
x=1.0; I=0
.0
The problem: Example6_2
ans
2.0000e+002 1.0000e+000 1.0000e+000 1.2327e-007
Thcp rob
lemisnotoriousfr q
o uiri
ngal ar
genumbero filer
ati
onsforconverg c
es.
Changesindesignares mal
la sthesolu
tionisb e
inga pp
roache
d.Heret h
eRandom Sin
cet hr
ea r
enos topp
ingc ri
ter
iabui1
tintothemethod( wa
ss ug
gest
edasan
Walka ndConjugateGradienlmethodsareuse dtoexaminethesolu
tion.Botht h
ese ex
erci
se)th
emethodranfor200iler
ati
ons(
fi
rs
tvalu
e). t
efi
nalval
uefort
hed
esi
gn
methodsarec hang
e d10drawa pprop
rialeconlourleve
ls.Toa voidc1utt
erdis
able V orandeo bj
ect
ivefuncti
onareveryimp
ress
ive:
pri
ntingle
xlinforma
tionon l ine
sr e
presen
tingdesignchang
es.A lsosi
nce se
methodsa
avoi
ded
rer
.Thetr
u
nf
ac
o
o
r200i
fthede
t
s
e
i
r
a
g
ti
o
nv
n
a
st
r
iab
h
l
e
efma
sont
lp
h
r
ec
i
n
o
t
n
i
t
n
o
u
g1
rp
0t
lo
heCommandwindowi
ti
sp r
ovidedastheoutpu
s
l
randomwalk:;
x=1.0; ;
x=1.0; I=1.23e-07
fromlheprogramalongwlthIhlin
alvalu
es.Ast hefigu
rcisbeingdrawni sc
ti 1ear
th
attheprogr
esstot h
es ol
utioni
ss l
ow. Sol
utio
nUslngCo ugateGradlentMethod:Thei
nvo
cat
ionando
utp
utfrom
t
heCommandwindowi
s

Solu
tlonUsingRandomWalkMethod: Fi
gur
e6 .7pre
senl
st heres
ullo f
ex
ecu
tigRandomWalk
n .m f
ort
hl
sex
amp
le.T
hp r
ogr
amin
voca
tiona
ndou
tputfr
om

njugateGradient('Example6_2' )
2 200
1.Oe 08
0
1
20)
The problem: Example6_2
eCommandwindowi
s
No. of iterations: 200
ans
9.6B07e-001 9.3700e-001 1.0222e-003

Thes
olu
tio
nis

c
onj
uga
teg
rad
ien ;=
t:x 0
.96
80;x
7 ;=0
.93
7; r=1.0222e-03
Thi
sapp
ear
snomatchfo
rth
eRandomWalkmethodf
ori
sin
ves
tig
ati
on.F
igu
re6
.8
t
rack
sedesi
gnchan
gesonth
econ
tou
rplot
.

N
M
6
.5.
2 Example6.3 Three-DlmensionalFlownearaRotatingDisk

Thisexamplerepres
enlsanot
herofIh
ee x
actsolu
tio
nstocN avier
-Stoke
se q
uation
s
fromfluidmecha
n i
cs.Then onl
inea
rt wo-
pointbou
ndaryv a
lueproblemdescrib
esa
visco
usf lo
wa r
ou n
daflatdis
katrota
tesabou
t axisper
pendicu
l toit
splanewi
ac onst
anta ngularveloc
ity
.A fte
rs uita
ble def
mitio
n[ 1
0]t hem at
hematica
l
des
cript
iono ftheproblemisthefol
lowingse
to fcoup
ledn o
nlinea
re q
uatio
nsw it
h
boundarycondi
tionsattwopoin
ls:

2F+H'=0 6.
(16a
)

-
1 2 3 4 5 H-G2-F"=0
F2+F' (
6.1
6b)
X

F
lgu
re6
.7 Randomw
alkm
eth
od:E
xam
ple6
.2
. 2FG+HG'-G"=0 6.
( 16
c)
256 N
UME
AIC
AlT
ECH
NIQ
UESF
ORU
NCO
NST
RAI
NEDO
PTI
MIZ
ATI
ON 6
.5 A
DDI
TIO
NALE
XAM
PLE
S 257

Y
I Y2 Y
I(O
) O
Y
2 Yi+Y Y
2(O
)
~II (
6.1
9)
Y
3 Y4 Y
3(0
)
Y
4
Y
;
2
YIY
3+Y
-2Y
I

v'5 Y
4
Y
5
(
(
O
)
O
)

x2

Thcs
tat
ceq
uat
ion
s(6
.19
) .
cin
tcg
ral
edu
sin
gMATLABf
unc
tino
o d
e45
.

.
.
M SolutlontotheProblem:Thet h
ree-
varia
bleproblemissol
vedusingtheDFP
method
. Example6_3.m r tums theobject
ivef un
cti
on.Itcal
lst h
ef unc
tio
n
Ex6_3_state.mwhichr ctu
rnsthesyste
mq uat
ionsinsta
tefo
nn.Thec a
lltoth
e
DFPmethodw i
thei n
it
ialdesi
gnvecto
ro f[1-18 Jwith20it
era
tio
nsoftheDFP
methodandatole
ranc
eforthegolde
nsectio
no f0.0
001isshownbelo
w.AJsointh
e
ca
llistheinp
uttolheupp
erboundc a
lcu
latio
n.

U
sag
e 'Example6_3'[
: DFP( 1 18]
20
0.0001
01
20) (
6.2
0)

Thef
ina
lva
luef
ort
hed
esi
gna
fte
r20i
ter
ati
onswas
2 3
x
t
4 5
x
;( =
) 0.
510
1; .
t
;
(
t.
t)=
-0.
615
7;x
j(=1
0.7
62;j=
7 5 08e06(
6.2
1)

F
lgu
re6
.8C
onj
uga
teg
rad
len
tme
tho
d:E
xam
ple6
.2
. 1
11etol
eranc
ef o
rt h
eg o
ldensec
tio
nwaso nly0.0 01
0 .h i
spo
ssi
blcl
hco
bje
cti
vc
c
annotdec
rcascun
lilasmalrt
l o
ler
anc
eissp
ecif
ied.
Thepubli
shedvalu
esforth
edesi
gnvar
iab
lesar

)= )=; H(O)=
F
(O 0
;G(
O 1 0 (
6.l
7a) ;
x=0.5101; ()=-0.6159 (
6.2
2)

F
()=0; G( )=0

(
6.1
7b) whichisr emarka
blyc l
osetoI h
ev al
uesobtainedbyt heDFPm ethod.Thev aJueof
xjisIL
sl
Lall
yn o
ts p
ecifi
edbUIisabout7.Sinceitisasubsti
tuteforinf
iniy
t theJarg
er
Equat
ion
s( 6
.16)areco
n v
ertedst
a t
es pa
f onn(s
Chapt
er5Example5.
3)
.The numbers houldnotbeap robJ
em.
des
ignvari
able
sa rEthemissi
ngboundaryc ondi
6or
tsonF '(
O G'(O)andt
) h
ef i
nal Example6. 3isnott r
ivi
alp ro
blem.Thei nteg
rationish i
ghlys e
nsiti
vet othe
val
ueoftheindepen
dentvar
iabl
e(inlie
uof .Theo
) bj
ect
ivefun
cti
onisesquar
ini
tia
lv alue
s.A r easona
bles t
arti
ngp o
inti sessen
tialtop reventthei n
tegra
tion
cr
rorint
heintegr
atedvaJ
uealthefi
nalcond
ition. fromg enerat
ingNaN' s( n
olan umber).Thes econddesignv ari
ablemuslhavea
ncgativ
es ign.Theexampl i ll
ustr
ate
st hea pp
licationofs tandar
do ptimi
zation
TheO
ptl
mlz
ati
onProblem techniquetos oJv
ean o
nlineardiff
ere
ntials y
stem.A s imila
ra ppJi
cationcanb e
madet oproblemsi ns yslemdynamicsando ptima1contro.
lI tise ss
enti
alt o
understand t h
ea lg
orithmsoutli
nedherea r
en umerica
lt oo
1s attranscen
dany
Minimize f
(xl'x2
x3
)
: Y
I(X
3)2+Y
3(x
3)2 (
6.1
8)
parti
cuJardisc
ipli
ne.
Ther
ea renumerica
Jt ech
niquesata d
d r
esst wo-p
ointn on
1inearboundaryvalue
whereth
csl
alcv
ari
ab1
esa
reo
bla
ine
dfr
omt
hes
olu
tio
noft
hcf
oll
owi
ngi
ni
ti
alv
alu
e problemsmoree f
fici
ent
ly.However
computingr es
ources
especia
llyonaPC arenot
probl
em: aconcern.Theref
oret
11
ep roc
cdureadoptediniscxamplei sanaccepta
b1eapproach
258 N
UME
RIC
ALT
ECH
NIQ
UESF
ORU
NCO
NST
RAI
NEOO
PTI
MIZ
ATI
ON 6
.5A
OOI
TIO
NALE
XAM
PLE
S 259

f
orth
iscla
sso
fpr
obl
ems
.Event
heRandomWalkmethodi
sim
pre
ssi
vei
ni
s
m
sta
nce.

'
1
6
.5. .4-
3 Example6 F
itt
lngBezierParametrlcCurves
0
.8
8 2
"
/
Theexamplei ntr
oduc
esan on
trad
iti a
la nda nunusualcurvefiu
ill
gp roc
edure
.
a
/ '
/i
Givenas e
to fdat
apointsaBeziercur
v e01user
-chos
eno r
derisfi
l10thedat
a.Bezier 0.
7
curve
sa repa r
ametr
icc urv
es as p
ecialcas
eo fu n
iformB-spli
nes.Bezier f /
para
metriza
tionisb ased on theB emsteinb as
isf u
ncti
ons. Any poit P on a
n 0
.6 ..~
./'
~



-~
.
---
1
Iwo-dime
nsionalBeziercurve(anyparamet
ricc u
rve
)isa C
lual
lyobtaine
d P (x
(v) J

y(
v))where0SvS1.l eact
ualrela
tionsare 805
~.


~
p ~.
/ "
1
~
0
.4


1
(
6.2
3)

(

P

v)=
[x BJ
y)= n

.
1
(
v 1 .
.
. /
/

l'

0
.3 /
1

;
=0
1
/
/ J

J
II
.;
(v
)
)
(
1-
)".
1 0
.2

/
' "
.
'/
1 /
-

C
!
I
E3
0
.1
whereB; E ev e
rtice
so fep o
lygontha
td et
erminsth
ec ur
v .B
e ;rep
rese
ntap a
ir
ofvaluesint wo-dimensio
n alspace
.Theo rderofthecurveislI-th hig
hestpower B



i
nl hebasisf unc
tion
s.Thea clu
alc om
putat
ionso fthepo
inlSonI heC U
lve'eell
sie
r 0
.2 0.
4 1
.6 2
usin
gm atrixalgebma ndarew e
llexplai
ndanddocumentedi nR e
ference11
.F ig
ure xd
ata
6.9represenL~ acubicBz ierc u
rve.Thef ollowi
ngaresome0' 1lhemostu se
ful
F
lgu
re6
.9 A
cub
lcBz
lr
cur
ve.
prop ie
so ft hecurveaso bsrve
dint h
efigu
re:

Thecur
vei
sco
mpl
ete
lyd
efi
nedbyt
hep
oly
gono
bta
inc
dbyj
oin
ingt
hev
ert
ice
s
ino
rde
r. exampleisg e
nericasmostd eci
sionsa basedon et ex
tfilethatcontai
nsth edata
'hedegreeofepolynomidefiningthecurveisonelessanthenumberof tobef i
ue
programi
d.1
sn
1c
o
a
ll
t v
sonm ym
ial
.Amorei
-fi
m
l
e
p
s
o
.TheB
r
tan
e
t a
z
s
i
o
erc
nf
a
o
I
ri
cu
t
l
si
a
n
t
i
c
o
l
n
u
sa
s
io
ref
ni
ai
sa
r
lym
ti
o
fu
d
u
n
l
d
a
e
r
r
.T
s t
o
h
o
is
d
ve
rt s
i o
fthepolyg
o n
.
i
ts igna
lsar easonabl
em atur
ityw ithMATLABp ro g
r amm
i n
g.Morei mpor
tanllyit
. Thefir
slandla
stpoi
ntsofthec
urvea
recoi
nci
dcn
twit
hthef
ir
sta
ndl
as
tve
rte
x.
exempli
fiesewayt oe x
ploiltheimmensepowero fbui
lt-i
nMATLABsuppo .Th e
Thcremainin
gv e
rtexpoi
ntsdono
tlypi
cal
lyi
Ieont
hccu
rvc
.
authorencour
agestheusertoexer
tsomce ffo
rttra
cingtheprogressofthecalcu
l a
tions
. Thesl
opcsalt
heend
softhec
urvch avet
hesamed
irec
tio
nasth
esi
deso
fth
e r oughec ode.A 101ofprogramc on
trolisbasedoneu ser
'sc hoiceconceming
pol
ygon theo rd
ero ftheB e
zierc u
rve.A ls
ot heini
tia
lv a
luesf orthed esig
nv aria
blesa re
. Thecu
rveisco
nta
inedw
ith
intheconvexhu
llofepo
lygon. generatedautom
atical
"basedont h
ed a
ta10befitt
ed.Thef unc
tioncallin
gs equence
usedini sexamplec anbebett
crunderstoo
dbyt hef o
llowingstruc
ture
:
I
nthisex npl
et hecon
veni
e n
tm at
rixrepre
sen
tat
ionsfort
hccurvear
cu se
d.Theyare
n
otdiscussedherehow
ever.butareav
ailab
lcint
hecodc.Forisex
am p
le.th
edcsign
v
ariabl
esa r
et h
ei ns
idepo
ly gonver
tic
es.Fo =
rn 5 th
crear
c6v ec .Thefi
rstand Example6_5_3.m
CaUsuig
etf
ilctopikupe(
c *.
tx
t)Icatcon
tainstwo-columnda
taatwillbe
l
as
tv cr
texareknownfromt h
ed a
tapoin
ts.Thi
sleav
es4v e
rtic
esor8ds i
gnva
riab
les
f
it(Ex6_
5_3.txt)
n=
for 5
.
'
hrowsupani n
putd
ialo
gboxt oobta
intheord
eroffitfromtheuse
r(0 5 ) =
Ca
llscoeff.mw i
ththeord
eri n
forma
tion
Example6_ 4.m: l
ism-f
i
Ici
sas t
and
-alo
neprogramtoru
nt hccxamplcint
hi
s C
allscomblnatlon.m-c alcu
lati
o 1c
n0' ombin
ationforBcrns
teinb
asi
s
sc
cti
on.TypingExample6_4alth
epromptsho
uldstar
tthcpro
gram.Actual
lyth
e C
all
sFactorial.m-c acu
I la
tesfa
cto
ria
lofani n
teger
260 NUMERICALTECHNIQUESFORUNCONSTRAINEDOPTIMIZATION 6
.5 ADDITIONALEXAMPLES 2
61

C
all
sC urv
e_fit
.m whichhandlest heo pt
imi t ion objective funcionvalue: 0.2497
CaIsDFP
l iteration number: 3
CaIsBez
l Sq_Err.mc alc
ul ationofO~je
:ctiv
ef
unc
tio
n gradient length squared: 0.0546
Ca
llsgr
i
's
df
un.m-c alculat
io no fder
iva

tivs objective function value: 0.1830
Ca
llsGold_SectionnV a

r
'
.m

- 1Ds t
epsi ze iteration number: 4
Call
sUpperBound_nVar.m-b ra
c kett heminimum gradient length squared: 0.1322
objective function value: 0.1605
Si
ncethe
reareeig
htdesi
gnv a
ria
bls
e a
11o ftheinform
ati
onexc
eptfo
rite
rat
ion iteration number: 5
num
ber.conve
rgen
cecri
ter
iaand objcti
vef un
ctio
nissupp
res
sedfr
omt he gradient length squared: 0.0573
Commandwindowtopr
eventsc
rol
lin
ga ndlos
so fcomp
rehen
sio
n. objective function value: 0.1467
lesi
gni
fic
ante
lem
entsiniscodea
ra sfollo
ws: iteration number: 6
gradient length squared: 0.0374
Pick
suped at
af i
lethroug
baf il
es e
lec
tionbox. objective function value: 0.1437
Usesaninputdia
10gboxt oqueryt h
euseront h
eorderofthec ve
. iteration number: 7
gradient length squared: 0.0071
Theordrdete
rminesthesiz
eo fthecoe
ffic
ien
tm at
rixAa ndi
tisa u
tomatica
11y
gen
erat.
objective function value: 0.1433
iteration number:
Thenumbero fde s
ignv a
ria
blesisautoma
ticall
yd e
termi
ned.Oncea gainitis gradient length squared: 0.2793
basedon orderofthecurv
e. objective function value: 0.1415
Theini
tia
lv a
luesforthedesignareautom
atic
a l
lygener
atedb a
sedont heda iteration number: 9
tobefi.
t gradient length squared: 0.4337
TheDFPm etho
di susedtofindtheoptimum. objective funcionvalue: 0.1401
Theobjec
tivefuncti
oniscomputedinthegene
r cf
i i
IeBeziecSq_Err.m.The U
I
Fromt hedataa boveitappearsthatt heeo risa round0 .14andisd i
ffi
culttor iu
ce
dat
as p
eci
fictoex amplearepassedthrougheMATLABg lo
balstate
m en.
t fu
rth
er.Ita l
soa ppearsther edu
ctioni nt h
eo bject
i v
eisa c companiedbyt heincrea
se
Theorigi
naldatasetand B ez
ierc u
rvefit
tingth
ed a
taard
is
playe
da tthe "
' i
nt h
eg radi
ent.afteracertainnumbero fite
rations
. l
tismovingawayf roms at
i s
fyin
g
end
. th
eFOC.Theb e
stv alu
ef ortheFOCi sa bo
ut0 .007a nds ta
rtstowo rse
nw ithf u
rthe
r
Theobj t
ivefuncti
ona ndthconvergen
ced at
aforeachitera
tio
na r
epri n
ted
'
1
1
'
it
era
tIons
.Itisq uitepossible n umer ic
ali naccuraci
e smayb eap roblema sther
e

I d - - R W 43
toth
eCommandw indo
w . aex
r tensivec omputationsi nvolvedi ne achi terat
ion.I tisa lsolikely ate
numerica1gradientc om
puta ti
onmayn eedtober efin
ed.C urren
t l
yegr ient
s e
ObJ
ectlv
eF un
ctlon
:Th o
bjec
tiv
efu
nct
ioni
sthe1 s
tsq
uarede
rro
rov e
rallo
f computedu singf orwardfini
tedifferencewi thas tepofO .O .T
O1 hesearep aramete
rs
t
hedat
apoi
ntsbet
wee
neact
ualdat
aan
dthefi
tt
edBe
z ie
rcu
rve
.Iti
sexp
r'sse
das tl
ta
tn dt ob x ploredi noptimi zationast h
e r
ei snou niversalseto fv al
ues
fo
ra l
lc lasseso fpr oble
m s.
Figure6 .1
0i llu
stra
teseo rigina
1d ata dt heB eziercurvea erel a
sti t
erat
ion
.
I
IIDa

Mi
nim
ize
: X): y-Y
BT
(
6.2
4) Thepol ygonsa r
en otshowna so u
re fforti
st og enra
tet hecv e.hefitisdefin
itel
y
1
<=1
'" .
J
acc
eptablean dthereisprobablyli
t t
leeB e
zi ercurveca ndoa boutac o
u p
leo fpoin
ts

The f
oll
owin
gi nf
orm
ationiscop
iedf
romt
heCommand window (
thef
il
eis th
ataren otv erysm oothlylocat
ed.I tisp r
o bablyt he
sep ointstha
tdon ota110wt h
e
Ex6
_5_3.tx
ta deo
n rd
eris5
): obj
ectivefunctIontod ec
reasef u
rtherw itho
uti ncreasi
ngt hgradien.
tThisc onclud
es
t m

ano
theri nnovativeu seo fu n
constrainedo ptimizatio
n.l ea uthorhasu sedt he
se
itt

Bxample6_4 cur
vest ooptimallyd es
igna ir
foi
lsf o
rl ow-spee dflig
h.
t
iteration number: 1
Eli--

gradient length squared: 5.0001 NoteonFOCf orUnconstrainedMinimiz


a t
ion: examplehasal
ert
edus
objective function value: 0.5302 toth
eq u
est
ionofFOCVf=O .Ifa
nal
yti
calcomput
ationofth
eder
ivat
ivei
spos
sib
le
iteration number: 2 foraprobl
em.the
nFOCh asthelik
eli
lto
odofb ei
ngmet.lndes
ignprob
lemsli
ke
gradient length squared: 5.6890 Example6
4
.w h
e r
etheele
mentsoft
hegrad
ientvec
torha
v eth
eform
H
262 NUMERICALTECHNIQUESFORUNCONSTRAINEDOPTIMIZATION PROBLEMS 263

;
e 5.Fl
etche
r R
.a n
dR eevcsR .M.F uncti
onM inimi
zationb yC onj
ugaleGradi
e nt
s.The


OB-

aEF--
4

n"au-

hv--

t
f
l7 0

:
.Vo pp.1 4
9 -18 19
64.

o
Compute rJoumal .

Ed-
-

u
au-

6.DavidonW.C .V ar
iableM e
tricM ethodsf orMinimizalionU.S.A lomicE nergy
Commissi onR e
searcha ndD evelopmentR e
p o
rlN o.ANL-5 990ArgonneN ati
onal
5
1
Labor
atory1 95
9.
7.HuangH .Y .Unif
iedApproachQua caJlyC onv
ergen tA1gorit
hmsforFu nct
ion
Min. ti
onJoumalo
fOp uw ton'
I aor
yandA pp
lica
tio/
lsVo.5
l p
p.405-4 2319
70.
{SEEE )S
a
a

8.Vand
erp1aa t
sG .N .Nl/lneri
calO ptim
izatio
/l Te
chniquesf orE n
gineer
ingD esi
gn
McGraw-Hi NewY
l
1 or k1 9
84.

9.Hock W.
andSchittk
ow skiK
.
T estExamplesforNonL inearProgrammilgCodes
!
Lect
ureN o t
esI nEconom ica ndM at
hematicalS y
stems18 7Spri
nger-V
erlagBerli
n

aq

1980
.
h 1
0.Sch
lich
t ingH.BoundaILa yerTheoryMcGraw-H NewY
i
l
I ork1979.

1
1.Rogers
G.F.andAdams J.A.MathematicalElemen
tsforComputerG raphic
s 2nded
.

h McGraw-H NewY
i
l
I ork 1 9
90.


1
1- oo PROBLEMS


4

e
..
._
-e.
.


)o. 0 6
.1 Applyt
heRandomWalkmethodt
oExample5
.2.


9 6
.2 S
olv
eus
ingt
heRandomWalkm
eth
od:
0
.5
xd
ata(
rea
dfromf
ll
e)
1
.5 2 2
.5
Minimize !
(X.
x2
) x
=1-22+ x1+~-2x. +4
6
.3 Applyt
heP
att
emS
ear
chmethodt 5
oExampl .
2.
F
lgu
re6
.10O
rlg
lna
lda
taa
ndB
ezl
erc
urv
e.
6
.4 S
olv
eus
ingt
hePattemS
ear
chm o
d:
Minimize !
(.
x.
x)=x
2 1-2
x
1X2+x
i +
.
q-2
x..4
6
.5 Modi
t heP atemS
e
archs otha
tprogramcon
tro
lp ne
tersforconto
ur

)
i
pl
otti
nggo
l dens e
cti
onandupperboundcal
cul
ati
oncanbesetby er
.
Inc
lude promptanda llo
wf o
rdefa
ultv
alue
sincaset
heuse
rd e
cide
snotto
ta
kea d
vantageofi.
t
6
.6 Tra
nslatet
hePowe1methodi
l ntoworkingMATLABc
ode.Ver
ifyt
heso
luti
onto
Examples6.
1and5.2
.StartfTomsevera
lpoin
tsandve
rif
yt h
att
henumberof
andwhicharebes
tcomputednu
meric
aly
l somesp
ecif
ica
tio
nsar
eneededreg
ardi
ng cyc
lestoconve
rgei
sesame.
der
iva
tivec
om p
utati
onsifth
eyaret
obeusedfo
renfo
rcin
gthen
eces
saryco
ndit
ion
s. 6
.7 V
eri
fyes ea
rchdi
rec
tio
nsa
rec
onj
uga
tew
ith s
pec
ttot
heH
ess
ianm
atr
ix
f
orExa
rnp
les6
.1 d5
.2.
6
.8 So
l v
eu singPow
ell'smod da
tveri
fyanytwosear
chd
ire
cti
onsa
re
REFERENCES cougatewi r
esp
ecttot
heHe
ssi
anm
atr
ixatt
heso
lut
ion
:

.F
1 e
ltc
her
.R P
rac
tic
alM
etl
lOds
forO
pti
miw
tin
o Vo1
W
.
1 i
ley
NewYork
19
80.
Minimize !
(.
x.
x)=x
2 1-2
x
1X2+x
i +
.
q-2
x.+4
2
.Bren
tR .P
.A l
gor
ithmsfo
rMi
lli
miz
ati
onw
ith
outD
eri
vat
ive
s t
ice
-Ha
ll 6
.9 So
lveExample5.
2us
ingt
heS
tee
pes
tDe
sce
ntC
onj
uga
teG
rad
ien
tDFP
and
E
ng1ew
oodC
lif
fs
NJ19
73. BFGSme ods
.

3
.Powel
.M.J
J .D.
NOl
lli
nea
rOp
tim
iWl
ioA
n c
ade
micP
res
sNewY
ork
.19
81. 6
.10Solv us
ingt heS t
eep
es
t Conjugate GradientDFPand BFGS
t Descen
methods problem
4
.FoxR.L.
.Op
tim
iza
tio
llMethodsforElgi
nee
rin
gDe
sig
n.A
ddi
son
-We
sle
y.R
ead
ing
i+
.q-
!
MA.1971
. z
e f
(x
.OX
2)=x
1-2
x
1X2+x 2x
.+4
7
264 N
UME
RIC
ALT
ECH
NIO
UESF
ORU
NCO
NST
RAI
NEDO
PTI
MIZ
ATI
ON

6
.11Ve
rif
yt h
ev a
lue
sinSc
tio
n6.
3.3us
ingac
alc
ula
tor
.Ve
rif
yift
hem
atr
ixAa
t
esol
utio
niseinv
ers
eofth
eHes
sian
.
6
.12Ve
rif
yifthem
atr
ixAa
tth
eso
lut
ioni
sth
ein
ver
seo
fth
eHe
ssi
anf
orDFP
meodfo
r
Minimize f(I
X x)=
2 x1-2xtx2+xJ+x~ -2x1+4
6
.13 DevelopeBFGSmethodi ntoMATLABc odeandveri
fythecaJcu
lati
onsin

6
.1
Sect
ion6.
4 Developt
3.
4
h
.
eM odi
fiedNewtonmcthodi ntoMATLABc odeanda pplyitto
NUMERICALTECHNIQUES
Example5.2. FORCONSTRAINED
6
.15 Howw illyouinc
orpor
atees id
econs
tra
intsint
othecodf
oraJloft
hevari
ous
methodsinthi
ssecti
on?Implemcnttheminthcnum
erica
lproced
ures. OPTIMIZATION
6
.16S
olv
eExamples6
.2
6.3
.ad6.
n 4byoneo
the
rmt
hodo
fth
ese
cti
on.
6
.17I
den
tif
yands
olv
eas
yst
emdynamicsproblemu
sin
gan
ymethodo
fth
iss
ect
ion
.
6
.18I
den
tif
yan
dso
lvcy
ourownc
urv
efi
tpr
obl
cm.

li
sc h
apt
erex
plo
resaJg
ori
thms/me
thodstha
thand
le eg c
ner
alopt
imi
zat
ion
pr
oble
m.Bothe
quit
yandineq
uaJi
tyco
nstr
ain
tsa
reinc
lud
ed.Forane
ngin
eer
ing
prob
l m thiswil
li nvolveb r
ingingsevera
ln onlinearr e
latio
n sintot h
ed esi
gns pa
ce.
Thisisc erta
intoi a s
et hedegreeo fdif
ficultyino btainingcs ol
ution
.F orthe
designere reisa nadditi
onalb urde
no fb e
ingmorea tt
entivetot hedesignchanges
andt hecor r
espondingnumberst oc oaxthesolutionifthem athemat i
cald e
finit
ionof
thep roblemisparli
cularl
ys e
vere.InaJloflhes
ep roble mslherearetwoo u tcomesth
at
a lgorith
mss eekt oaccomp i
sh
. l efi
rstist oens ur
ea tthed esignisf e
asib
le
(s
atisaJlc o
nstrain
ts)andt hesecond ti tiso ptimal(satisf
iest h
eKuhn l ck
er
cond
i tio
ns).Wh i
lethef o
cusisond eterminin
ges olutionint i
me sofdiff
icul
tyi
tis
esse
ntial10r ememberI hatf
easib
iliismorei m portanta toptima
l it
y.Alsou nsta
ted
in r estofec hapterisa teo ptimalsolu t
ionmustbef easib
le.Twod i
stin
ct
approa c
he swi1
1beusedt oh and
let heconstrainedop ti
miza t
ionp r
oblem.Th efirs
t
appr oachistermedei ndire
cta pproachands olves problembyt ransformin
git
intoa nu nconst
rain e
dp roblem.Thes econda pproachi s10h andleec ons in
ts
withoul n sforma tion-thedirec
ta ppro
ach.
Thei ndir
ectap proachisane xp
ressionofi ncremen
t aldev elopmento fthesubje
ct
tota keadvantageo f ecurren
tm ethods.Fore x nplei
tl everagestheDFPmethod
toh andlec onst
rainedo ptima
lp roblems.Twoi nd
irectmethodsa represe
nted.th
ExteriorP ena
ltyF unction( EPF)method and AugmentedLa grangeM u
ltipli
er
(ALM)m etho.Th
d ed ir
ectapproachhandlesthec o
nstraint
sandt h
eo bje
ctivetogeth
er
wioutany n s
for m
ation.Fourmethods p s ented. lemethodsi ni sbookare
SequentiaJL ine
arProgramming( SLP)SequentialQu adraticP rogramming(SQP)
GeneralizedReducedG radientMethod(GRG) andS equentiaJGra d
ientRestorat
ion
Algo rithm(SGRA).

265
2
66 N
UME
RIC
ALT
ECH
NIQ
UESF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 7
.
1PR
OBL
EMD
EFI
NIT
ION 267

7
.1 PROBLEMDEFINION F

Thes
tand
ardfor
mato
fth
eno
nli
nea
rpr
ogr
amm
ingp
rob
lem(
NLP
)isr
epr
odu
cedh
e

fo
rcon
venie
nce
:

M
ini
miz
e f
(x 2 Xn)
"X (
7.
1)
S
ubj
tt
o
: h
k(x
"X2 n)=O
'... X . k=1
2 .
1 (
7.2
)

g
j(X
"X2
.
..X
n)~ 0j 1 = m
.2 . (
7.3
) 9<0

XISXj~xll i=I.2.....1
t 7.
( 4
)

nv
I e
cto
rno
tat
ion

M
ini
miz
e f
(X. [
) Xl" (
7.5
)
S
ubj
ectt
o
: [
b(X
)]f=0 (
7.6
)

[
g(X
)]" S0 (
7.
7)
X
1nw
SX:
;;X
"1' (
7.8
)
3 4
F
orthi
schapte
rthefollow
ingind
icesar
er c
serv
ed:I.n
t umberofva
riab
l;.n
1 umb
er
o
fequa
litycon
str
ain
ls;m.n umbe
ro fine
qua
litycon
stra
int
s.Manyo fIh
ealgor
ithm
s
a
ndm et
hod spre
sen
tar eason
ablelev
elofd i
ffi
cul
ty.A two-
var
iableprob
1em(fo
r 1g
F u
re7
.1G
rap
hic
so
lu
1i
onf
o
rEx
amp
le7
.1
.
g
rap
hicli
a 1
lus
tra
tio
n).withas in
gleequa
lityandi ne
qua
lit
yc o
nst
rainti
su s
edto
i
ll
ust
ra
tet h
ev ar
iousalg
orims.Al1o fthefunct
ionsarenonl
ineara1t
houg
ht h
e Fi
gure7.1displa
yst h
egrap
hica
ls o
lut
ionto prob
lem.Itisc le
arfromthefi
gur
e
c
ons
tra
intfunc
tion
sh av
es i
mplegeome
tricshap
es. t
hatthesolu
tionisatxT=1.xi=1(why?).Thevalueoft hefunct
ionis3
.A simpl
e
aroachtoth
es o
lut
i o
nofth
ep ro
blemi
s10u u a
tion(7.lO)1
a 0elimi
nat
eoneofe
7
.1.
1 ProblemFormuJatlon-Example7
.1 va
ria
blesmep roble
me re
byredu
cingi
ttoasin
glev
a
riab
leconstr
ain
edpro
ble
m.
li
sisnotdonehe buti
ti
sag oode
xer
cis
e.FIg7_l.m1willcrea
tethefi
gu
re.
Example7 .1i s as i
mplemathemat
icalf orm
ulat
ion.Itdoesnot pr
esen
ta n
y
eng
ineeringprob1em.I
tiscons cte
dtoh a
v easolu
tiono j=1 dx
fx i=1f o
r 7
.1.
2 NecessaryCondltions
nstrainedprob1emandxj=0.8520a dx
n i=0.8520f o
rtheunc
ons i
nedprob
1em
.
Thet woc on
str
aintfunct
ion
sh av
es impl
eno n
1ine
ari
ty.The ua
lit
ycon
stra
inti
sa
l
e n
eces
saryc on
dition
-ort he Kuhn-T
ucker(KT
)c o
ndit
ionsf o
r e
ci
lew hiletheineq
uali
tycon
stra
intisane
lips
e.
problem-wasdevcl
opedinChapte
r4.Itisb a
sedonth
emin
imiza
tio
no fE
Lagra
ngia
nf u
nct
ion(.Theco
ndi
lion
sare
M
ini
miz
e f(x"X
2: x1-2x ~X2 +x
) Ix~ -2x1
r+X +4 (
7.9
)
Min
imi
ze
S
ubj
ecl
lo: h
(X"
X2: xr+xi-2=0
) (
7.
Oa)
F
(xl.'
Xn'A
I..
.A's
f I.
.
.sm)=fxp xn)+Ihl++
( +
g
(x"X
2:0
) .
25x
T+0
.75x~ -1S0 (
7.l
Ob)
P
1+ +sg "
"
(
7.1
1)
5x
O: l:
55; 0:
5x 55
2: (
7.
Oc) 1
F
t1
! 0bed
own
loa
dedf
rom ew
ebs
i a
r
ein
di
ca
le
dbyb
ol
df
ac
esa
nss
e
ri
fIy
pe
.
7
.1 PROBLEMD
EFN'
I ON 269
268 N
UME
RIC
ALT
ECH
NIO
UESF
OC
ONS
TRA
'NE
DOP
TlM
IZA
TIO
N


A4
L/
sub
j ttoeconsaint
s.le aen+1+munknownsi
r ntheL a
grang
ian.Thesame xi+xi-2=0 (
7.l
7c)
numbero fe
quati
onsisreq
uII
tos o
lve pr
oble
m.Thes
ea r
ep ro
videdbyt
heFOC
orKuhn-Tuckercon
ditio
ns.Here
'le q
uati
onsareo
bta
ine
da s E
qua
tio
ns 7.
t( 17
)iss
olv
eds
ymb
oli
cal
lyi
nMATLAB.T
hcr
ear
etwos
olu
tio
nst
ha!
s
ati
sfyt
hes
idcc
on i
s nt 7.
s( l0
c)
dF d
r d
h. . d
h
d81.
=~J + + + L - 4 1+ +P
.11 d
8m j=1
.2.
...n
.
x
;=1.4142; =0
0

a
xi axaIaxttaxi ta x
i
JS7=0;
dx
t X
;=0;
(
7.1
2)
;
x=0.9275; x
;=1.0676;=-0.1217
1e
qua
tio
nsa
reo
bta
ine
ddi
rec
tlyt
1l
fOughee
qua
lit
yco
nst
rai
nls
80t
ho fthesevio
laeei
t n
equ
ali
lycons
tra
int
.InF ig
ure7 .
1.thefi
rs
ts o
luti
on
x
hi X
2.
.
...xn)=O; k=1
.2.
...
.1 7.
( 1
3) d
e
d
o
f
c
in
i
sn
te
l
o
ydo
tpro
v
b

id
u
tl
easo
h
es
lut
i
e
o
c
o
n
n
.
disali
lt
led
iff
icu
lt10s
ee.Zoomingsh
ouldhe
lp.Casea

m
mc
qua
tio
nsa
rea
ppl
icdt
hro
ught
he2 c
ase
s
Caseb
: g=O l
i
ses
tab
lis
hesf
oure
qua
tio
nsa
s

s
jj=Oi
8 f=0 t
hen 8j<0
4xt-4x +2x -2+x~+2 x +0.
5sX1=0 (
7.1
8a)
>0 7.
( 14
)
f8j=0 l
i hen
.5~=O
-2xf+2xx2+2X2+1 (
7.1
8b)
TheKTc
ond
iti
onsa
ppl
yon
lyi
fth
epo
int
saer
r e
gul
ar(
seeExample4
.3)
.
xi+x~ -2=0 (
7.1
8c)
A
ppl
lca
tio
n0't
heKTC
ond
iti
ons
: eLagrangian
0
.25x~+O x~ -1=0 (
7.1
8d)
F(x"x2 ): x~ -2xTx2+xT+xx~ -
2x
+4+
Equ
ati
ons(7.
18) s
olv s
ymb
oli
cal
lyandl
heo
nlys
olu
tio
nsa
tis
fyi
ngI
hes
ide
( +~-2)+ (0.25 x
i+0.75~ -1) (
7.15
) c
ons
trnt
ss

; t i -a-
r
Theee
qua
tio
nsa
res
etupt
hro
ugh
x
i=1
.; =1
0 .0
; i
.
.
"=-0.
500
0; s"=O

dF (
7.1
6a)
E;=44-4xtX2+2XI+xi-2+2hi+05PXl=0 whichwase x
pected(fo
rthedes
ignv a
riab
lcsnotlh
em u
lti
pli
crs
).Thevalu
co fs"=0
i
sn o
te x
pecledaslhi
sisanact
iveconst
raint
.TheKTc ond
ition
scanbeconsi
dered10
bew e
aklysalis
fie
da ssisnotst
rct
i 1yposit
ive
.Asi nChapt
er6.where
verp o
ssib
le.
(
7.1
6b)
dF
= 2xT+2xx2+2i
C
1X2
.x

2+1
.5sX2=0
eKTc on
ditio
nsareusedtocheckforconver
gen
ce.

h=xi+x~ -2 = (
7.16
c)
7
.1.
3 ElementsofaNumericalTechnlque

T
hereisad ist
inc
Idie renceinthenumer
icaltechniqu
esw it
hi ncor
porati
ono ft
he.
Thef
our
lhe
qua
tio
ni e
sdev10pedt
hro
ugh c
onst
rain
lS.eveniflheideaofusi
ngas e
archdir
ectio
nv e
clori
ssti
llusefu.
lThemajor
d
iffer
encesi
nt ea
h 1gorithmsofth
ep r
eviou
schapterwas wayt hesearc
hdirec
tio
ns
Casea
: s=O Witht
hi
sin
for
mat
ionEqu
ati
ons(
7.16
)become wer
ee sta
bli
shed.Tou nders
tandthenecess
aryc han
ges.theg e
ne r
ala pproa
chfor
u
nconstr
ainedoptim
izationasseeninthepre
viouschapte
rw a
s:

4x1-4Xx2+2x 1 x~-2+2 x =O 7.
( 17
a)
GeneralAlgorlthm6
.1)
-2xT+2x x2+2
x2=0 (
7.1
7b) Ste
p1. ChooseXo
270 N
UME
RIC
ALT
ECH
NIO
UESFORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 7
.21
NDI
REC
TMETHODSFORC
ONS
TRA
INE
DOP
TIM
IZA
TlON 2
71

S
tep2
.Fo
rea
chi
ter
ati
oni it
era
tio
n.l eu nc ons
a in
eda lgorith
mi t
selfexecutesmanyi t
era
tion
s.T hiswould
u
r i ar obustu nc
onstraine
dm inimizert oha n
dleal a
rgeclassofp robems.Th e
D
ete
nni
nes
ear
chd
ire
cti
onv
ect
orS
j
BFGSmethodi sr ob
ustandi mpressi
veo veral ar
geclassofproblems.
(
I
twouldb
eni
cei
fth
eob
jec
tiv
ede
cre
ase
dal
ongt
hisd
ire
cti
on) Ap repr
ocessingl aski n
volvest f
r ormi n
gt h
ec onstrai
ned problem intoa n
S
tep3
.C alcu
lateAXj= Sj unco
nstraine
dp ro bl
em.T hisisl ar
gelyacc omplishe
dbya ugmentingtheo bje
ctive
Note:AXj i
snowafunct
ionofth
escal
ar(Xj
asSji
sknownfromS
tep2 fun
ctionwitha dditi
onalf u
nctions r ef
lect ev iol
ationoft en
h st
rain
tsv ery
j
(X i
scal
ledeste
psizeasi
test
abli
she
sel en
gthofAXj si
gnif
ican
tly.These n c
tionsa r
er efe
rredt oasep e n
alf
ctio
ns.l e W

si
gnifi
cantacti
vityini s a tonet imewhichl e
dt oenti
refarni
lie
so fdiffe
rent
a
;isde
ter
rni
nedbyM
ini
miz
ing
f(X
;+I
)'where
typ
eso fpenallyf unc
tionmethods[ 2).Thef irs
lo fthesewast heE x
1eriorPenalty
X
j+
1=X +AXj Funct
ion( EPF)m et
hod. Th ef ir
stv ersiono f ANSYS [ ] i
3 ncor
pora1ed
opt
imizati
oni nitsfin
iteelemenlprogramr eliedont h
eEP F
.TheEPF( p
resente
din
Asthea bovesteps er eviewedinS tep2adilemman dstober e
solved:Sh ou
ld en extsection
)hads evera
ls hortcomi
ngs.Toa d
dresst h
ose eI nte
riorPenalt
y
thesearchdirect
ionS jd ecr
e aeeo
s bjectivefunction0's ho ul
di tattempttosa t
isf
y Funct
ion( IPF
)methodswered eve
lopedl eading10t h
eV ariabl
eP enal
tyF unctio
n
theconst
raints
?(Itisassumeda titcann otdob otht houghv eryoftenitwill)S
. inc
e

r
(VPF)m ethods.I n istex
to
. nlyt h
eEPFi sa d
dressedl a
rgel
yduet oa cademic

t44j532
fea
sibi
lityismorei mp orta
n ta no pti
ma l
ityitis s iertoi denti
fyt helatt
era sa in
tere
s.
tI nviewo fee xcel
lentp erform
an ceof d ir
ectmethodsthesemethods
sign
ific
antinfluenceind eterrn
iningthedirectio
n.Th isismored ifficuI
tthanitsounds wi
llp robabl
yn otbeu s
cdt odayf orcontinuousp roblems.Theya rconcea gai
n
ase achconstr
aintc a nh avei t
sownf avori
ted ir
e c
tiona tt hec urre
ntp oin.
tSuch impor
tanting lobalo p
timi
zatior
lt echni
quesf orconstrai
nedp rob
lems.Thes econ
d
occasio
nsc a
llforat r ade
-offandt os e
ei fi
ti spossibleton egot
iatead ecreaseint h
e meodp s entedinthi
ss e
ctionleAugmentedLa
h gra
ngeMethod(ALM) islhebesl
objec
tivefunctionasw ell.I
ti scle
art ha
tS tep2w il
li nvolvei nvestmentofe ff
ortand oftheSUMT.l tsexceedingl
ys impleimplementationit
squalit
yo fsolu
tionandit
s
somes oph
istic
ation. ab
ili
tyt og e
neratei nfonn
ationont heL agrangem ulti1
pie
rsa llowittos eri
ousl
y
Stp3i
e snotfarb ehindi nthe qui mentf orsp ia
lh andling.On cethed i
rectio
n chal
lenge directtechn
iques.
i
se sta
blished(Step2 )whatk i
ndo fstepsizewillbea c
c ep
ta bl
e1S everalresul
tsa re
poss
iblc.Fir
stthco bjcctivefunctionca nb decreaseda longt hedirec
tion.Second
curre
nta ct
ivec o
nstraints( incl
uding e qu
alityc o
nstrain
ts )canbecomei nact
ive 7
.2.
1 E
xte
rlo Method
rPenaltyFunctlon(EP
viola
tedorc a
ns t
il
lp ser
v e eactivcstate
.T hirdcurrentinactiveconst
raintsc a
n
undergoas imil
arc ha nge0"1st
ate
.F ourth prob
ablymosti mp or
tan
t c
urrentviolate
d Thet ran
sform
ati
ono fthcopt
imiz
ati
onproblem(7
.1(
) 7.4
)10anu n
cons
tra
ine
d
consaint
sc anbecomea ctiveorinactiv
e.Iti sdi
fficu
ltt oencapsulatethisdiscussio
n problemismadepossi
bleth
roughapena
ltyf
unct
ionfonn
u l
atio
n.Thetra
nsfo
nne
d
inag eneri
ca lgori
thm .Somca l
gorithmscombineS teps2and3i ntoas inglestep
. uncons
train
edproblemis
:
Somed ividethei t
erationintoaf e
asibi
litycomponenlanda noptimalitycomponen .
t
Inessencetheg e
nerica 1gorithmfor isc hapte
rwhichi sn otparticul
arly efuli
s:
Minimize F(X'
1
1''
g)=f
(X)+p
(X'
1
1 '

) (
7.1
9)

GenerlcAlgorlthm(
A7.
1) X::
S
;X/:
S
; i=1
2
1/ 7.
( 4
)
S
tep1
. ChseXo
S
tep2
.F o
re ac
hite
rat
ioni whereP(X'h'
g)isth
epen
alt
yf u
nct
ion
.'1a
1 n
d'ga
rep
ena
ltyc
ons
tan
ts(
als
oca
lle
d
Dete
nninese
archd
ire
cti
onv
ect
orS
j multJ
li
es.)
Thep en
altyfu
ncti
onise
xpre
ssed
S
tep3
.Calc
ula
teAX;=jSj
Xj
+1=Xj+AXj
(X
p 'h''

)='h1 "
1
"'
1
k
(L
.
X)
21+'
81 (m {
lt
1
O
(X)}
)21 (
7.2
0)
7
.2 INDIRECTMETHODSFORCONSTRAINEDOPTIMIZAT10N

Thesemco dswered ev
e l
opedt
ot ak
ea dva
ntageofcode
s atso
lveuncon
strain
ed nEq
I uatio
n( 7
.2)
0 ifeequal
itycons i
ntsar
en o
tzero
the
irva
luegetssqu
aredand
opt
imiza
tionp r
oblems. They a
rea ls
or efe
rredtoa sSeq
uent
ialU n
constrai
ned m
ult
iplie
dbyt hepena
ltymult
ipli
erandt heng
etsaddedto eo
bjec
tivefunc
tion
.I f
Minim
izatio
nT ec
hni q
ues(SUMT)( 1)
.Thei de
abehindeappro
achistorepe
ated
ly t
hine
qual
itycons
trai
ntisinvio
lati
oni
tt o
ogetssqua
redandadde
d1 0 obj
ectiv
e
ca
lltheu n
consta
i/e
1 do pt
imi
zati
o1/algo
rithmu s
ingthesol
uti
ono ftheprevio
us f
unc
tionaft
erbeingamp
lifi
cdby p ena
ltymul
tipl
ier
s.Inasen
sei
ft hec
onst
raint
s
2
72 N
UME
RIC
ALT
ECH
NIQ
UESF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 7
.
2IN
DIR
ECTM
ETH
ODSF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 2
73

ar
eno1sat
isf
iedthene yarepeniz
edhencethefun
cti
on'snne.Itcanbesh own TheEPFi sv erysens
itivetot h
estarti
ngv al
ueoft hem u
ltipli
ersa ndtothsc a
ling
th
c l sfo
nncdu n ns n problemsolveseoriginalm nedproblema sthe fa
cto
rsa sw e
ll.D iffe
rentp ro b
lemsr espondf av
orablyt od iffe
rentv a
lu e
so ft he
mu
ltip
lie
rsr" ga
r pproach.I no r
derf o
rPt or emai
nf in
il
ea tev alu
eso fe mu
ltip
lirs
.Itisrecommendedt h
atthei n
iti
alvalue
so ft hemu l
tiplie
rsb echos enas
mu
ltip
lie
rs(1 dcdf orav a
lidsol
uti
on)ec o
nstr
aint
sm ustbes a
tis
ti
ed.Inc o
mputer th
erati
oo ftheobject
ivefu n
clIontothec orre
spondingt ennin p en
altyf u
nctiona1
imp
lement
ationi sl im
itis pla
cedb yal ar
gevalueinsado f.Ano th
erf a
cetof th
einit
ia
ld e
sign.T h
ise ns
uresa tb o
tht heobje
ctiv
ef unctiona ndtheconstr
aintsare
mputerimplementationofthi
smethodis al a
rgeva
lueofthemult
ipli
ersatth
et eq
uallyi mp
ortanti nd e
ten iningthec h
angesi nt hed esignf o
r s ucceeding
il
era
tio
nisboundt ocreat
enumeric
aldi
ffi l
ti
es
.l esemtip
lie
raresta
rte
dwithsma l
1 lt
era
tio
n.
val
ues dua gme l
ly c hite
rati
on
. eu n
conslr
aIn chniquef
or Oner eas
onf orthetennExt eri
orPenaltyistha
tatt hee ndofe achSUMTi terati
on
ex DFPwi 1
s o
lveE qua
tion(7.1
9)f o
raknownv alueo f m ul
tip
licr
s.The desig
nw illb ei
la sible( u
nti
lt h
es o
luti
oniso btained)
.T hisi mpl
iest hatc
so
lut
ion n cdf romtheDFPc anbeconside
r asaf u
nctio
no fth
cm u
ltip
lie
ra ndcan
1 methodd e
tenninesd e
signv alues a rea pp
roaching ef easibl
er egionfro mthe
bethou
ghtofas
ou
tsid
e.Thisisas erio
usd rawb a
ckifthem ethodfa
ilsp matu
r e
ly a
sitwilloftendo.
Thcinformat
i o
ng enera
teds of a
risv a
luelessasthed esignsw ercneverfeasi
ble.As
X.=X
.(r
"r) (
7.21
)
8 see
nint h
ee xampleb e
low.t h
eEPFs ev
e r
e l
yi n
crea
sesen onlinea
rityofthep roblem
TheSUMTi
ter
ati
oni
nvo
lve
sup
dat
ingt
hem
ult
ipl
ier
san
dei
ni
ti
ald
esi
gnv
ect
or cre
atin
gc onditionsfort heme o dt ofai.
lIli se xp e
cted t hei nc
reasei n
an
dcall
ingeunc
onst
rain
edmin
imiz
eraga
in.In al
gori
thmi
tisas
sumedt
hate non
line
arityisb alance
db yac ose
rs tart
ingvaluef orthed esignase achSUMT
DFPmethodi
su se
d( a
lth
oug
ha nymet
hodf r
omC ha
pter6c a
nb eus
edBFOSis it
erat
ionsta
rtscose
rtot hesolutio
nt h
ancp revi
ouso ne.
c
r om
mended). lnthefollowingtheEPFi sa pp
liedtoE xar
nple7.1t hroughas er
iesofcalculat
ions
ra
ther anth roug
ht hetrans
l at
ionofea lgori
thmi ntoMA TlABcode.The rea r
ea
Algorlthm:Exte
rlo
rPenaltyFunction(EP Method2) coupl
eo fchangesw it
hr espe
c ttoAlgorithm(A7.1)
.Tor esolvet h
ep en
altyfun c
tion
Step1.ChooseXIN.(
no.o
fSUMTi t
era
tio
ns)
Nu(no
.ofDFPi
ter
ati
ons
) withrespe
ctt oei n
equali
tyc onst
raintt
hecons
traintisa ssu medtoa lwaysb ein
E;
' S(f o
rc o
n vergenceandsto pping ) vio
lati
on80a ter e
turnf romthemllxfuncti
onis ec ons
traintfuncti
oni t
se
lf.This
r~ r
!( in
it
ialp ena
ltymulti
pli
e r s
) wild
1 r
ivethei nequ
alityconstrai
nttobea cti
vew hichweknowt ob etruefort h
is
examp
le.N um ericali mplementat
iona so utlin
edi nt h
ea l g
orithms houlda llow
Ch.c I(
/ scal
ingv alueformul
tip li
e rs)
dete
nninati
ono finac
tivec o
nstrai
nts
.I n s
teadofn umericali mplementationo fthe
q=1(SUMTi te
rati
oncount
e r)
q uncon
straine
dp ro
blemana naly
tica
ls olut
ionisdetermi n
edu singMATLABs ymbolic
S
tep2
.C allDFPt om i
n i
mizeF(X r% r~) compu
tation.Example7 .1isr eprodu
cedf orconve
nience .
Ou tpUl:xq.
S
tep3
.C on ve r
genc eforEPF
fhk=
I 0fork= 12....1
; M
ini
miz
e f
(Xj
oX2
): x1-2xTx2+xT+XIX~-2xl +4 (
7.9
Ifgj:5O.f o
rj=1 .2.. .. m; S
ubj
ect
: h(x( X
2): xT+x~-2=0 (
7.l
Oa)
I
fallsideconstr
ain
tsa res ati
sfi
ed
T h
e nC onvergedSto p g
(x( x
O. 25x r+ O x~-1 :
50 (
7.L
Ob)
Slo ppingCriter
ia:
o: 55; 0: 55 (
7.
l0c
)
d.F= Fq F
Q - q
- 0
-
"
-I dX= Xq* -X(q-I)*
5Xl: 5X2:

I
f( d.F l:5EI
:S t o
p( fu
ncti
onn otc h a
nging
) Figu
re7.2isthccont
o u
rplotofthetrans
forme
du n
constrai
ncdfun
c t
ionforv al
uesof
Els eIfd.XTd.X:5EI:Stop(des ignn o
tc h
angi
ng) rh= 1and =1.Thei nc
reas
einn o
nlin
ear
ityi
sr ca
d1
iya pp
arntF
. igure7.3isthepl
ot
s elfq= N.:S lOp(maximumi t era
tio
nsreac
hed
) fo h=
rr 5a ndrg=5.H an
dlinge sefun
ctio
nsnumerical
1ye v
enwitht h
eBFOSw il
1
Con tinue beac o
nside
rablecha
11enge
.B oththefig
ure
ss u
ggestsver
alpoin
ts ats a
tisf
yfirs
t
qq+l orde
rcondi
tion
s.Theirclos
enessm i
tdif
fic
ultfo
ra nynumer
icaltechniquetofi
nd
rg r~'Ch; :r
r 1
Cg
theopt
imum
Sec7_2_1-
.ltisc
lear theEPFs
plolmcontainst heco
e
v
d
ere
lyi
e tg
nc
e
n
r
e
e
a
r
s
a
e
st
t
e
h
st
en
h
o
n
ep
l
l
i
o
n
ea
tS
.
r
i
i
t
n
yo
cet
f
t
h
hep
ec o
r
d
ob
eu
l
em
s
e
.
s
x
qx
q
.
symbol
icm ani
pula
tion.a c
tual
lyd raw
ingtll
ep l
ott a
kest i
me.Evaluati
ngt hed a
ta
00t
oSt
ep2 Dume
ricall
yw i
llmakeab igdiffer
enc
e.
274 N
UME
RIC
ALT
ECH
NIQ
UESFORC
ONS
TRA
INE
DOP
TIM
IZA
nON 7.
2 I
NDI
REC
TMETHODSFORC
ONS
TRA
INE
DOP
TIM
IZA
TIN 275
O

v
$eer
cno
nll
nea
rlt
ywl
thm
anyl
oc
olm
lnl
mum
s
4
.
.
7;
..
;
..
: 4
3 4
1

l
.
.-
-
.. .'" 3 ~-c .
.

N
M

z 3 4 5
xt
5
xt

F
lgu
re7
.2 E o
rPe
nal
tyF
unc
llo
nMe
lho
d:E
xam
ple7
.1(
n.=rg=
1 1
)
. F
lgu
re7
.3E
xte
rio
rPe
nal
tyF
unc
tio
nMe
tho
d:E
xam
ple7
.1(
n.=5
.fg=5
)
.

A
p
t
i
p
o
l
lc
nf
o
a
tio
ri
spr
obl
emi
s
'
0
n EPFAorlthm(
A7.
2):Thec
orr
esp
ond
ingu
nco
nst
rai
nedf
unc
- enter value for rg [default 1
] 25
ans
-1.4125 -0.1015
F(X I .X2 . 'g)=(x~-2x1X2+xf+X1X~-2xl +4)+ -0.8692 1.0980
-0.6263 -1.2107
(x~ +xi-2
)2+'
8(0 1)2
xf+O (
7.2
2) -0.0278 -1.3266
-0.0124 1.3267
Sec7 _2_1_calc.misa nm-fi
Iet ha
tw i
llcalculat
eesoh ona ndth evalu
eso fe -0.0090 -0.0000
func
tion
.f o
rExample7.1.forapre d
e t
erminedsetofvalue
so fthepenaltymul
tipl
ier
s. 0.7893 -1.1267
I
tr e
quire
stwoi n
putsmt heu seratdif
fere
ntstages
.Thef ir
sti n
putisthevaluesfo
r 0.9775 1.0165
emult
ipli
ersforwhiches ol
utions h
ouldb eobtain
ed. leiIs
to fsoluti
on(ther
e 1.4184 -0.1318
arenineforth
isproblem)i
sd isplayedin Commandwindow.Theu serfind
se Input the design vector chosen for evaluation
solu
tiontha
tsati
sfi
esthesideconstrai
nts(usua
llyo n
e)whichmustb eentere
dute [0.9775 1.01651
prompt(not
e:itmustbee n
tereda sav e
ctor
).Theprogramt henprin
tso utev alu
es The design vector [0.9775 1.0165 1
ofev ariou
sf u
nctio
nsi n
vo lv
edi nee xa
mple.Thef ol
lowingisp ostedfromthe objective function: 2.9810
Commandwindowf orbotho fthepenaltymul
tiplie
rsetto25. equality constraint: 0.0112
inequality constraint: 0.0138
Sec7 2 1 calc
enter value for rh [default 1
] 25
7
.2 INDIRECTMETHODSFORCONSTRAINEDOPTIMIZATION 277
276 NUMERICALTECHNIOUESFORCONSTRAINEDOPTIMIZATION

Int h
ea boveruntheequa
lityandt h
ei n
equ
aliyn
t s
trntar
notsa
tis
fie
d( Here).i
st hemul
tipli
ervect
ortiedtot
he ual
itycon
saintspisthemul
tipli
er
ex
pected
).T a
ble7.1d ocumentstheres
ult
so ft
heapplic
ationof eEPFmethodto vect
ora ss
ocia
tedw il
ht h
ei ne
quali
tycon
str
ainsandr
t handr sa r
et hepena
lty
Example7.1throu
ghSec7 _2_1_calc.m.l esc
alin
gf a
ctori
s5forbothm
ult
ipl
ier
s. mul
tipli
ersu s
eds imi
lartol h
eEPFm e
thod.F issolveda sanu nco
nstrai
ned
Ag la
ncealTable7.1clea
rlyi1
Ius
tra
testhech
ara
cte
rist
icsoftheEPFmethod.Asthe func
tionforpredeter
minedvalue
so fp r
"andr
g.Thereforeth
es o
luti
onf o
r
val
uesofthemult
iplie
rsinc as
e: eachSUMTi te
rati
onis

. Thed
esi
gna
ppr
oac
heseo
pti
malv
alu
e.
X.=X(p
rh
rg)
Thec
ons
tra
intv
iol
ati
onsd
ecr
eas
e.
Thes
olu
tio
nisb
ein
gap
pro
ach
edf
romo
uls
idet
hef
eas
ibl
ere
gio
n. Atee ndofth
eSUMTi l
era
tio
nlh
evalu
eso ft
hemult
ipli
ersandpn
alt
ycon
stant
s
ar
eupdat
ed.Thela
tte
rareus
uall
yge
ome
trica
llysca
ledbutunl
ikeEPFdonothav
eto
Ani mpor
tantnote d
st obemad.leana
lyt
icalcom
p u
tatio
nu si
ngsymb
olic be i
vento f
orconve
rge
nce.
com
pu t
ationappe
ar sy.Thesameca
nnotbesai
df o
rthenum
erica
lc o
mpu
tati
on.
es
pecia
1lylook
ingatFig
ure7.
3. Al
gorlthm:AugmentedLsgrangeMu
i pl
lerLM)Method 7
.3)
S
tep1 N
.ChooseX1.(n
o.ofSUMTit
era
tio
ns)


7
.2.
2 AugmentedLagrangeM
ult
ipl
ier(ALM)Method Nu(
no.o
fDFPi~rations)

Ej
'
S(
fo
ir
co
nv
r
g
e
n
c
ea
nds
top
pin
g)
T
hisist h
em ostrobu
stofep ena1tyfunct
ionm et
hods
.Morei mpor
tantl ta
yi 1so
;
r.r
4
;(O
in
i
t
a
i1pen
a
I
ty
mI
l
u
l

Il
t

i
i
P
li
e

p
rovide
si nf
ormat
ionon eLa g
r a
ng emul
tipl
iersatesolut
ion.Thisi
sa c
hievedby
c
Ch sc
g( a
1ingv
alu
efo
rmu
lti
pli
ers
)
n
otsolvingforthemu
lti
plier
sb utm erel
yu pda
tingthemd ur
ings u
ccess
iveSUMT
v
r~O" r~ (maximumal
u eformul
tip
lie
r)
i
ter
ati
ons[24
).Itovercomsm anyo ft h
ed i
ffic
ult
iesass
ociate
dw i thepena1t
y
f
uncti
onformula
tionwit
houtanys igni
fic
antoverhe
nd. .
J
I(initi
almult
ipli
erve
c tor
s)
q=1(SUMTi ter
atio
ncounter)
Trans
r matlontotheUnconstralnedProblem:The gen
era
1o pti
miz
ati
on S
te . Ca
p2 11DFPt ominimizeF(X q)
.
.qp r
Zr
" :)
pro
blem(
7.1)
(7.
4)i
s lsfor
m in o do fL
agr
ang
em u
lti
pli
ers Output
:xq.
S
tep3
.C onver
ge nceforALM
Minimize



)+
Ifhk=0 frk=1
o 2
.... 1
;
r: f
8) (X) dX)zd lfg
j
: 0f
orj =1.
( >Ofor=0)
2. .
m;

)
hk (
X) (
7.2
3)
(IfVf+k'
I
fal
lsidco
k
n
s
V
h
t
k+ ~V =0)
r
ThenConverged
a
int
S
sa
to
r
p
esa
tis
fi

x
l
s Sx! i=1
.2.
...
.n (
7.4
) S
toppingCri
teria
:
M'=Fq-F q-1aJ(=x q*-X<q-I
)

f(M')2SE
l :S
J top(fun
ctionnotchang
ing)
T
abl
e71E
. x
ler
iorP
ena
llyF
unc
tio
nMe
lho
d:Exa
mpl
e7.
1
seIfaJ(Td.XSEI:S t
o p(de
signnotchan
ging)
I
te
rat
ion r
h r X1 X2 f s El
seIfq=N .:S top(maximumi ter
ati
onsrea
che
d)
8
C
ont
inu
e
'aq

.0
1 1
.0 .03
91 2
.957
8 0.0
687 0
.0227
0
.92
28 1
qq+l
5
.0 5
.0 0
.94
64 1.
036
4 2
.96
51 -0.
0302 0
.0295
- JA--J

2
5.0 25.0 0
.97
75 .0
1 16
5 2
.981
0 -0.
0112 0
.0138 +2r
hh(X
"O)
1
25 1
25 0
.99
42 1
.0044 2
.99
-. 2
0 7 0
.0037 qp
p q+2rl(max(xq*).-pqI2r8])
6
25 6
25 0
.99
88 1
.00
09 2
.99
88 -
5.9775e-
004 7
.5097
e004
1
r.
rrCh;r:rfCg
278 N
UME
RIC
ALT
ECH
NIO
UESF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 7.
2 I
NDI
REC
TME
THO
DSF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 279

xqxq* o
fva
lue
sfora1
1of
theSUMTite
rat
ion
satthet
erm
ina
tio
nof
thep
rog
ram
.Thei
ni
ti
al
00t
oSt
ep2 d
esi
gnvec
tori
s[32].I
ni
ti
al=1a nd~ =1.

TheALMa lg
orim( A 7.
3)isavail
ableasastand-
alon
ep rogr
aminALM.m.l e ALM
progra
mislongwhichisnotune
xpecte
d.Th e
sea1g
orit
hrn
sa r
enot v
ial
.Tot r
ans
lat
e 1nput the starting design vector
alg
orith
m(A7.3)int
ow orkingcodeisamendousa cc
omplishme
ntpa
rtic
ula
rlyif This is mandatory as there is no default vector setup
yourexpot oMATI.Bo
A cc
urr
edt hr
oughisbook
.Ther ea
dersho
uldwalkthroug
h The length of your vector indicates the number of
th
ec odel in
eb ylin
e. eo r g
aniz
atio
na nds tru
ctur
ea rek e
pts impl
ea nd unknowns (n)
str
aigh
tfor
wal
'd
.C onunenlsh av beenlibe
ral
lyu sedasa nc ncoura
gementto Please enter it now and hit return for example [1 2
und
erst
.1n
dthec o
de. 3 ...]
[3 2]

ALM.m:Thec od
eg ae
rsinp
utfromt
heus
ert
hroug
hsev
era
lp r
omp
tsint
he
The initial design vector:
Conunandwind
ow.Th epro
mptsan
d fi
na
lit
era
tio
nar
cop
iedbe
low
.The t
3 2
si
gnif
ica
ntf
eat
ure
so ft
hec
odear
e:
1nput the minimum values for the design vector. .
Thes t
artin
gd esignvect
o ri
sthefirs
tinputto progrn.Thenumbero fdes
ign These are input as a vector. The default values are
varia
blesisautomatical
l yext
ractedfr o
mt h
isi nfo
rmati
o n
. 3 *start value below the start value unless it is zero.
l elow erandu pperb oun
dson d esignv a bl
es( si
dec o
nsn t
s) 1n that case it is -5:
obtain
e dr oughu se
rp rompts(thoughe ya renotusedinep ro
grar
n). [
00]
Numbero fequ a
lityc o
nstra
intsa ndc orr
es po
n d
ingi n
iti
almult
ipli
ers()
promptcd. The minimumvalues for the design variables are 00
Numbero finequaJit
y n st
rain
tsa ndc o
rrespondinginit
ia
lmulti
plie
rs()
1nput the maximum values for the design vector.
promptcd.
These are input as a vector. The default values are
Valuesatc ac
hSUMTi t
crat
ion pr
intc
di ntheCommandw indow.Wamings 3 *start value above the start value.

-
genera
te dbyMATLAB s w
itchedo ff
. 1f start value is 0 then it is +5:

1!
The DFP.m i su sedf oru ncons inedo ptim
izatio
n.T hisp rogramuses
c
[
55 1
GoldSecti onnVar i--

oep rograme x

Pct
sthefollowi
n gest
ob eavail
able
inepa:
The maximum values for the design variables are 55
O
b jec
tivef unct
ion Of un.m
Number of equality constraints [
0] 1
Equali
tyc o
nstrai
nts Hfun.m 1nitial values for lambda 1
I
nequali
tyc onstr
aints Gfun.m
U
n cons
tra i
ne dfunct
Ion FALM.m Number of inequality constraints [
0] 1
Thep rogramu sesgloba
ls tatem
entst ocommuni catemult
ipli
ervalu
es. 1nitial values for beta 1
Thei n
iti
alpenaltym ul
tipli
ersarec omputcda u
t o
matic
ally.
ALM iteration number: 0
Sever
alp arametersarec od
edi n
toep rogram.e s
pecialyt
I hos
en ee
dedforthe Design Vector (X) 32
goldens ec
tionan dtheu ppe
rb oun dcalc
ulatio
n.T hesecanbec hang
edb y Objective function 64
usr
.ifn ec
essary
. Square Error in constraints(hg ) 1.2100e+002
1.8063e+001
App
licationtoExample7.1
:Thc fo l
lowin
gr ep
res
ent
st hein
iti
alp r
ompts Lagrange Multipliers (lambda beta): 1 1
s
ecnint h
eCommandwindowa n
dt h
ev alu
esf o
rthcsta
rti
ngite
rat
ion
s.O t
her Penalty Multipliers (rh rg): 5.2893e-001 3.5433e+000
i
ter
ati
onsares
im1
iar
lydi
spl
aye
d.Als
oi nc
1udedbelowi
sac on
sol
idate
dp r
inti
ng

3
280 N
UME
AIC
ALT
ECH
NIQ
UESFOAC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 7
.3D
IAE
CTMETHODSFOAC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 281

(other iteration omitted) . Thes


tar
tin
gde
sig
nca
nbef
eas
ibl
eori
nfe
asi
ble
.
Thei
ni
ti
alc
hoi
cesf
ort
hm
ult
ipl
ier
s nber
ela
xed
.
X not changing O.OOOE+OOO reached in 5 iterations
Thereisonlyamodestincreaseinthecalculations.
The values for x and f and 9 and h are Atconver
gen
cet h
eLagrangemul
tipl
ierswi1
lbedriv
en10t
ll
ei
roptimumva
lue
s.
3.0000e+000 2.OOOOe+OOO 6 .4000e+001 1.8063e+001 Thi
sa lowsv
J er
ific
ati
ono fKTc ond
itionsthrou
ghthesi
gnofthemul
tip
lie
rs
1.2100e+002 as
soci
ate ea
dwi cti
vei n
equ
alit
yc o
n sa
int
s.
7.9603e-001 7.1223e-001 2.9443e+000 0 7.379ge-001
9.9937e-001 1.0092e+000 2.9995e+000 1.8223e-004
2.9434e-004 7
.3 DIRECTMETHODSFORCONSTRAINEDOPT
lMIZAT
lON
9.9607e-001 1.0013e+000 2.9962e+000 0 2.731ge-005
9.9940e-001 1.0002e+000 2.9994e+000 2.5872e-011 Thedire
ctmethodsi nc
1udeboththeobj
ectiv
e d.econs
trntstosear
chf orthe
6.2772e-007 op
timalsol
utio
n.Whileemethodsdon o
ti n
volveco
nve
rsiontoadif
fer
entc1assof
:
1
9.9940e-001 1.0002e+000 2.9994e+000 2.5872e-011 probl
ems(lik
eS ec
tion7.)
2 mostofthemareb edonli
nea
riza
tionofth
ef u
n c
lions
6.2772e-007 abo
utt h
ecurrenldes
i poi
nl.L
inear
izati
onisbasedonexpan
s i
onofthefu n
ction
a
bou
tth
ecu
rre
ntv
ari
abl
eva
lue
sus
ingt
heT
ayl
ors
eri
(C
hap
ter4
).
The values for lamda and beta are
1.0000e+000 1.0000e+000
-9.0876e-001 0 Une
sr l
zatlon
:Th eTayl
ors e
rie
sforalWo.
var
iab
leexpandedf
unc
tio
njx
{y)
-1.6493e001 9.5663e-001 q
uadr
atic
all
yabou
til
iec
urren
tpoin
t(x
p'Y
p)i
sexpr
ess
eda
s:
9.1192e-002 9.5616e-001
7.6430e-002 9.9221e-001

p
Th rogramt
ookf
ivei
ter
ati
ons(
lif
thwasn
otn
ece
ssa
ry)t
ofi
ndt
hes
olu
tio
nas
:
1 [
J
13
)
{J+
=f(x
f"y
/
)-
1-

x
;
=O
.9
4 x=1.0002; r
;; =2.9994; h.=0.0000; g.=0.0007 (7.24) I
! +)
L_
.
.I(
x.
J
I
)
+2
-
--
-"I
(x
pJ'

) -
"I(

J

r i
whichi
sve
ryc
10set
oth
eac
tua
lso
lut
io.Th
n ev
alu
esf
orem
ult
ipl
ier
s Ifedisp
lacem
ensa
t reorg
anize
d acolumnv [ ax 8
y]. e
T xpa
nsi
oni
n

J
Equa
tio
n(7.2
6)canbeex
press
edinacondensedmanner
y
cJ
'= "=0.9922 u
A
. -
0.0
763
; s (
7.2
5)
ud

Th
iss ati
sfi
est h
e KTc onditi
ons. Howeveri nSection7 .1
.2 thev al
ueso ft he
f f
()=
.I
ti
m
e
x
u
l
p
t
l
i
a
p
l
i
ie
nt
r
h
s
ed
o
b
i
t
s
a
c
r
i
e
ne
p
a
du
nc
si
ye
n
x
gs
ce
y
p
mb
tt
ol
os
i
a
ccomp
y t
ut
h
at
i
es
o
y
n
mb
a
o
r
l
eq
i
u
cc
i
t
al
ed
cu
i
l
f
a
t
f
i
e
r
o
ent
nfai
le
sd
dt
if
od
f
i
i
c
s
u
c
l
tt
ov
e
o
r L
[



AT[
y]
H(;
Xn
.

.
Y
I
J
n]
I
]
I
.
(7
sYI
.2
7)

t
hisparti
cula
rs olut
ionwhichi si ndeedpossi
ble. lev aluesin( 7
.25)ar mo
a
cceptab
leant hoseinS ec
tion7.1.2consi
deringeKTc onditi
ons. ForI
tva
ria
ble
s.w
ithXpt
hec
urr
entp
oitand8xt
n hed
isp
lac
eme
ntv
ect
or
TheALMme od a
sd em
onstraledabovei
s effec
liveandu se
fulmethodinsDi
t e
o
fb e
longingtothecla
ssofi n
dire
ctme ods.I
th ass
evera
ls igni
fica
ntadvanta
gesove r
t
heotherpena
llyfunctio
nf orm
ulati
ons[2].Som ofthema relis
ledbelo
w: )=
f f(X
p)+V
flp
)
T8X+tdXTH )

Themethodi
sno
tse
nsi
tiv
etot
hei
ni
ti
alp
ena
ltym
ult
ipl
ier
sort
hei
rsc
ali
ng Eq
uat
ion(
7.2
8)c
bew
ril
teni
nte
rmso
fed
iff
ere
ncei
nfu
nct
ionv
alu
es
st
rat
egy
.
Themethoddoesn
v
alu
es1
0t
abl
ishc
o
o
n
t q
v
erg
e
u
n
i
c
e
r
eep
.
ena
ltym
ult
ipl
ier
stobed
riv
ent
oex
tre
me
=f(X
p+ f(X
p)=V
f(X
p) T
TdX+ dX t
Xp) )
Thee
qua
lit
yanda
cti
vec
ons
tra
intc
anbes
ati
sfi
edp
r
l i
sel
y. 2
df=Of+of
7
.3 DIRECTMETHODSFORCONSTRAINEDOPTIMIZATION 283
282 NUMERICALTECHNIQUESFORCONSTRAINEDOPTIMIZATION

whereof=VjTaXi stenndJ
e i
rs
tv a
ria
tio
n.o2ji
stes
h eco
ndv a
ria
lionandi
sgive
n 5
by eso ndten
ni ntheabove ua
tio
n.Inlin
ear
iza
tionofthefunct
ionfab
outth
e
curr
entva
lueofdesignXp'onlythef
i vari
ati
onisus
ed.Th neig
hboring ueof
4
thefun
cti
onc a
nbee xpr
essedas

l(X =p)+V
p) f(X f(X
p)TaX (
7.30
)
3
Alloft h
ef u
nctio
n s eproblemc b elin
eariz
edsimill
y.Itisess
entiaIt
o
under
stand d iff
erencebetweenf(X)andl(X p
)'Thisisil
Iust
rat
edinF i
gur e7.
4
usi
ngt h
eobjec
tivefuncti
onofExnmple7.1expandedaboutthecu
rre
ntd e
signx=3
x2=2.Th curvedi
I nesf(X)arethecon
toursofeo rigi
naIfun
cti
on.Thes Bigh
t N
li
nesJ(Xp)arethecontoursoft
heline
arize
df u
nctio
n( l
ine
sofc o
nstan
tv a
Iueoft h
e M

f
unc
tio
n)o
bta
ine
dth
rou
ght
hef
oll
owi
ng:

x
i -

t222dt
O
rig
inaIi
on: f
(x.X2): x1-2xrX2+ +X~
) 2x1+4

4Af
L
ine
ari
zedf
unc
tio
n:]
(!J
.X'!
I .X2)=+92!
J J
.XI-6!
J
.X2

wheret hec oe
fficientsin seconde xpres sioni ncludest h
ee valuationoft he
functionandg r
adien
tatx =3 X2=2a nds ubstitutedinE a tion(7.30).InF igure
7.4s e
veralc ontoursa r
eshowna lthoug hth oseofi ntre
sta r
ei ntheneighborhood
ofec urrentdesign.Anyn onlinearf unc tionc anbeexpandedi nthesamem anner. -1
F
d

Ifanotherp oin
twasc hose
n.t henes lopes0"1L helineswouldbed if
feren.
t xt
Theq uadrati
ce xpansionoft hefuncti onc anb eobt ai
nedbyu singE quo n(7.
28).
lee xpan dedcurveswil
lben onlinear(qu adr
c )
. l eyappear e ll
ips nF
i igw7 .5 1g
F u
re7
.4l
Ius
tra
tlo
nol
lln
ear
iza
tlo
n.
where s ever
aIc ontourso fe 0e c
t ivef unctiono fExam p
le 7.1 e xpanded
qua
d r
atilIya u tXI= 3X2= 2.Itisimp ortantto o gnizetha
te contourw ouldbe
dif
feren
ti
Fourd
fa
ir
n
e
o
c
the
rp oin
twe
tmethodsa r
c

d
h
i
o
s
s
c
e
u
nf
sse
ore x
dThef
pans
i
r
i
s
on
ti
.
sS eque
ntiaILinearP r
o grarnming
n C
urrentint
ere
stint r
adit
ion
aldes
i opt
i tio
n(i
schap)isdi
rec
tedtow
ard
a
ctua
ld e
signappucadonsandmigr
ati
onfmmthemainfmmeandUNIXEnvir
onmen
t
(SLP)wheret h
es oluti
oni so btainedbys uccessivelys olv
ingt hec orresponding
oePC(
t li
kei sbook)Forcomp
leten
ess
.t h
esta
ndar
df on
natoftheNLPi s
lin
e a
rizedo ptimiza
t io
np roblem.Thes o ndS equentiaIQ ua
draticP rogramming
(SQP)u seseq uadra
tice xpansionf oreo bje c
tivef unct
ion.LikeeSUMTe rep
roducedher
ef o
rc o
nvenien
ce:
curren
ts o l
utionp rovid
eses t
artingv aIue sf orthen exti te
rati
on.Thet hir
d.e
(
7.1
)
GeneraIized ReducedG radientMethod (GRG).d evelopsas oph
isticateds h Mi
nim
ize !
(xoX2. x
1
)
dir
e c
tiona ndf ollowsitwithane l
a bo
r ateo ne-d i
men sionalproc
ess.Thef ourth
.L he
I) =o
. k=12.... 1
t< (
7.2
)
Sequentia
1GradientR es
torationA lgo rith m(SGRA)u sesat wo-cyc l
ea pproa
c h S
ubj
ect
: h X"X2.

XI

workingonf ea
sibi
lityando pt
imalitya 1tematelyt of indt h
eoptimum.l e
rea re
~XI X2....
) O
. j=12
...
. m (
7.3
)
severa
1o thermethodsduet omanyr ese archersb ute yd iff
erfromo selist
edi n
smalld et
ails.Tok pt hel e
ngthoft hisc hapt err eas
onable.eyhaven otb e
e n XlS
:XiS
:Xr. n
i=1.2.... 7.
( 4
)
i Ju
nc ded.Withecode do therproce duresa vailablefromt h
issect
ion.itsh oul
dn ot
bedifculttoprogramt hadditiona
lt echn iquesa tarew orthexplori
ngf orparti
cular
I
nve
cto
rno
tat
ion
Ja
c s s
esofp rob
lems.
Ex ceptf orspec
ialc l
assesofp roble msi nthef ollo wi
ngtwoc hapler
s . i
sc hapter (
7.5
)
i
st hep r
i n
cipalr easonf o
rt heb ook.I tp rovides ar esolut
iono ft hec omple
t e (X
Minimize f )
. ]"
o
o
pt
rg
i
r
m
e
i
a
z
t
l
at
i
yi
o
m
np
pr
r
o
o
v
b
e
le
dn
ma
um
sp
e
ri
o
c
s
a
l
lt
a
e
t
c
e
h
d.F
n
iq
o
u

ral
.l
o
e
n
r
gt
ei
i m
sal
enowt
oto
he
rehaven
fworkong l
ob
o
a
tb
lo
e
p
e
t
i
nanynew
m i
zatio
n . S
ubj t
to: [
h(X
)]=O (
7.6
)
2
84 N
UME
RIC
ALT
ECH
NIO
UESF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 7
.3 D
IRE
CTM
ETH
ODSF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TlON 285

5
M
ini
miz
e: l
(aX)=f
(X)+V
; f(X
;)TaX (
7.3
1)

Su
t
lo
: aX): "
k(X
;)+v
hI(X;)aX=; k=
0 1
2...
1 (
7.3
2)
4

I

(
AX)
: (
X)+V8
; J
{X;
)TAXS0
; j=12.
...
m
(
7.3
3)

J
3


A
x!o
wa
x;Sax)
I
P
; i=1
2.
..
n 7.
( 34)

Equ
Al
lo
a
ti
ft
o
n
h
s(
ef
7.
u
n
3
c
1
)
t
i
(
on
7
.
si
34
)r
nEqu
e
p
a
t
r
i
e
s
o
e
n
n
s(
laL
7
.3
in
1
)
e
(
arP
7.4
3
ro
)
g
e
x
r
a
c
m
e
m
p
i
tf
n
o
g(LP
)p
raX.h
r
a
v
ob
l
en
e
u
m(
m
er
C
i
c
h
a
a
pt
lv
e
r3
a
lu
)
.
e
s
2
"
'
" af
te
rs u
bst
itu
tin
gan um
erica
lv ecto
rf o
rX ;.Assumi
nga nLPp ro
gramcodei
s

av
ail
abl
ei
t nbecalle
drepe
atedl
ya f
te
rt h
edesi
gnisupd
ateda
s

X"=X+AX
l-~.i

no
I rdertoi nc
ludeasearchdire
cti
ona ndstc
psizecal
cul
ati
onXi nEq u
atio
ns
(
7.31)(7
. 3
3 )i
sc ons
ideredasas o
lut
ionf o
rS( asear
chdirec
tio
na tthecurre
nl
d
esign)
.S tepsiz
ec ompu
tationslragyisn ol ong
ers i
mpl
e.I fr
ea r
ev i
olat
ed
co
nstra
intsa1ph
aa t
tempt
st oreduc
eisv io
lati
on.Ifecurr
entsolu
tioni
sfeas
ible
este
psi
z ewil
la tt
empttoreducethe nc
tionwithou
tcausi
ngtheconstr
aIn
tstob e
exce
ssive
l yvio
late
d.Suchs tr
ate
gie
sa r
el a
rge
lyi mple
mente
datthediscre
tio
nof
-
2
2 -
1 2 3 4 5 algo
r i
thmo rcodedev
elop
er.
x
v
Aorlt
hm:S equentlalLlnearProgrammlng(SLP)( A4
)
F
Jgu
re7
.5l
Iu
st
ra
ti
on0
1qu
adr
atl
c9x
pan
slo
n. S
tep1
.C hooseX 'Ns(no
.o fiter
ation
s)
E
;'S(fo
rc onve
rgencea nds t
oppin
g)
[
g(X
)]mS0 (
7.
7) q=1( itera
tio
nc o
unler)
X10wSXSXup S
tep2
.C al
lLPt oo pt
imize(7.31)(7.
34)
(
7.8
)
Outpu:S
t
E
xam
ple7.
1wi
llb
eus
edt
oiIu
l s
tra
tet
hev
ari
ousa
lgo
rit
hms
. Useac onstr
n edc alculat
ion(X;=xQ)
AX=..S
M
ini
miz
e f
( .
x xi
)
: x
1-2xix2+xi+xlrz-2xl+4 (
7.9
) Xq+I=Xq+AX
S
tep3
.C onvergenceforSLP
S
ubj
ect
to: h
(X
Ix
:: x
z
) i+r
z-2=0 (
7.1
0
Ifhk=0 fo
rk=1 2... 1
;
g
(X.
.X2
): 0.2sxi+0.75~-1 SO (
7.
10b
) IfgJS0 f
orj=1 .2. ..m;
[fa
lls i
deconst
raintsaresati
sfi
ed
OSXI:
:;
5; OSX2SS (
7
.lc
O)
IfKTc ondit
ionssatis
fied
ThenC onvergedStop
Stoppi
n gCri
ter
ia:
7
.3.
1 S
equ
ent
lalL
inearProgrammlng(SLP) q
AX=xq+l-x
I
nth
eSLP[
5]al
lofth
efun
cti
onsa
reex
pan
dedli
nea
rl
y.I
fX;i
sco
nsid
ere
de
cur
ren
t IfAX TAXSE I:Stop(designnotchangi
ng)
d
esi
gnv
t
ore
neli
nea
riz
edop
tim
alpro
blemcanb
ese
tupas Ifq=N .:SIOp(maximumi ter
atio
ns a
che
d)

2
86 N
UME
RIC
ALT
ECH
NIQ
UESF
ORC
ONS
TRA
INE
OOP
TIM
IZA
TIO
N 7
.3O
IRE
CTM
ETH
ODSF
ORC
ONS
TRA
INE
DOP
TIM
IZA
TIO
N 287

5
C
ont
inu
e
qq+l
4
00t
oSt
ep2

TheSLPisappli
ed10E xample7.
1b elow
.InC hapter3noe x
pli
citprogra mfo
rs o
lving
eLPp rogramwa sdevelope
da l
thoughacommand-by-commandw alkr oughw as
int
rodu
ced.Ap ro
g ramforapp
lyingeSimplexme odpslmplex.mi sinclud
edo n
ew e
bsite(wi
thoutanycommento rdiscu
ssion)
.U singinst
ructio
nsf romChapter3
addi
ngsomcp rogramc on
tro
la ndo r
ganizingsomeb ookk
ee pingc anp r
ovidea
MATLABp
l
s
o
u
o
pt
bpr
o
oh
bl
e
c
r
l
o
g

mi
r
pl
a
r
ne
mf
an
s
a
c
l
o
a
hi
rLPp
t
ter
at
r

i
o

o
b
eeSLPa
ni
l
em

sg
s.A
l
r
g
a
o
p
h
l
t
r
i
e
i
c
m
t
h
a
at
mt
e

Iyp
l
ly
oc
r
M.

e
s
o
e
d
e
nt
.AB'
.I
ed
Sl
ni
.Thea
i
n
ss
p
e
r
r

e

ogc anb
conel
aofi nt
er
eu

es
s
i
n
tc
e
e
di
a
r
a
i
na
z
nb
ed
c
zoomedandthesolutio
nr e
adf r
omt h
ep l
o.tThisistrea
tedasdX( ins
teadofusingit
asS.Th
) edesi
gnisu pdate
da ndanothe
rp lo
tc anbeo bt
ainedb yrunningthemf i
le
fo
ranewv al
ueo ft h
ed es
ignvecto
r.Sec7 _3_1- p1t
.m a
o s
sistsind i
s p
layin
gt he
i
Inea
rize
df u
ncti
onsf romwhichs o
lutio
nc anbeo bta
ined.Thee qua
lityc o
nstr
aintis
egr nlin
e.l er e
disi n
equ
alilycon
strintl edesignvectoris p utt
oe
pro
gram.Thd eu sessymbol
icc al
cula
tion10solveandd i
splaythesub pr
oblem.

A
ppllca
tlonofSLP
. Xl=
sP1 (32) -
4 -
3 -
2 o 2 3 4 5
St
e .L
p2 ineari
zeds
ubpro
ble
m r. OX
1
Min
imize1 (dX)=64+[
92-
6] ~XI II F
lgu
re7
.6E
xam
ple7
.
1SL
Pil
er
at
io
n1.
IsX21

FromFi
gur
e7 .
7(zoomed
)theso
lut
ioni
saxl=0
.5
4ax
2=0
.23
.Fo
rth
ene
xt
c
t I
I
(dX
) 1+[
:1 64]I 1
=0 21
IX
!
l i
i
ter
ati
onX3=[112
. 51
.02
].Rep
eatSte
p2.
-
S
te .L
p2 in
ear
ize
dsu
bpr
obl
em
3 i
-i

g
(dX
):4
.25+[
1.53
11 Iso 1
(
. ]I
z

Minim
)=3
.20
6+[
2.3
957-
0.2
363
j

I
!lX
21
-

l "
'
21
FromFigure7.6(zoomed)thesolutionis~ =ax =1.3
35
&2=ax
2=-O.
75.
For


l
t
henex
tite
rat
ionX2=[1.6651
.2
5].R
epe
atS
tep2
.
S
tep2.Linar
ize
dsu
b p
ro b
lem b
jec
t10
:():0.
3060+[
2.2
52.
04]1 1=0

l"'
2
l

]1~XII

M
ini
mi )=6
.79
85+[
13 0
5-1
.38
2 i
I
l
ILU21 E


)
::
0
06

FromFigu
re7.8(z
o ome
)t
d h
es o
lut
ion
isd
x(=0.
12
5dx2=0.02
.F orthenex
t
S :():23347+[333251lh=0 i
ter
ati
onX4=[1 .01 .0].S i
ncethi
sist h
eknowns olu
tionfur
the
ri t
erat
ion
s
I
sX21
la
x.l- s
topp
ed.
gdX9+ 2
( 51.87
5 ISO1
/
leSLPtoo
kthreei t
era
tio
n o
st.fi
ndtheso
lut
ion
.Thisisveryim
pres
sive
.Itistru
e
o
nlyfort
ho
.s
ecase
sw he retenumbero
h .
fequa
lityp
lusact
iveincq
ual
ityco
nstra
intsi
s
288 NUMEAICALTECHNIQUESFORCONSTRAINEDOPTIMIZATION 7
.3 DIAECTMETHODSFOACONSTRAINEDOPTIMlZATION 289

5 5

4 4

3 3

>
N
<0

<0

3

-
2 -
2

-3 -3

4 -4

-
5
5 4 5

1
-
-55
L
-4 -3 -
2 -
1 2 3 4 5
SX1

F
lgu
re7
.7E
xam
ple7
.1SLPI
le
ral
lon2
. F
lgu
re7
.8E
xam
ple7
.1SLPI
e
lra
tio
n3.

lhe same as e number o fd es


ignv ariables-af ul
lc omp[ement. The main
disadvan
tageo flhemelhoda ppesife reisnoful
lcomplement .Inlhatcase sid
e C bee x
ecuted
.Oncea gainlhemovel i
rn
itswi
llinflu
encees olu
tio.I
n fthemove
consint
s(7.34)a r
ec r
itica
ltoed etenninat
i o
no flhesolut
ionase yd evelopint
o li
mitsarele
ftatl h
esamev aluet
hes o
lutio
nw i
llalwaysbeonl h
es quew i
thno
activ
ec o
nstr
aints.Inl hesesit
uat
ionslhel i
mitsonl h
es idecons
traint
s ec a
lle
dl h
e po
ssib
ilit
yo fconv
ergenc
e.Theselirn
it
smuslbel oweredwith chite
rat
ion
.U s
ually
movel im
its
.l n seo factivesi
deconst
rninlsI h
emovel imi
lsestabl
isht hevalu
esof the
ya redoneg e
ometr
icallylhro
ughas cali
ngfacl
or.lisimpli
esl h
ec onv
ergence
lhedesignchanges.Ifl hedesig
nc han
ge sarec o
nsider
a sl h
es ear
chd i ct
ion(s

wi
lldependonl hestra
legyfo
rc han
gingl h
emovel imi
tsno
ta nappeali
ngsitu
ati
on.
algori
lhm)e nbo v aJueandd i
rect
iona reacted
.Forl h
esec hang
e stob esma
ll TheSLPi snotoneoflhepopu
larmelhods.111
emovel i
rni
tsareavoide
dw i l
henext
meo d
.
aslhesolu
tionisa pp
roac hed
emovel imi
tshavet obea d
justed(
lowered )witheve
ry
ite
rati
on. lestrnteg
yf orisadjus
trnentmayi n
fluen
c e esolu
tion
.
Example7 .1w ilhoutt h
ei n
equa
lityc on
strain
tb u
tw ilhee qual
it yconst
rain
t 7
.3.
2 SequentlalQuadratlcProgrammlng(SQP)
provide
sa ni l
lusliono fthemovel imits
.F igu 7.9r epr
esentslhel i
n riz
ati
on
aboutlhepoit[3
n 2.
JThemovelimitsi nlhefigu (box)repr
esentlhesideconst
rai
nt Thelac
ko frobu
stne
ssineSLPduetoen eedformoveli
rni
tscanbecount
el by
lim
its in
cludi
nga neleme
ntofn o
nlin r
ityi
nep rob
lem.The arcse
vera
lwaysl hi
scan
beachi
eved.Onewayi s10requir
elhal se
archdir
ect
ions(rememberinaca1
impl
ement
a ti
onsXi sS nE
)i quati
on 7.
s( 31
)(7.
34)beli
mite
dbyt h
eunitci
rcl
ewhich
-2~ Lttl 2; -2~A1 S2
canbedescri
bed co
nstr
ain
l:
l
tisc l
earfro
mF i
gure7.9I
hatw
ilho
ulI h
emovelim
itst
hcs
olu
tio
nisunbounded
whichisno
tveryhel
pf.
lUsingl
u h
esolu
tiono
bta
ine
dinlh
efi
gue
r lh
ene
xtitera
tio
n STSS
:1 7.
( 35
)
290 N
UME
AIC
ALT
ECH
NIC
UESF
OAC
ONS
TAA
INE
DOP
TlM
IZA
TIO
N 7
.3 D
IAE
CTMETHODSFOAC
ONS
TAA
INE
DOPT
lMI
ZAT
ION 2
91

5 optimum MATLAB i mple


ments(aso fthi
sw rit
ing
). Having a
cces
st ot h
e
Opti
mizatio
nToolboxa llow
sNLPt obes o
lvedusin
gSQP.A d et
ail
eddiscu
ssiono
f
th
es o
lutio
nt e
chniquei
sa l
soavai
lab
le[11
].
l eQPs ubpro
bl e
memployedi nthi
ss ubse
ctio
ni sbasedone xpandin
gt h
c
3 obj
ectiv
ef unct
ionq uad
rati
call
ya bou
tt hec u
rren
td esi
gn. lec o
nst
rain
tsa r
e
expandedlin
earl
ya sinSLP[ 8]
. isiscall
edsequen
tialquad
rati
cprogramming
2 (SQP)
.

Minim 1
(d
.X)=
f' r
)+Vf(XidX+
. TV2fl dX )

zo

.
S
ubj l
to: ():h
k(X
j)+VhI(X)=0
; k=1
.2.
...
.1(
7.32
)

-1 ~J{.X): g
j(X
j)+V {Xj
gJ )Td
.XS0
; j=1.2.....m (
7.33
)
s
x}o j
wSsxSx~P; i=1
.2.
.
.n (
7.3
4)
-
2

nE
I qua ti
o n(7.36)V(X )ist heH e
ssianma t
rix.Ina ctua
li mplementationt h
er e
al
-
3
Hess
i anwilln otb eused.Insteadam etr
ic] i supda dw ie achi te
rati
onis
us
ed. si sbase don s ucce
sso ftheV aria
bleMe cM ethods(V
.f)o fthe
-
4
pre
vio uschapte
r.S ever
alr esearc
hers[6.9
]h aveshown BFGSu pdateforthe
Hes8
i anp rovid
esa ne icien
ti mplementat
io noftheSQPm ethod.T hisQPi sw e
ll
-
5
; -4 -3 -2 o poseda ndc onvexands houl
dy ieldas o
luti
on.S ol
utiont othissub p
r oblemisat
6x
he
arto feSQPm ethod.A c o
nsidera
bleamounto fre se
archh asb eeninvestedin
deve
l opinge f
ficien
t t echniques toh andle i s s ubproblem. I n a f ormal
F
lgu
7
. Iu
9 lstr
atl
ono
fmoveI
Im
lt
s. impl
e mentationo f SQPd.Xi nE quations(7.36
) d( 7.32)(7.34
)m uslbe
placedbyt h
es earc
hd i
rectionS.TheQPf o
rSa l80modifiest h
ec o
nstrain
te qua
tions
ste
psizedetermin
ations h
ouldthena c
countf orthea ctu c hangeinth edesign 80thataf easi
bledirect
ionc anbef oundwi r e
specttoec u
rrentactivecons
traint
s.
vec
tor. The p robleme xpre
ssed by Eq ( 7.31)( 7.
35)i saq uadmtic Fig
ur e7 .10illu
s Sec oncema boutmovingl ine
a r
lyt oap ointona na cti
ve
programming( QP)s ubp
r ob
lem.Ani temti
ves o
lutiono fthi
ss ubproblemc b eone con8ai .XO
nt thec u
rrentdesignisona na c
t i
veconstra
i ntI
. fthese a
r c
hd ire
ctionSI
formo f SQPme o d.This odi sp opul
arandi suse dw id
ely.Whilet h
eQP fol
low s l in
earizedfunctionatXO( thetangenttot h
ef unctio
na tt h
atpoint)
.a ny
subprogrami s as imp
len online
arp roblemw ithl inearc o n
sints
.i tiss ti
lla st
epsize.a log E
n hd i
rectio
n.howevers malw
l i
llc auset h
ec onstr
ainttob e
multi
variablcn o
nlinearp roblem
.F o
rtunate
lyQP p rob lemsa pp
eari n many vi
olated.Ino r
dertod et
er mi
nean eighborin
gp oi
ntthatwillsti

ls at
isfytheconstm
ints.
disc
iplin
esa n
dt h
ereareeffi
cien
tprocedur
esanda lgorithmstoa ddre
s sthe
sep rob
lerns asearc hdirecti
ons lig
htlylessth et angentisu se
d.Thi si ntroduc
esal ac
ko f
[6-10
].Oneo fthsem ethodsisa nextens
iono ft heS im plexmethodo fLinear con
siste n
cya sthedeviat
i o
nfromt ang
encybecomesam atterofindividua
le xper
ience
Programming. and
pr acti .Experimentshaves ug
g e
steda t90-95%o fthetangentisausefulfigu
re
lesoluti
onto eQPi swelldocumente
d.Itwouldl ru iremuchd isc
us si
ona nd alth
o ughmakingi tascloseto100%i srecommended[ 2].bes ea
rchd ir
ectio
nf in
ding
ther
eforeisnotintroducedhcr
e.R ea
dersarer e
ferredtot hev ario
usr ef
erences
.T his QPs ub problemis
isalso ep rimaryr ea
s o
nwhyt heQPmethodi sa v
ailablei nt heOptimization
Toolboxi nMATLAs.Thef o
rmalmethodsforQPp roblemsa reb asedone f
ficiencyin M
ini
miz
e 7
(S)=f(X)+V
f(X
j)TS
T[H]S (
7.3
7)
1
thevarioussta
gesoft h
ei mpl
ementat
ion.Ani nef
ficientbuts ucces
sfulsolution10the
problemc anbeo btai
nedbyu singIheALMo ft hepre v
iouss e
ctio
nt osolvet heQP S
ubj
ecl
: (S):cMXi)+VhI(X
)S=O; k=1
.2.
...
1 (
7.3
8)
subproblem.Afte
rall
.c omputingres
ource
sa r
en o
tac onstrai
n ttoday
.I nlie
uo fformal
discu
ssion.ani n
tuit
iveunderstan
dingofen umericalmethodi sa ttemp dint h
is (
S:c
) i
g<X
)+V8
i . x
)
'
fSS0 .2
; j=1 ..m 7.
( 39
)
book.Th etra
nsla
tionofSQPi ntocodei
sn o
ttriv
iala ndthemethodi su su
allyt h
eb a
sis
ofc ommercialsoftwar
e.F ore xamplSQPi
e stheo n lyal gorith
mf orcon str
ained s
} r
OWSSjSS"
; i=I.2.....n (
7.4
0)
292 CONSTRA1NEDOPT1M
NUMERICALTECHN1QUESFO TION
lZA 7
.3 DIRECTMTHODSFORCONSTRAINEDOPTIMIZATION 293

x
j=x
;'1+S

7.
( 41
)

mTL-H m


r

x
''E

+
+

m
nu
AV

.
r

e
Mi
nim
ize
: .4
2)

x
J

+
X

+
=

nu


AV

FJ

Rur
A
Jr



M
ini
miz
e: 7.
( 4
3)

J
Equ
ation(7.42)or(7.4
3)canbeusedtoobtain evaluegs t
epsiz
e.Th efuncti
onin
>
<"1 Equa
t i
on( 7.
43)requi
resani m
porta
nto b
servat
ion.S h
o

Vous aimerez peut-être aussi