You are on page 1of 3

Homework 4

Due: November 20, 2023

˝ Class : COMPUTATIONAL METHODS FOR ENGINEERS


˝ Lecturer : Tran Quoc Viet
˝ Email : viet204@gmail.com

Fall 2023
COMPUTATIONAL METHODS FOR ENGINEERS Homework 4

Important note: Numerical solutions of the following problems should be pre-


sented with at least 5 significant digits.

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.

Problem 2: (20%) Minimize the Giunta function


2 „ ˆ ˙ ˆ ˙ ˆ ˙ȷ
ÿ
2 16 1 64 16
f px1 , x2 q “ 0.6 ` sin 1 ´ xi ´ sin 4 ´ xi ´ sin 1 ´ xi ,
i“1
15 50 15 15

for x1 , x2 P r´1, 1s, by applying two different solvers selected from your most preferred solvers.

Problem 3: (20%) For M pcospπ{5q, sinpπ{5qq P R2 and the domain


" *
2 x2 2
Ω “ px, yq P R : ` 100py ´ 9q ď 1 .
4
Find K P Ω such that the distance from M to K is smallest. Verify the Karush–Kuhn–Tucker
conditions for your numerical solution.

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?

Due: November 20, 2023 1


COMPUTATIONAL METHODS FOR ENGINEERS Homework 4

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

Verify your numerical results for every N P t7, 10, 15u.

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

where N P N, and ai ą 0 are constants such that N


ř śN
i“1 1{ai “ 1. Herein i“1 xi “ x1 ¨ x2 ¨ ¨ ¨ xN .
The inequality (1) can be proven using the Jensen inequality for the function x ÞÑ ex . Indeed,
we have
i a
N N N N
ÿ xai ÿ elnpxi q ÿ eai ln xi Jensen řN řN śn ź
i
“ “ ě e i“1 ai ln xi {ai
“e i“1 ln xi
“ elnp i“1 xi q
“ xi
i“1
ai i“1
ai 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.

Due: November 20, 2023 2

You might also like