Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
65 views

Assignment 1 Math

This document contains an assignment for a numerical optimization course. It includes 7 problems: 1) Finding the stationary point of a multivariate function. 2) Minimizing another multivariate function. 3) Showing that the maximum of two convex functions is convex. 4) Determining if a multivariate function is convex or not. 5) Determining if another function is convex over a given set. 6) Determining the conditions for a function of two variables to be convex. 7) Showing that the steepest descent algorithm satisfies a certain property.

Uploaded by

laura
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Assignment 1 Math

This document contains an assignment for a numerical optimization course. It includes 7 problems: 1) Finding the stationary point of a multivariate function. 2) Minimizing another multivariate function. 3) Showing that the maximum of two convex functions is convex. 4) Determining if a multivariate function is convex or not. 5) Determining if another function is convex over a given set. 6) Determining the conditions for a function of two variables to be convex. 7) Showing that the steepest descent algorithm satisfies a certain property.

Uploaded by

laura
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 42

ASSIGNMENT #1

Math 6026

Ing. LAURA ANDREA ARCE POLANCO


502165266
Student
PhD. Electrical Engineering

Professor:
Dr. Pedro Vsquez Urbano

Numerical Optimization

UNIVERSITY OF PUERTO RICO


MAYAGEZ CAMPUS
DEPARTMENT OF ELECTRICAL AND COMPUTERS ENGINEERING
February 2017
Numerical Optimization Assignment #1 L. ARCE

Assignment 1

1. Find the stationary point of the function


3 2
f ( x , y , z )=2 x 3 x 6 xy (x y1) Which of these points are local minima,
which are local maxima, and which are neither?

[ ]
2
f ( x)= 6 x 6 x12 xy +6 y 2 +6 y
6 x2 +12 xy+ 6 x

[
2 f ( x)= 12 x612 y 12 x +12 y+ 6
12 x +12 y +6 12 x ]
f =0

6 x 2+12 xy +6 x=0

(6)(x)( x +1)
y=
12 x

1
y= ( x +1)
2

Replace:
1 1
( x+1) 2 +6( (x +1))=0
2 2
1
6 x 2 +12 x ( ( x +1))+6
2

6
6 x 26 x+ 6 x2 +6 x + ( x 2+2 x +1 )3 x3=0
4

1
Numerical Optimization Assignment #1 L. ARCE

2 2 6 2 6
6 x 6 x+ 6 x +6 x + x +3 x + 3 x3=0
4 4

2 6 1
x 13.5 =0 x=
4 3

Evaluating

[]
1
2
f ( x)= [ 12 x612 y 12 x +12 y+ 6
12 x +12 y +6 12 x ] =
3
1
3

2 f ( x)(
1 1
3 3 [
, )= 2 6
6 4 ] 1=1< 0 2=22>0

Conclution no is P.D
Not is conc
Not is convex
Not local max, not local min

3 3
2. Solve min f(x; y) = x + y 3 xy

[
f = 3 x 23 y
3 y 23 x ]
a. 3x2 - 3y = 0
x2 - y = 0
x2 = y
b. 3y2 - 3x = 0
y2 - x = 0

2
Numerical Optimization Assignment #1 L. ARCE

y2 = x

(0,0) y (1,1) values which satisfy these equations

3 0 [
2 f (0,0)= 0 3 ] 1=0 2=9 Not is P.D

2 f (1,1)= 6 3
3 6 [ ] 1=6 2=27 is P.D

3. Suppose that f (x) and g(x) are convex functions dened over a convex set
C in Rn and that h(x)=max{f (x), g(x)}, x C.Show thath (x) is convex over
set C.

Since the intersection (any) of convex sets is a convex set, we can say:

h ( x )=max { f ( x ) , g ( x ) } EC (h)=f ( x )( x
Then, as well as each of the functions epigraphers f (x), g(x) is convex, their
intersection so too. Thus, EC (f ) is convex, so that f (x) is convex on C.

4. Determine if the function f ( x 1 ; x 2 ; x3 ) =x 13 + ( x 1 + x 2 )2+ ( x1 + x 3 )2 is convex or

not.

[ ]
3 x 13 +2(x 1+ x2 )+2(x 1+ x 3 )
f (x)= 2 x1 +2 x 2
2 x1 +2 x3

[ ]
6 x1 + 4 2 2
2 f ( x)= 2 2 0 1=6 x +4 2=12 x
1 1 +4 3 =24 x 1

2 0 2

2
6 x 1+ 4> 0 ; x 1>
3
1
12 x 1 +4 >0 ; x 1>
3
24 x 1> 0 ; x 1> 0

3
Numerical Optimization Assignment #1 L. ARCE

Then the three conditions are true for x1>0 and the function f is convex if
x1>0.

xy 2
5. Determine if the function x+ 2 y +1 2ln over the set {(x,y) R2 |x > y
f (x , y )=
>1} is convex or not.

[ ]
2
2 x+ 4 y +2
f ( x)= x
2
4 x +8 y + 4
y

[ ]
2
2
+2 4
2 x
f ( x)=
2
4 +8
y2

2 4( x 2 + 4 y 2+ 1) 1
1= +2 2= >0 and
x2 ; x2 y 2 f is convex if

2 >0, then, f is convex when x, y 0 (is different zero).
2
x
6. Determine under what conditions the function f ( x , y )= is convex?
y

[]
2
y
2
f ( x)= x
2y
x

4
Numerical Optimization Assignment #1 L. ARCE

[ ]
2 y2 2 y
3 2
2 f ( x)= x x
2 y 2
x2 x

2 y2 2 y2
1= 3 >0 ; x Should be positive 2=0
x3 x

7. Suppose that xk and xk+1 are two consecutive points generated by the
steepest descent algorithm with exact line search. Show that
f ( xk ) T f ( xk +1 )=0

Consider the line search trough xk1 in the direction pk to give xk. The
condition for a minimum at k for the optimal descend, is

df (xk1+ kpk) F (k)


= f ( xk )Tpk = f (xk )T f ( xk +1)=0
d pk d pk =

Where; F( k)=f (xk 1+ kPk )=min f (xk 1+pk )(k )=f (xk1+ kPk )

8. Implement the steepest descent and verify with the problems:

x y 4 +2 x 2+ y 2x+ 2 y
a. f =
2
x 1+ x 2x 3
2
x 1x 2+ x 3 +
b. 2
x 1+ x 2+ x 3 +
f =
4 4

c. f =x 10.6 x2 + 4 x 3+ 0.25 x 4 ln( xi)ln(5 xi)


i=1 i=1

d.

5
Numerical Optimization Assignment #1 L. ARCE

Solution of the functions


Functions n x1 X2 X3 X4 x y
f( x , y ) 21 0.0335 -0.5670

f( 14 -0.5 0 0.5
x 1+ x 2+ x 3 )
f( 237 0.5 2.5 0.2 0.8
x 1+ x 2+ x 3+ x 4
)
f( 376 4 3 1
x 1+ x 2+ x 3 )

CODE IN MATLAB

Exercise A

clear all
clc
numITE = 1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

syms l a
x = [l a];
f(x) = (l-a)^4 + 2*l^2 + a^2 -l + 2*a;
vari = x;
x0 = [0.1 1];
a0 = 1;
TAB = zeros(numITE, 5);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
df = jacobian(f, vari);
DF = eval(subs(df, vari, x0));
ERR = 10^(-6);
Xk = x0;
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, a0);
Xold = x0+1;
i = 0; % number of iterations
%% LOOP
while ((norm(Xk - Xold) > ERR) && (i < numITE))
i = i + 1;

6
Numerical Optimization Assignment #1 L. ARCE

Xold = Xk;
Xk = Xk + ak*pk
TAB(i,:) = [i Xk pk];
DF = eval(subs(df, vari, Xk));
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, a0);
end

for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB

TAB =

1.0000 0.5532 0.1086 0.4532 -0.8914


2.0000 -0.0893 -0.6577 -0.6425 -0.7663
3.0000 0.0353 -0.6477 0.9968 0.0798
4.0000 -0.0015 -0.5972 -0.5892 0.8080
5.0000 0.0288 -0.5897 0.9705 0.2411
6.0000 0.0219 -0.5757 -0.4392 0.8984
7.0000 0.0297 -0.5750 0.9966 0.0827
8.0000 0.0290 -0.5672 -0.0969 0.9953
9.0000 0.0325 -0.5689 0.8980 -0.4400
10.0000 0.0325 -0.5670 0.0079 1.0000
11.0000 0.0333 -0.5674 0.8903 -0.4554
12.0000 0.0332 -0.5670 -0.3209 0.9471
13.0000 0.0336 -0.5672 0.8863 -0.4631
14.0000 0.0334 -0.5670 -0.7192 0.6949
15.0000 0.0335 -0.5669 0.7114 0.7028
16.0000 0.0335 -0.5670 -0.9947 -0.1026
17.0000 0.0335 -0.5670 0.2559 -0.9667
18.0000 0.0335 -0.5670 -0.8734 0.4870
19.0000 0.0335 -0.5670 0.7271 -0.6866
20.0000 0.0335 -0.5670 -0.7813 -0.6242
21.0000 0.0335 -0.5670 0.7354 -0.6776

Exercise B

clear all
clc
numITE = 1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

syms x1 x2 x3
x = [x1 x2 x3];

7
Numerical Optimization Assignment #1 L. ARCE

f(x) = (x1 + x2 + x3)^2 + (x1 - x2 + x3)^2 + (-x1 + x2 - x3)^2;


vari = x;
x0 = [0 0.1 0.1];
a0 = 1;
TAB = zeros(numITE, 7);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
df = jacobian(f, vari);
DF = eval(subs(df, vari, x0));
ERR = 10^(-6);
Xk = x0;
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, a0);
Xold = x0+1;
i = 0; % number of iterations
%% LOOP
while ((norm(Xk - Xold) > ERR) && (i < numITE))
i = i + 1;
Xold = Xk;
Xk = Xk + ak*pk
TAB(i,:) = [i Xk pk];
DF = eval(subs(df, vari, Xk));
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, a0);
end

for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB

Exercise C

STEEPEST DESCEND METHOD

clear all
clc
numITE = 300 ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Problem (b)
syms x1 x2 x3 x4
x = [x1, x2, x3, x4];
f(x) = x1 - 0.6*x2 + 4*x3 + 0.25*x4 - sum(log(x)) - log(5 - sum(x));

8
Numerical Optimization Assignment #1 L. ARCE

vari = x;
x0 = [1 1 0.1 1];
a0 = 1;
TAB = zeros(numITE, 9);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
df = jacobian(f, vari);
DF = eval(subs(df, vari, x0));
ERR = 10^(-6);
Xk = x0;
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, a0);
Xold = x0+1;
i = 0; % number of iterations
%% LOOP
while ((norm(Xk - Xold) > ERR) && (i < numITE))
i = i + 1;
Xold = Xk;
Xk = Xk + ak*pk
TAB(i,:) = [i Xk pk];
DF = eval(subs(df, vari, Xk));
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, ak);
end

for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB

TAB =

1.0000 0.9765 1.0479 0.3440 1.0100 -0.0939 0.1915 0.9762 0.0399


2.0000 0.9040 1.1627 0.1347 1.0251 -0.2902 0.4592 -0.8374 0.0604
3.0000 0.8663 1.2364 0.3702 1.0384 -0.1507 0.2951 0.9420 0.0532
4.0000 0.8066 1.3215 0.1428 1.0432 -0.2388 0.3401 -0.9094 0.0191
5.0000 0.7893 1.3589 0.2607 1.0488 -0.1384 0.2991 0.9430 0.0452
6.0000 0.7472 1.4348 0.1710 1.0549 -0.3369 0.6072 -0.7180 0.0486
7.0000 0.7218 1.4935 0.2782 1.0610 -0.2036 0.4700 0.8575 0.0491
8.0000 0.6918 1.5501 0.1708 1.0611 -0.2398 0.4525 -0.8589 0.0005

9
Numerical Optimization Assignment #1 L. ARCE

9.0000 0.6724 1.6045 0.2816 1.0645 -0.1549 0.4358 0.8862 0.0275


10.0000 0.6494 1.6524 0.1685 1.0610 -0.1841 0.3828 -0.9049 -0.0284
11.0000 0.6365 1.7003 0.2832 1.0621 -0.1031 0.3834 0.9178 0.0085
12.0000 0.6187 1.7411 0.1666 1.0557 -0.1427 0.3263 -0.9330 -0.0511
13.0000 0.6147 1.7623 0.2252 1.0553 -0.0642 0.3390 0.9386 -0.0058
14.0000 0.6009 1.8116 0.1897 1.0498 -0.2200 0.7880 -0.5683 -0.0882
15.0000 0.5937 1.8495 0.2387 1.0462 -0.1150 0.6072 0.7840 -0.0581
16.0000 0.5847 1.8809 0.1859 1.0391 -0.1443 0.5019 -0.8452 -0.1138
17.0000 0.5801 1.9127 0.2393 1.0346 -0.0740 0.5100 0.8540 -0.0710
18.0000 0.5725 1.9400 0.1841 1.0264 -0.1215 0.4359 -0.8820 -0.1318
19.0000 0.5694 1.9684 0.2395 1.0214 -0.0497 0.4545 0.8857 -0.0804
20.0000 0.5628 1.9922 0.1828 1.0124 -0.1051 0.3808 -0.9075 -0.1427
21.0000 0.5608 2.0177 0.2395 1.0072 -0.0316 0.4085 0.9083 -0.0845
22.0000 0.5550 2.0386 0.1817 0.9979 -0.0933 0.3344 -0.9260 -0.1483
23.0000 0.5539 2.0617 0.2395 0.9926 -0.0179 0.3696 0.9252 -0.0845
24.0000 0.5486 2.0802 0.1807 0.9832 -0.0847 0.2949 -0.9399 -0.1499
25.0000 0.5481 2.1012 0.2394 0.9781 -0.0073 0.3363 0.9382 -0.0816
26.0000 0.5432 2.1175 0.1800 0.9689 -0.0784 0.2608 -0.9507 -0.1485
27.0000 0.5433 2.1367 0.2392 0.9641 0.0011 0.3074 0.9485 -0.0766
28.0000 0.5387 2.1511 0.1793 0.9550 -0.0736 0.2312 -0.9592 -0.1451
29.0000 0.5389 2.1600 0.2092 0.9528 0.0077 0.2822 0.9567 -0.0702
30.0000 0.5358 2.1857 0.1956 0.9419 -0.0998 0.8241 -0.4349 -0.3489
31.0000 0.5348 2.2043 0.2198 0.9353 -0.0335 0.5946 0.7746 -0.2128
32.0000 0.5321 2.2161 0.1918 0.9285 -0.0868 0.3774 -0.8966 -0.2148
33.0000 0.5317 2.2301 0.2193 0.9238 -0.0115 0.4471 0.8815 -0.1517
34.0000 0.5291 2.2409 0.1909 0.9173 -0.0834 0.3479 -0.9105 -0.2075
35.0000 0.5290 2.2535 0.2192 0.9131 -0.0038 0.4035 0.9052 -0.1338
36.0000 0.5265 2.2634 0.1903 0.9070 -0.0801 0.3150 -0.9250 -0.1969
37.0000 0.5265 2.2749 0.2191 0.9033 0.0022 0.3696 0.9216 -0.1187
38.0000 0.5241 2.2838 0.1898 0.8975 -0.0773 0.2839 -0.9375 -0.1856

10
Numerical Optimization Assignment #1 L. ARCE

39.0000 0.5244 2.2944 0.2190 0.8942 0.0072 0.3403 0.9344 -0.1048


40.0000 0.5220 2.3024 0.1893 0.8887 -0.0749 0.2554 -0.9480 -0.1744
41.0000 0.5224 2.3122 0.2189 0.8859 0.0114 0.3143 0.9448 -0.0919
42.0000 0.5201 2.3194 0.1890 0.8808 -0.0729 0.2294 -0.9567 -0.1638
43.0000 0.5206 2.3285 0.2188 0.8783 0.0151 0.2907 0.9533 -0.0798
44.0000 0.5183 2.3349 0.1886 0.8735 -0.0711 0.2057 -0.9638 -0.1537
45.0000 0.5189 2.3433 0.2187 0.8713 0.0184 0.2694 0.9604 -0.0687
46.0000 0.5167 2.3491 0.1884 0.8668 -0.0695 0.1841 -0.9698 -0.1444
47.0000 0.5174 2.3569 0.2185 0.8650 0.0213 0.2499 0.9663 -0.0584
48.0000 0.5153 2.3620 0.1881 0.8607 -0.0681 0.1644 -0.9746 -0.1357
49.0000 0.5160 2.3693 0.2184 0.8592 0.0239 0.2322 0.9711 -0.0490
50.0000 0.5139 2.3739 0.1879 0.8552 -0.0669 0.1464 -0.9787 -0.1277
51.0000 0.5143 2.3772 0.2031 0.8546 0.0262 0.2160 0.9752 -0.0404
52.0000 0.5129 2.3905 0.1977 0.8485 -0.0924 0.8498 -0.3435 -0.3890
53.0000 0.5128 2.3946 0.2042 0.8471 -0.0187 0.5227 0.8319 -0.1856
54.0000 0.5119 2.3995 0.1988 0.8445 -0.1099 0.6280 -0.6982 -0.3257
55.0000 0.5116 2.4043 0.2047 0.8427 -0.0319 0.6119 0.7562 -0.2295
56.0000 0.5108 2.4084 0.1984 0.8405 -0.1029 0.5195 -0.7994 -0.2836
57.0000 0.5107 2.4127 0.2047 0.8389 -0.0228 0.5590 0.8038 -0.2023
58.0000 0.5099 2.4164 0.1982 0.8369 -0.0991 0.4676 -0.8382 -0.2627
59.0000 0.5098 2.4204 0.2047 0.8355 -0.0154 0.5132 0.8393 -0.1789
60.0000 0.5090 2.4237 0.1979 0.8336 -0.0957 0.4212 -0.8684 -0.2437
61.0000 0.5090 2.4274 0.2047 0.8323 -0.0089 0.4719 0.8673 -0.1579
62.0000 0.5082 2.4303 0.1977 0.8306 -0.0924 0.3795 -0.8923 -0.2263
63.0000 0.5082 2.4337 0.2047 0.8295 -0.0032 0.4345 0.8899 -0.1390
64.0000 0.5075 2.4364 0.1976 0.8278 -0.0894 0.3418 -0.9115 -0.2105
65.0000 0.5075 2.4395 0.2047 0.8269 0.0019 0.4005 0.9081 -0.1220
66.0000 0.5068 2.4419 0.1974 0.8254 -0.0865 0.3076 -0.9271 -0.1961
67.0000 0.5069 2.4448 0.2046 0.8245 0.0065 0.3695 0.9231 -0.1066
68.0000 0.5062 2.4470 0.1973 0.8231 -0.0839 0.2766 -0.9397 -0.1829

11
Numerical Optimization Assignment #1 L. ARCE

69.0000 0.5063 2.4496 0.2046 0.8224 0.0106 0.3412 0.9353 -0.0927


70.0000 0.5057 2.4516 0.1972 0.8210 -0.0814 0.2483 -0.9500 -0.1709
71.0000 0.5058 2.4540 0.2046 0.8204 0.0143 0.3154 0.9455 -0.0801
72.0000 0.5052 2.4558 0.1971 0.8192 -0.0791 0.2227 -0.9584 -0.1599
73.0000 0.5053 2.4581 0.2045 0.8186 0.0176 0.2919 0.9538 -0.0686
74.0000 0.5047 2.4596 0.1970 0.8174 -0.0769 0.1993 -0.9653 -0.1500
75.0000 0.5049 2.4617 0.2045 0.8170 0.0206 0.2704 0.9608 -0.0583
76.0000 0.5043 2.4631 0.1969 0.8159 -0.0749 0.1779 -0.9710 -0.1409
77.0000 0.5045 2.4651 0.2045 0.8155 0.0234 0.2507 0.9665 -0.0489
78.0000 0.5039 2.4663 0.1968 0.8145 -0.0730 0.1585 -0.9757 -0.1326
79.0000 0.5041 2.4681 0.2044 0.8142 0.0259 0.2328 0.9714 -0.0403
80.0000 0.5036 2.4692 0.1968 0.8132 -0.0713 0.1408 -0.9795 -0.1250
81.0000 0.5038 2.4709 0.2044 0.8129 0.0281 0.2164 0.9754 -0.0326
82.0000 0.5032 2.4719 0.1967 0.8120 -0.0697 0.1246 -0.9827 -0.1181
83.0000 0.5035 2.4735 0.2044 0.8118 0.0302 0.2014 0.9787 -0.0255
84.0000 0.5029 2.4743 0.1967 0.8109 -0.0682 0.1099 -0.9853 -0.1118
85.0000 0.5032 2.4758 0.2043 0.8108 0.0321 0.1877 0.9815 -0.0191
86.0000 0.5027 2.4765 0.1966 0.8100 -0.0668 0.0964 -0.9874 -0.1061
87.0000 0.5029 2.4779 0.2043 0.8099 0.0338 0.1752 0.9839 -0.0133
88.0000 0.5024 2.4786 0.1966 0.8091 -0.0655 0.0842 -0.9892 -0.1008
89.0000 0.5027 2.4799 0.2043 0.8090 0.0353 0.1638 0.9858 -0.0080
90.0000 0.5022 2.4804 0.1965 0.8083 -0.0644 0.0730 -0.9906 -0.0960
91.0000 0.5025 2.4816 0.2043 0.8082 0.0368 0.1533 0.9875 -0.0032
92.0000 0.5020 2.4821 0.1965 0.8075 -0.0633 0.0628 -0.9918 -0.0917
93.0000 0.5023 2.4832 0.2042 0.8075 0.0380 0.1438 0.9889 0.0012
94.0000 0.5018 2.4837 0.1965 0.8068 -0.0623 0.0534 -0.9928 -0.0877
95.0000 0.5019 2.4842 0.2003 0.8069 0.0392 0.1351 0.9900 0.0052
96.0000 0.5015 2.4877 0.1996 0.8053 -0.1075 0.8952 -0.1892 -0.3889
97.0000 0.5015 2.4881 0.2005 0.8052 -0.0137 0.4401 0.8871 -0.1386
98.0000 0.5014 2.4887 0.1998 0.8049 -0.1284 0.6398 -0.6830 -0.3281

12
Numerical Optimization Assignment #1 L. ARCE

99.0000 0.5014 2.4893 0.2006 0.8047 -0.0274 0.5584 0.8064 -0.1925


100.0000 0.5013 2.4897 0.1998 0.8044 -0.1064 0.4583 -0.8447 -0.2553
101.0000 0.5012 2.4902 0.2006 0.8043 -0.0164 0.5105 0.8432 -0.1677
102.0000 0.5011 2.4906 0.1997 0.8040 -0.1009 0.4135 -0.8733 -0.2369
103.0000 0.5011 2.4911 0.2006 0.8039 -0.0087 0.4691 0.8707 -0.1474
104.0000 0.5010 2.4914 0.1997 0.8037 -0.0966 0.3723 -0.8964 -0.2203
105.0000 0.5010 2.4919 0.2006 0.8036 -0.0026 0.4317 0.8927 -0.1295
106.0000 0.5009 2.4922 0.1997 0.8034 -0.0929 0.3349 -0.9149 -0.2051
107.0000 0.5009 2.4926 0.2006 0.8033 0.0027 0.3976 0.9105 -0.1134
108.0000 0.5009 2.4929 0.1997 0.8031 -0.0896 0.3011 -0.9299 -0.1914
109.0000 0.5009 2.4932 0.2006 0.8030 0.0074 0.3667 0.9250 -0.0989
110.0000 0.5008 2.4935 0.1997 0.8028 -0.0866 0.2703 -0.9420 -0.1788
111.0000 0.5008 2.4938 0.2006 0.8027 0.0116 0.3384 0.9370 -0.0858
112.0000 0.5007 2.4941 0.1996 0.8025 -0.0837 0.2424 -0.9519 -0.1674
113.0000 0.5007 2.4944 0.2006 0.8025 0.0153 0.3127 0.9468 -0.0740
114.0000 0.5006 2.4946 0.1996 0.8023 -0.0811 0.2171 -0.9600 -0.1569
115.0000 0.5007 2.4949 0.2006 0.8023 0.0187 0.2892 0.9550 -0.0632
116.0000 0.5006 2.4951 0.1996 0.8021 -0.0787 0.1940 -0.9667 -0.1473
117.0000 0.5006 2.4953 0.2006 0.8021 0.0217 0.2678 0.9617 -0.0534
118.0000 0.5005 2.4955 0.1996 0.8019 -0.0764 0.1730 -0.9721 -0.1385
119.0000 0.5006 2.4957 0.2006 0.8019 0.0244 0.2483 0.9674 -0.0445
120.0000 0.5005 2.4959 0.1996 0.8018 -0.0744 0.1539 -0.9766 -0.1305
121.0000 0.5005 2.4961 0.2005 0.8017 0.0269 0.2304 0.9720 -0.0365
122.0000 0.5004 2.4962 0.1996 0.8016 -0.0725 0.1365 -0.9803 -0.1232
123.0000 0.5005 2.4964 0.2005 0.8016 0.0291 0.2142 0.9759 -0.0291
124.0000 0.5004 2.4966 0.1996 0.8015 -0.0707 0.1206 -0.9833 -0.1166
125.0000 0.5004 2.4968 0.2005 0.8014 0.0311 0.1993 0.9792 -0.0224
126.0000 0.5004 2.4969 0.1996 0.8013 -0.0691 0.1062 -0.9858 -0.1105
127.0000 0.5004 2.4970 0.2005 0.8013 0.0330 0.1858 0.9819 -0.0164
128.0000 0.5003 2.4971 0.1996 0.8012 -0.0676 0.0930 -0.9878 -0.1049

13
Numerical Optimization Assignment #1 L. ARCE

129.0000 0.5004 2.4973 0.2005 0.8012 0.0346 0.1734 0.9842 -0.0108


130.0000 0.5003 2.4974 0.1996 0.8011 -0.0662 0.0810 -0.9895 -0.0998
131.0000 0.5003 2.4975 0.2005 0.8011 0.0361 0.1621 0.9861 -0.0058
132.0000 0.5003 2.4976 0.1996 0.8010 -0.0650 0.0700 -0.9909 -0.0951
133.0000 0.5003 2.4978 0.2005 0.8010 0.0375 0.1518 0.9877 -0.0012
134.0000 0.5002 2.4978 0.1996 0.8009 -0.0638 0.0601 -0.9920 -0.0909
135.0000 0.5003 2.4980 0.2005 0.8009 0.0387 0.1423 0.9891 0.0030
136.0000 0.5002 2.4980 0.1996 0.8008 -0.0628 0.0510 -0.9929 -0.0870
137.0000 0.5003 2.4981 0.2005 0.8008 0.0399 0.1337 0.9902 0.0068
138.0000 0.5002 2.4982 0.1995 0.8008 -0.0618 0.0427 -0.9937 -0.0835
139.0000 0.5002 2.4983 0.2005 0.8008 0.0409 0.1259 0.9911 0.0103
140.0000 0.5002 2.4983 0.1995 0.8007 -0.0609 0.0351 -0.9943 -0.0802
141.0000 0.5002 2.4985 0.2005 0.8007 0.0418 0.1187 0.9920 0.0135
142.0000 0.5002 2.4985 0.1995 0.8006 -0.0601 0.0282 -0.9948 -0.0773
143.0000 0.5002 2.4986 0.2005 0.8006 0.0427 0.1122 0.9926 0.0163
144.0000 0.5001 2.4986 0.1995 0.8006 -0.0593 0.0219 -0.9952 -0.0746
145.0000 0.5002 2.4987 0.2005 0.8006 0.0435 0.1062 0.9932 0.0190
146.0000 0.5001 2.4987 0.1995 0.8005 -0.0587 0.0161 -0.9955 -0.0721
147.0000 0.5002 2.4988 0.2005 0.8005 0.0442 0.1008 0.9937 0.0214
148.0000 0.5001 2.4988 0.1995 0.8005 -0.0580 0.0109 -0.9958 -0.0699
149.0000 0.5002 2.4989 0.2005 0.8005 0.0448 0.0958 0.9941 0.0236
150.0000 0.5001 2.4989 0.1995 0.8004 -0.0575 0.0061 -0.9960 -0.0678
151.0000 0.5001 2.4990 0.2005 0.8005 0.0454 0.0913 0.9945 0.0256
152.0000 0.5001 2.4990 0.1995 0.8004 -0.0569 0.0017 -0.9962 -0.0659
153.0000 0.5001 2.4991 0.2005 0.8004 0.0459 0.0871 0.9948 0.0274
154.0000 0.5001 2.4991 0.1995 0.8004 -0.0565 -0.0023 -0.9963 -0.0642
155.0000 0.5001 2.4992 0.2005 0.8004 0.0464 0.0833 0.9950 0.0290
156.0000 0.5001 2.4992 0.1995 0.8003 -0.0560 -0.0059 -0.9964 -0.0627
157.0000 0.5001 2.4993 0.2005 0.8003 0.0468 0.0799 0.9952 0.0306
158.0000 0.5001 2.4993 0.1995 0.8003 -0.0556 -0.0092 -0.9965 -0.0612

14
Numerical Optimization Assignment #1 L. ARCE

159.0000 0.5001 2.4993 0.2000 0.8003 0.0472 0.0767 0.9954 0.0319


160.0000 0.5000 2.4997 0.2000 0.8001 -0.1120 0.9091 -0.0783 -0.3935
161.0000 0.5000 2.4998 0.2000 0.8001 0.0118 0.2322 0.9715 -0.0471
162.0000 0.5000 2.4998 0.2000 0.8001 -0.0803 0.1342 -0.9793 -0.1283
163.0000 0.5000 2.4998 0.2000 0.8001 0.0242 0.2181 0.9750 -0.0346
164.0000 0.5000 2.4998 0.2000 0.8001 -0.0732 0.1204 -0.9828 -0.1191
165.0000 0.5000 2.4998 0.2000 0.8001 0.0294 0.2035 0.9783 -0.0258
166.0000 0.5000 2.4998 0.2000 0.8001 -0.0699 0.1068 -0.9855 -0.1120
167.0000 0.5000 2.4998 0.2000 0.8001 0.0322 0.1898 0.9811 -0.0188
168.0000 0.5000 2.4998 0.2000 0.8001 -0.0679 0.0939 -0.9876 -0.1060
169.0000 0.5000 2.4998 0.2000 0.8001 0.0342 0.1770 0.9835 -0.0127
170.0000 0.5000 2.4998 0.2000 0.8001 -0.0664 0.0820 -0.9893 -0.1007
171.0000 0.5000 2.4998 0.2000 0.8001 0.0358 0.1654 0.9856 -0.0074
172.0000 0.5000 2.4998 0.2000 0.8001 -0.0652 0.0711 -0.9907 -0.0959
173.0000 0.5000 2.4999 0.2000 0.8001 0.0372 0.1547 0.9873 -0.0025
174.0000 0.5000 2.4999 0.2000 0.8001 -0.0640 0.0611 -0.9919 -0.0915
175.0000 0.5000 2.4999 0.2000 0.8001 0.0385 0.1450 0.9887 0.0018
176.0000 0.5000 2.4999 0.2000 0.8001 -0.0629 0.0519 -0.9928 -0.0876
177.0000 0.5000 2.4999 0.2000 0.8001 0.0397 0.1362 0.9899 0.0058
178.0000 0.5000 2.4999 0.2000 0.8000 -0.0620 0.0436 -0.9936 -0.0840
179.0000 0.5000 2.4999 0.2000 0.8000 0.0407 0.1281 0.9909 0.0094
180.0000 0.5000 2.4999 0.2000 0.8000 -0.0611 0.0359 -0.9942 -0.0807
181.0000 0.5000 2.4999 0.2000 0.8000 0.0417 0.1207 0.9917 0.0127
182.0000 0.5000 2.4999 0.2000 0.8000 -0.0602 0.0290 -0.9947 -0.0777
183.0000 0.5000 2.4999 0.2000 0.8000 0.0425 0.1140 0.9924 0.0156
184.0000 0.5000 2.4999 0.2000 0.8000 -0.1171 0.9037 -0.1052 -0.3982
185.0000 0.5000 2.4999 0.2000 0.8000 -0.0175 0.5254 0.8329 -0.1730
186.0000 0.5000 2.4999 0.2000 0.8000 -0.0889 0.2886 -0.9349 -0.1862
187.0000 0.5000 2.4999 0.2000 0.8000 -0.0001 0.4165 0.9010 -0.1213
188.0000 0.5000 2.4999 0.2000 0.8000 -0.0875 0.2749 -0.9403 -0.1806

15
Numerical Optimization Assignment #1 L. ARCE

189.0000 0.5000 2.4999 0.2000 0.8000 0.0069 0.3706 0.9234 -0.0999


190.0000 0.5000 2.5000 0.2000 0.8000 -0.0852 0.2530 -0.9483 -0.1716
191.0000 0.5000 2.5000 0.2000 0.8000 0.0119 0.3372 0.9376 -0.0845
192.0000 0.5000 2.5000 0.2000 0.8000 -0.0828 0.2295 -0.9562 -0.1619
193.0000 0.5000 2.5000 0.2000 0.8000 0.0159 0.3094 0.9481 -0.0718
194.0000 0.5000 2.5000 0.2000 0.8000 -0.0804 0.2067 -0.9631 -0.1525
195.0000 0.5000 2.5000 0.2000 0.8000 0.0194 0.2852 0.9564 -0.0608
196.0000 0.5000 2.5000 0.2000 0.8000 -0.0781 0.1853 -0.9690 -0.1436
197.0000 0.5000 2.5000 0.2000 0.8000 0.0224 0.2635 0.9630 -0.0510
198.0000 0.5000 2.5000 0.2000 0.8000 -0.0759 0.1654 -0.9739 -0.1354
199.0000 0.5000 2.5000 0.2000 0.8000 0.0251 0.2440 0.9685 -0.0422
200.0000 0.5000 2.5000 0.2000 0.8000 -0.0739 0.1472 -0.9780 -0.1278
201.0000 0.5000 2.5000 0.2000 0.8000 0.0276 0.2264 0.9731 -0.0342
202.0000 0.5000 2.5000 0.2000 0.8000 -0.0720 0.1306 -0.9814 -0.1208
203.0000 0.5000 2.5000 0.2000 0.8000 0.0297 0.2103 0.9768 -0.0271
204.0000 0.5000 2.5000 0.2000 0.8000 -0.0703 0.1153 -0.9842 -0.1144
205.0000 0.5000 2.5000 0.2000 0.8000 0.0317 0.1957 0.9799 -0.0205
206.0000 0.5000 2.5000 0.2000 0.8000 -0.0687 0.1014 -0.9865 -0.1085
207.0000 0.5000 2.5000 0.2000 0.8000 0.0335 0.1824 0.9825 -0.0146
208.0000 0.5000 2.5000 0.2000 0.8000 -0.0673 0.0887 -0.9884 -0.1031
209.0000 0.5000 2.5000 0.2000 0.8000 0.0351 0.1703 0.9847 -0.0092
210.0000 0.5000 2.5000 0.2000 0.8000 -0.0659 0.0771 -0.9900 -0.0982
211.0000 0.5000 2.5000 0.2000 0.8000 0.0366 0.1592 0.9866 -0.0043
212.0000 0.5000 2.5000 0.2000 0.8000 -0.0647 0.0665 -0.9913 -0.0937
213.0000 0.5000 2.5000 0.2000 0.8000 0.0379 0.1491 0.9881 0.0002
214.0000 0.5000 2.5000 0.2000 0.8000 -0.0636 0.0568 -0.9923 -0.0896
215.0000 0.5000 2.5000 0.2000 0.8000 0.0391 0.1399 0.9894 0.0042
216.0000 0.5000 2.5000 0.2000 0.8000 -0.0625 0.0480 -0.9932 -0.0858
217.0000 0.5000 2.5000 0.2000 0.8000 0.0402 0.1315 0.9905 0.0079
218.0000 0.5000 2.5000 0.2000 0.8000 -0.0616 0.0400 -0.9939 -0.0824

16
Numerical Optimization Assignment #1 L. ARCE

219.0000 0.5000 2.5000 0.2000 0.8000 0.0412 0.1239 0.9914 0.0113


220.0000 0.5000 2.5000 0.2000 0.8000 -0.0607 0.0326 -0.9945 -0.0792
221.0000 0.5000 2.5000 0.2000 0.8000 0.0421 0.1169 0.9921 0.0144
222.0000 0.5000 2.5000 0.2000 0.8000 -0.0599 0.0259 -0.9949 -0.0764
223.0000 0.5000 2.5000 0.2000 0.8000 0.0430 0.1105 0.9928 0.0172
224.0000 0.5000 2.5000 0.2000 0.8000 -0.0592 0.0198 -0.9953 -0.0738
225.0000 0.5000 2.5000 0.2000 0.8000 0.0437 0.1047 0.9934 0.0198
226.0000 0.5000 2.5000 0.2000 0.8000 -0.0585 0.0143 -0.9956 -0.0714
227.0000 0.5000 2.5000 0.2000 0.8000 0.0444 0.0993 0.9938 0.0221
228.0000 0.5000 2.5000 0.2000 0.8000 -0.0579 0.0092 -0.9959 -0.0692
229.0000 0.5000 2.5000 0.2000 0.8000 0.0450 0.0945 0.9942 0.0242
230.0000 0.5000 2.5000 0.2000 0.8000 -0.0573 0.0045 -0.9961 -0.0672
231.0000 0.5000 2.5000 0.2000 0.8000 0.0456 0.0901 0.9945 0.0261
232.0000 0.5000 2.5000 0.2000 0.8000 -0.0568 0.0003 -0.9962 -0.0654
233.0000 0.5000 2.5000 0.2000 0.8000 0.0461 0.0860 0.9948 0.0279
234.0000 0.5000 2.5000 0.2000 0.8000 -0.0563 -0.0036 -0.9964 -0.0637
235.0000 0.5000 2.5000 0.2000 0.8000 0.0466 0.0823 0.9951 0.0295
236.0000 0.5000 2.5000 0.2000 0.8000 -0.1156 0.9081 -0.0647 -0.3972
237.0000 0.5000 2.5000 0.2000 0.8000 0.0052 0.3815 0.9183 -0.1051

Exercise D

syms x1 x2 x3
x = [x1; x2; x3];
H = [10 -18 2; -18 40 -1; 2 -1 3];
c = [12; -47; -8];
f(x) = simplify(0.5*(x.')*H*x + (c.')*x);
vari = (x.');
x0 = [0.1 0.1 1];
a0 = 1;
TAB = zeros(numITE, 7);
%
df = jacobian(f, vari);
DF = eval(subs(df, vari, x0));
ERR = 10^(-6);

17
Numerical Optimization Assignment #1 L. ARCE

Xk = x0;
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, a0);
Xold = x0+1;
i = 0; % number of iterations
%% LOOP
while ((norm(Xk - Xold) > ERR) && (i < numITE))
i = i + 1;
Xold = Xk;
Xk = Xk + ak*pk
TAB(i,:) = [i Xk pk];
DF = eval(subs(df, vari, Xk));
pk = -DF/norm(DF);
ak = findalpha(f, vari, Xk, pk, ak);
end

for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB

TAB =

1.0000 -0.1755 1.0559 1.1023 -0.2755 0.9559 0.1023


2.0000 0.5252 1.3455 1.7543 0.7007 0.2896 0.6520
3.0000 1.0691 2.0360 2.2312 0.5438 0.6905 0.4769
4.0000 1.3637 1.6337 2.2686 0.5892 -0.8045 0.0747
5.0000 1.3411 1.8827 2.2715 -0.0902 0.9958 0.0118
6.0000 1.5655 1.7746 2.2935 0.8974 -0.4323 0.0880
7.0000 1.5539 2.0242 2.2844 -0.0460 0.9983 -0.0365
8.0000 1.7437 1.8614 2.2872 0.7590 -0.6510 0.0110
9.0000 1.7235 2.1098 2.2677 -0.0809 0.9937 -0.0779
10.0000 1.9024 1.9353 2.2617 0.7157 -0.6980 -0.0239
11.0000 1.8736 2.1822 2.2352 -0.1154 0.9876 -0.1061
12.0000 2.0447 2.0003 2.2238 0.6846 -0.7275 -0.0455
13.0000 2.0085 2.2458 2.1928 -0.1450 0.9816 -0.1241
14.0000 2.1735 2.0585 2.1782 0.6601 -0.7489 -0.0584

18
Numerical Optimization Assignment #1 L. ARCE

15.0000 2.1310 2.3026 2.1445 -0.1700 0.9762 -0.1348


16.0000 2.2910 2.1112 2.1282 0.6401 -0.7655 -0.0654
17.0000 2.2432 2.3541 2.0931 -0.1912 0.9715 -0.1404
18.0000 2.3991 2.1593 2.0760 0.6234 -0.7789 -0.0683
19.0000 2.3467 2.4012 2.0404 -0.2095 0.9674 -0.1425
20.0000 2.4989 2.2036 2.0232 0.6090 -0.7902 -0.0685
21.0000 2.4426 2.4446 1.9877 -0.2255 0.9638 -0.1421
22.0000 2.5917 2.2446 1.9710 0.5965 -0.7999 -0.0669
23.0000 2.5318 2.4848 1.9359 -0.2396 0.9607 -0.1402
24.0000 2.6781 2.2827 1.9199 0.5853 -0.8083 -0.0640
25.0000 2.6151 2.5222 1.8856 -0.2523 0.9579 -0.1372
26.0000 2.7589 2.3183 1.8706 0.5753 -0.8157 -0.0603
27.0000 2.6929 2.5571 1.8371 -0.2637 0.9553 -0.1336
28.0000 2.8345 2.3515 1.8231 0.5661 -0.8224 -0.0563
29.0000 2.7659 2.5897 1.7907 -0.2742 0.9529 -0.1296
30.0000 2.9054 2.3826 1.7777 0.5578 -0.8284 -0.0519
31.0000 2.8345 2.6203 1.7463 -0.2837 0.9507 -0.1254
32.0000 2.9720 2.4118 1.7345 0.5500 -0.8338 -0.0475
33.0000 2.8988 2.6490 1.7042 -0.2926 0.9485 -0.1212
34.0000 3.0345 2.4393 1.6934 0.5428 -0.8388 -0.0431
35.0000 2.9593 2.6759 1.6641 -0.3007 0.9465 -0.1170
36.0000 3.0934 2.4651 1.6544 0.5361 -0.8433 -0.0388
37.0000 3.0163 2.7012 1.6262 -0.3083 0.9446 -0.1129
38.0000 3.1487 2.4894 1.6175 0.5298 -0.8474 -0.0347
39.0000 3.0699 2.7251 1.5903 -0.3154 0.9427 -0.1089
40.0000 3.2008 2.5122 1.5826 0.5238 -0.8513 -0.0307
41.0000 3.1203 2.7475 1.5564 -0.3220 0.9409 -0.1051
42.0000 3.2499 2.5338 1.5497 0.5183 -0.8548 -0.0268

19
Numerical Optimization Assignment #1 L. ARCE

43.0000 3.1679 2.7686 1.5243 -0.3281 0.9392 -0.1014


44.0000 3.2961 2.5540 1.5185 0.5130 -0.8581 -0.0231
45.0000 3.2126 2.7884 1.4941 -0.3339 0.9375 -0.0979
46.0000 3.3397 2.5731 1.4892 0.5081 -0.8611 -0.0197
47.0000 3.2548 2.8071 1.4655 -0.3393 0.9359 -0.0946
48.0000 3.3807 2.5911 1.4614 0.5034 -0.8639 -0.0164
49.0000 3.2946 2.8247 1.4386 -0.3444 0.9344 -0.0914
50.0000 3.4193 2.6081 1.4353 0.4990 -0.8665 -0.0132
51.0000 3.3320 2.8413 1.4132 -0.3491 0.9329 -0.0884
52.0000 3.4557 2.6241 1.4106 0.4948 -0.8689 -0.0103
53.0000 3.3673 2.8570 1.3892 -0.3536 0.9315 -0.0856
54.0000 3.4901 2.6392 1.3873 0.4909 -0.8712 -0.0075
55.0000 3.4006 2.8717 1.3666 -0.3578 0.9301 -0.0829
56.0000 3.5224 2.6534 1.3654 0.4872 -0.8733 -0.0048
57.0000 3.4320 2.8856 1.3453 -0.3617 0.9288 -0.0804
58.0000 3.5529 2.6668 1.3447 0.4837 -0.8752 -0.0024
59.0000 3.4615 2.8987 1.3252 -0.3654 0.9276 -0.0780
60.0000 3.5816 2.6794 1.3252 0.4804 -0.8771 -0.0000
61.0000 3.4894 2.9110 1.3063 -0.3689 0.9264 -0.0757
62.0000 3.6087 2.6913 1.3068 0.4772 -0.8788 0.0022
63.0000 3.5157 2.9226 1.2884 -0.3722 0.9252 -0.0736
64.0000 3.6342 2.7025 1.2895 0.4743 -0.8804 0.0043
65.0000 3.5404 2.9335 1.2716 -0.3753 0.9241 -0.0716
66.0000 3.6583 2.7131 1.2731 0.4715 -0.8819 0.0063
67.0000 3.5637 2.9439 1.2557 -0.3782 0.9231 -0.0697
68.0000 3.6810 2.7230 1.2577 0.4689 -0.8832 0.0081
69.0000 3.5857 2.9536 1.2408 -0.3809 0.9221 -0.0679
70.0000 3.7023 2.7324 1.2432 0.4664 -0.8845 0.0099

20
Numerical Optimization Assignment #1 L. ARCE

71.0000 3.6065 2.9627 1.2267 -0.3834 0.9212 -0.0663


72.0000 3.7225 2.7413 1.2295 0.4640 -0.8858 0.0115
73.0000 3.6260 2.9714 1.2134 -0.3859 0.9203 -0.0647
74.0000 3.7415 2.7496 1.2166 0.4618 -0.8869 0.0131
75.0000 3.6444 2.9795 1.2009 -0.3881 0.9194 -0.0632
76.0000 3.7593 2.7575 1.2045 0.4597 -0.8880 0.0145
77.0000 3.6618 2.9872 1.1890 -0.3903 0.9186 -0.0618
78.0000 3.7762 2.7649 1.1930 0.4577 -0.8890 0.0159
79.0000 3.6781 2.9944 1.1779 -0.3923 0.9179 -0.0604
80.0000 3.7921 2.7719 1.1822 0.4559 -0.8899 0.0172
81.0000 3.6936 3.0012 1.1674 -0.3942 0.9171 -0.0592
82.0000 3.8071 2.7785 1.1720 0.4541 -0.8908 0.0184
83.0000 3.7081 3.0076 1.1575 -0.3959 0.9164 -0.0580
84.0000 3.8212 2.7847 1.1624 0.4524 -0.8916 0.0196
85.0000 3.7218 3.0137 1.1482 -0.3976 0.9158 -0.0569
86.0000 3.8345 2.7906 1.1534 0.4509 -0.8923 0.0207
87.0000 3.7347 3.0194 1.1394 -0.3992 0.9152 -0.0558
88.0000 3.8471 2.7961 1.1449 0.4494 -0.8931 0.0217
89.0000 3.7469 3.0248 1.1312 -0.4007 0.9146 -0.0548
90.0000 3.8589 2.8013 1.1368 0.4480 -0.8937 0.0227
91.0000 3.7584 3.0298 1.1234 -0.4021 0.9140 -0.0539
92.0000 3.8701 2.8062 1.1293 0.4467 -0.8944 0.0236
93.0000 3.7692 3.0346 1.1160 -0.4034 0.9135 -0.0530
94.0000 3.8806 2.8109 1.1221 0.4454 -0.8950 0.0245
95.0000 3.7794 3.0391 1.1091 -0.4046 0.9130 -0.0522
96.0000 3.8905 2.8152 1.1154 0.4443 -0.8955 0.0253
97.0000 3.7890 3.0434 1.1025 -0.4058 0.9125 -0.0514
98.0000 3.8998 2.8193 1.1090 0.4432 -0.8961 0.0260

21
Numerical Optimization Assignment #1 L. ARCE

99.0000 3.7981 3.0474 1.0964 -0.4069 0.9121 -0.0507


100.0000 3.8534 2.9353 1.0997 0.4421 -0.8966 0.0268
101.0000 3.9491 2.9809 1.0336 0.7662 0.3648 -0.5290
102.0000 3.9516 2.9779 1.0331 0.6336 -0.7646 -0.1177
103.0000 3.9530 2.9811 1.0314 0.3584 0.8219 -0.4427
104.0000 3.9559 2.9786 1.0306 0.7344 -0.6459 -0.2084
105.0000 3.9557 2.9824 1.0296 -0.0546 0.9643 -0.2593
106.0000 3.9585 2.9797 1.0288 0.7144 -0.6736 -0.1892
107.0000 3.9582 2.9835 1.0279 -0.0744 0.9657 -0.2488
108.0000 3.9609 2.9808 1.0272 0.6985 -0.6940 -0.1744
109.0000 3.9605 2.9846 1.0262 -0.0955 0.9667 -0.2376
110.0000 3.9632 2.9818 1.0256 0.6842 -0.7113 -0.1614
111.0000 3.9627 2.9856 1.0247 -0.1159 0.9671 -0.2265
112.0000 3.9654 2.9827 1.0241 0.6707 -0.7265 -0.1494
113.0000 3.9648 2.9865 1.0233 -0.1352 0.9670 -0.2160
114.0000 3.9674 2.9836 1.0228 0.6580 -0.7402 -0.1383
115.0000 3.9668 2.9874 1.0220 -0.1532 0.9665 -0.2059
116.0000 3.9693 2.9844 1.0215 0.6458 -0.7527 -0.1280
117.0000 3.9687 2.9882 1.0207 -0.1701 0.9656 -0.1964
118.0000 3.9711 2.9852 1.0202 0.6343 -0.7640 -0.1182
119.0000 3.9704 2.9890 1.0195 -0.1859 0.9645 -0.1874
120.0000 3.9728 2.9860 1.0191 0.6232 -0.7744 -0.1091
121.0000 3.9721 2.9897 1.0184 -0.2007 0.9632 -0.1789
122.0000 3.9745 2.9867 1.0180 0.6127 -0.7839 -0.1005
123.0000 3.9736 2.9904 1.0173 -0.2145 0.9617 -0.1709
124.0000 3.9760 2.9873 1.0170 0.6027 -0.7926 -0.0924
125.0000 3.9751 2.9911 1.0163 -0.2273 0.9600 -0.1634
126.0000 3.9774 2.9880 1.0160 0.5932 -0.8006 -0.0848

22
Numerical Optimization Assignment #1 L. ARCE

127.0000 3.9765 2.9917 1.0154 -0.2394 0.9583 -0.1563


128.0000 3.9788 2.9886 1.0151 0.5842 -0.8079 -0.0776
129.0000 3.9778 2.9923 1.0145 -0.2507 0.9565 -0.1496
130.0000 3.9800 2.9891 1.0142 0.5756 -0.8147 -0.0709
131.0000 3.9790 2.9928 1.0136 -0.2612 0.9546 -0.1432
132.0000 3.9812 2.9896 1.0134 0.5674 -0.8209 -0.0646
133.0000 3.9802 2.9933 1.0129 -0.2711 0.9527 -0.1372
134.0000 3.9823 2.9901 1.0126 0.5597 -0.8266 -0.0586
135.0000 3.9812 2.9938 1.0121 -0.2803 0.9508 -0.1316
136.0000 3.9834 2.9906 1.0119 0.5523 -0.8320 -0.0530
137.0000 3.9823 2.9943 1.0114 -0.2890 0.9490 -0.1263
138.0000 3.9844 2.9910 1.0112 0.5453 -0.8369 -0.0477
139.0000 3.9832 2.9947 1.0108 -0.2972 0.9471 -0.1213
140.0000 3.9854 2.9914 1.0106 0.5387 -0.8414 -0.0427
141.0000 3.9842 2.9951 1.0101 -0.3048 0.9453 -0.1166
142.0000 3.9862 2.9918 1.0100 0.5324 -0.8456 -0.0380
143.0000 3.9850 2.9955 1.0095 -0.3119 0.9435 -0.1121
144.0000 3.9871 2.9922 1.0094 0.5265 -0.8495 -0.0336
145.0000 3.9858 2.9959 1.0090 -0.3187 0.9417 -0.1079
146.0000 3.9879 2.9925 1.0089 0.5209 -0.8531 -0.0294
147.0000 3.9866 2.9962 1.0085 -0.3250 0.9400 -0.1039
148.0000 3.9886 2.9929 1.0084 0.5156 -0.8565 -0.0255
149.0000 3.9873 2.9965 1.0080 -0.3309 0.9383 -0.1002
150.0000 3.9893 2.9932 1.0079 0.5105 -0.8596 -0.0218
151.0000 3.9880 2.9968 1.0075 -0.3364 0.9367 -0.0967
152.0000 3.9900 2.9935 1.0074 0.5058 -0.8625 -0.0183
153.0000 3.9886 2.9971 1.0071 -0.3417 0.9352 -0.0933
154.0000 3.9906 2.9937 1.0070 0.5012 -0.8652 -0.0150

23
Numerical Optimization Assignment #1 L. ARCE

155.0000 3.9892 2.9974 1.0067 -0.3466 0.9337 -0.0902


156.0000 3.9912 2.9940 1.0066 0.4970 -0.8677 -0.0119
157.0000 3.9898 2.9976 1.0063 -0.3512 0.9322 -0.0872
158.0000 3.9917 2.9942 1.0063 0.4929 -0.8700 -0.0090
159.0000 3.9904 2.9979 1.0059 -0.3555 0.9309 -0.0845
160.0000 3.9923 2.9945 1.0059 0.4891 -0.8722 -0.0063
161.0000 3.9909 2.9981 1.0056 -0.3596 0.9295 -0.0818
162.0000 3.9928 2.9947 1.0056 0.4855 -0.8742 -0.0037
163.0000 3.9913 2.9983 1.0053 -0.3634 0.9282 -0.0794
164.0000 3.9932 2.9949 1.0052 0.4821 -0.8761 -0.0013
165.0000 3.9918 2.9985 1.0049 -0.3670 0.9270 -0.0770
166.0000 3.9937 2.9951 1.0050 0.4789 -0.8779 0.0010
167.0000 3.9922 2.9987 1.0047 -0.3704 0.9259 -0.0748
168.0000 3.9941 2.9953 1.0047 0.4758 -0.8795 0.0032
169.0000 3.9926 2.9989 1.0044 -0.3736 0.9247 -0.0727
170.0000 3.9945 2.9954 1.0044 0.4730 -0.8811 0.0052
171.0000 3.9930 2.9990 1.0041 -0.3766 0.9237 -0.0708
172.0000 3.9948 2.9956 1.0042 0.4703 -0.8825 0.0071
173.0000 3.9933 2.9992 1.0039 -0.3794 0.9227 -0.0689
174.0000 3.9952 2.9957 1.0039 0.4677 -0.8838 0.0089
175.0000 3.9937 2.9993 1.0037 -0.3820 0.9217 -0.0672
176.0000 3.9955 2.9959 1.0037 0.4653 -0.8851 0.0106
177.0000 3.9940 2.9995 1.0034 -0.3845 0.9208 -0.0656
178.0000 3.9958 2.9960 1.0035 0.4630 -0.8863 0.0122
179.0000 3.9943 2.9996 1.0032 -0.3869 0.9199 -0.0640
180.0000 3.9961 2.9961 1.0033 0.4608 -0.8874 0.0138
181.0000 3.9946 2.9997 1.0031 -0.3891 0.9191 -0.0625
182.0000 3.9964 2.9963 1.0031 0.4588 -0.8884 0.0152

24
Numerical Optimization Assignment #1 L. ARCE

183.0000 3.9948 2.9999 1.0029 -0.3912 0.9183 -0.0612


184.0000 3.9966 2.9964 1.0029 0.4569 -0.8894 0.0165
185.0000 3.9951 3.0000 1.0027 -0.3931 0.9175 -0.0599
186.0000 3.9969 2.9965 1.0028 0.4550 -0.8903 0.0178
187.0000 3.9953 3.0001 1.0025 -0.3950 0.9168 -0.0587
188.0000 3.9971 2.9966 1.0026 0.4533 -0.8911 0.0190
189.0000 3.9955 3.0002 1.0024 -0.3967 0.9162 -0.0575
190.0000 3.9973 2.9967 1.0025 0.4517 -0.8919 0.0201
191.0000 3.9957 3.0003 1.0023 -0.3983 0.9155 -0.0564
192.0000 3.9975 2.9968 1.0023 0.4502 -0.8927 0.0212
193.0000 3.9959 3.0003 1.0021 -0.3999 0.9149 -0.0554
194.0000 3.9977 2.9969 1.0022 0.4487 -0.8934 0.0222
195.0000 3.9961 3.0004 1.0020 -0.4013 0.9143 -0.0544
196.0000 3.9979 2.9969 1.0021 0.4474 -0.8940 0.0231
197.0000 3.9963 3.0005 1.0019 -0.4027 0.9138 -0.0535
198.0000 3.9980 2.9970 1.0020 0.4461 -0.8947 0.0240
199.0000 3.9965 3.0006 1.0018 -0.4040 0.9133 -0.0527
200.0000 3.9982 2.9971 1.0019 0.4449 -0.8952 0.0248
201.0000 3.9966 3.0006 1.0017 -0.4052 0.9128 -0.0518
202.0000 3.9984 2.9971 1.0018 0.4437 -0.8958 0.0256
203.0000 3.9968 3.0007 1.0016 -0.4063 0.9123 -0.0511
204.0000 3.9985 2.9972 1.0017 0.4427 -0.8963 0.0264
205.0000 3.9969 3.0008 1.0015 -0.4074 0.9119 -0.0504
206.0000 3.9986 2.9973 1.0016 0.4417 -0.8968 0.0271
207.0000 3.9970 3.0008 1.0014 -0.4084 0.9115 -0.0497
208.0000 3.9988 2.9973 1.0015 0.4407 -0.8972 0.0277
209.0000 3.9972 3.0009 1.0013 -0.4093 0.9111 -0.0491
210.0000 3.9989 2.9974 1.0014 0.4398 -0.8977 0.0283

25
Numerical Optimization Assignment #1 L. ARCE

211.0000 3.9973 3.0009 1.0012 -0.4102 0.9107 -0.0484


212.0000 3.9990 2.9974 1.0013 0.4389 -0.8980 0.0289
213.0000 3.9974 3.0010 1.0011 -0.4111 0.9103 -0.0479
214.0000 3.9991 2.9975 1.0013 0.4381 -0.8984 0.0295
215.0000 3.9975 3.0010 1.0011 -0.4119 0.9100 -0.0473
216.0000 3.9992 2.9975 1.0012 0.4374 -0.8988 0.0300
217.0000 3.9976 3.0011 1.0010 -0.4126 0.9097 -0.0468
218.0000 3.9993 2.9976 1.0011 0.4367 -0.8991 0.0305
219.0000 3.9977 3.0011 1.0009 -0.4133 0.9094 -0.0464
220.0000 3.9994 2.9976 1.0011 0.4360 -0.8994 0.0310
221.0000 3.9978 3.0011 1.0009 -0.4140 0.9091 -0.0459
222.0000 3.9995 2.9976 1.0010 0.4354 -0.8997 0.0314
223.0000 3.9978 3.0012 1.0008 -0.4146 0.9089 -0.0455
224.0000 3.9995 2.9977 1.0010 0.4348 -0.9000 0.0318
225.0000 3.9979 3.0012 1.0008 -0.4152 0.9086 -0.0451
226.0000 3.9996 2.9977 1.0009 0.4342 -0.9002 0.0322
227.0000 3.9980 3.0012 1.0007 -0.4158 0.9084 -0.0447
228.0000 3.9997 2.9977 1.0009 0.4337 -0.9005 0.0326
229.0000 3.9981 3.0013 1.0007 -0.4163 0.9081 -0.0444
230.0000 3.9997 2.9978 1.0008 0.4332 -0.9007 0.0329
231.0000 3.9981 3.0013 1.0006 -0.4168 0.9079 -0.0440
232.0000 3.9998 2.9978 1.0008 0.4327 -0.9009 0.0332
233.0000 3.9982 3.0013 1.0006 -0.4172 0.9077 -0.0437
234.0000 3.9999 2.9978 1.0007 0.4322 -0.9011 0.0335
235.0000 3.9982 3.0014 1.0006 -0.4177 0.9076 -0.0434
236.0000 3.9999 2.9978 1.0007 0.4318 -0.9013 0.0338
237.0000 3.9983 3.0014 1.0005 -0.4181 0.9074 -0.0431
238.0000 4.0000 2.9979 1.0007 0.4314 -0.9015 0.0341

26
Numerical Optimization Assignment #1 L. ARCE

239.0000 3.9983 3.0014 1.0005 -0.4185 0.9072 -0.0429


240.0000 4.0000 2.9979 1.0006 0.4310 -0.9017 0.0344
241.0000 3.9984 3.0014 1.0005 -0.4189 0.9071 -0.0426
242.0000 4.0001 2.9979 1.0006 0.4307 -0.9018 0.0346
243.0000 3.9984 3.0014 1.0004 -0.4192 0.9069 -0.0424
244.0000 4.0001 2.9979 1.0006 0.4304 -0.9020 0.0348
245.0000 3.9985 3.0015 1.0004 -0.4195 0.9068 -0.0422
246.0000 4.0002 2.9979 1.0005 0.4300 -0.9021 0.0350
247.0000 3.9985 3.0015 1.0004 -0.4198 0.9066 -0.0420
248.0000 4.0002 2.9980 1.0005 0.4297 -0.9023 0.0352
249.0000 3.9986 3.0015 1.0003 -0.4201 0.9065 -0.0418
250.0000 4.0002 2.9980 1.0005 0.4295 -0.9024 0.0354
251.0000 3.9986 3.0015 1.0003 -0.4204 0.9064 -0.0416
252.0000 4.0003 2.9980 1.0005 0.4292 -0.9025 0.0356
253.0000 3.9986 3.0015 1.0003 -0.4207 0.9063 -0.0414
254.0000 4.0003 2.9980 1.0004 0.4290 -0.9026 0.0358
255.0000 3.9987 3.0015 1.0003 -0.4209 0.9062 -0.0413
256.0000 4.0003 2.9980 1.0004 0.4287 -0.9027 0.0359
257.0000 3.9987 3.0016 1.0003 -0.4211 0.9061 -0.0411
258.0000 4.0004 2.9980 1.0004 0.4285 -0.9028 0.0361
259.0000 3.9987 3.0016 1.0002 -0.4213 0.9060 -0.0410
260.0000 4.0004 2.9980 1.0004 0.4283 -0.9029 0.0362
261.0000 3.9987 3.0016 1.0002 -0.4215 0.9059 -0.0408
262.0000 4.0004 2.9980 1.0004 0.4281 -0.9030 0.0364
263.0000 3.9988 3.0016 1.0002 -0.4217 0.9058 -0.0407
264.0000 4.0004 2.9981 1.0003 0.4279 -0.9031 0.0365
265.0000 3.9988 3.0016 1.0002 -0.4219 0.9057 -0.0406
266.0000 4.0005 2.9981 1.0003 0.4277 -0.9032 0.0366

27
Numerical Optimization Assignment #1 L. ARCE

267.0000 3.9988 3.0016 1.0002 -0.4221 0.9057 -0.0404


268.0000 3.9996 2.9998 1.0002 0.4276 -0.9032 0.0367
269.0000 4.0000 3.0000 1.0000 0.7755 0.3458 -0.5283
270.0000 4.0000 3.0000 1.0000 0.2319 -0.9594 0.1607
271.0000 4.0000 3.0000 1.0000 -0.8601 -0.0986 0.5005
272.0000 4.0000 3.0000 1.0000 -0.2542 -0.8793 0.4029
273.0000 4.0000 3.0000 1.0000 -0.6735 0.7234 0.1519
274.0000 4.0000 3.0000 1.0000 0.0817 -0.9661 0.2450
275.0000 4.0000 3.0000 1.0000 -0.6687 0.7287 0.1477
276.0000 4.0000 3.0000 1.0000 0.1139 -0.9671 0.2276
277.0000 4.0000 3.0000 1.0000 -0.6598 0.7383 0.1399
278.0000 4.0000 3.0000 1.0000 0.1379 -0.9670 0.2145
279.0000 4.0000 3.0000 1.0000 -0.6495 0.7490 0.1310
280.0000 4.0000 3.0000 1.0000 0.1579 -0.9663 0.2033
281.0000 4.0000 3.0000 1.0000 -0.6387 0.7597 0.1219
282.0000 4.0000 3.0000 1.0000 0.1755 -0.9653 0.1933
283.0000 4.0000 3.0000 1.0000 -0.6280 0.7699 0.1130
284.0000 4.0000 3.0000 1.0000 0.1915 -0.9640 0.1842
285.0000 4.0000 3.0000 1.0000 -0.6176 0.7795 0.1044
286.0000 4.0000 3.0000 1.0000 0.2062 -0.9626 0.1757
287.0000 4.0000 3.0000 1.0000 -0.6076 0.7884 0.0963
288.0000 4.0000 3.0000 1.0000 0.2199 -0.9610 0.1678
289.0000 4.0000 3.0000 1.0000 -0.5979 0.7966 0.0885
290.0000 4.0000 3.0000 1.0000 0.2325 -0.9593 0.1603
291.0000 4.0000 3.0000 1.0000 -0.5887 0.8042 0.0812
292.0000 4.0000 3.0000 1.0000 0.2443 -0.9575 0.1533
293.0000 4.0000 3.0000 1.0000 -0.5800 0.8113 0.0743
294.0000 4.0000 3.0000 1.0000 0.2553 -0.9557 0.1468

28
Numerical Optimization Assignment #1 L. ARCE

295.0000 4.0000 3.0000 1.0000 -0.5716 0.8177 0.0678


296.0000 4.0000 3.0000 1.0000 0.2656 -0.9538 0.1406
297.0000 4.0000 3.0000 1.0000 -0.5637 0.8237 0.0617
298.0000 4.0000 3.0000 1.0000 0.2753 -0.9519 0.1347
299.0000 4.0000 3.0000 1.0000 -0.5561 0.8292 0.0559
300.0000 4.0000 3.0000 1.0000 0.2843 -0.9500 0.1292
301.0000 4.0000 3.0000 1.0000 -0.5490 0.8343 0.0504
302.0000 4.0000 3.0000 1.0000 0.2927 -0.9481 0.1240
303.0000 4.0000 3.0000 1.0000 -0.5422 0.8390 0.0453
304.0000 4.0000 3.0000 1.0000 0.3006 -0.9463 0.1191
305.0000 4.0000 3.0000 1.0000 -0.5357 0.8434 0.0404
306.0000 4.0000 3.0000 1.0000 0.3080 -0.9445 0.1145
307.0000 4.0000 3.0000 1.0000 -0.5296 0.8475 0.0359
308.0000 4.0000 3.0000 1.0000 0.3150 -0.9427 0.1102
309.0000 4.0000 3.0000 1.0000 -0.5238 0.8512 0.0316
310.0000 4.0000 3.0000 1.0000 0.3215 -0.9409 0.1061
311.0000 4.0000 3.0000 1.0000 -0.5184 0.8547 0.0275
312.0000 4.0000 3.0000 1.0000 0.3277 -0.9392 0.1022
313.0000 4.0000 3.0000 1.0000 -0.5132 0.8580 0.0237
314.0000 4.0000 3.0000 1.0000 0.3334 -0.9376 0.0986
315.0000 4.0000 3.0000 1.0000 -0.5083 0.8610 0.0201
316.0000 4.0000 3.0000 1.0000 0.3388 -0.9360 0.0951
317.0000 4.0000 3.0000 1.0000 -0.5036 0.8638 0.0168
318.0000 4.0000 3.0000 1.0000 0.3439 -0.9345 0.0919
319.0000 4.0000 3.0000 1.0000 -0.4992 0.8664 0.0136
320.0000 4.0000 3.0000 1.0000 0.3487 -0.9330 0.0888
321.0000 4.0000 3.0000 1.0000 -0.4951 0.8688 0.0106
322.0000 4.0000 3.0000 1.0000 0.3532 -0.9316 0.0860

29
Numerical Optimization Assignment #1 L. ARCE

323.0000 4.0000 3.0000 1.0000 -0.4911 0.8710 0.0077


324.0000 4.0000 3.0000 1.0000 0.3574 -0.9302 0.0833
325.0000 4.0000 3.0000 1.0000 -0.4874 0.8732 0.0051
326.0000 4.0000 3.0000 1.0000 0.3613 -0.9289 0.0807
327.0000 4.0000 3.0000 1.0000 -0.4839 0.8751 0.0026
328.0000 4.0000 3.0000 1.0000 0.3651 -0.9277 0.0783
329.0000 4.0000 3.0000 1.0000 -0.4806 0.8769 0.0002
330.0000 4.0000 3.0000 1.0000 0.3686 -0.9265 0.0760
331.0000 4.0000 3.0000 1.0000 -0.4775 0.8787 -0.0020
332.0000 4.0000 3.0000 1.0000 0.3719 -0.9253 0.0739
333.0000 4.0000 3.0000 1.0000 -0.4745 0.8803 -0.0041
334.0000 4.0000 3.0000 1.0000 0.3749 -0.9243 0.0718
335.0000 4.0000 3.0000 1.0000 -0.4717 0.8817 -0.0061
336.0000 4.0000 3.0000 1.0000 0.3779 -0.9232 0.0699
337.0000 4.0000 3.0000 1.0000 -0.4690 0.8831 -0.0080
338.0000 4.0000 3.0000 1.0000 0.3806 -0.9222 0.0681
339.0000 4.0000 3.0000 1.0000 -0.4665 0.8844 -0.0097
340.0000 4.0000 3.0000 1.0000 0.3832 -0.9213 0.0664
341.0000 4.0000 3.0000 1.0000 -0.4642 0.8857 -0.0114
342.0000 4.0000 3.0000 1.0000 0.3856 -0.9204 0.0648
343.0000 4.0000 3.0000 1.0000 -0.4620 0.8868 -0.0130
344.0000 4.0000 3.0000 1.0000 0.3879 -0.9195 0.0633
345.0000 4.0000 3.0000 1.0000 -0.4599 0.8879 -0.0144
346.0000 4.0000 3.0000 1.0000 0.3900 -0.9187 0.0619
347.0000 4.0000 3.0000 1.0000 -0.4579 0.8889 -0.0158
348.0000 4.0000 3.0000 1.0000 0.3921 -0.9179 0.0606
349.0000 4.0000 3.0000 1.0000 -0.4560 0.8898 -0.0171
350.0000 4.0000 3.0000 1.0000 0.3940 -0.9172 0.0593

30
Numerical Optimization Assignment #1 L. ARCE

351.0000 4.0000 3.0000 1.0000 -0.4542 0.8907 -0.0184


352.0000 4.0000 3.0000 1.0000 0.3958 -0.9165 0.0581
353.0000 4.0000 3.0000 1.0000 -0.4526 0.8915 -0.0195
354.0000 4.0000 3.0000 1.0000 0.3974 -0.9159 0.0570
355.0000 4.0000 3.0000 1.0000 -0.4510 0.8923 -0.0206
356.0000 4.0000 3.0000 1.0000 0.3990 -0.9152 0.0559
357.0000 4.0000 3.0000 1.0000 -0.4495 0.8930 -0.0216
358.0000 4.0000 3.0000 1.0000 0.4005 -0.9146 0.0549
359.0000 4.0000 3.0000 1.0000 -0.4481 0.8937 -0.0226
360.0000 4.0000 3.0000 1.0000 0.4019 -0.9141 0.0540
361.0000 4.0000 3.0000 1.0000 -0.4468 0.8943 -0.0235
362.0000 4.0000 3.0000 1.0000 0.4033 -0.9135 0.0531
363.0000 4.0000 3.0000 1.0000 -0.4455 0.8949 -0.0244
364.0000 4.0000 3.0000 1.0000 0.4045 -0.9130 0.0523
365.0000 4.0000 3.0000 1.0000 -0.4444 0.8955 -0.0252
366.0000 4.0000 3.0000 1.0000 0.4057 -0.9126 0.0515
367.0000 4.0000 3.0000 1.0000 -0.4432 0.8960 -0.0260
368.0000 4.0000 3.0000 1.0000 0.4068 -0.9121 0.0508
369.0000 4.0000 3.0000 1.0000 -0.4422 0.8965 -0.0267
370.0000 4.0000 3.0000 1.0000 0.4078 -0.9117 0.0501
371.0000 4.0000 3.0000 1.0000 -0.4412 0.8970 -0.0274
372.0000 4.0000 3.0000 1.0000 0.4088 -0.9113 0.0494
373.0000 4.0000 3.0000 1.0000 -0.4403 0.8974 -0.0280
374.0000 4.0000 3.0000 1.0000 0.4097 -0.9109 0.0488
375.0000 4.0000 3.0000 1.0000 -0.4394 0.8978 -0.0286
376.0 4.0000 3.0000 1.0000 0.4106 -0.9105 0.0482

31
Numerical Optimization Assignment #1 L. ARCE

9. Use the Newtons method to solve the previous problems.

Exercise a.
% Script NEWTON METHOD

clear all

numITE = 1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Problem (a)
% ctrl + R to comment
% ctrl + T to uncomment

syms l a
x = [l a];
f(x) = (l-a)^4 + 2*l^2 + a^2 -l + 2*a;
VAR = x;
TAB = zeros(numITE, 5);
x0 = [0 1];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% BODY SCRIPT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
i = 0; % Counter: number of iterations:
ERR = 10^(-6); % error
Xk = x0';
df = gradient(f);
ddf = hessian(f);
GRAD = eval(subs(df, VAR, Xk.'));
HESS = eval(subs(ddf, VAR, Xk.'));
Pk = -pinv(HESS)*GRAD;
%% LOOP
while norm(GRAD) >= ERR
i = i + 1
Xk = Xk + Pk
GRAD = eval(subs(df, VAR, Xk.'));
HESS = eval(subs(ddf, VAR, Xk.'));
Pk = -pinv(HESS)*GRAD;
TAB(i,:)=[i Xk.' Pk.'];
if i == numITE
break;
end
clc
end
for j = i+1:numITE
TAB(i+1,:) = [];

32
Numerical Optimization Assignment #1 L. ARCE

end
TAB
%
% End script

TAB =

1.0000 -0.3250 0.1500 0.2251 -0.4502


2.0000 -0.0999 -0.3002 0.2512 -0.5024
3.0000 0.1513 -0.8026 -0.0837 0.1674
4.0000 0.0676 -0.6352 -0.0302 0.0605
5.0000 0.0373 -0.5747 -0.0038 0.0076
6.0000 0.0335 -0.5671 -0.0001 0.0001
7.0000 0.0335 -0.5670 -0.0000 0.0000

Exercise b.

clear all

numITE = 1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Problem (a)
% ctrl + R to comment
% ctrl + T to uncomment
syms x1 x2 x3
x = [x1; x2; x3];
f(x) = (x1 + x2 + x3)^2 + (x1 - x2 + x3)^2 + (-x1 + x2 - x3)^2;
VAR = x;
x0 = [1 1 1];
TAB = zeros(numITE, 7);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
i = 0; % Counter: number of iterations:
ERR = 10^(-6); % error
Xk = x0';
df = gradient(f);
ddf = hessian(f);
GRAD = eval(subs(df, VAR, Xk));
HESS = eval(subs(ddf, VAR, Xk));
Pk = -pinv(HESS)*GRAD;
%% LOOP
while norm(GRAD) >= ERR
i = i + 1

33
Numerical Optimization Assignment #1 L. ARCE

Xk = Xk + Pk
GRAD = eval(subs(df, VAR, Xk));
HESS = eval(subs(ddf, VAR, Xk));
Pk = -pinv(HESS)*GRAD;
TAB(i,:)=[i Xk.' Pk.'];
if i == numITE
break;
end
clc
end
for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB
% End script

TAB =

1.0 0 -0.0000 0.0000 -0.0000 0.0000 -0.0000

Exercise c.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%
% Script NEWTON METHOD
%
clear all

numITE = 1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Problem (a)
% ctrl + R to comment
% ctrl + T to uncomment

syms x1 x2 x3 x4
x = [x1, x2, x3, x4];
f(x) = x1 - 0.6*x2 + 4*x3 + 0.25*x4 - sum(log(x)) - log(5 - sum(x));
VAR = x;
TAB = zeros(numITE, 9);
x0 = [1 1 0.1 1];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% BODY SCRIPT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
i = 0; % Counter: number of iterations:
ERR = 10^(-6); % error
Xk = x0;

34
Numerical Optimization Assignment #1 L. ARCE

df = gradient(f);
ddf = hessian(f);
GRAD = eval(subs(df, VAR, Xk));
HESS = eval(subs(ddf, VAR, Xk));
Pk = -pinv(HESS)*GRAD;
%% LOOP
while norm(GRAD) >= ERR
i = i + 1
Xk = Xk + Pk.'
GRAD = eval(subs(df, VAR, Xk));
HESS = eval(subs(ddf, VAR, Xk));
Pk = -pinv(HESS)*GRAD;
TAB(i,:)=[i Xk Pk.'];
if i == numITE
break;
end
clc
end
for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB
%
% End script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%

TAB =

1.0000 0.3489 1.9489 0.1535 1.0989 0.1137 0.6872 0.0373


-0.3288
2.0000 0.4626 2.6361 0.1908 0.7702 0.0350 -0.1313 0.0089
0.0297
3.0000 0.4976 2.5048 0.1996 0.7999 0.0024 -0.0048 0.0004
0.0001
4.0000 0.5000 2.5000 0.2000 0.8000 0.0000 -0.0000 0.0000
-0.0000
5.0000 0.5000 2.5000 0.2000 0.8000 0.0000 -0.0000 -0.0000
-0.0000

Exercise d.
% Script NEWTON METHOD
%
clear all

35
Numerical Optimization Assignment #1 L. ARCE

numITE = 1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Problem (a)
% ctrl + R to comment
% ctrl + T to uncomment

syms x1 x2 x3
x = [x1; x2; x3];
H = [10 -18 2; -18 40 -1; 2 -1 3];
c = [12; -47; -8];
f(x) = simplify(0.5*(x.')*H*x + (c.')*x);
VAR = x.';
TAB = zeros(numITE, 7);
x0 = [0.1 0.1 1];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% BODY SCRIPT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
i = 0; % Counter: number of iterations:
ERR = 10^(-6); % error
Xk = x0;
df = gradient(f);
ddf = hessian(f);
GRAD = eval(subs(df, VAR, Xk));
HESS = eval(subs(ddf, VAR, Xk));
Pk = -pinv(HESS)*GRAD;
%% LOOP
while norm(GRAD) >= ERR
i = i + 1
Xk = Xk + Pk.'
GRAD = eval(subs(df, VAR, Xk));
HESS = eval(subs(ddf, VAR, Xk));
Pk = -pinv(HESS)*GRAD;
TAB(i,:)=[i Xk Pk.'];
if i == numITE
break;
end
clc
end
for j = i+1:numITE
TAB(i+1,:) = [];
end
TAB
%
% End script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%

TAB =

1.0000 4.0000 3.0000 1.0000 0 0 0

36
Numerical Optimization Assignment #1 L. ARCE

10. Solve from your text: 2.1, 2.3, 2.6, 2.9, 2.16, 3.6

[ ]
2
f ( x)= 400 x 1 ( x 2x 12 ) +2(1+ x 1)
(x 2x 1 )200

[ ]
2
2 f ( x)= 400 ( x 23 x 1 ) + 2 x 1 4 00
x 1 4 00 200

Now evaluating

x= 0[]
0
1
; x*=( 1 ) ; only this solution for f ( x)=0
f

[
x= 802 400
400 200 ]
2 f

1=802 2=400 then is P.D and x strict local minimizer of f(x)

37
Numerical Optimization Assignment #1 L. ARCE


df 1
dx

dx n
[ ]
df 1 = an
a1
= a


f (x)=

d2 f 1
dx 12
2
d f1
dx 2 dx 1

[ ]
2
d i
aixi
= =0 ; where , s=1 t=1 n
dxsdxt
2
f ( x)=

And

38
Numerical Optimization Assignment #1 L. ARCE

Here Pk is the descent direction

Then Is indeed is minimizer.

39
Numerical Optimization Assignment #1 L. ARCE

For k odd:

then

The secuence is Superlinear, and secuence is not quadratic becase for k

for k I have

Here show that zk is quadratic.

40
Numerical Optimization Assignment #1 L. ARCE

41

You might also like