Problem Set #3 (With Corrections)

Similar documents
Problem Set #9 (With Solutions)

Problem Set #4 (With Corrections)

Chapter 3 Numerical Methods

Characterizing Improving Directions Unconstrained Optimization

Programming, numerics and optimization

PRIMAL-DUAL INTERIOR POINT METHOD FOR LINEAR PROGRAMMING. 1. Introduction

Optimization III: Constrained Optimization

Optimal Control Techniques for Dynamic Walking

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited.

Local and Global Minimum

Sequential Coordinate-wise Algorithm for Non-negative Least Squares Problem

CONLIN & MMA solvers. Pierre DUYSINX LTAS Automotive Engineering Academic year

Lecture 12: Feasible direction methods

MEI STRUCTURED MATHEMATICS METHODS FOR ADVANCED MATHEMATICS, C3. Practice Paper C3-B

Mathematical Programming and Research Methods (Part II)

Demo 1: KKT conditions with inequality constraints

Numerical Methods Lecture 7 - Optimization

Lecture 2 September 3

Solution Methods Numerical Algorithms

Programs. Introduction

Comparison of Interior Point Filter Line Search Strategies for Constrained Optimization by Performance Profiles

Lecture Notes: Constraint Optimization

Distance-to-Solution Estimates for Optimization Problems with Constraints in Standard Form

LECTURE 13: SOLUTION METHODS FOR CONSTRAINED OPTIMIZATION. 1. Primal approach 2. Penalty and barrier methods 3. Dual approach 4. Primal-dual approach

Today. Gradient descent for minimization of functions of real variables. Multi-dimensional scaling. Self-organizing maps

Lecture 15: Log Barrier Method

SYSTEMS OF NONLINEAR EQUATIONS

A Truncated Newton Method in an Augmented Lagrangian Framework for Nonlinear Programming

Unconstrained Optimization Principles of Unconstrained Optimization Search Methods

CasADi tutorial Introduction

Introduction to Machine Learning

Lagrangean relaxation - exercises

Sparse Optimization Lecture: Proximal Operator/Algorithm and Lagrange Dual

Convex Optimization and Machine Learning

A NEW SEQUENTIAL CUTTING PLANE ALGORITHM FOR SOLVING MIXED INTEGER NONLINEAR PROGRAMMING PROBLEMS

ISCTE/FCUL - Mestrado Matemática Financeira. Aula de Janeiro de 2009 Ano lectivo: 2008/2009. Diana Aldea Mendes

A fast algorithm for sparse reconstruction based on shrinkage, subspace optimization and continuation [Wen,Yin,Goldfarb,Zhang 2009]

Chapter 6. Curves and Surfaces. 6.1 Graphs as Surfaces

Key Concepts: Economic Computation, Part II

LECTURE NOTES Non-Linear Programming

Shiqian Ma, MAT-258A: Numerical Optimization 1. Chapter 2. Convex Optimization

Interior Point I. Lab 21. Introduction

for Approximating the Analytic Center of a Polytope Abstract. The analytic center of a polytope P + = fx 0 : Ax = b e T x =1g log x j

Part 4. Decomposition Algorithms Dantzig-Wolf Decomposition Algorithm

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Math Models of OR: The Simplex Algorithm: Practical Considerations

Convex Programs. COMPSCI 371D Machine Learning. COMPSCI 371D Machine Learning Convex Programs 1 / 21

Newton and Quasi-Newton Methods

Introduction to Optimization

Theoretical Concepts of Machine Learning

Kernels and Constrained Optimization

Convex Optimization. Erick Delage, and Ashutosh Saxena. October 20, (a) (b) (c)

Computational Optimization. Constrained Optimization Algorithms

MINLPB4: A Fortran Subroutine for Mixed-Integer Nonlinear Optimization by Branch-and-Bound 1 - User s Guide -

WE consider the gate-sizing problem, that is, the problem

Constrained Optimization COS 323

Lower bounds and recursive methods for the problem of adjudicating conflicting claims

Penalty Alternating Direction Methods for Mixed- Integer Optimization: A New View on Feasibility Pumps

Lagrangian Relaxation

ISM206 Lecture, April 26, 2005 Optimization of Nonlinear Objectives, with Non-Linear Constraints

Convexization in Markov Chain Monte Carlo

Numerical Method in Optimization as a Multi-stage Decision Control System

Perceptron Learning Algorithm (PLA)

Detecting Infeasibility in Infeasible-Interior-Point. Methods for Optimization

Optimization in Scilab

d f(g(t), h(t)) = x dt + f ( y dt = 0. Notice that we can rewrite the relationship on the left hand side of the equality using the dot product: ( f

Linear Programming Problems

Lecture 2 Optimization with equality constraints

Constrained Global Optimization with Radial Basis Functions

Fast-Lipschitz Optimization

Gate Sizing by Lagrangian Relaxation Revisited

Modified Augmented Lagrangian Coordination and Alternating Direction Method of Multipliers with

Math 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations

Today. Golden section, discussion of error Newton s method. Newton s method, steepest descent, conjugate gradient

Machine Learning for Signal Processing Lecture 4: Optimization

MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS

Lecture 10: SVM Lecture Overview Support Vector Machines The binary classification problem

A primal-dual framework for mixtures of regularizers

Generic descent algorithm Generalization to multiple dimensions Problems of descent methods, possible improvements Fixes Local minima

A FACTOR GRAPH APPROACH TO CONSTRAINED OPTIMIZATION. A Thesis Presented to The Academic Faculty. Ivan Dario Jimenez

Applied Lagrange Duality for Constrained Optimization

(c) 0 (d) (a) 27 (b) (e) x 2 3x2

Lab 2: Support vector machines

UNIT 3 EXPRESSIONS AND EQUATIONS Lesson 3: Creating Quadratic Equations in Two or More Variables

Today s class. Roots of equation Finish up incremental search Open methods. Numerical Methods, Fall 2011 Lecture 5. Prof. Jinbo Bi CSE, UConn

QL: A Fortran Code for Convex Quadratic Programming - User s Guide, Version

Lec 11 Rate-Distortion Optimization (RDO) in Video Coding-I

NLPLSX: A Fortran Implementation of an SQP Algorithm for Least-Squares Optimization with Very Many Observations - User s Guide -

Assignment 2. with (a) (10 pts) naive Gauss elimination, (b) (10 pts) Gauss with partial pivoting

5 Day 5: Maxima and minima for n variables.

3. parallel: (b) and (c); perpendicular (a) and (b), (a) and (c)

11.1 Optimization Approaches

Chapter 5 Partial Differentiation

Inverse and Implicit functions

The derivative of a function at one point. 1. Secant lines and tangents. 2. The tangent problem

Convex Optimization MLSS 2015

An introduction into numerical optimization with KNITRO

Solving for dynamic user equilibrium

Optimization Methods: Advanced Topics in Optimization - Multi-objective Optimization 1. Module 8 Lecture Notes 2. Multi-objective Optimization

Convex Optimization - Chapter 1-2. Xiangru Lian August 28, 2015

Transcription:

IC-32 Optimal Control Winter 2006 Benoît Chachuat ME C2 401, Ph: 33844, benoit.chachuat@epfl.ch Problem Set #3 (With Corrections) 1. Consider the following NLP problem: min x IR 3 f(x) := x2 1 + x 1 x 2 + 2x 2 2 6x 1 2x 2 x 3 (1) s.t. g 1 (x) := 2x 2 1 + x 2 2 15 g 2 (x) := x 1 2x 2 x 3 3 x 1, x 2, x 3 0. (2) (a) Find an optimal solution x to this problem using the function fmincon in MATLAB s Optimization Toolbox: Make sure that the medium scale SQP algorithm, with Quasi-Newton update and line-search, is the selected solver in fmincon; Set the solution point tolerance, function tolerance and constraint tolerance in fmincon to 10 7 ; Specify the initial guess as x 0 = ( 1 1 1 ) T ; Make sure that the inequality constraint g 2 is treated as a linear constraint by fmincon; Solve the NLP by using a finite-difference approximation of the gradients of the objective function and constraints first. Then, resolve the problem by providing explicit expressions for the gradients of the objective function and constraints (ask fmincon to check for the gradients before running the optimization in this latter case); Make sure that the solver terminated successfully in each case. Solution. A possible implementation (with analytic expressions for the gradients) is as follows: 8 x0 = [ 1; 1; 1 ]; 10 A = [ -1 2 1 ]; 13 %Solve NLP Problem 14 [xopt, fopt, iout ] = fmincon( @exm1_fun, x0, A, b, [], [], xl, [],... 15 @exm1_ctr, options ); 1

exm1 fun.m 1 %%%%%%%%%%%%%%% FUNCTION TO BE MINIMIZED %%%%%%%%%%%%%%% 2 % Objective: f(x) := x1^2+x1*x2+2*x2^2-6*x1-2*x2-*x3 4 function [f,df] = exm1_fun(x) 5 f = x(1)^2+x(1)*x(2)+2*x(2)^2-6*x(1)-2*x(2)-*x(3); % function 6 if nargout > 1 7 df = [ 2*x(1)+x(2)-6 % gradient 8 x(1)+4*x(2)-2 9 - ]; exm1 ctr.m 1 %%%%%%%%%%%%%%%%%%%%%% CONSTRAINTS %%%%%%%%%%%%%%%%%%%%% 2 % nonlin. ineq. constraint: g1(x) := 2*x1^2+x2^2-15 4 function [g,h,dg,dh] = exm1_ctr(x) 5 g = [ 2*x(1)^2+x(2)^2-15 ]; % inequality constraints 6 h = []; % equality constraints 7 if nargout > 2 8 dg = [ 4*x(1); 2*x(2); 0 ]; % gradient of inequality constraints 9 dh = []; % gradient of equality constraints fmincon terminates normally, i.e., with iout=1. The iterates converge to the point x ( 2.7386 0 5.7386 ) T, and the corresponding optimal solution value is f(x ) 77.7950. Moreover, the active constraints at x are g 1, g 2 and the lower bound on x 2. (b) Repeat the numerical optimization from a different starting point, e.g., x 0 = ( 4 0 0 ) T. Does fmincon converge to the same solution point? Could this be expected? Solution. The iterates converge to the same optimal solution point x 0 ( 2.7386 0 5.7386 ) T. This could be expected since Problem (1) is strictly convex. (c) Get the values ν of the Lagrange multipliers at x, as well as the gradients of the objective function and constraints. Check that the optimal solution point is (i) a regular point and (ii) a KKT point. Solution. These checks can be done by modifying the file as follows: 8 x0 = [ 1; 1; 1 ]; 2

10 A = [ -1 2 1 ]; 13 %Solve NLP Problem 14 [xopt, fopt, iout, output, mopt ] = fmincon( @exm1_fun, x0, A, b, [], [], xl, [],... 15 @exm1_ctr, options ); 16 [fopt, dfopt] = exm1_fun(xopt); 17 [gopt, dum, dgopt, ddum] = exm1_ctr(xopt); 18 19 %Check regularity 20 rank = rank( [ dgopt(1) A(1) 0; 21 dgopt(2) A(2) -1; 22 dgopt(3) A(3) 0; ]); 23 disp(sprintf( Rank of Active Constraints: %d, rank)) 24 25 %Check KKT conditions 26 for i= 1:3 27 KKT(i) = dfopt(i) + mopt.ineqnonlin*dgopt(i) + mopt.ineqlin*a(i) - mopt.lower(i); 28 end 29 disp(sprintf( KKT Conditions = %g %g %g, KKT(1), KKT(2), KKT(3))) The values of the Lagrange multipliers are ν 1 1.1432 (constraint g 1 ), ν 2 = (constraint g 2 ), and µ 2 24.7386 (lower bound on x 2). i. It is found that the rank of the Jacobian of the active constraints at x is 3, hence x is a regular point. ii. Regarding KKT conditions at x, the constraints are all satisfied, the dual feasibility conditions are satisfied within 10 8, and the Lagrange multipliers of the active inequality constraints are all nonnegative. So x is a KKT point too. (d) Consider the perturbed problem: min x IR 3 f(x) := x2 1 + x 1x 2 + 2x 2 2 6x 1 2x 2 x 3 (3) s.t. g 1 (x, θ) := 2x 2 1 + x 2 2 θ g 2 (x) := x 1 2x 2 x 3 3 x 1, x 2, x 3 0, where θ stands for the perturbation parameter. Solve (3) for N equally spaced values of θ in the range [0, 30] (e.g., use a resolution of 0.5 for θ). Let us denote the optimal solution points as ξ (θ) and the optimal value of the Lagrange multiplier associated to the perturbed constraint as ω (θ). Solution. A possible modification of the mfiles for solving the perturbed NLP problem is as follows: 3

8 x0 = [ 1; 1; 1 ]; 10 A = [ -1 2 1 ]; 13 %Solve NLP Perturbed Problem 14 for ic = 1:61 15 ci(ic) = (ic-1)/2.; 16 [xopt, fopt, iout, output, mopt ] = fmincon( @exm1_fun, x0, A, b, [], [], xl,... 17 [], @(x)exm1_ctr(x,ci(ic)), options ); 18 fi(ic) = fopt; 19 ni(ic) = mopt.ineqnonlin; 20 end 21 22 %Plot Results 23 clf; 24 figure(1); 25 plot( ci, fi, b ); 26 axis([ 0 30 0 10 ]); 27 figure(2); 28 plot( ci, ni, b ); 29 axis([ 0 30 0 10 ]); 30 31 %Estimated slope f(xopt) vs. ci 32 slope = (fi(32)-fi(30))/(ci(32)-ci(30)); 33 disp(sprintf( Slope of f(xi(ci)) at ci=15: %d, slope)) exm1 ctr.m 1 %%%%%%%%%%%%%%%%%%%%%% CONSTRAINTS %%%%%%%%%%%%%%%%%%%%% 2 % nonlin. ineq. constraint: g1(x) := 2*x1^2+x2^2-15 4 function [g,h,dg,dh] = exm1_ctr(x,c) 5 g = [ 2*x(1)^2+x(2)^2-c ]; % inequality constraints 6 h = []; % equality constraints 7 if nargout > 2 8 dg = [ 4*x(1); 2*x(2); 0 ]; % gradient of inequality constraints 9 dh = []; % gradient of equality constraints i. Plot f(ξ (θ)) versus θ, and estimate the slope of this curve at θ = 15. What does the corresponding value represent? Solution. The resulting curve is shown in the left plot of Fig. 1 below. An estimation of the slope of this curve at θ = 15 is obtained via a (centered) finite difference formula as: θ f(ξ (15 + θ)) f(ξ (15 θ)) 2 θ 1.143396. This value corresponds to minus the Lagrange multiplier relative to the inequality g 1, θ = ν1 1.1432. θ=15 4

Here, we can talk of the value of the Lagrange multiplier, for a regularity condition holds at the optimal solution point, which guarantees uniqueness of the Lagrange multipliers; moreover, (3) being strictly convex, ξ (θ) is a unique for each value of θ, {ξ (θ)} = arg min{f(x) : g 1 (x; θ) 0, g 2 (x) 0, x 1, x 2, x 3 0}. -30 10-40 9 8-50 7 f(ξ (θ)) -60-70 ω (θ) 6 5 4-80 3 frag replacements ω (θ) -90-100 0 5 10 15 20 25 30 θ PSfrag replacements f(ξ (θ)) 2 1 0 0 5 10 15 20 25 30 θ Figure 1: Plots of f(ξ (θ)) vs θ (left plot) and ω (θ)) vs θ (right plot) for Problem (3). ii. Plot ω (θ) versus θ. Comment this plot and, in particular, explain the behavior at θ = 0. What is be the slope of the curve f(ξ (θ)) versus θ at θ = 0? Solution. At θ = 0, it is easily seen that the only feasible points for the problem are points on the line segment I := {x IR 3 : x 1 = x 2 = 0, 0 x 3 3}. Since the objective function is inversely proportional to x 3, the optimal solution is obviously ξ (0) = ( 0 0 3 ) T. The active constraints at ξ (0) are g 1, g 2 as well as the lower bounds x 1 0, x 2 0. 4 constraints are thus active, while the search space is of dimension 3 only, i.e., the gradients of the active constraints at ξ (0) cannot be linearly independent and ξ (0) is not a regular point. This, in turn, indicates that the KKT conditions may not hold at ξ (0), even though ξ (0) is a local minimum point. The non-existence of a Lagrange multiplier at θ = 0 is confirmed from the right plot of Fig. 1; it is seen that the value of the Lagrange multiplier goes to + as θ 0+. Finally, since f(ξ (θ)) θ = ω (θ), for each θ > 0, then lim =. θ 0 + θ This behavior can be seen from the left plot of Fig. 1. 5