实用优化例题答案_第1页
实用优化例题答案_第2页
实用优化例题答案_第3页
实用优化例题答案_第4页
实用优化例题答案_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、SAMPLE SOLUTIONS PRACTICAL OPTIMIZATION: Algorithms and Engineering Applications Andreas Antoniou and Wu-Sheng Lu (Revision date: March 9, 2009) SA.1(a) Solve the following minimization problem by using a graphical method: minimize f(x) = 2x1+ x2 2 2 subject to:c1(x) = (x1+ 3)2 x2 2+ 9 0 c2(x) = 3x1

2、 2x2 6 0 Note: An explicit numerical solution is required. (b) Indicate the feasible region. (c) Is the optimum point constrained? Solution (a) and (b) If we let f(x) = 2x1+ x2 2 2 = c with c = 2, 6, 10, and 14, a family of contours, which are parabolas, can be constructed for the objective function

3、 as shown in Fig. SA1. On the other hand, setting c1(x) = 0andc2(x) = 0 yields circle (x1+ 3)2+ x2 2= 9 and straight line x2= 3 2x1 3 respectively. Together these equations defi ne the feasible region shown in Fig. SA.1. By inspec- tion, we observe that the solution of the constrained problem is x=

4、6 0T at which f(x) = 14 (c) Since the solution is on the boundary of the feasible region, it is constrained. SA.2 Repeat SA.1(a) to (c) for the problem minimize f(x) = x2 1 4x1+ x2+ 4 subject to:c1(x) = 2x1 3x2+ 12 0 c2(x) = 1 (x1 6)2 4 x2 2 9 0 Note: Obtain an accurate solution by using MATLAB. 2PR

5、ACTICAL OPTIMIZATION: Algorithms and Engineering Applications 121086420 6 4 2 0 2 4 6 c = 2 6 10 14 Solution Feasible region x1 x2 Figure SA.1 Solution (a) and (b) The objective function can be expressed as f(x) = (x1 2)2+ x2 If we let f(x) = (x1 2)2+ x2= c with c = 1, 1, 3, and 5, a family of conto

6、urs, which are parabolas, can be constructed for the objective function as shown in Fig. SA.2. On the other hand, setting c1(x) = 0 and c2(x) = 0 yields straight line x2= 2 3x1 + 4 and ellipse (x1 6)2 22 + x2 2 32 = 1 respectively. Together these equations defi ne the feasible region shown in Fig. S

7、A.2. By in- spection, we observe that the solution point is achieved when the intersection points between a function contour curve and the circle defi ned by c2(x) = 0 converge to a single point. Since these two curves are represented by (x1 2)2+ x2= c and (x1 6)2 22 + x2 2 32 = 1 SAMPLE SOLUTIONS3

8、1012345678910 5 4 3 2 1 0 1 2 3 4 5 c = 1 1 3 5 Solution Feasible region x1 x2 Figure SA.2 we can eliminate x2 in the second equation by using the fi rst equation to obtain the equation 4x4 1 32x 3 1+ (105 8c)x 2 1+ (32c 236)x1+ (352 + 4c 2 32c) = 0 As can be seen from Fig. SA.2, the value of c = ct

9、hat corresponds to the solution point lies between 3 and 5. A bisection method to identify this value of cis as follows: Considerthe intervalcl, cu with cl= 3 and cu= 5. We take the valueofc in the aboveequation to be c = (cl+cu)/2 andcomputethe fourroots of the equation. Since the numberof intersec

10、tion points is at most two, there are at most two real roots for the equation. If with the above value of c the equation has two distinct real roots, then this c is greater than the optimum cand we set cu= c. Otherwise, the equation has no real roots and the value of c is smaller than c. In this cas

11、e, we set cl= c. The above steps are repeated until the length of interval cl, cu is less than a prescribed tolerance . The value of ccan then be taken as c= (cl+ cu)/2. The solution can be obtained to within a tolerance = 1012by running MATLAB program progSA2.m.1By running progSA2.m the solution wa

12、s found to be c= 3.4706, x= 4.1150 1.0027T. (c) Since the solution is on the boundary of the feasible region, it is constrained. SA.3(a) An nn symmetric matrix A has positive as well as negative components in its diagonal. Show that it is an indefi nite matrix. (b) Show that the diagonal of a positi

13、ve semidefi nite matrix A cannot have negative components. Likewise, show that if A is negative semidefi nite, then its diagonal cannot have positive compo- nents. (c) If the diagonal components of A are nonnegative,is it necessarily positive semidefi nite? 1 The MATLAB programs used in these soluti

14、ons can be found in a PDF fi le immediately after this PDF fi le. 4PRACTICAL OPTIMIZATION: Algorithms and Engineering Applications Solution (a) Suppose that the ith and jth diagonal components of A, aiiand ajj, are positive and negative, respectively. If eiis the ith column of the n n identity matri

15、x, then eT iAei= aii 0 Hence, by defi nition (see Appendix A.6), A cannot be negative semidefi nite. Similarly, if ejis the jth column of the n n identity matrix, then eT jAej = ajj 0 and hence A cannot be positive semidefi nite. Therefore, A is an indefi nite matrix. (b) We prove the statements in

16、part (b) by contradiction. If A is positive semidefi nite and has a negative diagonal component ajj, then eT jAej= ajj 0 which contradicts the fact that A is negative semidefi nite (see Appendix A.6). These contradic- tions show that the statements in part (b) are true. (c) Thenonnegativenessofthedi

17、agonalcomponentsofamatrixcannotguaranteethepositivesemidef- initeness of the matrix in general. For example, A = ?1 3 3 2 ? has positive diagonal components but it is not positive semidefi nite because its principal minors, i.e., 1, 2, and 7, are not all nonnegative. SA.4 An optimization algorithm w

18、as used to solve the problem minimize f(x) = x2 1+ 2x1x2+ 2x1+ 3x 4 2 and it converged to the solution xa= 1.6503 0.6503T. (a) Classify the Hessian of f(x) as positive defi nite, positive semidefi nite, etc. (b) Determine whether xais a minimizer, maximizer, or saddle point. Solution (a) The Hessian

19、 of the function can be obtained as H(x) = ?2 2 2 36x2 2 ? The principal minors of H(x) are 2,36x2 2, and 72x224 whereas the principal minors of H(x) are 2, 36x2 2, and72x22 4. HenceH(x) is positivedefi nite, positivesemidefi nite,orindefi nite if and only if 72x2 2 4 0, = 0, or 0, respectively. By

20、setting 72x22 4 = 0, we obtain x1= 1/32. Therefore, we conclude that (i) if x2 1?(32), then the leading principal minors are all positive and H(x) is positive defi nite; (ii) if x2= 1/(32), then the principal minors are nonnegativeand H(x) is positive semidef- inite; SAMPLE SOLUTIONS5 (iii) and if 1

21、/(32) x2 1/(32), then both H(x) and H(x) have positive and negative principal minors and H(x) is indefi nite. (b) The gradient of the objective function is given by g(x) = ?2(x 1+ x2+ 1) 12x3 2+ 2x1 ? At xa= 1.6503 0.6503T, we have g(xa) = ? 0 5.3489 ? 104andH(xa) = ?2 2 2 15.2259 ? Since g(xa) 0 an

22、d H(xa ) is positive defi nite, it follows that xais a minimizer. SA.5(a) Use MATLAB to plot f(x) = 0.6x4 2+ 5x 2 1 7x 2 2+ sin(x1x2) 5x2 over the region x1, x2 .2 (b) Use MATLAB to generate a contour plot of f(x) over the same region as in (a). To facilitate the addition of a line search to the con

23、tour plot in part (d), use MATLAB command hold on to hold successive plots. (c) Compute the gradient of f(x), and prepare MATLAB function fi les to evaluate f(x) and its gradient. (d) Use Fletchers inexact line search algorithm to update point x0along search direction d0by solving the problem minimi

24、ze 0 f(x0+ d0) where x0= ? ? ,d0= ?1.00 1.01 ? This can be done by using the following algorithm: 1. Record the numerical values of obtained. 2. Record the updated point x1= x0+ d0. 3. Evaluate f(x1) and compare it with f(x0). 4. Plot the line search result on the contour plot generated in part (b).

25、 5. Plot f(x0+d0) as a functionof overthe interval0,4.8332. Based onthe plot, comment on the precision of Fletchers inexact line search. (e) Repeat part (d) for x0= ? ? ,d0= ? 1.0 0.85 ? The interval of for plotting f(x0+ d0) in this case is 0, 5.7120. Solution (a) Using MATLAB program progSA5a.m, t

26、he plot of Fig. SA.3 can be obtained. (b) Using MATLAB program progSA5b.m, the plot of Fig. SA.4 can be obtained. (c) The gradient of f(x) is given by g(x) = ? 10 x1+ x2cos(x1x2) 2.4x3 2 14x2+ x1cos(x1x2) 5 ? Functions f(x) and g(x) can be evaluated by using MATLAB programs progSA5c1.m and progSA5c2

27、.m, respectively. 2A MATLAB command for plotting the surface of a two-variable function is mesh. 6PRACTICAL OPTIMIZATION: Algorithms and Engineering Applications 3 2 1 0 1 2 3 3 2 1 0 1 2 3 50 0 50 100 x1 x2 Figure SA.3 x1 x2 31.3 17.9 3.17 16.6 6.99 2.58 8.32 28 3210123 3 2 1 0 1 2 3 Figure SA.4 (d

28、) Inexactlinesearch(Algorithm4.6)canbecarriedoutbyusingMATLABprograminex lsearch.m, which requires four input parameters, namely, point x0to start the search, vector d0as the search direction, the function name for the objective function, and the function name for the gradient. For the present probl

29、em, the MATLAB commands x0=-pi -pi d0=1 1.01 alpha=inex_lsearch(x0,d0,progSA5c1,progSA5c2) yield alpha = 5.1316. Hence x1= x0+ d0= ?1.9900 2.0413 ? and, therefore, f(x0) = 53.9839,f(x1) = 9.9527 Using the MATLAB commands x1 = x0 + alpha*d0; plot(x0(1) x1(1), x0(2) x1(2); plot (x0(1), x0(2), .); plot

30、(x1(1), x1(2), o); SAMPLE SOLUTIONS7 the line-search update illustrated by the solid blue line in the contour plot of Fig. SA.5 can be obtained. To examine the performance of the inexact line search, we can plot the variation of x1 x2 31.3 17.9 3.17 16.6 6.99 2.58 8.32 28 x1 x0 A B 3210123 3 2 1 0 1

31、 2 3 Figure SA.5 f(x) with respect to the line x = x0+ d0 (i.e., dashed blue line x0B in Fig. SA.5). From triangle x0AB, we compute the length x0B as x0B = ? (2)2+ ? 2 1.01 ?2 = 8.8419 Hence the value of corresponding to point B is given by max= 8.8419 ?d0? = 8.8419 1 + 1.012= 6.0803 A plot of f(x0+

32、 d0) as a function of over the interval 0, 6.0803 can be obtained as shown in Fig. SA.6 by using MATLAB program progSA5d.m. Evidently, the inexact line search algorithm obtained a fairly good value of , i.e., = 5.1316 (see mark in Fig. SA.6). 0123456 20 10 0 10 20 30 40 50 60 f(x0+d0) Figure SA.6 8P

33、RACTICAL OPTIMIZATION: Algorithms and Engineering Applications (e) Proceeding as in part (d) with d0= 1 0.85T, the MATLAB commands x0=-pi -pi; d0=1 0.85; alpha=inex_lsearch(x0,d0,progSA5c1,progSA5c2); yield = 2.7852. Hence x1= x0+ d0= ?0.3564 0.7742 ? and f(x0) = 53.9839andf(x1) = 0.7985 The line se

34、arch is illustrated by the dashed red line in Fig SA.5. The interval for in this case is 0, 6.2832. The plot of f(x0+ d0) was produced using MATLAB program progSA5e.m and is shown in Fig. SA.7. From Fig. SA.7, we see again that the inexact line search provides a 0123456 20 10 0 10 20 30 40 50 60 f(x

35、0+d0) Figure SA.7 very good value for (see mark). SA.6 Consider the minimization problem minimize f(x) = 2x2 1+ 0.5x 2 2 x1x2+ 4x1 x2+ 2 (a) Find a point satisfying the fi rst-order necessary conditions for a minimum. (b) Show that this point is the global minimizer. (c) What is the rate of converge

36、nceof the steepest-descent method for this problem? (d) Starting at x0= 0 0T, how many steepest-descent iterations would it take (at most) to reduce the function value to 1012? Solution (a) The objective function can be expressed in the standard form as f(x) = 1 2x T ? 4 1 1 1 ? x + xT ? 4 1 ? + 2 H

37、ence the gradient of f(x) is given by g(x) = ? 4 1 1 1 ? x + ? 4 1 ? By setting g(x) to zero and solving g(x) = 0 for x, the unique stationary point x= 1 0T can be obtained. SAMPLE SOLUTIONS9 (b) From (a), we obtain the Hessian matrix of f(x) as H = ? 4 1 1 1 ? Since the leading principalminors of H

38、, i.e., 4 and 3, are positive, H is positive defi nite and f(x) is a strictly globally convex function; hence xis the unique global minimizer of f(x). (c) The two eigenvalues of H are found to be 0.6972 and 4.3028. Thus r = 0.6972/4.3028 = 0.1620, and the convergenceratio is given by = (1 r)2 (1 + r

39、)2 = 0.52 (d) It follows from Eq. (5.8) that |f(xk) f(x)| k|f(x0) f(x)| From part (a), x= 1 0Tandf(x) = 0 Hence |f(xk)| k|f(x0)| Consequently, if k|f(x0)| 1012(SA.1) f(x0) = 2, and log10 = 0.2840, then taking the logarithm of both sides of Eq. (SA.1) gives k (12 + log102) 0.284 = 43.314 Therefore, i

40、t would take the steepest-descent algorithm at most 44 iterations to reduce the objec- tive function to 1012. SA.7 Solve the minimization problem minimize f(x) = 0.5x2 1+ 2x 2 2 x1x2 x1+ 4x2 by using the Newton method assuming that x0= 0 0T. Solution The objective function can be expressed f(x) = 1

41、2x T ? 1 1 1 4 ? x + xT ?1 4 ? Therefore, the gradient and Hessian are given by g(x) = ? 1 1 1 4 ? x + ?1 4 ? andH = ? 1 1 1 4 ? respectively. At x0= 0 0T, g(x0) = 1 4Tand hence the search direction is given by d0= H1g(x0) = ? 1 1 1 4 ?1?1 4 ? = ? 0 1 ? Since the objective function is quadratic, the

42、 line search can be performed by fi nding the value of that minimizes f(x0+ d0) = dT 0Hd0 2 2+ (gT 0d0) + const 10PRACTICAL OPTIMIZATION: Algorithms and Engineering Applications This is given by 0= gT 0d0 dT 0Hd0 = gT 0H1g0 gT 0H1g0 = 1 and hence x1= x0+ 0d0= ?0 0 ? + ? 0 1 ? = ? 0 1 ? At x1, we hav

43、e g(x1) = 0 and hence x1is a stationary point. Since the Hessian matrix H is constant and positive defi nite, point x1is the unique global minimizer of the objective function. SA.8(a) Find the global minimizer of the objective function f(x) = (x1 4x2)4+ 12(x3 x4)4+ 3(x2 10 x3)2+ 55(x1 2x4)2 by using

44、 the fact that each term in the objective function is nonnegative. (b) Solve the problem in part (a) using the steepest-descent method with = 106and try the initial points 1 1 1 1Tand 2 10 15 17T. (c) Solvetheprobleminpart(a)usingtheGauss-Newtonmethodwiththesameterminationtolerance and initial point

45、s as in part (b). Solution (a) We note that the objective function f(x) = (x1 4x2)4+ 12(x3 x4)4+ 3(x2 10 x3)2+ 55(x1 2x4)2 always assumes nonnegative values and hence the least value it can assume is zero. This can happen if and only if the four terms on the right-hand side are all zero, i.e., x1 4x

46、2= 0,x3 x4= 0 x2 10 x3= 0,x1 2x4= 0 The above system of linear equations has the unique solution x= 0 0 0 0Tas can be easily shown. Therefore, the global minimizer of f(x) is identifi ed as x= 0. (b) The gradient of the objective function f(x) can be computed as g(x) = 4(x1 4x2)3+ 110(x1 2x4) 16(x1

47、4x2)3+ 6(x2 10 x3) 48(x3 x4)3 60(x2 10 x3) 48(x3 x4)3 220(x1 2x4) With x0= 1 1 1 1Tand = 106, it took the steepest-descent algorithm 36,686 iterations to converge to the solution x= 0.048418130.017047760.001706020.02420804T With x0= 2 10 15 17T, it took the steepest-descent algorithm 37,276 iteratio

48、ns to converge to the solution x= 0.048132240.016947100.001695950.02406512T The abovesolutions were obtained by runningMATLAB program progSA8b.m which requires threeMATLABfunctions,namely,progSA8b1.m, progSA8b2.m,andinex lsearch.m. (c) The objective function can be expressed as f(x) = f2 1(x) + f 2

49、2(x) + f 2 3(x) + f 2 4(x) SAMPLE SOLUTIONS11 where f1(x) = (x1 4x2)2,f2(x) = 12(x 3 x4)2 f3(x) = 3(x 2 10 x3), f4(x) = 55(x 1 2x4) The Jacobian is found to be J(x) = 2(x1 4x2) 8(x1 4x2)00 00212(x3 x4) 212(x3 x4) 0 3 1030 55 00255 With x0= 1 1 1 1Tand = 106, it took the Gauss-Newton method 13 iterat

50、ions to converge to the solution x= 0.81773862 0.05457502 0.00545750 0.40886931 10 6 With x0= 2 10 15 17Tand = 106, it took the Gauss-Newton method 15 iterations to converge to the solution x= 0.55449372 0.21471714 0.02147171 0.27724686 10 6 The abovesolutions were obtained by runningMATLAB program

51、progSA8c.m which requires four MATLAB functions, namely, progSA8b1.m, progSA8c1.m, progSA8c2.m, and inex lsearch.m. SA.9 Consider an underdetermined system of linear equations Ax = b(SA.2) where A Rmnand b Rm1with m n. A solution x of Eq. (SA.2) is sought such that its L1-norm, i.e., ?x?1= n ? i=1 |

52、xi| is minimized. Formulate the above problem as a constrained minimized problem and convert it into a unconstrained problem. Solution The optimization problem can be formulated as minimize f(x) = ?x?1(SA.3a) subject to: Ax = b(SA.3b) In order to convert the problem in (SA.3) into an unconstrained p

53、roblem, we apply the singular-value decomposition (SVD) of matrix A, namely A = UVT(SA.4) (see Eq. (A.34) of Appendix A.9). Let the rank of A be r. It is known that all the solutions of (SA.3b) are characterized by x = A+b + Vr(SA.5) whereA+denotestheMoore-Penrosepseudo-inverseofA(seeAppendixA.9)and

54、Vr= vr+1vr+2vn is a matrix of dimension n (n r) composed of the last n r columns of matrix V obtained in Eq. (SA.4), and R(nr)1is an arbitrary (n r)-dimensional vector (see Eq. (A.44). By using (SA.5), the constraint in (SA.3b) is eliminated and we obtain a unconstrained optimization problem as mini

55、mize Rnr?Vr + A+b?1 12PRACTICAL OPTIMIZATION: Algorithms and Engineering Applications SA.10 The feasible region shown in Fig. SA.8 can be described by R : x2 0.5x1+ 0.5 x2 0 Find variable transformations x1= T2(t1, t2) and x2= T2(t1, t2) such that t1, t2 would describe the same feasible region. 10 0

56、.5 -1x1 x2 R Figure SA.8 Solution We note that the feasible region can be represented by 2x2 1 x1 2x2+ 1 0 x2 0.5 Hence for a fi xed x2, a feasible value of x1can be obtained as x1= (1 2x2)tanh(t1) where t1 and x2varies from 0 to 0.5. Furthermore, a variable x2that assumes values in the range 0 x2 0

57、.5 can be expressed as x2= 0.25tanh(t2) + 1 where t2 . By combining the above two expressions, we obtain x1= 1 0.5tanh(t2+ 1)tanh(t1) x2= 0.25tanh(t2) + 1 where t1, t2 2, then we can use a bisection method to identify a 0 such that g() = 2 and the solution in this case is given by x= 1 2(Q + I)1p SA

58、.12 Show that the constrained L1-norm minimization problem minimize?x?1 subject to: Ax = b can be formulated as a linear programmingproblem. Data matrices A and b as well as variable vector x are all real-valued. Solution If the components of x are assumed to be bounded, i.e., |xi| i then from the d

59、efi nition of the L1norm ?x?1= n ? i=1 |xi| Hence it follows that ?x?1 n ? i=1 i 14PRACTICAL OPTIMIZATION: Algorithms and Engineering Applications Consequently, the L1-norm minimization problem can be expressed as minimize n ? i=1 i subject to:|xi| i Ax = b If we treat ifor i = 1, 2, ., n as auxiliary variables and let x = 1 2 . . . n x1 x2 . . . xn ,c = 1 1 . . . 1 0 0 . . . 0 the

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论