Professional Documents
Culture Documents
Fall 2023
COMPUTATIONAL METHODS FOR ENGINEERS Homework 4
Problem 1: (40%) For the real-valued function f px, yq “ x ` y sinpπ{7q and the domain
␣
Ω “ px, yq P R2 : x ě 0, y ě 0, x ď 10, x ´ y ě ´8, 5x ´ y ě 0,
x ` y ě 8, ´x ` 6y ě 12, 5x ` p2 ` sinpπ{7qqy ď 68 u .
Determine maxpx,yqPΩ f px, yq and argmaxpx,yqPΩ f px, yq using
1. (10%) the Penalty function method,
2. (10%) the augmented Lagrange multiplier method,
3. (10%) the ”SLSQP” method from scipy.optimize.minimize.
4. (10%) Verify the Karush–Kuhn–Tucker (KKT) conditions for every solution from your
previous computation.
Note when verifying the KKT conditions that you must write all the Lagrange multipliers
associated to active constraints.
for x1 , x2 P r´1, 1s, by applying two different solvers selected from your most preferred solvers.
Problem 4: (10%) In the exam to select candidates for International Mathematical Olympiad
(IMO) team of Vietnam (2021), students were asked to prove the inequality:
4pa2 ` b2 ` c2 q ` 2pab ` bc ` acq ` 7abc ď R
for a, b, c ě 0 such that 2pa2 ` b2 ` c2 q ` 3pab ` bc ` caq “ 5pa ` b ` cq. Here R is concealed.
You are asked to apply constrained optimization techniques to verify the latter inequality.
Define
f pa, b, cq “ 4pa2 ` b2 ` c2 q ` 2pab ` bc ` acq ` 7abc.
Maximize f pa, b, cq s.t.
a ě b ě c ě 0, 2pa2 ` b2 ` c2 q ` 3pab ` bc ` caq “ 5pa ` b ` cq.
What is the value of R?
Problem 5: (10%) For P “ 1.2345. Let N be some integer. Generate randomly αi P p0, 1q,
for i “ 1, N , and put řN
αi
ai “ i“1 , i “ 1, N .
αi
řN
(It implies that ai ą 0 and i“1 1{ai “ 1.)
Minimize the function
N
ÿ xai i
f pxq “ , x “ px1 , . . . , xN q P RN
i“1
ai
subject to
xi ě 0, i “ 1, 2, . . . , N
and
N
ź
xi “ P.
i“1
Hint: To verify numerical results, exact solution is required. In fact, we aim at verifying the
inequality
N N
ÿ xai i
ź
ě xi , for all xi ě 0, (1)
i“1
ai i“1
The equality ”=” happens when xai i “ C, where C is constant. In the case,
N
ź
xi “ P
i“1
therefore we obtain
N
ź N
ź řN
xi “ C 1{ai “ C i“1 1{ai
“ C 1 “ P.
i“1 i“1
Or, we have
N
1{ai
ÿ xai i
x˚i “P , i “ 1, 2, . . . N, ˚
f px q “ min “ P.
i“1
ai
The latter quantities play the role of the exact solution, which you can compare to your nu-
merical results.