Arora, Introduction to Optimum Design, 4e
10-21
10.35 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the equal-interval search
with δ=0.05 at the given point and in the given search direction.
22
1 2 12 1 2
( ) 0.5 7 7 ;f x x xx x x= +− − −x
[7, 6]=d
at
[1, 1]=x
Solution:
2
( ) 18.5 85 13.5f
α αα
= −−
(from the solution to Problem 10.25)
10.36 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the equal-interval search
with δ=0.05 at the given point and in the given search direction.
22
12 23
( ) ( ) ( );f xx x x=+ ++x
[4,8,4]=−−−d
at
[1, 1,1]=x
Solution:
10.37 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the equal-interval search
with δ=0.05 at the given point and in the given search direction.
222
1 23
() ;f xxx=++x
[ 2, 4, 2]=−−d
at
[1, 2, 1]= −x
Solution:
2
Solved using a modified form of the program in Section B.2, Appendix B.
Output: Initial lower alpha bound = 0.45;
Initial upper alpha bound = 0.55;
Minimum (α*) after two iterations = 0.1;
Minimum function value (f*) = 0;
No. of function evaluations = 12.
Chapter 10 Numerical Methods for Unconstrained Optimum Design
10.38 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the equal-interval search
with δ=0.05 at the given point and in the given search direction.
22
1 23 12
( ) ( 3 ) 4( ) ;f x x x xx=++ + x
[1, 3, 1]=d
at
[ 1, 1, 1]=−−−x
Solution:
2
10.39 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the equal-interval search
with δ=0.05 at the given point and in the given search direction.
2 22
1 2 3 1 2 3 12 23
() 9 8 6 4 2 2 2 2 ;f xxxxxxxxxx=++++ +x
[2, 2, 0]= −d
at
[1, 1,1]=x
Solution:
2
10.40 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the equal-interval search
with δ=0.05 at the given point and in the given search direction.
2222
12 3 4
()( 1)( 2)( 3)( 4);fx x x x=++−+x
[ 2, 2, 2, 2]=−−d
at
[2,1, 4,3]=x
Solution:
2
Problems 10.41 to 10.50 are solved using the program in Section B.2 of Appendix B.
10.41 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22
12
( ) 0.1 10;f xx= +−x
[ 1, 2]=−−d
at
[5,1]=x
Solution:
2
Solved using the following modified program in Section B.2, Appendix B. The code was modified
to save the initial values of the lower and upper alpha bounds, then complete only two iterations of
Phase II, rather than fully refining the function in Phase II. The same program was using for
Problems 10.42 – 10.50 (changing the equation in the function funct()), for which example code
will not be repeated.
___________________________________________________________________________________
#include <iostream>
#include <math.h>
float ali = 0; // holds the initial value of the lower alpha bound
float aui = 0; // holds the initial value of the upper alpha bound
float *alphaptr = &alpha; //pointer to alpha
float *aliptr = &ali; //pointer to ali
float *auiptr = &aui; //pointer to aui
Chapter 10 Numerical Methods for Unconstrained Optimum Design
return 0;
}
/* this function implements golden interval search
a = optimal value of alpha on return
float au = d+(pow((float)1.618, q)*d); //holds value of upper bound of alpha,
//initially set to 2*delta
float fa = 0; //holds function value of midpoint alpha
float fb = 0; //holds function value at midpoint alpha b
float fu = 0; //holds function value of upper alpha bound
fu = funct(au, n);
}
*aui = au;
*ali = al;
ab = al+((float)0.618*(aual));
fb = funct(ab, n);
Arora, Introduction to Optimum Design, 4e
10-25
{
case 1:
au = ab;
case 2:
al = aa;
case 3:
al = aa;
au = ab;
aa = al+((float)0.382*(aual));
ab = al+((float)0.618*(aual));
fa = funct(aa, n);
/* calculates the function value
a = value of alpha, input
fVal = function value on return
Chapter 10 Numerical Methods for Unconstrained Optimum Design
10.42 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22
12
( ) ( 2) ( 1) ;fx x=+−x
[ 4, 6]=−−d
at
[4, 4]=x
Solution:
2
( ) 52 52 13f
ααα
= −+
(from the solution to Problem 10.22)
10.43 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22 2
21 1
( ) 10( ) (1 ) ;f xx x= − +−x
[ 162, 40]= −d
at
[2, 2]=x
Solution:
4 32
( ) 6887475360 361117440 5809444 27844 41f
α α α αα
= + −+
(from the solution to Problem 10.23)
Solved using a modified form of the program in Section B.2, Appendix B.
Output: Initial lower alpha bound = 0;
Initial upper alpha bound = 0.1309;
Minimum (α*) after two iterations = 0.025;
Minimum function value (f*) = 23.7626;
No. of function evaluations = 6.
10.44 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22
12
( ) ( 2) ;fx x=−+x
[2, 2]= −d
at
[1, 1]=x
Solution:
2
() 8 8 2f
ααα
= −+
(from the solution to Problem 10.24)
Arora, Introduction to Optimum Design, 4e
10-27
10.45 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22
1 2 12 1 2
( ) 0.5 7 7 ;f x x xx x x= +− − −x
[7, 6]=d
at
[1, 1]=x
Solution:
2
( ) 18.5 85 13.5f
α αα
= −−
(from the solution to Problem 10.25)
10.46 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22
12 23
( ) ( ) ( );f xx x x=+ ++x
[4,8,4]=−−−d
at
[1, 1,1]=x
Solution:
(from the solution to Problem 10.26)
10.47 _______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
222
1 23
() ;f xxx=++x
[ 2, 4, 2]=−−d
at
[1, 2, 1]= −x
Solution:
2
( ) 24 24 6f
ααα
= −+
(from the solution to Problem 10.27)
Chapter 10 Numerical Methods for Unconstrained Optimum Design
Arora, Introduction to Optimum Design, 4e
10-28
10.48 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
22
1 23 12
( ) ( 3 ) 4( ) ;f x x x xx=++ + x
[1, 3, 1]=d
at
[ 1, 1, 1]=−−−x
Solution:
2
( ) 137 110 25f
ααα
= −+
(from the solution to Problem 10.28)
10.49 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
2 22
1 2 3 1 2 3 12 23
() 9 8 6 4 2 2 2 2 ;f xxxxxxxxxx=++++ +x
[2, 2, 0]= −d
at
[1, 1,1]=x
Solution:
2
() 8 8f
ααα
= −
(from the solution to Problem 10.29)
10.50 ______________________________________________________________________________
For the following function, calculate the initial interval of uncertainty for the golden section search
with δ=0.05 at the given point and the search direction; then complete two iterations of the Phase II of
the method.
2222
12 3 4
()( 1)( 2)( 3)( 4);fx x x x=++−+x
[ 2, 2, 2, 2]=−−d
at
[2,1, 4,3]=x
Solution:
2
( ) 16 16 4f
ααα
= −+
(from the solution to Problem 10.30)
10.53 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
22
12 1 2 1 2
( , ) 12.096 21.504 x 1.7321 ;fxx x x x= + −−
starting point,
[1, 1]=x
Solution:
Iteration 1:
(0) [1,1], 0, 0.001k
2.
(0) (0)
12
[24.192 1.7321, 43.008 x 1] [22.4599, 42.008], 47.6x
ε
= −= = >cc
(0) (0) [ 22.4599, 42.008]=−=− −dc
4.
(1) (0) (0)
[1 22.4599 ,1 42.008 ]
α αα
=+=− −xx d
(0) (0) 2 2
( ) ( ) 12.096(1 22.4599 ) 21.504(1 42.008 ) 1.7321(1 22.4599 )
(1 42.008 )
ff
αα α α α
α
=+= + − −
−−
xd
0
( ) 2269.1192 88098.6 0, 0.025757f
α αα
=+==
0
( ) 88098.6 0,f
α
= >
So,
α
0 = 0.025757 is a minimum point.
5.
(1) (0) (0)
0
[0.42151, 0.08198], 1kk
α
=+= − =+xx d
Iteration 2:
1.
(1) [0.42151, 0.08198], 1k=−=x
2.
(1) (1)
[8.465, 4.525], 9.6
ε
=−=>cc
3.
(1) 1 [ 8.465, 4.525]=−=dc
(2) (1) (1)
(1) (1) 2 2
( ) ( ) 12.096(0.4215 8.465 ) 21.504( 0.082 4.525 )
1.7321(0.4215 8.465 ) ( 0.082 4.525 )
ff
αα α α
αα
= + = + −+
−− +
xd
1
( ) 2614.123 92.138 0, 0.035246f
αα α
= −==
1
( ) 2614 0,f
α
= >
So
α
1 = 0.035246 is a minimum point.
5.
(2 ) (1) (1)
1[0.1231, 0.0775], 1kk
α
=+= =+xx d
Arora, Introduction to Optimum Design, 4e
10-31
10.54 ___________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
22
12 1 2 1
( , ) 6.983 12.415 ;fxx x x x=+−
starting point,
[2,1]=x
Solution:
Iteration 1:
(0) [2,1], 0, 0.001k
2.
(0) (0)
12
[13.966 1, 24.83 x ] [26.932, 24.83], 36.6314x
ε
=−= =>cc
(0) (0) [ 26.932, 24.83]=−=− −dc
4.
(1) (0) (0)
[2 26.932 ,1 24.83 ]
α αα
=+=− −xx d
(0) (0) 2 2
( ) ( ) 6.983(2 26.932 ) 12.415(1 24.83 ) (2 26.936 )ff
αα α α α
= + = + −−xd
0
( ) 25441.4173 1341.97325 0, 0.05275f
αα α
= −==
0
( ) 25441 0;f
α
= >
So,
α
0 = 0.05275 is a minimum point.
5.
(1) (0) (0)
0[0.579, 0.310], 1kk
α
=+= − =+xx d
Iteration 2:
1.
(1) [0.579, 0.310], 1k=−=x
2.
(1) (1)
[7.086, 7.697], 10.4621
ε
=−=>cc
3.
(1) 1 [ 7.086,7.697]=−=dc
(2) (1) (1) [0.579 7.086 , 0.310 7.697 ]
(1) (1) 2 2
( ) ( ) 6.983(0.579 7.086 ) 12.415( 0.31 7.697 ) (0.579 7.086 )ff
αα α α α
= + = + −+ xd
1
( ) 2172.276 109.460 0, 0.0504f
αα α
= −==
1
( ) 2172 0,f
α
= >
So
α
1 = 0.0504 is a minimum point.
5.
(2 ) (1) (1)
1
[0.222,0.0778], 1kk
α
=+= =+xx d
Chapter 10 Numerical Methods for Unconstrained Optimum Design
10.55 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
22
12 1 2 2
( , ) 12.096 21.504 ;fxx x x x=+−
starting point,
[1, 2]=x
Solution:
Iteration 1:
1.
(0) [1, 2], 0, 0.001k
ε
= = =x
2.
(0) (0)
12
[24.192 , 43.008 x 1] [24.192,85.016], 88.391x
ε
= −= = >cc
3.
(0) (0) [ 24.192, 85.016]=−=− −dc
(1) (0) (0) [1 24.192 , 2 85.016 ]
(0) (0) 2 2
( ) ( ) 12.096(1 24.192 ) 21.504(2 85.016 ) (2 85.016 )ff
αα α α α
= + = + −−xd
0
( ) 325008.23 7812.973 0, 0.02404f
αα α
= −==
0
( ) 325008 0,f
α
= >
So,
α
0 = 0.02404 is a minimum point.
5.
(1) (0) (0)
0[0.418, 0.0437], 1kk
α
=+= − =+xx d
(1) 1 [ 10.112, 2.879]=−=dc
4.
(2) (1) (1)
[0.418 10.112 , 0.0437 2.879 ]
α αα
=+= − +xx d
(1) (1) 2 2
( ) ( ) 12.096(0.418 10.112 ) 21.504( 0.0437 2.879)
( 0.0437 2.879 )
ff
αα α α
α
=+= + − +
−− +
xd
1
( ) 2830.171 110.545 0, 0.03906f
αα α
= −==
1
( ) 2830 0,f
α
= >
So
α
1 = 0.03906 is a minimum point.
5.
(2 ) (1) (1)
1
[0.0230,0.0688], 1kk
α
=+= =+xx d
10.56 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
22
12 1 2 1 2
( , ) 25 20 2 x ;fxx x x x= + −−
starting point,
[3,1]=x
Solution:
Iteration 1:
(0) [3,1], 0, 0.001k
2.
(0) (0)
12
[50 2, 40 x 1] [148, 39], 153.05x
ε
= − −= = >cc
(0) (0) [ 148, 39]=−=− −dc
4.
(1) (0) (0)
[3 148 ,1 39 ]
α αα
=+=− −xx d
(0) (0) 2 2
( ) ( ) 25(3 148 ) 20(1 39 ) 2(3 148 ) (1 39 )ff
α α α α αα
= + = + − − −−xd
0
( ) 1156040 23425 0, 0.02026f
αα α
= −==
0
( ) 1156040 0;f
α
= >
So,
α
0 = 0.02026 is a minimum point.
5.
(1) (0) (0)
0[0.001055,0.2097], 1kk
α
=+= =+xx d
Iteration 2:
1.
(1) [0.001055,0.2097], 1k= =x
2.
(1) (1)
[ 1.947,7.388], 7.64
ε
=−=>cc
3.
(1) 1 [1.947, 7.388]=−= −dc
(2) (1) (1)
(1) (1) 2 2
( ) ( ) 25(0.001055 1.947 ) 20(0.2097 7.388 ) 2(0.001055 1.947 )
(0.2097 7.388 )
ff
αα α α α
α
=+= + + +
−−
xd
1
( ) 2372.842 58.374 0, 0.0246f
αα α
= −==
1
( ) 2373 0,f
α
= >
So
α
1 = 0.0246 is a minimum point.
5.
(2 ) (1) (1)
1
[0.0490,0.0280], 1kk
α
=+= =+xx d
Chapter 10 Numerical Methods for Unconstrained Optimum Design
Arora, Introduction to Optimum Design, 4e
10-34
10.57 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
222
1 2 3 1 2 3 12 23
(,,x) 222 2;fxx xxxxxxx=+++ +
starting point,
[1, 1,1]=x
Solution:
Iteration 1:
1.
(0) [1,1,1], 0, 0.001k
ε
= = =x
(0) (0)
1221332
3.
(0) (0) [4,8,6]=− =−−−dc
(1) (0) (0)
(0) (0) 2 2 2
( ) ( ) (1 4 ) 2(1 8 ) 2(1 6 ) 2(1 4 )(1 8 ) 2(1 8 )(1 6 )ff
α α α α α αα αα
= + = +− +− +− − +− xd
0
( ) 752 116 0, 0.154255f
αα α
= −= =
0
( ) 752 0;f
α
= >
So,
α
0 = 0.154255 is a minimum point.
5.
(1) (0) (0)
0
[0.383, 0.234,0.0745], 1kk
α
=+= − =+xx d
Iteration 2:
(1) [0.383, 0.234,0.0745], 1k=−=x
3.
(1) 1
[ 0.298,0.021, 0.17]=−=dc
4.
(2) (1) (1) [0.383 0.298 , 0.234 0.021 , 0.0745 0.17 ]
α α αα
=+= − + +xx d
(1) (1) 2 2 2
( ) ( ) (0.383 0.298 ) 2( 0.234 0.021 ) 2(0.0745 0.17)
2(0.383 0.298 )( 0.234 0.021 ) 2( 0.234 0.021 )(0.0745 0.17 )
ff
αα α α α
α α αα
= + = +− + + +
+ − −+ +−+ +
xd
1
( ) 0.28422 0.118145 0, 0.4157f
αα α
= −==
1
( ) 0.28422 0,f
α
= >
So
α
1 = 0.4157 is a minimum point.
5.
(2 ) (1) (1)
1[0.259, 0.225,0.145], 1kk
α
=+= − =+xx d
Chapter 10 Numerical Methods for Unconstrained Optimum Design
Arora, Introduction to Optimum Design, 4e
10-35
10.58 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point. The step size may be approximated or calculated using a computer program.
2 2 22 22
12 1 2 12 2 12 2 1 2
( , ) 8 8 80 20 100 80 20 100 5 x 5 x ;fxx x x xx x xx x= + +− + − ++ + −
starting point,
[4, 6]=x
Solution:
Iteration 1:
1.
(0) [4,6], 0, 0.001k
ε
= = =x
2.
(0) (0)
[ 16.9714,69.9571], 71.9863
ε
=−=>cc
3.
(0) (0) [16.9714, 69.9571]=−= −dc
(1) (0) (0)
(0) (0) 2 2
22
( ) ( ) 8(4 16.9714 ) 8(6 69.9571 ) 5(10 52.9857 )
ff
αα α α α
=+=++−−
xd
00.07885
5.
(1) (0) (0)
0
[5.3382,0.4839], 1kk
α
=+= =+xx d
Iteration 2:
1.
(1) [5.3382,0.4839], 1k= =x
2.
(1) (1)
[4.9720,1.2237], 5.124
ε
= = >cc
3.
(1) 1
[ 4.9720, 1.2237]=−=− −dc
(2) (1) (1)
(1) (1) 2 2
22
( ) ( ) 8(5.3382 4.9720 ) 8(0.4839 1.2237 ) 5(5.8221 6.1957 )
ff
αα ααα
=+= + − −
xd
1
Chapter 10 Numerical Methods for Unconstrained Optimum Design
10.59 _____________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point. The step size may be approximated or calculated using a computer program.
2 2 22 22
12 1 2 12 2 12 2 1 2
( , ) 9 9 100 20 100 64 16 64 5 x 41x ;fxx x x xx x xx x= + +− + ++ + −
starting point,
[5, 2]=x
Solution:
Iteration 1:
(0) [5, 2], 0, 0.001k
(0) (0) 2 2
22
( ) ( ) 9(5 3.378436 ) 9(2 22.55649 ) 5(5 3.378436 )
ff
αα α α α
= + = + −−
xd
00.07327
5.
(1) (0) (0)
0[4.75246,0.34729], 1kk
α
=+= =+xx d
Iteration 2:
1.
(1) [4.75246,0.34729], 1k= =x
2.
(1) (1)
[4.7079, 0.6505], 4.75
ε
=−=>cc
3.
(1) 1 [ 4.7079,0.6505]=−=dc
(2) (1) (1)
(1) (1) 2 2
22
2
( ) ( ) 9(4.75246 4.7079 ) 9(0.34729 0.6505 ) 5(4.75246 4.7079 )
41(0.34729 0.6505 )
100 (4.75246 4.7079 ) (0.34729 0.6505 ) 20(0.34729 0.6505 ) 100
64 (4.75246 4.7079 ) (0.34729 0.6505
ff
αα ααα
α
αα α
αα
=+= + + − −
−+
++ + +
− ++
xd
2
) 16(0.34729 0.6505 ) 64
α
+ ++
(Using the Golden Section Method in Appendix B to solve for
1
α
);
1
0.19582
α
=
5.
(2 ) (1) (1)
1
[3.8306,0.4747], 1kk
α
=+= =+xx d
Chapter 10 Numerical Methods for Unconstrained Optimum Design
10.60 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
22 2
12 2 1 1
( , ) 100( x ) (1 x ) ;fxx x= − +−
starting point,
[5, 2]=x
Solution:
Iteration 1:
1.
(0) [5, 2], 0, 0.00001k
ε
= = =x
(0) 2 2 (0)
1 1 12 2 1
3.
(0) (0) [ 46008, 4600]=−=dc
(1) (0) (0) [5 46008 , 2 4600 ]
(Using the Golden Section Method in Appendix B to solve for 0
α
);
00.00014
α
=
(1) (0) (0)
Arora, Introduction to Optimum Design, 4e
10-38
10.61 ______________________________________________________________________________
For the following function, complete two iterations of the steepest-descent method starting from the
given design point.
22 4 4
123 4 1 2 3 4 2 3 1 4
( , , , x ) (x 10 x ) 5(x x ) (x 2 x ) 10(x x ) ;fxx x = + − +− +
starting point,
[1,2,3,4]=x
Solution:
Iteration 1:
(0)
2.
(0) 3 3 3
1 2 14 1 2 23 34 23
[2( 10 x ) 40(x x ) , 20(x 10 x ) 4(x 2 x ) ,10(x x ) 8(x 2 x ),x=−+−+− −c
3 (0)
34 14
10(x x ) 40(x x ) ] [ 1118,124,502,1090], 1645
ε
− −− = = >c
(0) (0) [1118, 124, 502, 1090]== −−−dc
4.
(1) (0) (0) [1 1118 , 2 124 ,3 502 , 4 1090 ]
α ααα α
=+=+ − − xx d
(0) (0) 2 2 4 4
( ) ( ) (2358 19) 5(588 1) (880 4) 10(2208 3)ff
αα α αα α
= + = + −+ − + xd
(Using the Golden Section Method in Appendix B to solve for 0
α
);
00.001854
α
=
5.
(1) (0) (0)
0[3.0728,1.7701, 2.06929,1.97914], 1kk
α
=+= =+xx d
Iteration 2:
(1)
2.
(1) (1)
[23.068, 239.418,107.193, 53.226], 268.66
ε
= −=>cc
3.
(1) 1
[ 23.068, 239.418, 107.193,53.226]=−=− − dc
4.
(2) (1) (1) [3.0728 23.068 ,1.7701 239.418 , 2.06929 107.193 ,1.97914
α αα α
=+= − xx d
4
10(1.0937 76.294 )
α
+−
(Using the Golden Section Method in Appendix B to solve for
1
α
);
10.00597616
α
=
(2 ) (1) (1)
Chapter 10 Numerical Methods for Unconstrained Optimum Design
10.62 ______________________________________________________________________________
Solve Exercises 10.52 to 10.61 using the computer program given in Appendix B for the steepest-
descent method.
Solutions:
The solutions were obtained using the following program, written in C++.
____________________________________________________________________________________
int main()
{
float delta = 0.1; // * modify this value for the required delta for
line search
float f = 0; // holds the value of the function at the minimum
float x[2] = {1, 1}; // * modify this array to hold design variable vector
float d[2] = {0, 0}; // * modify this array to hold the direction vector
float c[2] = {0, 0}; // holds the gradient vector
float wrk[2] = {0, 0}; // vector to hold temporary values
float alpha = 0; // holds the value of alpha at the minimum
Chapter 10 Numerical Methods for Unconstrained Optimum Design
if(temp <= epsilon2)
{
k = noc+1;
for(int l = 0; l < ndv; l++)
}
}
if(nocActual >= noc)
{
}
cout <<“f* = “<<f<<“\n”; //outputs optimum cost function value
cout <<“NFE: “<<nCount<<“\n”; //outputs the number of function evaluations
cout<<“NIT: “<<nocActual;
return 0;
}
float delta1 = delta; //holds optimal value of delta, initially
set to passed value
float al = 0; //lower bound of alpha
float aa = delta1; //holds value of midpoint alpha a,
initially set to delta1