ISYE524 Homework 5 solution

$30.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Problem 1 — Nonconvex Quadratics

Suppose you have the constraint:

2x2+y2+z2+3xyβˆ’xz+2yz≀02π‘₯2+𝑦2+𝑧2+3π‘₯π‘¦βˆ’π‘₯𝑧+2𝑦𝑧≀0Β (1)

(a) Write constraint (1) in the standard formΒ vTQv≀0𝑣𝑇𝑄𝑣≀0Β whereΒ Q𝑄 is a symmetric matrix. What isΒ Q𝑄 and what isΒ v𝑣?

v =Β βŽ›βŽβŽœxyz⎞⎠⎟(π‘₯𝑦𝑧), Q =Β βŽ›βŽβŽœ21.5βˆ’0.51.511βˆ’0.511⎞⎠⎟(21.5βˆ’0.51.511βˆ’0.511)

(b) This constraint is not convex (i.e., the set of points satisfying the constraint is not an ellipsoid). Explain why this is the case.Β Hint: You can perform an orthogonal decomposition of a symmetric matrixΒ Q𝑄 in Julia like this:

using LinearAlgebra
Q = [2 1.5 -0.5;1.5 1 1; -0.5 1 1]
(L,U) = (eigvals(Q),eigvecs(Q)) # L is the vector of eigenvalues and U is orthogonal
U * Diagonal(L) * U' # this is equal to Q (as long as Q was symmetric to begin with)
(L,U)
([-0.7717848741953769, 1.671965737371683, 3.099819136823694], [0.4755037916822413 -0.396463343135491 0.7853107420923526; -0.701884978187095 0.3671776439352714 0.6103589560164115; 0.5303335002534842 0.8414258109566005 0.10367730303646348])

As seen above, the constraint is not positive semidefinite by orthogonal decomposition, as some eigenvalues are nonpositive.

(c) We can write constraint (1) in norm format as follows:

βˆ₯Avβˆ₯22βˆ’βˆ₯Bvβˆ₯22≀0‖𝐴𝑣‖22βˆ’β€–π΅π‘£β€–22≀0Β (2)

Find matrices A𝐴 and B𝐡 that make this constraint equivalent to (1).

βˆ₯Avβˆ₯22βˆ’βˆ₯Bvβˆ₯22≀0‖𝐴𝑣‖22βˆ’β€–π΅π‘£β€–22≀0

βˆ₯Avβˆ₯22=(2x)2+y2+z2‖𝐴𝑣‖22=(2π‘₯)2+𝑦2+𝑧2

βˆ₯Bvβˆ₯22=(3xyβˆ’xz+2yz)2‖𝐡𝑣‖22=(3π‘₯π‘¦βˆ’π‘₯𝑧+2𝑦𝑧)2

A =Β βŽ›βŽβŽœ411110101⎞⎠⎟(411110101)Β B =Β βŽ›βŽβŽœ0βˆ’6βˆ’4βˆ’606βˆ’460⎞⎠⎟(0βˆ’6βˆ’4βˆ’606βˆ’460)

(d) Explain how to findΒ (x,y,z)(π‘₯,𝑦,𝑧)Β that satisfy the above constraint but makeΒ 2x2+y2+z22π‘₯2+𝑦2+𝑧2Β arbitrarily large.

To find (x,y,z) such that the above constraint is satisfied andΒ 2x2+y2+z22π‘₯2+𝑦2+𝑧2Β is arbitrarily large,

vTQv=Ξ»1w21+...+Ξ»nw2n𝑣𝑇𝑄𝑣=πœ†1𝑀12+…+πœ†π‘›π‘€π‘›2

must be proven, whereΒ w=UTv𝑀=π‘ˆπ‘‡π‘£Β (orΒ v=Uw𝑣=π‘ˆπ‘€) and v is the same v defined in (a).

To do so, letΒ wi=0𝑀𝑖=0Β ifΒ Ξ»i>=0πœ†π‘–>=0Β andΒ wi=t𝑀𝑖=𝑑 for some positiveΒ t𝑑 ifΒ Ξ»i<0πœ†π‘–<0

Thus, it stands to reason thatΒ t𝑑 should be arbitrarily large, as w is a vector of either 0 orΒ t𝑑, and therefore,Β v=Uw𝑣=π‘ˆπ‘€Β is arbitrarily large thereforeΒ 2x2+y2+z22π‘₯2+𝑦2+𝑧2Β is arbitrarily large

Problem 2 — Geometric Programming

Fizzy Water, Inc. is designing a pipe that disinfects their water before it is packaged. The pipe is designed to heat the water toΒ T𝑇 (degrees above ambient temperature). The pipe has a fixed length and circular cross section with radiusΒ rπ‘Ÿ. The pipe is wrapped in a layer of material with thickenssΒ w𝑀 (much smaller thanΒ rπ‘Ÿ) for insulation to minimize heat loss. The design variables for the pipe areΒ T,r,𝑇,π‘Ÿ,Β andΒ w𝑀.

Heat loss can be converted to energy cost and is roughly equal toΒ (Ξ±1Tr)/w(𝛼1π‘‡π‘Ÿ)/𝑀 for some constantΒ Ξ±1𝛼1. The cost of the pipe is approximately proportional to the total material used:Β Ξ±2r𝛼2π‘ŸΒ for a constantΒ Ξ±2𝛼2. The insulation cost, similarly,is porportional to the total insulation material used, or roughlyΒ Ξ±3rw𝛼3π‘Ÿπ‘€Β for a constantΒ Ξ±3𝛼3. The total cost of constructing and using the pipe is the sum of these three costs.

Fizzy Water wants to maximize the total heat flow through the pipe, which is proportional to the velocity of the water through the pipe. This value can be approximated byΒ Ξ±4Tr2𝛼4π‘‡π‘Ÿ2Β for a constantΒ Ξ±4𝛼4. All α𝛼 constants and all variablesΒ T,r,w𝑇,π‘Ÿ,𝑀 are strictly positive.

The problem Fizzy Water wants you to help them solve is to maximize the total heat flow through the pipe, subject to their budget Cmax𝐢max which is an upper bound on total cost. They also have the following constraints:

  • Tmin≀T≀Tmax𝑇min≀𝑇≀𝑇max
  • rmin≀r≀rmaxπ‘Ÿminβ‰€π‘Ÿβ‰€π‘Ÿmax
  • wmin≀w≀wmax𝑀min≀𝑀≀𝑀max
  • w≀0.1r𝑀≀0.1π‘Ÿ

(a) Express this problem as a geometric program, and convert it into a convex optimization problem.

Geometric form:

minT,r,w>0aβˆ’14βˆ—Tβˆ’1βˆ—(r2)βˆ’1s.t.a1Tr/wCmax+a2r/Cmax+a3rw/CmaxTmin/TT/Tmaxrmin/rr/rmaxwmin/ww/wmaxw/0.1r≀1≀1≀1≀1≀1≀1≀1≀1min𝑇,π‘Ÿ,𝑀>0π‘Ž4βˆ’1βˆ—π‘‡βˆ’1βˆ—(π‘Ÿ2)βˆ’1s.t.π‘Ž1π‘‡π‘Ÿ/π‘€πΆπ‘šπ‘Žπ‘₯+π‘Ž2π‘Ÿ/πΆπ‘šπ‘Žπ‘₯+π‘Ž3π‘Ÿπ‘€/πΆπ‘šπ‘Žπ‘₯≀1π‘‡π‘šπ‘–π‘›/𝑇≀1𝑇/π‘‡π‘šπ‘Žπ‘₯≀1π‘Ÿπ‘šπ‘–π‘›/π‘Ÿβ‰€1π‘Ÿ/π‘Ÿπ‘šπ‘Žπ‘₯≀1π‘€π‘šπ‘–π‘›/𝑀≀1𝑀/π‘€π‘šπ‘Žπ‘₯≀1𝑀/0.1π‘Ÿβ‰€1

Convex form:

minx,y,zβˆ’xβˆ’2ys.t.log(elog(a1/Cmax)+x+yβˆ’z+log(elog(a2/Cmax)+y+log(elog(a3/Cmax)+y+zlog(Tmin)log(rmin)log(wmin)zβˆ’y≀0β‰€βˆ’x≀log(Tmax)β‰€βˆ’y≀log(rmax)β‰€βˆ’z≀log(wmax)≀1minπ‘₯,𝑦,π‘§βˆ’π‘₯βˆ’2𝑦s.t.π‘™π‘œπ‘”(π‘’π‘™π‘œπ‘”(π‘Ž1/πΆπ‘šπ‘Žπ‘₯)+π‘₯+π‘¦βˆ’π‘§+π‘™π‘œπ‘”(π‘’π‘™π‘œπ‘”(π‘Ž2/πΆπ‘šπ‘Žπ‘₯)+𝑦+π‘™π‘œπ‘”(π‘’π‘™π‘œπ‘”(π‘Ž3/πΆπ‘šπ‘Žπ‘₯)+𝑦+𝑧≀0π‘™π‘œπ‘”(π‘‡π‘šπ‘–π‘›)β‰€βˆ’π‘₯β‰€π‘™π‘œπ‘”(π‘‡π‘šπ‘Žπ‘₯)π‘™π‘œπ‘”(π‘Ÿπ‘šπ‘–π‘›)β‰€βˆ’π‘¦β‰€π‘™π‘œπ‘”(π‘Ÿπ‘šπ‘Žπ‘₯)π‘™π‘œπ‘”(π‘€π‘šπ‘–π‘›)β‰€βˆ’π‘§β‰€π‘™π‘œπ‘”(π‘€π‘šπ‘Žπ‘₯)π‘§βˆ’π‘¦β‰€1

(b) Consider a simple instance of this problem whereΒ Cmax=100𝐢max=100Β and allΒ Ξ±i𝛼𝑖 values equal 1. Assume for simplicity that every variable (T,r,w𝑇,π‘Ÿ,𝑀) has a lower bound of 1 and no upper bound. Solve this problem using JuMP. Use the Ipopt solver (or any other solver that can solve convex optimization problems) and the “@NLconstraint(…)” command to specify any nonlinear constraints. What are the optimalΒ T,r𝑇,π‘Ÿ, andΒ w𝑀?

cmax = 100
a1 = 1
a2 = 1
a3 = 1
a4 = 1

### MODEL ###

using JuMP, Ipopt

m = Model(Ipopt.Optimizer)

@variable(m, x)
@variable(m, y)
@variable(m, z)

@objective(m, Min, -x - 2y)

@NLconstraint(m,log(exp(log(a1/cmax)+ x + y - z))+log(exp(log(a2/cmax) + y)) + log(exp(log(a3/cmax) + y + z)) <= 0)
@constraint(m, -x >= 1)
@constraint(m, -y >= 1)
@constraint(m, -z >= 1)
@constraint(m, z-y <= 1)

optimize!(m)

println()
T = exp(value(x))
r = exp(value(y))
w = exp(value(z))
println("Temperature: ", T)
println("Radius: ", r)
println("Thickness: ", w)
println("Maximum heat flow: ", T*r^2)
This is Ipopt version 3.14.13, running with linear solver MUMPS 5.6.0.

Number of nonzeros in equality constraint Jacobian...:        0
Number of nonzeros in inequality constraint Jacobian.:        8
Number of nonzeros in Lagrangian Hessian.............:        6

Total number of variables............................:        3
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:        0
Total number of inequality constraints...............:        5
        inequality constraints with only lower bounds:        3
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        2

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  0.0000000e+00 1.00e+00 6.92e-01  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  3.2571425e+00 0.00e+00 4.82e-01  -1.0 4.34e+00    -  7.58e-01 1.00e+00h  1
   2  3.0846593e+00 0.00e+00 4.31e-02  -1.7 2.28e-01    -  9.19e-01 1.00e+00f  1
   3  3.0065655e+00 0.00e+00 2.22e-03  -2.5 1.13e-01    -  9.42e-01 1.00e+00f  1
   4  3.0003081e+00 0.00e+00 4.60e-04  -3.8 3.11e-01    -  8.42e-01 1.00e+00f  1
   5  3.0000037e+00 0.00e+00 1.15e-06  -5.7 7.17e-03    -  9.97e-01 1.00e+00f  1
   6  3.0000000e+00 0.00e+00 4.10e-09  -8.6 7.94e-03    -  9.96e-01 1.00e+00f  1
   7  3.0000000e+00 0.00e+00 5.62e-10  -9.0 3.07e-01    -  8.79e-01 1.00e+00h  1

Number of Iterations....: 7

                                   (scaled)                 (unscaled)
Objective...............:   2.9999999718181813e+00    2.9999999718181813e+00
Dual infeasibility......:   5.6204110977765058e-10    5.6204110977765058e-10
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Variable bound violation:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   3.1301266299467510e-09    3.1301266299467510e-09
Overall NLP error.......:   3.1301266299467510e-09    3.1301266299467510e-09


Number of objective function evaluations             = 8
Number of objective gradient evaluations             = 8
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 8
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 8
Number of Lagrangian Hessian evaluations             = 7
Total seconds in IPOPT                               = 0.005

EXIT: Optimal Solution Found.

Temperature: 0.3678794445158009
Radius: 0.36787944468301886
Thickness: 0.14594295986505196
Maximum heat flow: 0.04978706977095408