Chapter 10 Numerical Methods for Unconstrained Optimum Design
}
void scale(float arrOne[], float arrTwo[], int scalar, int n)
{
for(int i = 0; i < n; i++)
{
arrTwo[i] = –1*arrOne[i]+scalar*arrTwo[i];
}
}
float tNorm(float vec[], int n)
void update(float x[], float xwrk[], float d[], float a, int n)
{
}
void printStuff(int currCount, float x[], float alph, float grad[], float f, int
ndv)
{
cout<<“Iteration number: “<<currCount<<” Function value: “<<f<<” Alpha value:
“<<alph<<“\n”;
cout<<“Norm of gradient vector: “<<tNorm(grad, ndv)<<“\n”;
}
____________________________________________________________________________________
10.53: x* = (0.0716066, 0.0232642), f * = − 0.0736332, NIT = 8, NFE = 125;
10.55: x* = (0.00000998224, 0.0232725), f * = − 0.0116257, NIT = 6, NFE = 96;
10.57: x* = (0.000494682, -0.000290992, 0.000167161), f * = 0.0, NIT = 18, NFE = 388;
10.59: x* = (3.73312, 0.341153), f * = −1526.56, NIT = 16, NFE = 227;
10.61: x* = (0.0488862, 0.00489234, 0.0264347, 0.0264981), f * = 0.00000783204, NIT = 80,