Metody optimalizace Projekt 4

Metody optimalizace
Projekt 4
Úloha 1 Nakreslete graf a vrstevnice funkce
f (x1 , x2 ) = 100(x31 − x22 )2 + (1 − x1 )2 .
Řešte úlohu optimalizace bez omezení
min f (x1 , x2 ).
x∈R2
Tuto úlohu řešte metodou největšího spádu, Newtonovou metodou s analyticky vypočteným gradientem i Hessiánem, Newtonovou metodou s numericky vypočteným gradientem i Hessiánem, metodou
nelineárních sdružených gradientů, BFGS metodou a Trust region metodou. Porovnejte rychlost konvergence (tj. počty iterací) a počty vyčíslení minimalizované funkce při použití jednotlivých metod.
Úlohy počítejte s ukončující podmínkou na velikost gradientu i délku kroku.
Úloha 2 Řešte úlohu minimalizace výrobní ceny plechovky na sodovku z přiložených listů (úloha
1.1), kde C1 = 1.00$. Úlohu řešte jako úlohu optimalizace s omezením pomocí některé z metod určených pro optimalizaci s omezením (metoda penalty nebo metoda rozšířených Lagrangiánů).
Úloha 3 Minimum kvadratické funkce
1
f (x) = xT Ax − bT x
2
aproximuje (až na jednotky) průhyb struny zatížené jednotkovou
(x1 = xn = 0), kde A ∈ Rn×n , b ∈ Rn a

1
0
0
0
0 ...
0
0
0
0
 0
2
−1
0
0
.
.
.
0
0
0
0

 0 −1
2 −1
0 ...
0
0
0
0

 0
0 −1
2 −1 . . .
0
0
0
0

 0
0
0
−1
2
.
.
.
0
0
0
0

 ..
.
.
.
.
.
.
.
..
.
..
..
..
.. . .
..
..
..
A = (n − 1)  .
.

 0
0
0
0
0 ...
2 −1
0
0

 0
0
0
0
0
.
.
.
−1
2
−1
0

 0
0
0
0
0 ...
0 −1
2 −1

 0
0
0
0
0 ...
0
0 −1
2
0
0
0
0
0 ...
0
0
0
0
silou a uchycené na obou koncích
0
0
0
0
0
..
.
0
0
0
0
1










,









0
1
..
.

1 

b=−

n−1
 1
0




.


Minimum kvadratické funkce f za podmínky xi ≥ `i , kde `i < 0 definuje překážku, popisuje
průhyb struny nad tuhou překážkou. Otestujte metodu penalty na problémech s překážkou určenou
hodnotou `i = τ < 0, ∀i ∈ {1, . . . , n}. Hodnotu τ si zvolte sami.
Example 7.1 New consurner research, with deference to the obesity problem
among the general population, suggests that people should drink no more than
,r2
INTHODUCTION
about 0.25 liter of soda pop st a tíme'The fabricadon cost of the redesignedsoda
can is proportional to the suďace aťea,and can be estimated at $1.00 per square
centimeter of ttre material used. A circular cross-section is the most plausible,
given current tooling available for manufacture.For aestheticreason, the height
must be at least twice the diameter.Studies indicate that holding comfort reqnires
a diameter between 5 and I cm. Create a design that will cost the least.
Figure 1.1 representsa sketch of the can. In most product designs,parficularly
in engi:neering,it is necessary ta work with a figure. The diameter d and the
height ň are sďficient to describe the soda can. what about the thickness r of
the material of the can? What are the assumptions for the design problem? Is
r small enough to be ignored in the c*lculation of the volume of soda in the
can? Another important assumption could be that the can will be made using
a given stock roll. Another one is that the material required for the can will
include only the cylindrical suďace area and the area of the bottom. The top will
be fitted with an end cap that will provide the mechanism by which the soda
can be poured, The top is not part of this design problem. In the first attempt
at developing the mathematical,we could staťtout by consideríngthe quantities
identified, including the thickness, as design variables:
Design variables: d, h,,t
Reviewing the statementof the design problem, one of the parametersis the
cost of material per unit area that is given as $1.00 peť square meter. Let us
identify the cost of material per unit area as constant C. Durlng the search for
the optimal solution this quantity will be held at the given value. Note, if this
value changes then our cost of the can will correspondingly change.This is what
we mean by a design parameter. Typically, change in parameterswill require a
new solution to the optimization problem:
Design Parameter: C
The design functions will include the computation oť the volume enclosed
by the can and the suďace area of the rnaterial used. The volume in the can is
iaLn1+, The suďace area is rdh * rrd21a. The aestheticconstraintrequires that
r.*9--*r
ffi
Figr:re t.Í Examp|e1.1- Design of a new beveragecan.
&.
'ff.
,il
Ěg
ii.n
YI
ff
ffi
r,,,,,rr
'ffi
-ff
'it''ffi
;i,,,,,r,;:d
I irb
ffi
i
1.1 OPTIMIZATION
FUNDAMENTALS
da
ffe
leo
ht
es
iy
he
of
Is
he
1g
ill
il l
1a
pt
3S
ls
)r
ls
rt
á
d
s
13
lr = 2d. The side constraintson the diameter are prescribed in the problem. Far
*ompleteness,the side constraints on the other variables have to be prescribed
by the designer' We can ťormally set up the optimization problem:
Minimize
f (d, h, t): C{ndh + rd21+7
Subject to: Íz1{d,
Ít,t}): rrd.2h1a- 25a : a
91(d,ll, Í): 2d _ h < a
5íd<8;
4 s h< 2 0 ;
( 1 .1 3 )
(1 . 1 4 )
i 1 .1 s)
0 . 0 0 1< r < 0 - 0 1
In the mathematicalmodel (1.13-1.15) of the optimizarion problem for rhe
first example the values of the design variables are expected io be expressed
ía consistent units-centimeters.It is the responsibility of the designer tJensure
correct and accurate problem formulation including dimensions and units. Note
Ťhatthe cost C was originally expressedas meter squared.Hence a scaliing factor
mustbe usedin (1.13).We will call rhisC1.
. Intuitively, there is some concern with the problem as expressed by the
Equations(1.13-1.15) even thoughthe descriptionis valid. How can the vaiue of
the design variable Í be established?The variation in Í does not affect the design.
Changing the value oť/ does not change , ht, or 8t, Hence it cannotbe a desígn
'f
l,ariable (Note: The variation in / may affect the válue of C' but we have alreaáy
decided this value will not change during optimization). Iť this were a serious
design example then the cans have to be designed for impact, stacking strength,
and stressesoccurring during transportatíonand handling. In that case l win pr.obably be a critical design varjable. This will require severď additional struótural
constraints in the problem. Moreover, it is likely that developmentof these func{ions will not be a simple exercise. This could serve as an interesting extension
to this problem for homework or project- The new mathernaticalmodel for the
optimization problem after dropping t, and expressing Ld,hl as fxt, xz)becomes:
Minirnize f (x1,x2):C{tr4x2 + rx!1A1
(1 . 1 6)
Subjectto: ht{xt, x2):rxlx2l4 * 2SA* A
(r.17)
&t(xi, x2}:2x1_ xz Í 0
5<xr<8;
( 1 .1
8)
4<x2<20
The problem ťepresentedby Equations (1.16)_(1"18)is the mathematical
model for the design problem expressed in the standard format. For this
problem, simple geometrical relations were sufficient to set up the optimization
probiem.