math 565 final assignmentorion.math.iastate.edu/keinert/math565/homework/m565_s15_final.pdf · math...

5
Math 565 Final Assignment due Thursday, May 7, 2015, at 2pm Fritz Keinert For each problem that uses Matlab or some other tool, you should hand in a printout of the relevant script or function file(s), or a transcript of your interactive session, plus whatever outputs or plots are requested. Put the problems in the proper order, and label all printouts clearly. The final output should have full accuracy (format long); intermediate results can be shorter, if you want. 1. (Based on Nocedal problem 16.11) Consider the optimization problem minimize x 2 1 +2x 2 2 - 2x 1 - 6x 2 - 2x 1 x 2 subject to x 1 + x 2 2 - x 1 +2x 2 2 x 1 ,x 2 0. (a) Find the solution, using fmincon or some other method. Also find the value of λ from the KKT conditions for that point. (b) Let c(x) 0 be the vector of constraint functions. Use the quadratic penalty function P (x)= kc(x) - k 2 2 and solve the unconstrained problem minimize f (x)+ μP (x) for several values of μ, using fminunc or a similar routine. Use the starting guess x 0 = (0.5, 0.5) for the first μ, and after that use the result from the previous step as the next starting value. Use mu = (0:0.5:10).^2. For each value of μ, print out the minimizer x μ , and the value of the objective function. (c) Similar to part (b), but with the 2-norm penalty P (x)= kc(x) - k 2 , for mu = 0:0.5:4. According to theory, x μ should be exact for all μ past a certain threshold. Find that threshold, and verify that your results agree with theory. Hint: I got bad results with fminunc. It does not seem to like the fact that this P is not differentiable. Use the Nelder-Mead routine instead. (d) Use the log barrier function B(x)= - X log c i (x), and solve the unconstrained problem minimize f (x)+ τB(x) for τ = 10 k , k =2, 1,..., -5. (e) (5 points extra credit) According to Nocedal, using the barrier function from part (d) is the old way of doing things. The new and improved way is to rewrite the problem with slack variables s i , and then use the barrier function for s i instead of c i (x). Repeat part (d) for this approach. How do the results compare? (40)

Upload: others

Post on 24-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Math 565 Final Assignmentorion.math.iastate.edu/keinert/math565/homework/m565_s15_final.pdf · Math 565 Final Assignment due Thursday, May 7, 2015, at 2pm Fritz Keinert For each problem

Math 565 Final Assignment due Thursday, May 7, 2015, at 2pmFritz Keinert

For each problem that uses Matlab or some other tool, you should hand in a printoutof the relevant script or function file(s), or a transcript of your interactive session, pluswhatever outputs or plots are requested. Put the problems in the proper order, andlabel all printouts clearly. The final output should have full accuracy (format long);intermediate results can be shorter, if you want.

1. (Based on Nocedal problem 16.11)Consider the optimization problem

minimize x21 + 2x22 − 2x1 − 6x2 − 2x1x2

subject to x1 + x2 ≤ 2

− x1 + 2x2 ≤ 2

x1, x2 ≥ 0.

(a) Find the solution, using fmincon or some other method. Also find the value of λfrom the KKT conditions for that point.

(b) Let c(x) ≥ 0 be the vector of constraint functions. Use the quadratic penaltyfunction

P (x) = ‖c(x)−‖22and solve the unconstrained problem

minimize f(x) + µP (x)

for several values of µ, using fminunc or a similar routine.Use the starting guess x0 = (0.5, 0.5) for the first µ, and after that use the result from

the previous step as the next starting value. Use mu = (0:0.5:10).^2. For each valueof µ, print out the minimizer xµ, and the value of the objective function.

(c) Similar to part (b), but with the 2-norm penalty

P (x) = ‖c(x)−‖2,for mu = 0:0.5:4. According to theory, xµ should be exact for all µ past a certainthreshold. Find that threshold, and verify that your results agree with theory.

Hint: I got bad results with fminunc. It does not seem to like the fact that this P isnot differentiable. Use the Nelder-Mead routine instead.

(d) Use the log barrier function

B(x) = −∑

log ci(x),

and solve the unconstrained problem

minimize f(x) + τB(x)

for τ = 10k, k = 2, 1, . . . ,−5.(e) (5 points extra credit)According to Nocedal, using the barrier function from part (d) is the old way of doing

things. The new and improved way is to rewrite the problem with slack variables si,and then use the barrier function for si instead of ci(x).

Repeat part (d) for this approach. How do the results compare? (40)

Page 2: Math 565 Final Assignmentorion.math.iastate.edu/keinert/math565/homework/m565_s15_final.pdf · Math 565 Final Assignment due Thursday, May 7, 2015, at 2pm Fritz Keinert For each problem

2 Math 565 — Final Assignment — due Thursday, May 7, 2015, at 2pm

2. Do optimization project 2: Design of a truss (see pages appended at the end), withsome minor modifications.

The project says that the truss has weight, but then they basically disregard that.It says that the effect of a load L at C is just L times the effect of a unit load. If thetruss has weight, this is not true. If F0 is the vector of stresses due to the weight of thetruss, and F1 are the stresses due to a unit load without weight, then the stresses dueto weight plus load L are F0 + L · F1.

I tried it with and without weight, and the effect of the truss weight is about 1% ofthe effect of a unit load, so it is negligible. Ignore the weight of the truss.

Also, the objective function is supposed to be maximum load divided by the weightof the truss. Again, that makes hardly any difference. If the point B moves around,some elements get longer and others get shorter. The total length hardly changes, andthe weight is proportional to the total length. Just maximize the allowable load.

For easier grading, use the following notation.There are 9 elements, numbered as in the picture. Let ri be the length of the ith

element, and fi the stress on it. From the viewpoint of the joints, a positive force pointstowards the inside of the element, away from the joint. From the viewpoint of theelement, a positive force pulls towards the joints, so it is tension. A negative force iscompression. There are 3 more forces f10, f11, f12 that act on the wall.

The point B has coordinates (a, b), all the other coordinates are fixed. There are 4angles at B that depend on the coordinates of B. Call them p, q, r, s. The other anglesare fixed.

Every joint gives us 2 equations: the sum of horizontal forces and the sum of verticalforces are both 0. We get a system of 12 equations in 12 unknowns.

(a) Put point B at (1.5, 1). Set up and solve the equations for a unit load at C.Figure out the maximum load before an element fails. Which element fails first?

(b) Generalize part (a) for the case when B has coordinates (a, b). Maximize theallowable load as a function of (a, b).

(60)

Page 3: Math 565 Final Assignmentorion.math.iastate.edu/keinert/math565/homework/m565_s15_final.pdf · Math 565 Final Assignment due Thursday, May 7, 2015, at 2pm Fritz Keinert For each problem
Page 4: Math 565 Final Assignmentorion.math.iastate.edu/keinert/math565/homework/m565_s15_final.pdf · Math 565 Final Assignment due Thursday, May 7, 2015, at 2pm Fritz Keinert For each problem
Page 5: Math 565 Final Assignmentorion.math.iastate.edu/keinert/math565/homework/m565_s15_final.pdf · Math 565 Final Assignment due Thursday, May 7, 2015, at 2pm Fritz Keinert For each problem